diff --git a/README.md b/README.md index 3462250..5469788 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,49 @@ # startree-cli - + +This is a naive CLI implementation for StarTree using the swagger.json file from the Apache Pinot server + +## Installation Instructions +To use, copy releases/startree-arm64 to /usr/local/bin and then `chmod +x /usr/local/bin/startree-arm64` +You will likely want to run `ln -s /usr/local/bin/startree-arm64 /usr/local/bin/startree` to make it easier to run + +To avoid having to manually set the hostname and auth token each time, create the following directory `mkdir -p /Users/$USER/.config/startree` then copy the config from `releases/config.yaml` to that new directory + +Edit the config.yaml and replace $HOSTNAME with the hostname of your cluster (something like pinot.startree.cloud, do not include https://) and replace ${TOKEN} with your API token. Note that this field is encapsulated and requires the auth type prepended, so it should look something like: + `Authorization: 'Basic OIFDGsjfe24234sdfdfsdv...='` + +## Usage instructions + +This "should" work identically to the swagger UI that's hosted in the cluster. All functions include any help text that was included in the original swagger.json. + +If something isn't working as expected, the `--debug` flag is useful to see what is actually going on. + +### Enable Shell Completion on Mac + +To enable shell completion on mac, first you will need to enable Shell Completion in zsh. Run the following command once: + +`echo "autoload -U compinit; compinit" >> ~/.zshrc` + +After that, you can run the following command to enable shell completion for the current session. + +`source <(startree completion zsh)` + +If you would like to add this permanently to the system, you can do the following: +``` +mkdir -p ${fpath[1]} +chown $USER ${fpath[1]} +sudo startree completion zsh > "${fpath[1]}/_startree" +``` + +## Building / Development + +This CLI was built using the swagger build tools from https://goswagger.io/generate/cli.html + +To install swagger, you can download the appropriate binary from https://github.com/go-swagger/go-swagger/releases/ and copy it to `/usr/local/bin` + +Make sure your clone of this repo is in your $GOPATH, `cd src`, and then run the following commands: +``` +go mod tidy +swagger generate cli -f swagger.json --cli-app-name startree +go build -o cmd/startree/main.go +``` + diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 0000000..6045239 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,2 @@ +Authorization: 'Basic ${TOKEN}' +hostname: $HOSTNAME diff --git a/releases/startree b/releases/startree new file mode 120000 index 0000000..a3741d9 --- /dev/null +++ b/releases/startree @@ -0,0 +1 @@ +startree-arm64 \ No newline at end of file diff --git a/releases/startree-arm64 b/releases/startree-arm64 new file mode 100755 index 0000000..552721b Binary files /dev/null and b/releases/startree-arm64 differ diff --git a/src/cli/add_config_operation.go b/src/cli/add_config_operation.go new file mode 100644 index 0000000..cd1bf74 --- /dev/null +++ b/src/cli/add_config_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableAddConfigCmd returns a cmd to handle operation addConfig +func makeOperationTableAddConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "addConfig", + Short: `Add the TableConfigs using the tableConfigsStr json`, + RunE: runOperationTableAddConfig, + } + + if err := registerOperationTableAddConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableAddConfig uses cmd flags to call endpoint api +func runOperationTableAddConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewAddConfigParams() + if err, _ := retrieveOperationTableAddConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableAddConfigValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableAddConfigResult(appCli.Table.AddConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableAddConfigParamFlags registers all flags needed to fill params +func registerOperationTableAddConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableAddConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableAddConfigValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableAddConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableAddConfigValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableAddConfigBodyFlag(m *table.AddConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableAddConfigValidationTypesToSkipFlag(m *table.AddConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableAddConfigResult parses request result and return the string content +func parseOperationTableAddConfigResult(resp0 *table.AddConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.AddConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/add_instance_operation.go b/src/cli/add_instance_operation.go new file mode 100644 index 0000000..f7dce99 --- /dev/null +++ b/src/cli/add_instance_operation.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/instance" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationInstanceAddInstanceCmd returns a cmd to handle operation addInstance +func makeOperationInstanceAddInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "addInstance", + Short: `Creates a new instance with given instance config`, + RunE: runOperationInstanceAddInstance, + } + + if err := registerOperationInstanceAddInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceAddInstance uses cmd flags to call endpoint api +func runOperationInstanceAddInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewAddInstanceParams() + if err, _ := retrieveOperationInstanceAddInstanceBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationInstanceAddInstanceUpdateBrokerResourceFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceAddInstanceResult(appCli.Instance.AddInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceAddInstanceParamFlags registers all flags needed to fill params +func registerOperationInstanceAddInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceAddInstanceBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationInstanceAddInstanceUpdateBrokerResourceParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceAddInstanceBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelInstanceFlags(0, "instance", cmd); err != nil { + return err + } + + return nil +} +func registerOperationInstanceAddInstanceUpdateBrokerResourceParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + updateBrokerResourceDescription := `Whether to update broker resource for broker instance` + + var updateBrokerResourceFlagName string + if cmdPrefix == "" { + updateBrokerResourceFlagName = "updateBrokerResource" + } else { + updateBrokerResourceFlagName = fmt.Sprintf("%v.updateBrokerResource", cmdPrefix) + } + + var updateBrokerResourceFlagDefault bool + + _ = cmd.PersistentFlags().Bool(updateBrokerResourceFlagName, updateBrokerResourceFlagDefault, updateBrokerResourceDescription) + + return nil +} + +func retrieveOperationInstanceAddInstanceBodyFlag(m *instance.AddInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.Instance{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.Instance: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.Instance{} + } + err, added := retrieveModelInstanceFlags(0, bodyValueModel, "instance", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationInstanceAddInstanceUpdateBrokerResourceFlag(m *instance.AddInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("updateBrokerResource") { + + var updateBrokerResourceFlagName string + if cmdPrefix == "" { + updateBrokerResourceFlagName = "updateBrokerResource" + } else { + updateBrokerResourceFlagName = fmt.Sprintf("%v.updateBrokerResource", cmdPrefix) + } + + updateBrokerResourceFlagValue, err := cmd.Flags().GetBool(updateBrokerResourceFlagName) + if err != nil { + return err, false + } + m.UpdateBrokerResource = &updateBrokerResourceFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceAddInstanceResult parses request result and return the string content +func parseOperationInstanceAddInstanceResult(resp0 *instance.AddInstanceOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning addInstanceOK is not supported + + // Non schema case: warning addInstanceConflict is not supported + + // Non schema case: warning addInstanceInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response addInstanceOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/add_schema1_operation.go b/src/cli/add_schema1_operation.go new file mode 100644 index 0000000..afd338a --- /dev/null +++ b/src/cli/add_schema1_operation.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/schema" + + "github.com/spf13/cobra" +) + +// makeOperationSchemaAddSchema1Cmd returns a cmd to handle operation addSchema1 +func makeOperationSchemaAddSchema1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "addSchema_1", + Short: `Adds a new schema`, + RunE: runOperationSchemaAddSchema1, + } + + if err := registerOperationSchemaAddSchema1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaAddSchema1 uses cmd flags to call endpoint api +func runOperationSchemaAddSchema1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewAddSchema1Params() + if err, _ := retrieveOperationSchemaAddSchema1BodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSchemaAddSchema1ForceFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSchemaAddSchema1OverrideFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaAddSchema1Result(appCli.Schema.AddSchema1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaAddSchema1ParamFlags registers all flags needed to fill params +func registerOperationSchemaAddSchema1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSchemaAddSchema1BodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSchemaAddSchema1ForceParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSchemaAddSchema1OverrideParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSchemaAddSchema1BodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationSchemaAddSchema1ForceParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceDescription := `Whether to force overriding the schema if the schema exists` + + var forceFlagName string + if cmdPrefix == "" { + forceFlagName = "force" + } else { + forceFlagName = fmt.Sprintf("%v.force", cmdPrefix) + } + + var forceFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceFlagName, forceFlagDefault, forceDescription) + + return nil +} +func registerOperationSchemaAddSchema1OverrideParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + overrideDescription := `Whether to override the schema if the schema exists` + + var overrideFlagName string + if cmdPrefix == "" { + overrideFlagName = "override" + } else { + overrideFlagName = fmt.Sprintf("%v.override", cmdPrefix) + } + + var overrideFlagDefault bool = true + + _ = cmd.PersistentFlags().Bool(overrideFlagName, overrideFlagDefault, overrideDescription) + + return nil +} + +func retrieveOperationSchemaAddSchema1BodyFlag(m *schema.AddSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationSchemaAddSchema1ForceFlag(m *schema.AddSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("force") { + + var forceFlagName string + if cmdPrefix == "" { + forceFlagName = "force" + } else { + forceFlagName = fmt.Sprintf("%v.force", cmdPrefix) + } + + forceFlagValue, err := cmd.Flags().GetBool(forceFlagName) + if err != nil { + return err, false + } + m.Force = &forceFlagValue + + } + return nil, retAdded +} +func retrieveOperationSchemaAddSchema1OverrideFlag(m *schema.AddSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("override") { + + var overrideFlagName string + if cmdPrefix == "" { + overrideFlagName = "override" + } else { + overrideFlagName = fmt.Sprintf("%v.override", cmdPrefix) + } + + overrideFlagValue, err := cmd.Flags().GetBool(overrideFlagName) + if err != nil { + return err, false + } + m.Override = &overrideFlagValue + + } + return nil, retAdded +} + +// parseOperationSchemaAddSchema1Result parses request result and return the string content +func parseOperationSchemaAddSchema1Result(resp0 *schema.AddSchema1OK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning addSchema1OK is not supported + + // Non schema case: warning addSchema1BadRequest is not supported + + // Non schema case: warning addSchema1Conflict is not supported + + // Non schema case: warning addSchema1InternalServerError is not supported + + return "", respErr + } + + // warning: non schema response addSchema1OK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/add_table_operation.go b/src/cli/add_table_operation.go new file mode 100644 index 0000000..adb4426 --- /dev/null +++ b/src/cli/add_table_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableAddTableCmd returns a cmd to handle operation addTable +func makeOperationTableAddTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "addTable", + Short: `Adds a table`, + RunE: runOperationTableAddTable, + } + + if err := registerOperationTableAddTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableAddTable uses cmd flags to call endpoint api +func runOperationTableAddTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewAddTableParams() + if err, _ := retrieveOperationTableAddTableBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableAddTableValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableAddTableResult(appCli.Table.AddTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableAddTableParamFlags registers all flags needed to fill params +func registerOperationTableAddTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableAddTableBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableAddTableValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableAddTableBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableAddTableValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableAddTableBodyFlag(m *table.AddTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableAddTableValidationTypesToSkipFlag(m *table.AddTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableAddTableResult parses request result and return the string content +func parseOperationTableAddTableResult(resp0 *table.AddTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.AddTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/add_user_operation.go b/src/cli/add_user_operation.go new file mode 100644 index 0000000..b3dad79 --- /dev/null +++ b/src/cli/add_user_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/user" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationUserAddUserCmd returns a cmd to handle operation addUser +func makeOperationUserAddUserCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "addUser", + Short: `Add a user`, + RunE: runOperationUserAddUser, + } + + if err := registerOperationUserAddUserParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationUserAddUser uses cmd flags to call endpoint api +func runOperationUserAddUser(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := user.NewAddUserParams() + if err, _ := retrieveOperationUserAddUserBodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationUserAddUserResult(appCli.User.AddUser(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationUserAddUserParamFlags registers all flags needed to fill params +func registerOperationUserAddUserParamFlags(cmd *cobra.Command) error { + if err := registerOperationUserAddUserBodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationUserAddUserBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} + +func retrieveOperationUserAddUserBodyFlag(m *user.AddUserParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} + +// parseOperationUserAddUserResult parses request result and return the string content +func parseOperationUserAddUserResult(resp0 *user.AddUserOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*user.AddUserOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/adhoc_task_config_model.go b/src/cli/adhoc_task_config_model.go new file mode 100644 index 0000000..39d3b09 --- /dev/null +++ b/src/cli/adhoc_task_config_model.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for AdhocTaskConfig + +// register flags to command +func registerModelAdhocTaskConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerAdhocTaskConfigTableName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerAdhocTaskConfigTaskConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerAdhocTaskConfigTaskName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerAdhocTaskConfigTaskType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerAdhocTaskConfigTableName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tableNameDescription := `Required. ` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func registerAdhocTaskConfigTaskConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: taskConfigs map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerAdhocTaskConfigTaskName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + taskNameDescription := `` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func registerAdhocTaskConfigTaskType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + taskTypeDescription := `Required. ` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelAdhocTaskConfigFlags(depth int, m *models.AdhocTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, tableNameAdded := retrieveAdhocTaskConfigTableNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableNameAdded + + err, taskConfigsAdded := retrieveAdhocTaskConfigTaskConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskConfigsAdded + + err, taskNameAdded := retrieveAdhocTaskConfigTaskNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskNameAdded + + err, taskTypeAdded := retrieveAdhocTaskConfigTaskTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskTypeAdded + + return nil, retAdded +} + +func retrieveAdhocTaskConfigTableNameFlags(depth int, m *models.AdhocTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableNameFlagName := fmt.Sprintf("%v.tableName", cmdPrefix) + if cmd.Flags().Changed(tableNameFlagName) { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveAdhocTaskConfigTaskConfigsFlags(depth int, m *models.AdhocTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskConfigsFlagName := fmt.Sprintf("%v.taskConfigs", cmdPrefix) + if cmd.Flags().Changed(taskConfigsFlagName) { + // warning: taskConfigs map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveAdhocTaskConfigTaskNameFlags(depth int, m *models.AdhocTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskNameFlagName := fmt.Sprintf("%v.taskName", cmdPrefix) + if cmd.Flags().Changed(taskNameFlagName) { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveAdhocTaskConfigTaskTypeFlags(depth int, m *models.AdhocTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskTypeFlagName := fmt.Sprintf("%v.taskType", cmdPrefix) + if cmd.Flags().Changed(taskTypeFlagName) { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/aggregation_config_model.go b/src/cli/aggregation_config_model.go new file mode 100644 index 0000000..0ea6d6f --- /dev/null +++ b/src/cli/aggregation_config_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for AggregationConfig + +// register flags to command +func registerModelAggregationConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerAggregationConfigAggregationFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerAggregationConfigColumnName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerAggregationConfigAggregationFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + aggregationFunctionDescription := `` + + var aggregationFunctionFlagName string + if cmdPrefix == "" { + aggregationFunctionFlagName = "aggregationFunction" + } else { + aggregationFunctionFlagName = fmt.Sprintf("%v.aggregationFunction", cmdPrefix) + } + + var aggregationFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(aggregationFunctionFlagName, aggregationFunctionFlagDefault, aggregationFunctionDescription) + + return nil +} + +func registerAggregationConfigColumnName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + columnNameDescription := `` + + var columnNameFlagName string + if cmdPrefix == "" { + columnNameFlagName = "columnName" + } else { + columnNameFlagName = fmt.Sprintf("%v.columnName", cmdPrefix) + } + + var columnNameFlagDefault string + + _ = cmd.PersistentFlags().String(columnNameFlagName, columnNameFlagDefault, columnNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelAggregationConfigFlags(depth int, m *models.AggregationConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, aggregationFunctionAdded := retrieveAggregationConfigAggregationFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || aggregationFunctionAdded + + err, columnNameAdded := retrieveAggregationConfigColumnNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || columnNameAdded + + return nil, retAdded +} + +func retrieveAggregationConfigAggregationFunctionFlags(depth int, m *models.AggregationConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + aggregationFunctionFlagName := fmt.Sprintf("%v.aggregationFunction", cmdPrefix) + if cmd.Flags().Changed(aggregationFunctionFlagName) { + + var aggregationFunctionFlagName string + if cmdPrefix == "" { + aggregationFunctionFlagName = "aggregationFunction" + } else { + aggregationFunctionFlagName = fmt.Sprintf("%v.aggregationFunction", cmdPrefix) + } + + aggregationFunctionFlagValue, err := cmd.Flags().GetString(aggregationFunctionFlagName) + if err != nil { + return err, false + } + m.AggregationFunction = aggregationFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveAggregationConfigColumnNameFlags(depth int, m *models.AggregationConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + columnNameFlagName := fmt.Sprintf("%v.columnName", cmdPrefix) + if cmd.Flags().Changed(columnNameFlagName) { + + var columnNameFlagName string + if cmdPrefix == "" { + columnNameFlagName = "columnName" + } else { + columnNameFlagName = fmt.Sprintf("%v.columnName", cmdPrefix) + } + + columnNameFlagValue, err := cmd.Flags().GetString(columnNameFlagName) + if err != nil { + return err, false + } + m.ColumnName = columnNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/alter_table_state_or_list_table_config_operation.go b/src/cli/alter_table_state_or_list_table_config_operation.go new file mode 100644 index 0000000..1ce15cd --- /dev/null +++ b/src/cli/alter_table_state_or_list_table_config_operation.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableAlterTableStateOrListTableConfigCmd returns a cmd to handle operation alterTableStateOrListTableConfig +func makeOperationTableAlterTableStateOrListTableConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "alterTableStateOrListTableConfig", + Short: `Get/Enable/Disable/Drop a table. If table name is the only parameter specified , the tableconfig will be printed`, + RunE: runOperationTableAlterTableStateOrListTableConfig, + } + + if err := registerOperationTableAlterTableStateOrListTableConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableAlterTableStateOrListTableConfig uses cmd flags to call endpoint api +func runOperationTableAlterTableStateOrListTableConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewAlterTableStateOrListTableConfigParams() + if err, _ := retrieveOperationTableAlterTableStateOrListTableConfigStateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableAlterTableStateOrListTableConfigTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableAlterTableStateOrListTableConfigTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableAlterTableStateOrListTableConfigResult(appCli.Table.AlterTableStateOrListTableConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableAlterTableStateOrListTableConfigParamFlags registers all flags needed to fill params +func registerOperationTableAlterTableStateOrListTableConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableAlterTableStateOrListTableConfigStateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableAlterTableStateOrListTableConfigTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableAlterTableStateOrListTableConfigTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableAlterTableStateOrListTableConfigStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `enable|disable|drop` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationTableAlterTableStateOrListTableConfigTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableAlterTableStateOrListTableConfigTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `realtime|offline` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableAlterTableStateOrListTableConfigStateFlag(m *table.AlterTableStateOrListTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableAlterTableStateOrListTableConfigTableNameFlag(m *table.AlterTableStateOrListTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableAlterTableStateOrListTableConfigTypeFlag(m *table.AlterTableStateOrListTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableAlterTableStateOrListTableConfigResult parses request result and return the string content +func parseOperationTableAlterTableStateOrListTableConfigResult(resp0 *table.AlterTableStateOrListTableConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.AlterTableStateOrListTableConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/assign_instances_operation.go b/src/cli/assign_instances_operation.go new file mode 100644 index 0000000..84ffff3 --- /dev/null +++ b/src/cli/assign_instances_operation.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableAssignInstancesCmd returns a cmd to handle operation assignInstances +func makeOperationTableAssignInstancesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "assignInstances", + Short: ``, + RunE: runOperationTableAssignInstances, + } + + if err := registerOperationTableAssignInstancesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableAssignInstances uses cmd flags to call endpoint api +func runOperationTableAssignInstances(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewAssignInstancesParams() + if err, _ := retrieveOperationTableAssignInstancesDryRunFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableAssignInstancesTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableAssignInstancesTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableAssignInstancesResult(appCli.Table.AssignInstances(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableAssignInstancesParamFlags registers all flags needed to fill params +func registerOperationTableAssignInstancesParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableAssignInstancesDryRunParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableAssignInstancesTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableAssignInstancesTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableAssignInstancesDryRunParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + dryRunDescription := `Whether to do dry-run` + + var dryRunFlagName string + if cmdPrefix == "" { + dryRunFlagName = "dryRun" + } else { + dryRunFlagName = fmt.Sprintf("%v.dryRun", cmdPrefix) + } + + var dryRunFlagDefault bool + + _ = cmd.PersistentFlags().Bool(dryRunFlagName, dryRunFlagDefault, dryRunDescription) + + return nil +} +func registerOperationTableAssignInstancesTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableAssignInstancesTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["OFFLINE","CONSUMING","COMPLETED"]. OFFLINE|CONSUMING|COMPLETED` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["OFFLINE","CONSUMING","COMPLETED"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTableAssignInstancesDryRunFlag(m *table.AssignInstancesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("dryRun") { + + var dryRunFlagName string + if cmdPrefix == "" { + dryRunFlagName = "dryRun" + } else { + dryRunFlagName = fmt.Sprintf("%v.dryRun", cmdPrefix) + } + + dryRunFlagValue, err := cmd.Flags().GetBool(dryRunFlagName) + if err != nil { + return err, false + } + m.DryRun = &dryRunFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableAssignInstancesTableNameFlag(m *table.AssignInstancesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableAssignInstancesTypeFlag(m *table.AssignInstancesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableAssignInstancesResult parses request result and return the string content +func parseOperationTableAssignInstancesResult(resp0 *table.AssignInstancesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.AssignInstancesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/auth_workflow_info_model.go b/src/cli/auth_workflow_info_model.go new file mode 100644 index 0000000..9fb712c --- /dev/null +++ b/src/cli/auth_workflow_info_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for AuthWorkflowInfo + +// register flags to command +func registerModelAuthWorkflowInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerAuthWorkflowInfoWorkflow(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerAuthWorkflowInfoWorkflow(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + workflowDescription := `` + + var workflowFlagName string + if cmdPrefix == "" { + workflowFlagName = "workflow" + } else { + workflowFlagName = fmt.Sprintf("%v.workflow", cmdPrefix) + } + + var workflowFlagDefault string + + _ = cmd.PersistentFlags().String(workflowFlagName, workflowFlagDefault, workflowDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelAuthWorkflowInfoFlags(depth int, m *models.AuthWorkflowInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, workflowAdded := retrieveAuthWorkflowInfoWorkflowFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || workflowAdded + + return nil, retAdded +} + +func retrieveAuthWorkflowInfoWorkflowFlags(depth int, m *models.AuthWorkflowInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + workflowFlagName := fmt.Sprintf("%v.workflow", cmdPrefix) + if cmd.Flags().Changed(workflowFlagName) { + + var workflowFlagName string + if cmdPrefix == "" { + workflowFlagName = "workflow" + } else { + workflowFlagName = fmt.Sprintf("%v.workflow", cmdPrefix) + } + + workflowFlagValue, err := cmd.Flags().GetString(workflowFlagName) + if err != nil { + return err, false + } + m.Workflow = workflowFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/autocomplete.go b/src/cli/autocomplete.go new file mode 100644 index 0000000..9b6fa25 --- /dev/null +++ b/src/cli/autocomplete.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "os" + + "github.com/spf13/cobra" +) + +func makeGenCompletionCmd() *cobra.Command { + + var completionCmd = &cobra.Command{ + Use: "completion [bash|zsh|fish|powershell]", + Short: "Generate completion script", + Long: `To load completions: + +Bash: + + $ source <(yourprogram completion bash) + + # To load completions for each session, execute once: + # Linux: + $ yourprogram completion bash > /etc/bash_completion.d/yourprogram + # macOS: + $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram + +Zsh: + + # If shell completion is not already enabled in your environment, + # you will need to enable it. You can execute the following once: + + $ echo "autoload -U compinit; compinit" >> ~/.zshrc + + # To load completions for each session, execute once: + $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" + + # You will need to start a new shell for this setup to take effect. + +fish: + + $ yourprogram completion fish | source + + # To load completions for each session, execute once: + $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish + +PowerShell: + + PS> yourprogram completion powershell | Out-String | Invoke-Expression + + # To load completions for every new session, run: + PS> yourprogram completion powershell > yourprogram.ps1 + # and source this file from your PowerShell profile. +`, + DisableFlagsInUseLine: true, + ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, + Args: cobra.ExactValidArgs(1), + Run: func(cmd *cobra.Command, args []string) { + switch args[0] { + case "bash": + cmd.Root().GenBashCompletion(os.Stdout) + case "zsh": + cmd.Root().GenZshCompletion(os.Stdout) + case "fish": + cmd.Root().GenFishCompletion(os.Stdout, true) + case "powershell": + cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) + } + }, + } + return completionCmd +} diff --git a/src/cli/batch_ingestion_config_model.go b/src/cli/batch_ingestion_config_model.go new file mode 100644 index 0000000..4f465ad --- /dev/null +++ b/src/cli/batch_ingestion_config_model.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for BatchIngestionConfig + +// register flags to command +func registerModelBatchIngestionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerBatchIngestionConfigBatchConfigMaps(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBatchIngestionConfigConsistentDataPush(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBatchIngestionConfigSegmentIngestionFrequency(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBatchIngestionConfigSegmentIngestionType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerBatchIngestionConfigBatchConfigMaps(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: batchConfigMaps []map[string]string array type is not supported by go-swagger cli yet + + return nil +} + +func registerBatchIngestionConfigConsistentDataPush(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + consistentDataPushDescription := `` + + var consistentDataPushFlagName string + if cmdPrefix == "" { + consistentDataPushFlagName = "consistentDataPush" + } else { + consistentDataPushFlagName = fmt.Sprintf("%v.consistentDataPush", cmdPrefix) + } + + var consistentDataPushFlagDefault bool + + _ = cmd.PersistentFlags().Bool(consistentDataPushFlagName, consistentDataPushFlagDefault, consistentDataPushDescription) + + return nil +} + +func registerBatchIngestionConfigSegmentIngestionFrequency(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentIngestionFrequencyDescription := `` + + var segmentIngestionFrequencyFlagName string + if cmdPrefix == "" { + segmentIngestionFrequencyFlagName = "segmentIngestionFrequency" + } else { + segmentIngestionFrequencyFlagName = fmt.Sprintf("%v.segmentIngestionFrequency", cmdPrefix) + } + + var segmentIngestionFrequencyFlagDefault string + + _ = cmd.PersistentFlags().String(segmentIngestionFrequencyFlagName, segmentIngestionFrequencyFlagDefault, segmentIngestionFrequencyDescription) + + return nil +} + +func registerBatchIngestionConfigSegmentIngestionType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentIngestionTypeDescription := `` + + var segmentIngestionTypeFlagName string + if cmdPrefix == "" { + segmentIngestionTypeFlagName = "segmentIngestionType" + } else { + segmentIngestionTypeFlagName = fmt.Sprintf("%v.segmentIngestionType", cmdPrefix) + } + + var segmentIngestionTypeFlagDefault string + + _ = cmd.PersistentFlags().String(segmentIngestionTypeFlagName, segmentIngestionTypeFlagDefault, segmentIngestionTypeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelBatchIngestionConfigFlags(depth int, m *models.BatchIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, batchConfigMapsAdded := retrieveBatchIngestionConfigBatchConfigMapsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || batchConfigMapsAdded + + err, consistentDataPushAdded := retrieveBatchIngestionConfigConsistentDataPushFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || consistentDataPushAdded + + err, segmentIngestionFrequencyAdded := retrieveBatchIngestionConfigSegmentIngestionFrequencyFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentIngestionFrequencyAdded + + err, segmentIngestionTypeAdded := retrieveBatchIngestionConfigSegmentIngestionTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentIngestionTypeAdded + + return nil, retAdded +} + +func retrieveBatchIngestionConfigBatchConfigMapsFlags(depth int, m *models.BatchIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + batchConfigMapsFlagName := fmt.Sprintf("%v.batchConfigMaps", cmdPrefix) + if cmd.Flags().Changed(batchConfigMapsFlagName) { + // warning: batchConfigMaps array type []map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveBatchIngestionConfigConsistentDataPushFlags(depth int, m *models.BatchIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + consistentDataPushFlagName := fmt.Sprintf("%v.consistentDataPush", cmdPrefix) + if cmd.Flags().Changed(consistentDataPushFlagName) { + + var consistentDataPushFlagName string + if cmdPrefix == "" { + consistentDataPushFlagName = "consistentDataPush" + } else { + consistentDataPushFlagName = fmt.Sprintf("%v.consistentDataPush", cmdPrefix) + } + + consistentDataPushFlagValue, err := cmd.Flags().GetBool(consistentDataPushFlagName) + if err != nil { + return err, false + } + m.ConsistentDataPush = consistentDataPushFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveBatchIngestionConfigSegmentIngestionFrequencyFlags(depth int, m *models.BatchIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentIngestionFrequencyFlagName := fmt.Sprintf("%v.segmentIngestionFrequency", cmdPrefix) + if cmd.Flags().Changed(segmentIngestionFrequencyFlagName) { + + var segmentIngestionFrequencyFlagName string + if cmdPrefix == "" { + segmentIngestionFrequencyFlagName = "segmentIngestionFrequency" + } else { + segmentIngestionFrequencyFlagName = fmt.Sprintf("%v.segmentIngestionFrequency", cmdPrefix) + } + + segmentIngestionFrequencyFlagValue, err := cmd.Flags().GetString(segmentIngestionFrequencyFlagName) + if err != nil { + return err, false + } + m.SegmentIngestionFrequency = segmentIngestionFrequencyFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveBatchIngestionConfigSegmentIngestionTypeFlags(depth int, m *models.BatchIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentIngestionTypeFlagName := fmt.Sprintf("%v.segmentIngestionType", cmdPrefix) + if cmd.Flags().Changed(segmentIngestionTypeFlagName) { + + var segmentIngestionTypeFlagName string + if cmdPrefix == "" { + segmentIngestionTypeFlagName = "segmentIngestionType" + } else { + segmentIngestionTypeFlagName = fmt.Sprintf("%v.segmentIngestionType", cmdPrefix) + } + + segmentIngestionTypeFlagValue, err := cmd.Flags().GetString(segmentIngestionTypeFlagName) + if err != nil { + return err, false + } + m.SegmentIngestionType = segmentIngestionTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/bloom_filter_config_model.go b/src/cli/bloom_filter_config_model.go new file mode 100644 index 0000000..e89b631 --- /dev/null +++ b/src/cli/bloom_filter_config_model.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for BloomFilterConfig + +// register flags to command +func registerModelBloomFilterConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerBloomFilterConfigFpp(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBloomFilterConfigLoadOnHeap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBloomFilterConfigMaxSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerBloomFilterConfigFpp(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + fppDescription := `` + + var fppFlagName string + if cmdPrefix == "" { + fppFlagName = "fpp" + } else { + fppFlagName = fmt.Sprintf("%v.fpp", cmdPrefix) + } + + var fppFlagDefault float64 + + _ = cmd.PersistentFlags().Float64(fppFlagName, fppFlagDefault, fppDescription) + + return nil +} + +func registerBloomFilterConfigLoadOnHeap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + loadOnHeapDescription := `` + + var loadOnHeapFlagName string + if cmdPrefix == "" { + loadOnHeapFlagName = "loadOnHeap" + } else { + loadOnHeapFlagName = fmt.Sprintf("%v.loadOnHeap", cmdPrefix) + } + + var loadOnHeapFlagDefault bool + + _ = cmd.PersistentFlags().Bool(loadOnHeapFlagName, loadOnHeapFlagDefault, loadOnHeapDescription) + + return nil +} + +func registerBloomFilterConfigMaxSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxSizeInBytesDescription := `` + + var maxSizeInBytesFlagName string + if cmdPrefix == "" { + maxSizeInBytesFlagName = "maxSizeInBytes" + } else { + maxSizeInBytesFlagName = fmt.Sprintf("%v.maxSizeInBytes", cmdPrefix) + } + + var maxSizeInBytesFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxSizeInBytesFlagName, maxSizeInBytesFlagDefault, maxSizeInBytesDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelBloomFilterConfigFlags(depth int, m *models.BloomFilterConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, fppAdded := retrieveBloomFilterConfigFppFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fppAdded + + err, loadOnHeapAdded := retrieveBloomFilterConfigLoadOnHeapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || loadOnHeapAdded + + err, maxSizeInBytesAdded := retrieveBloomFilterConfigMaxSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxSizeInBytesAdded + + return nil, retAdded +} + +func retrieveBloomFilterConfigFppFlags(depth int, m *models.BloomFilterConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fppFlagName := fmt.Sprintf("%v.fpp", cmdPrefix) + if cmd.Flags().Changed(fppFlagName) { + + var fppFlagName string + if cmdPrefix == "" { + fppFlagName = "fpp" + } else { + fppFlagName = fmt.Sprintf("%v.fpp", cmdPrefix) + } + + fppFlagValue, err := cmd.Flags().GetFloat64(fppFlagName) + if err != nil { + return err, false + } + m.Fpp = fppFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveBloomFilterConfigLoadOnHeapFlags(depth int, m *models.BloomFilterConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + loadOnHeapFlagName := fmt.Sprintf("%v.loadOnHeap", cmdPrefix) + if cmd.Flags().Changed(loadOnHeapFlagName) { + + var loadOnHeapFlagName string + if cmdPrefix == "" { + loadOnHeapFlagName = "loadOnHeap" + } else { + loadOnHeapFlagName = fmt.Sprintf("%v.loadOnHeap", cmdPrefix) + } + + loadOnHeapFlagValue, err := cmd.Flags().GetBool(loadOnHeapFlagName) + if err != nil { + return err, false + } + m.LoadOnHeap = &loadOnHeapFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveBloomFilterConfigMaxSizeInBytesFlags(depth int, m *models.BloomFilterConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxSizeInBytesFlagName := fmt.Sprintf("%v.maxSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(maxSizeInBytesFlagName) { + + var maxSizeInBytesFlagName string + if cmdPrefix == "" { + maxSizeInBytesFlagName = "maxSizeInBytes" + } else { + maxSizeInBytesFlagName = fmt.Sprintf("%v.maxSizeInBytes", cmdPrefix) + } + + maxSizeInBytesFlagValue, err := cmd.Flags().GetInt32(maxSizeInBytesFlagName) + if err != nil { + return err, false + } + m.MaxSizeInBytes = maxSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/body_part_model.go b/src/cli/body_part_model.go new file mode 100644 index 0000000..99e8b2b --- /dev/null +++ b/src/cli/body_part_model.go @@ -0,0 +1,368 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for BodyPart + +// register flags to command +func registerModelBodyPartFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerBodyPartContentDisposition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartEntity(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartMediaType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartMessageBodyWorkers(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartParameterizedHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartParent(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerBodyPartProviders(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerBodyPartContentDisposition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var contentDispositionFlagName string + if cmdPrefix == "" { + contentDispositionFlagName = "contentDisposition" + } else { + contentDispositionFlagName = fmt.Sprintf("%v.contentDisposition", cmdPrefix) + } + + if err := registerModelContentDispositionFlags(depth+1, contentDispositionFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerBodyPartEntity(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: entity interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerBodyPartHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: headers map[string][]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerBodyPartMediaType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var mediaTypeFlagName string + if cmdPrefix == "" { + mediaTypeFlagName = "mediaType" + } else { + mediaTypeFlagName = fmt.Sprintf("%v.mediaType", cmdPrefix) + } + + if err := registerModelMediaTypeFlags(depth+1, mediaTypeFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerBodyPartMessageBodyWorkers(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: messageBodyWorkers MessageBodyWorkers map type is not supported by go-swagger cli yet + + return nil +} + +func registerBodyPartParameterizedHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameterizedHeaders map[string][]ParameterizedHeader map type is not supported by go-swagger cli yet + + return nil +} + +func registerBodyPartParent(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var parentFlagName string + if cmdPrefix == "" { + parentFlagName = "parent" + } else { + parentFlagName = fmt.Sprintf("%v.parent", cmdPrefix) + } + + if err := registerModelMultiPartFlags(depth+1, parentFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerBodyPartProviders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: providers Providers map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelBodyPartFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, contentDispositionAdded := retrieveBodyPartContentDispositionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + + err, entityAdded := retrieveBodyPartEntityFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || entityAdded + + err, headersAdded := retrieveBodyPartHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || headersAdded + + err, mediaTypeAdded := retrieveBodyPartMediaTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + + err, messageBodyWorkersAdded := retrieveBodyPartMessageBodyWorkersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || messageBodyWorkersAdded + + err, parameterizedHeadersAdded := retrieveBodyPartParameterizedHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parameterizedHeadersAdded + + err, parentAdded := retrieveBodyPartParentFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + + err, providersAdded := retrieveBodyPartProvidersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || providersAdded + + return nil, retAdded +} + +func retrieveBodyPartContentDispositionFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + contentDispositionFlagName := fmt.Sprintf("%v.contentDisposition", cmdPrefix) + if cmd.Flags().Changed(contentDispositionFlagName) { + // info: complex object contentDisposition ContentDisposition is retrieved outside this Changed() block + } + contentDispositionFlagValue := m.ContentDisposition + if swag.IsZero(contentDispositionFlagValue) { + contentDispositionFlagValue = &models.ContentDisposition{} + } + + err, contentDispositionAdded := retrieveModelContentDispositionFlags(depth+1, contentDispositionFlagValue, contentDispositionFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + if contentDispositionAdded { + m.ContentDisposition = contentDispositionFlagValue + } + + return nil, retAdded +} + +func retrieveBodyPartEntityFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + entityFlagName := fmt.Sprintf("%v.entity", cmdPrefix) + if cmd.Flags().Changed(entityFlagName) { + // warning: entity map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveBodyPartHeadersFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + headersFlagName := fmt.Sprintf("%v.headers", cmdPrefix) + if cmd.Flags().Changed(headersFlagName) { + // warning: headers map type map[string][]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveBodyPartMediaTypeFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + mediaTypeFlagName := fmt.Sprintf("%v.mediaType", cmdPrefix) + if cmd.Flags().Changed(mediaTypeFlagName) { + // info: complex object mediaType MediaType is retrieved outside this Changed() block + } + mediaTypeFlagValue := m.MediaType + if swag.IsZero(mediaTypeFlagValue) { + mediaTypeFlagValue = &models.MediaType{} + } + + err, mediaTypeAdded := retrieveModelMediaTypeFlags(depth+1, mediaTypeFlagValue, mediaTypeFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + if mediaTypeAdded { + m.MediaType = mediaTypeFlagValue + } + + return nil, retAdded +} + +func retrieveBodyPartMessageBodyWorkersFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + messageBodyWorkersFlagName := fmt.Sprintf("%v.messageBodyWorkers", cmdPrefix) + if cmd.Flags().Changed(messageBodyWorkersFlagName) { + // warning: messageBodyWorkers map type MessageBodyWorkers is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveBodyPartParameterizedHeadersFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parameterizedHeadersFlagName := fmt.Sprintf("%v.parameterizedHeaders", cmdPrefix) + if cmd.Flags().Changed(parameterizedHeadersFlagName) { + // warning: parameterizedHeaders map type map[string][]ParameterizedHeader is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveBodyPartParentFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parentFlagName := fmt.Sprintf("%v.parent", cmdPrefix) + if cmd.Flags().Changed(parentFlagName) { + // info: complex object parent MultiPart is retrieved outside this Changed() block + } + parentFlagValue := m.Parent + if swag.IsZero(parentFlagValue) { + parentFlagValue = &models.MultiPart{} + } + + err, parentAdded := retrieveModelMultiPartFlags(depth+1, parentFlagValue, parentFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + if parentAdded { + m.Parent = parentFlagValue + } + + return nil, retAdded +} + +func retrieveBodyPartProvidersFlags(depth int, m *models.BodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + providersFlagName := fmt.Sprintf("%v.providers", cmdPrefix) + if cmd.Flags().Changed(providersFlagName) { + // warning: providers map type Providers is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/cancel_query_operation.go b/src/cli/cancel_query_operation.go new file mode 100644 index 0000000..28d1ac2 --- /dev/null +++ b/src/cli/cancel_query_operation.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/query" + + "github.com/spf13/cobra" +) + +// makeOperationQueryCancelQueryCmd returns a cmd to handle operation cancelQuery +func makeOperationQueryCancelQueryCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "cancelQuery", + Short: `No effect if no query exists for the given queryId on the requested broker. Query may continue to run for a short while after calling cancel as it's done in a non-blocking manner. The cancel method can be called multiple times.`, + RunE: runOperationQueryCancelQuery, + } + + if err := registerOperationQueryCancelQueryParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationQueryCancelQuery uses cmd flags to call endpoint api +func runOperationQueryCancelQuery(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := query.NewCancelQueryParams() + if err, _ := retrieveOperationQueryCancelQueryBrokerIDFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationQueryCancelQueryQueryIDFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationQueryCancelQueryTimeoutMsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationQueryCancelQueryVerboseFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationQueryCancelQueryResult(appCli.Query.CancelQuery(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationQueryCancelQueryParamFlags registers all flags needed to fill params +func registerOperationQueryCancelQueryParamFlags(cmd *cobra.Command) error { + if err := registerOperationQueryCancelQueryBrokerIDParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationQueryCancelQueryQueryIDParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationQueryCancelQueryTimeoutMsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationQueryCancelQueryVerboseParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationQueryCancelQueryBrokerIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + brokerIdDescription := `Required. Broker that's running the query` + + var brokerIdFlagName string + if cmdPrefix == "" { + brokerIdFlagName = "brokerId" + } else { + brokerIdFlagName = fmt.Sprintf("%v.brokerId", cmdPrefix) + } + + var brokerIdFlagDefault string + + _ = cmd.PersistentFlags().String(brokerIdFlagName, brokerIdFlagDefault, brokerIdDescription) + + return nil +} +func registerOperationQueryCancelQueryQueryIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + queryIdDescription := `Required. QueryId as assigned by the broker` + + var queryIdFlagName string + if cmdPrefix == "" { + queryIdFlagName = "queryId" + } else { + queryIdFlagName = fmt.Sprintf("%v.queryId", cmdPrefix) + } + + var queryIdFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(queryIdFlagName, queryIdFlagDefault, queryIdDescription) + + return nil +} +func registerOperationQueryCancelQueryTimeoutMsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + timeoutMsDescription := `Timeout for servers to respond the cancel request` + + var timeoutMsFlagName string + if cmdPrefix == "" { + timeoutMsFlagName = "timeoutMs" + } else { + timeoutMsFlagName = fmt.Sprintf("%v.timeoutMs", cmdPrefix) + } + + var timeoutMsFlagDefault int32 = 3000 + + _ = cmd.PersistentFlags().Int32(timeoutMsFlagName, timeoutMsFlagDefault, timeoutMsDescription) + + return nil +} +func registerOperationQueryCancelQueryVerboseParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + verboseDescription := `Return verbose responses for troubleshooting` + + var verboseFlagName string + if cmdPrefix == "" { + verboseFlagName = "verbose" + } else { + verboseFlagName = fmt.Sprintf("%v.verbose", cmdPrefix) + } + + var verboseFlagDefault bool + + _ = cmd.PersistentFlags().Bool(verboseFlagName, verboseFlagDefault, verboseDescription) + + return nil +} + +func retrieveOperationQueryCancelQueryBrokerIDFlag(m *query.CancelQueryParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("brokerId") { + + var brokerIdFlagName string + if cmdPrefix == "" { + brokerIdFlagName = "brokerId" + } else { + brokerIdFlagName = fmt.Sprintf("%v.brokerId", cmdPrefix) + } + + brokerIdFlagValue, err := cmd.Flags().GetString(brokerIdFlagName) + if err != nil { + return err, false + } + m.BrokerID = brokerIdFlagValue + + } + return nil, retAdded +} +func retrieveOperationQueryCancelQueryQueryIDFlag(m *query.CancelQueryParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("queryId") { + + var queryIdFlagName string + if cmdPrefix == "" { + queryIdFlagName = "queryId" + } else { + queryIdFlagName = fmt.Sprintf("%v.queryId", cmdPrefix) + } + + queryIdFlagValue, err := cmd.Flags().GetInt64(queryIdFlagName) + if err != nil { + return err, false + } + m.QueryID = queryIdFlagValue + + } + return nil, retAdded +} +func retrieveOperationQueryCancelQueryTimeoutMsFlag(m *query.CancelQueryParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("timeoutMs") { + + var timeoutMsFlagName string + if cmdPrefix == "" { + timeoutMsFlagName = "timeoutMs" + } else { + timeoutMsFlagName = fmt.Sprintf("%v.timeoutMs", cmdPrefix) + } + + timeoutMsFlagValue, err := cmd.Flags().GetInt32(timeoutMsFlagName) + if err != nil { + return err, false + } + m.TimeoutMs = &timeoutMsFlagValue + + } + return nil, retAdded +} +func retrieveOperationQueryCancelQueryVerboseFlag(m *query.CancelQueryParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("verbose") { + + var verboseFlagName string + if cmdPrefix == "" { + verboseFlagName = "verbose" + } else { + verboseFlagName = fmt.Sprintf("%v.verbose", cmdPrefix) + } + + verboseFlagValue, err := cmd.Flags().GetBool(verboseFlagName) + if err != nil { + return err, false + } + m.Verbose = &verboseFlagValue + + } + return nil, retAdded +} + +// parseOperationQueryCancelQueryResult parses request result and return the string content +func parseOperationQueryCancelQueryResult(resp0 *query.CancelQueryOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning cancelQueryOK is not supported + + // Non schema case: warning cancelQueryNotFound is not supported + + // Non schema case: warning cancelQueryInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response cancelQueryOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/change_tenant_state_operation.go b/src/cli/change_tenant_state_operation.go new file mode 100644 index 0000000..2f7121f --- /dev/null +++ b/src/cli/change_tenant_state_operation.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tenant" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTenantChangeTenantStateCmd returns a cmd to handle operation changeTenantState +func makeOperationTenantChangeTenantStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "changeTenantState", + Short: ``, + RunE: runOperationTenantChangeTenantState, + } + + if err := registerOperationTenantChangeTenantStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantChangeTenantState uses cmd flags to call endpoint api +func runOperationTenantChangeTenantState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewChangeTenantStateParams() + if err, _ := retrieveOperationTenantChangeTenantStateStateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantChangeTenantStateTenantNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantChangeTenantStateTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantChangeTenantStateResult(appCli.Tenant.ChangeTenantState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantChangeTenantStateParamFlags registers all flags needed to fill params +func registerOperationTenantChangeTenantStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantChangeTenantStateStateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantChangeTenantStateTenantNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantChangeTenantStateTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantChangeTenantStateStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `Enum: ["enable","disable","drop"]. Required. state` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + if err := cmd.RegisterFlagCompletionFunc(stateFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["enable","disable","drop"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} +func registerOperationTenantChangeTenantStateTenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Tenant name` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} +func registerOperationTenantChangeTenantStateTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["SERVER","BROKER"]. tenant type` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["SERVER","BROKER"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTenantChangeTenantStateStateFlag(m *tenant.ChangeTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantChangeTenantStateTenantNameFlag(m *tenant.ChangeTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantChangeTenantStateTypeFlag(m *tenant.ChangeTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTenantChangeTenantStateResult parses request result and return the string content +func parseOperationTenantChangeTenantStateResult(resp0 *tenant.ChangeTenantStateOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*tenant.ChangeTenantStateOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + // Non schema case: warning changeTenantStateNotFound is not supported + + // Non schema case: warning changeTenantStateInternalServerError is not supported + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/check_health_legacy_operation.go b/src/cli/check_health_legacy_operation.go new file mode 100644 index 0000000..8e56547 --- /dev/null +++ b/src/cli/check_health_legacy_operation.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/health" + + "github.com/spf13/cobra" +) + +// makeOperationHealthCheckHealthLegacyCmd returns a cmd to handle operation checkHealthLegacy +func makeOperationHealthCheckHealthLegacyCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "checkHealthLegacy", + Short: ``, + RunE: runOperationHealthCheckHealthLegacy, + } + + if err := registerOperationHealthCheckHealthLegacyParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationHealthCheckHealthLegacy uses cmd flags to call endpoint api +func runOperationHealthCheckHealthLegacy(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := health.NewCheckHealthLegacyParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationHealthCheckHealthLegacyResult(appCli.Health.CheckHealthLegacy(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationHealthCheckHealthLegacyParamFlags registers all flags needed to fill params +func registerOperationHealthCheckHealthLegacyParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationHealthCheckHealthLegacyResult parses request result and return the string content +func parseOperationHealthCheckHealthLegacyResult(resp0 *health.CheckHealthLegacyOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning checkHealthLegacyOK is not supported + + return "", respErr + } + + // warning: non schema response checkHealthLegacyOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/check_health_operation.go b/src/cli/check_health_operation.go new file mode 100644 index 0000000..570f9d8 --- /dev/null +++ b/src/cli/check_health_operation.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/health" + + "github.com/spf13/cobra" +) + +// makeOperationHealthCheckHealthCmd returns a cmd to handle operation checkHealth +func makeOperationHealthCheckHealthCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "checkHealth", + Short: ``, + RunE: runOperationHealthCheckHealth, + } + + if err := registerOperationHealthCheckHealthParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationHealthCheckHealth uses cmd flags to call endpoint api +func runOperationHealthCheckHealth(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := health.NewCheckHealthParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationHealthCheckHealthResult(appCli.Health.CheckHealth(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationHealthCheckHealthParamFlags registers all flags needed to fill params +func registerOperationHealthCheckHealthParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationHealthCheckHealthResult parses request result and return the string content +func parseOperationHealthCheckHealthResult(resp0 *health.CheckHealthOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning checkHealthOK is not supported + + return "", respErr + } + + // warning: non schema response checkHealthOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/check_table_config_operation.go b/src/cli/check_table_config_operation.go new file mode 100644 index 0000000..42e65ff --- /dev/null +++ b/src/cli/check_table_config_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableCheckTableConfigCmd returns a cmd to handle operation checkTableConfig +func makeOperationTableCheckTableConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "checkTableConfig", + Short: `This API returns the table config that matches the one you get from 'GET /tables/{tableName}'. This allows us to validate table config before apply.`, + RunE: runOperationTableCheckTableConfig, + } + + if err := registerOperationTableCheckTableConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableCheckTableConfig uses cmd flags to call endpoint api +func runOperationTableCheckTableConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewCheckTableConfigParams() + if err, _ := retrieveOperationTableCheckTableConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableCheckTableConfigValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableCheckTableConfigResult(appCli.Table.CheckTableConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableCheckTableConfigParamFlags registers all flags needed to fill params +func registerOperationTableCheckTableConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableCheckTableConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableCheckTableConfigValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableCheckTableConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableCheckTableConfigValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableCheckTableConfigBodyFlag(m *table.CheckTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableCheckTableConfigValidationTypesToSkipFlag(m *table.CheckTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableCheckTableConfigResult parses request result and return the string content +func parseOperationTableCheckTableConfigResult(resp0 *table.CheckTableConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.CheckTableConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/clean_up_tasks_deprecated_operation.go b/src/cli/clean_up_tasks_deprecated_operation.go new file mode 100644 index 0000000..d9d832e --- /dev/null +++ b/src/cli/clean_up_tasks_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskCleanUpTasksDeprecatedCmd returns a cmd to handle operation cleanUpTasksDeprecated +func makeOperationTaskCleanUpTasksDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "cleanUpTasksDeprecated", + Short: ``, + RunE: runOperationTaskCleanUpTasksDeprecated, + } + + if err := registerOperationTaskCleanUpTasksDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskCleanUpTasksDeprecated uses cmd flags to call endpoint api +func runOperationTaskCleanUpTasksDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewCleanUpTasksDeprecatedParams() + if err, _ := retrieveOperationTaskCleanUpTasksDeprecatedTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskCleanUpTasksDeprecatedResult(appCli.Task.CleanUpTasksDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskCleanUpTasksDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskCleanUpTasksDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskCleanUpTasksDeprecatedTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskCleanUpTasksDeprecatedTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskCleanUpTasksDeprecatedTaskTypeFlag(m *task.CleanUpTasksDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskCleanUpTasksDeprecatedResult parses request result and return the string content +func parseOperationTaskCleanUpTasksDeprecatedResult(resp0 *task.CleanUpTasksDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.CleanUpTasksDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/clean_up_tasks_operation.go b/src/cli/clean_up_tasks_operation.go new file mode 100644 index 0000000..7a69f0e --- /dev/null +++ b/src/cli/clean_up_tasks_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskCleanUpTasksCmd returns a cmd to handle operation cleanUpTasks +func makeOperationTaskCleanUpTasksCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "cleanUpTasks", + Short: ``, + RunE: runOperationTaskCleanUpTasks, + } + + if err := registerOperationTaskCleanUpTasksParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskCleanUpTasks uses cmd flags to call endpoint api +func runOperationTaskCleanUpTasks(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewCleanUpTasksParams() + if err, _ := retrieveOperationTaskCleanUpTasksTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskCleanUpTasksResult(appCli.Task.CleanUpTasks(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskCleanUpTasksParamFlags registers all flags needed to fill params +func registerOperationTaskCleanUpTasksParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskCleanUpTasksTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskCleanUpTasksTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskCleanUpTasksTaskTypeFlag(m *task.CleanUpTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskCleanUpTasksResult parses request result and return the string content +func parseOperationTaskCleanUpTasksResult(resp0 *task.CleanUpTasksOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.CleanUpTasksOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/cli.go b/src/cli/cli.go new file mode 100644 index 0000000..63aecc2 --- /dev/null +++ b/src/cli/cli.go @@ -0,0 +1,1680 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "log" + "os" + "path" + "path/filepath" + + "startree.ai/cli/client" + + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + homedir "github.com/mitchellh/go-homedir" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +// debug flag indicating that cli should output debug logs +var debug bool + +// config file location +var configFile string + +// dry run flag +var dryRun bool + +// name of the executable +var exeName string = filepath.Base(os.Args[0]) + +// logDebugf writes debug log to stdout +func logDebugf(format string, v ...interface{}) { + if !debug { + return + } + log.Printf(format, v...) +} + +// depth of recursion to construct model flags +var maxDepth int = 5 + +// makeClient constructs a client object +func makeClient(cmd *cobra.Command, args []string) (*client.PinotControllerAPI, error) { + hostname := viper.GetString("hostname") + viper.SetDefault("base_path", client.DefaultBasePath) + basePath := viper.GetString("base_path") + scheme := viper.GetString("scheme") + + r := httptransport.New(hostname, basePath, []string{scheme}) + r.SetDebug(debug) + // set custom producer and consumer to use the default ones + + r.Consumers["application/json"] = runtime.JSONConsumer() + + // warning: consumes multipart/form-data is not supported by go-swagger cli yet + + // warning: consumes text/plain is not supported by go-swagger cli yet + + // warning: produces application/octet-stream is not supported by go-swagger cli yet + + r.Producers["application/json"] = runtime.JSONProducer() + + // warning: produces text/plain is not supported by go-swagger cli yet + + auth, err := makeAuthInfoWriter(cmd) + if err != nil { + return nil, err + } + r.DefaultAuthentication = auth + + appCli := client.New(r, strfmt.Default) + logDebugf("Server url: %v://%v", scheme, hostname) + return appCli, nil +} + +// MakeRootCmd returns the root cmd +func MakeRootCmd() (*cobra.Command, error) { + cobra.OnInitialize(initViperConfigs) + + // Use executable name as the command name + rootCmd := &cobra.Command{ + Use: exeName, + } + + // register basic flags + rootCmd.PersistentFlags().String("hostname", client.DefaultHost, "hostname of the service") + viper.BindPFlag("hostname", rootCmd.PersistentFlags().Lookup("hostname")) + rootCmd.PersistentFlags().String("scheme", client.DefaultSchemes[0], fmt.Sprintf("Choose from: %v", client.DefaultSchemes)) + viper.BindPFlag("scheme", rootCmd.PersistentFlags().Lookup("scheme")) + rootCmd.PersistentFlags().String("base-path", client.DefaultBasePath, fmt.Sprintf("For example: %v", client.DefaultBasePath)) + viper.BindPFlag("base_path", rootCmd.PersistentFlags().Lookup("base-path")) + + // configure debug flag + rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "output debug logs") + // configure config location + rootCmd.PersistentFlags().StringVar(&configFile, "config", "", "config file path") + // configure dry run flag + rootCmd.PersistentFlags().BoolVar(&dryRun, "dry-run", false, "do not send the request to server") + + // register security flags + if err := registerAuthInoWriterFlags(rootCmd); err != nil { + return nil, err + } + // add all operation groups + operationGroupAppConfigsCmd, err := makeOperationGroupAppConfigsCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupAppConfigsCmd) + + operationGroupAtomicIngestionCmd, err := makeOperationGroupAtomicIngestionCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupAtomicIngestionCmd) + + operationGroupAuthCmd, err := makeOperationGroupAuthCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupAuthCmd) + + operationGroupBrokerCmd, err := makeOperationGroupBrokerCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupBrokerCmd) + + operationGroupClusterCmd, err := makeOperationGroupClusterCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupClusterCmd) + + operationGroupClusterHealthCmd, err := makeOperationGroupClusterHealthCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupClusterHealthCmd) + + operationGroupHealthCmd, err := makeOperationGroupHealthCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupHealthCmd) + + operationGroupInstanceCmd, err := makeOperationGroupInstanceCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupInstanceCmd) + + operationGroupLeaderCmd, err := makeOperationGroupLeaderCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupLeaderCmd) + + operationGroupLoggerCmd, err := makeOperationGroupLoggerCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupLoggerCmd) + + operationGroupPeriodicTaskCmd, err := makeOperationGroupPeriodicTaskCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupPeriodicTaskCmd) + + operationGroupQueryCmd, err := makeOperationGroupQueryCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupQueryCmd) + + operationGroupSchemaCmd, err := makeOperationGroupSchemaCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupSchemaCmd) + + operationGroupSegmentCmd, err := makeOperationGroupSegmentCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupSegmentCmd) + + operationGroupTableCmd, err := makeOperationGroupTableCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupTableCmd) + + operationGroupTaskCmd, err := makeOperationGroupTaskCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupTaskCmd) + + operationGroupTenantCmd, err := makeOperationGroupTenantCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupTenantCmd) + + operationGroupTunerCmd, err := makeOperationGroupTunerCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupTunerCmd) + + operationGroupUpsertCmd, err := makeOperationGroupUpsertCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupUpsertCmd) + + operationGroupUserCmd, err := makeOperationGroupUserCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupUserCmd) + + operationGroupVersionCmd, err := makeOperationGroupVersionCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupVersionCmd) + + operationGroupWriteAPICmd, err := makeOperationGroupWriteAPICmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupWriteAPICmd) + + operationGroupZookeeperCmd, err := makeOperationGroupZookeeperCmd() + if err != nil { + return nil, err + } + rootCmd.AddCommand(operationGroupZookeeperCmd) + + // add cobra completion + rootCmd.AddCommand(makeGenCompletionCmd()) + + return rootCmd, nil +} + +// initViperConfigs initialize viper config using config file in '$HOME/.config//config.' +// currently hostname, scheme and auth tokens can be specified in this config file. +func initViperConfigs() { + if configFile != "" { + // use user specified config file location + viper.SetConfigFile(configFile) + } else { + // look for default config + // Find home directory. + home, err := homedir.Dir() + cobra.CheckErr(err) + + // Search config in home directory with name ".cobra" (without extension). + viper.AddConfigPath(path.Join(home, ".config", exeName)) + viper.SetConfigName("config") + } + + if err := viper.ReadInConfig(); err != nil { + logDebugf("Error: loading config file: %v", err) + return + } + logDebugf("Using config file: %v", viper.ConfigFileUsed()) +} + +// registerAuthInoWriterFlags registers all flags needed to perform authentication +func registerAuthInoWriterFlags(cmd *cobra.Command) error { + /*Authorization */ + cmd.PersistentFlags().String("Authorization", "", ``) + viper.BindPFlag("Authorization", cmd.PersistentFlags().Lookup("Authorization")) + return nil +} + +// makeAuthInfoWriter retrieves cmd flags and construct an auth info writer +func makeAuthInfoWriter(cmd *cobra.Command) (runtime.ClientAuthInfoWriter, error) { + auths := []runtime.ClientAuthInfoWriter{} + /*Authorization */ + if viper.IsSet("Authorization") { + AuthorizationKey := viper.GetString("Authorization") + auths = append(auths, httptransport.APIKeyAuth("Authorization", "header", AuthorizationKey)) + } + if len(auths) == 0 { + logDebugf("Warning: No auth params detected.") + return nil, nil + } + // compose all auths together + return httptransport.Compose(auths...), nil +} + +func makeOperationGroupAppConfigsCmd() (*cobra.Command, error) { + operationGroupAppConfigsCmd := &cobra.Command{ + Use: "app_configs", + Long: ``, + } + + operationGetAppConfigsCmd, err := makeOperationAppConfigsGetAppConfigsCmd() + if err != nil { + return nil, err + } + operationGroupAppConfigsCmd.AddCommand(operationGetAppConfigsCmd) + + return operationGroupAppConfigsCmd, nil +} +func makeOperationGroupAtomicIngestionCmd() (*cobra.Command, error) { + operationGroupAtomicIngestionCmd := &cobra.Command{ + Use: "atomic_ingestion", + Long: ``, + } + + operationEndDataIngestRequestCmd, err := makeOperationAtomicIngestionEndDataIngestRequestCmd() + if err != nil { + return nil, err + } + operationGroupAtomicIngestionCmd.AddCommand(operationEndDataIngestRequestCmd) + + operationStartDataIngestRequestCmd, err := makeOperationAtomicIngestionStartDataIngestRequestCmd() + if err != nil { + return nil, err + } + operationGroupAtomicIngestionCmd.AddCommand(operationStartDataIngestRequestCmd) + + return operationGroupAtomicIngestionCmd, nil +} +func makeOperationGroupAuthCmd() (*cobra.Command, error) { + operationGroupAuthCmd := &cobra.Command{ + Use: "auth", + Long: ``, + } + + operationInfoCmd, err := makeOperationAuthInfoCmd() + if err != nil { + return nil, err + } + operationGroupAuthCmd.AddCommand(operationInfoCmd) + + operationVerifyCmd, err := makeOperationAuthVerifyCmd() + if err != nil { + return nil, err + } + operationGroupAuthCmd.AddCommand(operationVerifyCmd) + + return operationGroupAuthCmd, nil +} +func makeOperationGroupBrokerCmd() (*cobra.Command, error) { + operationGroupBrokerCmd := &cobra.Command{ + Use: "broker", + Long: ``, + } + + operationGetBrokersForTableCmd, err := makeOperationBrokerGetBrokersForTableCmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetBrokersForTableCmd) + + operationGetBrokersForTableV2Cmd, err := makeOperationBrokerGetBrokersForTableV2Cmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetBrokersForTableV2Cmd) + + operationGetBrokersForTenantCmd, err := makeOperationBrokerGetBrokersForTenantCmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetBrokersForTenantCmd) + + operationGetBrokersForTenantV2Cmd, err := makeOperationBrokerGetBrokersForTenantV2Cmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetBrokersForTenantV2Cmd) + + operationGetTablesToBrokersMappingCmd, err := makeOperationBrokerGetTablesToBrokersMappingCmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetTablesToBrokersMappingCmd) + + operationGetTablesToBrokersMappingV2Cmd, err := makeOperationBrokerGetTablesToBrokersMappingV2Cmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetTablesToBrokersMappingV2Cmd) + + operationGetTenantsToBrokersMappingCmd, err := makeOperationBrokerGetTenantsToBrokersMappingCmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetTenantsToBrokersMappingCmd) + + operationGetTenantsToBrokersMappingV2Cmd, err := makeOperationBrokerGetTenantsToBrokersMappingV2Cmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationGetTenantsToBrokersMappingV2Cmd) + + operationListBrokersMappingCmd, err := makeOperationBrokerListBrokersMappingCmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationListBrokersMappingCmd) + + operationListBrokersMappingV2Cmd, err := makeOperationBrokerListBrokersMappingV2Cmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationListBrokersMappingV2Cmd) + + operationToggleQueryRateLimitingCmd, err := makeOperationBrokerToggleQueryRateLimitingCmd() + if err != nil { + return nil, err + } + operationGroupBrokerCmd.AddCommand(operationToggleQueryRateLimitingCmd) + + return operationGroupBrokerCmd, nil +} +func makeOperationGroupClusterCmd() (*cobra.Command, error) { + operationGroupClusterCmd := &cobra.Command{ + Use: "cluster", + Long: ``, + } + + operationDeleteClusterConfigCmd, err := makeOperationClusterDeleteClusterConfigCmd() + if err != nil { + return nil, err + } + operationGroupClusterCmd.AddCommand(operationDeleteClusterConfigCmd) + + operationGetClusterInfoCmd, err := makeOperationClusterGetClusterInfoCmd() + if err != nil { + return nil, err + } + operationGroupClusterCmd.AddCommand(operationGetClusterInfoCmd) + + operationGetSegmentDebugInfoCmd, err := makeOperationClusterGetSegmentDebugInfoCmd() + if err != nil { + return nil, err + } + operationGroupClusterCmd.AddCommand(operationGetSegmentDebugInfoCmd) + + operationGetTableDebugInfoCmd, err := makeOperationClusterGetTableDebugInfoCmd() + if err != nil { + return nil, err + } + operationGroupClusterCmd.AddCommand(operationGetTableDebugInfoCmd) + + operationListClusterConfigsCmd, err := makeOperationClusterListClusterConfigsCmd() + if err != nil { + return nil, err + } + operationGroupClusterCmd.AddCommand(operationListClusterConfigsCmd) + + operationUpdateClusterConfigCmd, err := makeOperationClusterUpdateClusterConfigCmd() + if err != nil { + return nil, err + } + operationGroupClusterCmd.AddCommand(operationUpdateClusterConfigCmd) + + return operationGroupClusterCmd, nil +} +func makeOperationGroupClusterHealthCmd() (*cobra.Command, error) { + operationGroupClusterHealthCmd := &cobra.Command{ + Use: "cluster_health", + Long: ``, + } + + operationGetClusterHealthDetailsCmd, err := makeOperationClusterHealthGetClusterHealthDetailsCmd() + if err != nil { + return nil, err + } + operationGroupClusterHealthCmd.AddCommand(operationGetClusterHealthDetailsCmd) + + return operationGroupClusterHealthCmd, nil +} +func makeOperationGroupHealthCmd() (*cobra.Command, error) { + operationGroupHealthCmd := &cobra.Command{ + Use: "health", + Long: ``, + } + + operationCheckHealthCmd, err := makeOperationHealthCheckHealthCmd() + if err != nil { + return nil, err + } + operationGroupHealthCmd.AddCommand(operationCheckHealthCmd) + + operationCheckHealthLegacyCmd, err := makeOperationHealthCheckHealthLegacyCmd() + if err != nil { + return nil, err + } + operationGroupHealthCmd.AddCommand(operationCheckHealthLegacyCmd) + + return operationGroupHealthCmd, nil +} +func makeOperationGroupInstanceCmd() (*cobra.Command, error) { + operationGroupInstanceCmd := &cobra.Command{ + Use: "instance", + Long: ``, + } + + operationAddInstanceCmd, err := makeOperationInstanceAddInstanceCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationAddInstanceCmd) + + operationDropInstanceCmd, err := makeOperationInstanceDropInstanceCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationDropInstanceCmd) + + operationGetAllInstancesCmd, err := makeOperationInstanceGetAllInstancesCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationGetAllInstancesCmd) + + operationGetInstanceCmd, err := makeOperationInstanceGetInstanceCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationGetInstanceCmd) + + operationToggleInstanceStateCmd, err := makeOperationInstanceToggleInstanceStateCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationToggleInstanceStateCmd) + + operationUpdateBrokerResourceCmd, err := makeOperationInstanceUpdateBrokerResourceCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationUpdateBrokerResourceCmd) + + operationUpdateInstanceCmd, err := makeOperationInstanceUpdateInstanceCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationUpdateInstanceCmd) + + operationUpdateInstanceTagsCmd, err := makeOperationInstanceUpdateInstanceTagsCmd() + if err != nil { + return nil, err + } + operationGroupInstanceCmd.AddCommand(operationUpdateInstanceTagsCmd) + + return operationGroupInstanceCmd, nil +} +func makeOperationGroupLeaderCmd() (*cobra.Command, error) { + operationGroupLeaderCmd := &cobra.Command{ + Use: "leader", + Long: ``, + } + + operationGetLeaderForTableCmd, err := makeOperationLeaderGetLeaderForTableCmd() + if err != nil { + return nil, err + } + operationGroupLeaderCmd.AddCommand(operationGetLeaderForTableCmd) + + operationGetLeadersForAllTablesCmd, err := makeOperationLeaderGetLeadersForAllTablesCmd() + if err != nil { + return nil, err + } + operationGroupLeaderCmd.AddCommand(operationGetLeadersForAllTablesCmd) + + return operationGroupLeaderCmd, nil +} +func makeOperationGroupLoggerCmd() (*cobra.Command, error) { + operationGroupLoggerCmd := &cobra.Command{ + Use: "logger", + Long: ``, + } + + operationDownloadLogFileCmd, err := makeOperationLoggerDownloadLogFileCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationDownloadLogFileCmd) + + operationDownloadLogFileFromInstanceCmd, err := makeOperationLoggerDownloadLogFileFromInstanceCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationDownloadLogFileFromInstanceCmd) + + operationGetLocalLogFilesCmd, err := makeOperationLoggerGetLocalLogFilesCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationGetLocalLogFilesCmd) + + operationGetLogFilesFromAllInstancesCmd, err := makeOperationLoggerGetLogFilesFromAllInstancesCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationGetLogFilesFromAllInstancesCmd) + + operationGetLogFilesFromInstanceCmd, err := makeOperationLoggerGetLogFilesFromInstanceCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationGetLogFilesFromInstanceCmd) + + operationGetLoggerCmd, err := makeOperationLoggerGetLoggerCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationGetLoggerCmd) + + operationGetLoggersCmd, err := makeOperationLoggerGetLoggersCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationGetLoggersCmd) + + operationSetLoggerLevelCmd, err := makeOperationLoggerSetLoggerLevelCmd() + if err != nil { + return nil, err + } + operationGroupLoggerCmd.AddCommand(operationSetLoggerLevelCmd) + + return operationGroupLoggerCmd, nil +} +func makeOperationGroupPeriodicTaskCmd() (*cobra.Command, error) { + operationGroupPeriodicTaskCmd := &cobra.Command{ + Use: "periodic_task", + Long: ``, + } + + operationGetPeriodicTaskNamesCmd, err := makeOperationPeriodicTaskGetPeriodicTaskNamesCmd() + if err != nil { + return nil, err + } + operationGroupPeriodicTaskCmd.AddCommand(operationGetPeriodicTaskNamesCmd) + + operationRunPeriodicTaskCmd, err := makeOperationPeriodicTaskRunPeriodicTaskCmd() + if err != nil { + return nil, err + } + operationGroupPeriodicTaskCmd.AddCommand(operationRunPeriodicTaskCmd) + + return operationGroupPeriodicTaskCmd, nil +} +func makeOperationGroupQueryCmd() (*cobra.Command, error) { + operationGroupQueryCmd := &cobra.Command{ + Use: "query", + Long: ``, + } + + operationCancelQueryCmd, err := makeOperationQueryCancelQueryCmd() + if err != nil { + return nil, err + } + operationGroupQueryCmd.AddCommand(operationCancelQueryCmd) + + operationGetRunningQueriesCmd, err := makeOperationQueryGetRunningQueriesCmd() + if err != nil { + return nil, err + } + operationGroupQueryCmd.AddCommand(operationGetRunningQueriesCmd) + + return operationGroupQueryCmd, nil +} +func makeOperationGroupSchemaCmd() (*cobra.Command, error) { + operationGroupSchemaCmd := &cobra.Command{ + Use: "schema", + Long: ``, + } + + operationAddSchema1Cmd, err := makeOperationSchemaAddSchema1Cmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationAddSchema1Cmd) + + operationDeleteSchemaCmd, err := makeOperationSchemaDeleteSchemaCmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationDeleteSchemaCmd) + + operationGetSchemaCmd, err := makeOperationSchemaGetSchemaCmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationGetSchemaCmd) + + operationGetTableSchemaCmd, err := makeOperationSchemaGetTableSchemaCmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationGetTableSchemaCmd) + + operationListSchemaNamesCmd, err := makeOperationSchemaListSchemaNamesCmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationListSchemaNamesCmd) + + operationUpdateSchema1Cmd, err := makeOperationSchemaUpdateSchema1Cmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationUpdateSchema1Cmd) + + operationValidateSchema1Cmd, err := makeOperationSchemaValidateSchema1Cmd() + if err != nil { + return nil, err + } + operationGroupSchemaCmd.AddCommand(operationValidateSchema1Cmd) + + return operationGroupSchemaCmd, nil +} +func makeOperationGroupSegmentCmd() (*cobra.Command, error) { + operationGroupSegmentCmd := &cobra.Command{ + Use: "segment", + Long: ``, + } + + operationDeleteAllSegmentsCmd, err := makeOperationSegmentDeleteAllSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationDeleteAllSegmentsCmd) + + operationDeleteSegmentCmd, err := makeOperationSegmentDeleteSegmentCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationDeleteSegmentCmd) + + operationDeleteSegmentsCmd, err := makeOperationSegmentDeleteSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationDeleteSegmentsCmd) + + operationDownloadSegmentCmd, err := makeOperationSegmentDownloadSegmentCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationDownloadSegmentCmd) + + operationEndReplaceSegmentsCmd, err := makeOperationSegmentEndReplaceSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationEndReplaceSegmentsCmd) + + operationGetReloadJobStatusCmd, err := makeOperationSegmentGetReloadJobStatusCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetReloadJobStatusCmd) + + operationGetSegmentMetadataCmd, err := makeOperationSegmentGetSegmentMetadataCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentMetadataCmd) + + operationGetSegmentMetadataDeprecated1Cmd, err := makeOperationSegmentGetSegmentMetadataDeprecated1Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentMetadataDeprecated1Cmd) + + operationGetSegmentMetadataDeprecated2Cmd, err := makeOperationSegmentGetSegmentMetadataDeprecated2Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentMetadataDeprecated2Cmd) + + operationGetSegmentTiersCmd, err := makeOperationSegmentGetSegmentTiersCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentTiersCmd) + + operationGetSegmentToCrcMapCmd, err := makeOperationSegmentGetSegmentToCrcMapCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentToCrcMapCmd) + + operationGetSegmentToCrcMapDeprecatedCmd, err := makeOperationSegmentGetSegmentToCrcMapDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentToCrcMapDeprecatedCmd) + + operationGetSegmentsCmd, err := makeOperationSegmentGetSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSegmentsCmd) + + operationGetSelectedSegmentsCmd, err := makeOperationSegmentGetSelectedSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetSelectedSegmentsCmd) + + operationGetServerMetadataCmd, err := makeOperationSegmentGetServerMetadataCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetServerMetadataCmd) + + operationGetServerToSegmentsMapCmd, err := makeOperationSegmentGetServerToSegmentsMapCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetServerToSegmentsMapCmd) + + operationGetServerToSegmentsMapDeprecated1Cmd, err := makeOperationSegmentGetServerToSegmentsMapDeprecated1Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetServerToSegmentsMapDeprecated1Cmd) + + operationGetServerToSegmentsMapDeprecated2Cmd, err := makeOperationSegmentGetServerToSegmentsMapDeprecated2Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetServerToSegmentsMapDeprecated2Cmd) + + operationGetTableTiersCmd, err := makeOperationSegmentGetTableTiersCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationGetTableTiersCmd) + + operationListSegmentLineageCmd, err := makeOperationSegmentListSegmentLineageCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationListSegmentLineageCmd) + + operationReloadAllSegmentsCmd, err := makeOperationSegmentReloadAllSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationReloadAllSegmentsCmd) + + operationReloadAllSegmentsDeprecated1Cmd, err := makeOperationSegmentReloadAllSegmentsDeprecated1Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationReloadAllSegmentsDeprecated1Cmd) + + operationReloadAllSegmentsDeprecated2Cmd, err := makeOperationSegmentReloadAllSegmentsDeprecated2Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationReloadAllSegmentsDeprecated2Cmd) + + operationReloadSegmentCmd, err := makeOperationSegmentReloadSegmentCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationReloadSegmentCmd) + + operationReloadSegmentDeprecated1Cmd, err := makeOperationSegmentReloadSegmentDeprecated1Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationReloadSegmentDeprecated1Cmd) + + operationReloadSegmentDeprecated2Cmd, err := makeOperationSegmentReloadSegmentDeprecated2Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationReloadSegmentDeprecated2Cmd) + + operationResetSegmentCmd, err := makeOperationSegmentResetSegmentCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationResetSegmentCmd) + + operationResetSegmentsCmd, err := makeOperationSegmentResetSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationResetSegmentsCmd) + + operationRevertReplaceSegmentsCmd, err := makeOperationSegmentRevertReplaceSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationRevertReplaceSegmentsCmd) + + operationStartReplaceSegmentsCmd, err := makeOperationSegmentStartReplaceSegmentsCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationStartReplaceSegmentsCmd) + + operationUpdateTimeIntervalZKCmd, err := makeOperationSegmentUpdateTimeIntervalZKCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationUpdateTimeIntervalZKCmd) + + operationUploadSegmentAsMultiPartCmd, err := makeOperationSegmentUploadSegmentAsMultiPartCmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationUploadSegmentAsMultiPartCmd) + + operationUploadSegmentAsMultiPartV2Cmd, err := makeOperationSegmentUploadSegmentAsMultiPartV2Cmd() + if err != nil { + return nil, err + } + operationGroupSegmentCmd.AddCommand(operationUploadSegmentAsMultiPartV2Cmd) + + return operationGroupSegmentCmd, nil +} +func makeOperationGroupTableCmd() (*cobra.Command, error) { + operationGroupTableCmd := &cobra.Command{ + Use: "table", + Long: ``, + } + + operationAddConfigCmd, err := makeOperationTableAddConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationAddConfigCmd) + + operationAddTableCmd, err := makeOperationTableAddTableCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationAddTableCmd) + + operationAlterTableStateOrListTableConfigCmd, err := makeOperationTableAlterTableStateOrListTableConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationAlterTableStateOrListTableConfigCmd) + + operationAssignInstancesCmd, err := makeOperationTableAssignInstancesCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationAssignInstancesCmd) + + operationCheckTableConfigCmd, err := makeOperationTableCheckTableConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationCheckTableConfigCmd) + + operationDeleteConfigCmd, err := makeOperationTableDeleteConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationDeleteConfigCmd) + + operationDeleteTableCmd, err := makeOperationTableDeleteTableCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationDeleteTableCmd) + + operationDeleteTimeBoundaryCmd, err := makeOperationTableDeleteTimeBoundaryCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationDeleteTimeBoundaryCmd) + + operationForceCommitCmd, err := makeOperationTableForceCommitCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationForceCommitCmd) + + operationGetConfigCmd, err := makeOperationTableGetConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetConfigCmd) + + operationGetConsumingSegmentsInfoCmd, err := makeOperationTableGetConsumingSegmentsInfoCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetConsumingSegmentsInfoCmd) + + operationGetControllerJobsCmd, err := makeOperationTableGetControllerJobsCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetControllerJobsCmd) + + operationGetExternalViewCmd, err := makeOperationTableGetExternalViewCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetExternalViewCmd) + + operationGetForceCommitJobStatusCmd, err := makeOperationTableGetForceCommitJobStatusCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetForceCommitJobStatusCmd) + + operationGetIdealStateCmd, err := makeOperationTableGetIdealStateCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetIdealStateCmd) + + operationGetInstancePartitionsCmd, err := makeOperationTableGetInstancePartitionsCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetInstancePartitionsCmd) + + operationGetLiveBrokersCmd, err := makeOperationTableGetLiveBrokersCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetLiveBrokersCmd) + + operationGetLiveBrokersForTableCmd, err := makeOperationTableGetLiveBrokersForTableCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetLiveBrokersForTableCmd) + + operationGetPauseStatusCmd, err := makeOperationTableGetPauseStatusCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetPauseStatusCmd) + + operationGetTableAggregateMetadataCmd, err := makeOperationTableGetTableAggregateMetadataCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetTableAggregateMetadataCmd) + + operationGetTableInstancesCmd, err := makeOperationTableGetTableInstancesCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetTableInstancesCmd) + + operationGetTableSizeCmd, err := makeOperationTableGetTableSizeCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetTableSizeCmd) + + operationGetTableStateCmd, err := makeOperationTableGetTableStateCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetTableStateCmd) + + operationGetTableStatsCmd, err := makeOperationTableGetTableStatsCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetTableStatsCmd) + + operationGetTableStatusCmd, err := makeOperationTableGetTableStatusCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationGetTableStatusCmd) + + operationIngestFromFileCmd, err := makeOperationTableIngestFromFileCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationIngestFromFileCmd) + + operationIngestFromURICmd, err := makeOperationTableIngestFromURICmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationIngestFromURICmd) + + operationListConfigsCmd, err := makeOperationTableListConfigsCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationListConfigsCmd) + + operationListTablesCmd, err := makeOperationTableListTablesCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationListTablesCmd) + + operationPauseConsumptionCmd, err := makeOperationTablePauseConsumptionCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationPauseConsumptionCmd) + + operationPutCmd, err := makeOperationTablePutCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationPutCmd) + + operationRebalanceCmd, err := makeOperationTableRebalanceCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationRebalanceCmd) + + operationRebuildBrokerResourceCmd, err := makeOperationTableRebuildBrokerResourceCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationRebuildBrokerResourceCmd) + + operationRecommendConfigCmd, err := makeOperationTableRecommendConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationRecommendConfigCmd) + + operationRemoveInstancePartitionsCmd, err := makeOperationTableRemoveInstancePartitionsCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationRemoveInstancePartitionsCmd) + + operationReplaceInstanceCmd, err := makeOperationTableReplaceInstanceCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationReplaceInstanceCmd) + + operationResumeConsumptionCmd, err := makeOperationTableResumeConsumptionCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationResumeConsumptionCmd) + + operationSetInstancePartitionsCmd, err := makeOperationTableSetInstancePartitionsCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationSetInstancePartitionsCmd) + + operationSetTimeBoundaryCmd, err := makeOperationTableSetTimeBoundaryCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationSetTimeBoundaryCmd) + + operationUpdateConfigCmd, err := makeOperationTableUpdateConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationUpdateConfigCmd) + + operationUpdateIndexingConfigCmd, err := makeOperationTableUpdateIndexingConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationUpdateIndexingConfigCmd) + + operationUpdateTableConfigCmd, err := makeOperationTableUpdateTableConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationUpdateTableConfigCmd) + + operationUpdateTableMetadataCmd, err := makeOperationTableUpdateTableMetadataCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationUpdateTableMetadataCmd) + + operationValidateConfigCmd, err := makeOperationTableValidateConfigCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationValidateConfigCmd) + + operationValidateTableAndSchemaCmd, err := makeOperationTableValidateTableAndSchemaCmd() + if err != nil { + return nil, err + } + operationGroupTableCmd.AddCommand(operationValidateTableAndSchemaCmd) + + return operationGroupTableCmd, nil +} +func makeOperationGroupTaskCmd() (*cobra.Command, error) { + operationGroupTaskCmd := &cobra.Command{ + Use: "task", + Long: ``, + } + + operationCleanUpTasksCmd, err := makeOperationTaskCleanUpTasksCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationCleanUpTasksCmd) + + operationCleanUpTasksDeprecatedCmd, err := makeOperationTaskCleanUpTasksDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationCleanUpTasksDeprecatedCmd) + + operationDeleteTaskCmd, err := makeOperationTaskDeleteTaskCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationDeleteTaskCmd) + + operationDeleteTaskMetadataByTableCmd, err := makeOperationTaskDeleteTaskMetadataByTableCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationDeleteTaskMetadataByTableCmd) + + operationDeleteTaskQueueCmd, err := makeOperationTaskDeleteTaskQueueCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationDeleteTaskQueueCmd) + + operationDeleteTasksCmd, err := makeOperationTaskDeleteTasksCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationDeleteTasksCmd) + + operationExecuteAdhocTaskCmd, err := makeOperationTaskExecuteAdhocTaskCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationExecuteAdhocTaskCmd) + + operationGetCronSchedulerInformationCmd, err := makeOperationTaskGetCronSchedulerInformationCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetCronSchedulerInformationCmd) + + operationGetCronSchedulerJobDetailsCmd, err := makeOperationTaskGetCronSchedulerJobDetailsCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetCronSchedulerJobDetailsCmd) + + operationGetCronSchedulerJobKeysCmd, err := makeOperationTaskGetCronSchedulerJobKeysCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetCronSchedulerJobKeysCmd) + + operationGetSubtaskConfigsCmd, err := makeOperationTaskGetSubtaskConfigsCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetSubtaskConfigsCmd) + + operationGetSubtaskOnWorkerProgressCmd, err := makeOperationTaskGetSubtaskOnWorkerProgressCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetSubtaskOnWorkerProgressCmd) + + operationGetSubtaskProgressCmd, err := makeOperationTaskGetSubtaskProgressCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetSubtaskProgressCmd) + + operationGetSubtaskStatesCmd, err := makeOperationTaskGetSubtaskStatesCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetSubtaskStatesCmd) + + operationGetTaskConfigCmd, err := makeOperationTaskGetTaskConfigCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskConfigCmd) + + operationGetTaskConfigsCmd, err := makeOperationTaskGetTaskConfigsCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskConfigsCmd) + + operationGetTaskConfigsDeprecatedCmd, err := makeOperationTaskGetTaskConfigsDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskConfigsDeprecatedCmd) + + operationGetTaskCountsCmd, err := makeOperationTaskGetTaskCountsCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskCountsCmd) + + operationGetTaskDebugInfoCmd, err := makeOperationTaskGetTaskDebugInfoCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskDebugInfoCmd) + + operationGetTaskGenerationDebugIntoCmd, err := makeOperationTaskGetTaskGenerationDebugIntoCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskGenerationDebugIntoCmd) + + operationGetTaskMetadataByTableCmd, err := makeOperationTaskGetTaskMetadataByTableCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskMetadataByTableCmd) + + operationGetTaskQueueStateCmd, err := makeOperationTaskGetTaskQueueStateCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskQueueStateCmd) + + operationGetTaskQueueStateDeprecatedCmd, err := makeOperationTaskGetTaskQueueStateDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskQueueStateDeprecatedCmd) + + operationGetTaskQueuesCmd, err := makeOperationTaskGetTaskQueuesCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskQueuesCmd) + + operationGetTaskStateCmd, err := makeOperationTaskGetTaskStateCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskStateCmd) + + operationGetTaskStateDeprecatedCmd, err := makeOperationTaskGetTaskStateDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskStateDeprecatedCmd) + + operationGetTaskStatesCmd, err := makeOperationTaskGetTaskStatesCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskStatesCmd) + + operationGetTaskStatesByTableCmd, err := makeOperationTaskGetTaskStatesByTableCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskStatesByTableCmd) + + operationGetTaskStatesDeprecatedCmd, err := makeOperationTaskGetTaskStatesDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTaskStatesDeprecatedCmd) + + operationGetTasksCmd, err := makeOperationTaskGetTasksCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTasksCmd) + + operationGetTasksDebugInfoCmd, err := makeOperationTaskGetTasksDebugInfoCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTasksDebugInfoCmd) + + operationGetTasksDebugInfo1Cmd, err := makeOperationTaskGetTasksDebugInfo1Cmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTasksDebugInfo1Cmd) + + operationGetTasksDeprecatedCmd, err := makeOperationTaskGetTasksDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationGetTasksDeprecatedCmd) + + operationListTaskTypesCmd, err := makeOperationTaskListTaskTypesCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationListTaskTypesCmd) + + operationResumeTasksCmd, err := makeOperationTaskResumeTasksCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationResumeTasksCmd) + + operationScheduleTasksCmd, err := makeOperationTaskScheduleTasksCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationScheduleTasksCmd) + + operationScheduleTasksDeprecatedCmd, err := makeOperationTaskScheduleTasksDeprecatedCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationScheduleTasksDeprecatedCmd) + + operationStopTasksCmd, err := makeOperationTaskStopTasksCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationStopTasksCmd) + + operationToggleTaskQueueStateCmd, err := makeOperationTaskToggleTaskQueueStateCmd() + if err != nil { + return nil, err + } + operationGroupTaskCmd.AddCommand(operationToggleTaskQueueStateCmd) + + return operationGroupTaskCmd, nil +} +func makeOperationGroupTenantCmd() (*cobra.Command, error) { + operationGroupTenantCmd := &cobra.Command{ + Use: "tenant", + Long: ``, + } + + operationChangeTenantStateCmd, err := makeOperationTenantChangeTenantStateCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationChangeTenantStateCmd) + + operationCreateTenantCmd, err := makeOperationTenantCreateTenantCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationCreateTenantCmd) + + operationDeleteTenantCmd, err := makeOperationTenantDeleteTenantCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationDeleteTenantCmd) + + operationGetAllTenantsCmd, err := makeOperationTenantGetAllTenantsCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationGetAllTenantsCmd) + + operationGetTablesOnTenantCmd, err := makeOperationTenantGetTablesOnTenantCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationGetTablesOnTenantCmd) + + operationGetTenantMetadataCmd, err := makeOperationTenantGetTenantMetadataCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationGetTenantMetadataCmd) + + operationListInstanceOrToggleTenantStateCmd, err := makeOperationTenantListInstanceOrToggleTenantStateCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationListInstanceOrToggleTenantStateCmd) + + operationUpdateTenantCmd, err := makeOperationTenantUpdateTenantCmd() + if err != nil { + return nil, err + } + operationGroupTenantCmd.AddCommand(operationUpdateTenantCmd) + + return operationGroupTenantCmd, nil +} +func makeOperationGroupTunerCmd() (*cobra.Command, error) { + operationGroupTunerCmd := &cobra.Command{ + Use: "tuner", + Long: ``, + } + + operationTuneTableCmd, err := makeOperationTunerTuneTableCmd() + if err != nil { + return nil, err + } + operationGroupTunerCmd.AddCommand(operationTuneTableCmd) + + operationTuneTable1Cmd, err := makeOperationTunerTuneTable1Cmd() + if err != nil { + return nil, err + } + operationGroupTunerCmd.AddCommand(operationTuneTable1Cmd) + + return operationGroupTunerCmd, nil +} +func makeOperationGroupUpsertCmd() (*cobra.Command, error) { + operationGroupUpsertCmd := &cobra.Command{ + Use: "upsert", + Long: ``, + } + + operationEstimateHeapUsageCmd, err := makeOperationUpsertEstimateHeapUsageCmd() + if err != nil { + return nil, err + } + operationGroupUpsertCmd.AddCommand(operationEstimateHeapUsageCmd) + + return operationGroupUpsertCmd, nil +} +func makeOperationGroupUserCmd() (*cobra.Command, error) { + operationGroupUserCmd := &cobra.Command{ + Use: "user", + Long: ``, + } + + operationAddUserCmd, err := makeOperationUserAddUserCmd() + if err != nil { + return nil, err + } + operationGroupUserCmd.AddCommand(operationAddUserCmd) + + operationDeleteUserCmd, err := makeOperationUserDeleteUserCmd() + if err != nil { + return nil, err + } + operationGroupUserCmd.AddCommand(operationDeleteUserCmd) + + operationGetUserCmd, err := makeOperationUserGetUserCmd() + if err != nil { + return nil, err + } + operationGroupUserCmd.AddCommand(operationGetUserCmd) + + operationListUersCmd, err := makeOperationUserListUersCmd() + if err != nil { + return nil, err + } + operationGroupUserCmd.AddCommand(operationListUersCmd) + + operationUpdateUserConfigCmd, err := makeOperationUserUpdateUserConfigCmd() + if err != nil { + return nil, err + } + operationGroupUserCmd.AddCommand(operationUpdateUserConfigCmd) + + return operationGroupUserCmd, nil +} +func makeOperationGroupVersionCmd() (*cobra.Command, error) { + operationGroupVersionCmd := &cobra.Command{ + Use: "version", + Long: ``, + } + + operationGetVersionNumberCmd, err := makeOperationVersionGetVersionNumberCmd() + if err != nil { + return nil, err + } + operationGroupVersionCmd.AddCommand(operationGetVersionNumberCmd) + + return operationGroupVersionCmd, nil +} +func makeOperationGroupWriteAPICmd() (*cobra.Command, error) { + operationGroupWriteAPICmd := &cobra.Command{ + Use: "write_api", + Long: ``, + } + + operationGetWriteConfigCmd, err := makeOperationWriteAPIGetWriteConfigCmd() + if err != nil { + return nil, err + } + operationGroupWriteAPICmd.AddCommand(operationGetWriteConfigCmd) + + operationInsertCmd, err := makeOperationWriteAPIInsertCmd() + if err != nil { + return nil, err + } + operationGroupWriteAPICmd.AddCommand(operationInsertCmd) + + operationUpdateWriteConfigCmd, err := makeOperationWriteAPIUpdateWriteConfigCmd() + if err != nil { + return nil, err + } + operationGroupWriteAPICmd.AddCommand(operationUpdateWriteConfigCmd) + + return operationGroupWriteAPICmd, nil +} +func makeOperationGroupZookeeperCmd() (*cobra.Command, error) { + operationGroupZookeeperCmd := &cobra.Command{ + Use: "zookeeper", + Long: ``, + } + + operationDeleteCmd, err := makeOperationZookeeperDeleteCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationDeleteCmd) + + operationGetChildrenCmd, err := makeOperationZookeeperGetChildrenCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationGetChildrenCmd) + + operationGetDataCmd, err := makeOperationZookeeperGetDataCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationGetDataCmd) + + operationLsCmd, err := makeOperationZookeeperLsCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationLsCmd) + + operationLslCmd, err := makeOperationZookeeperLslCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationLslCmd) + + operationPutChildrenCmd, err := makeOperationZookeeperPutChildrenCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationPutChildrenCmd) + + operationPutDataCmd, err := makeOperationZookeeperPutDataCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationPutDataCmd) + + operationStatCmd, err := makeOperationZookeeperStatCmd() + if err != nil { + return nil, err + } + operationGroupZookeeperCmd.AddCommand(operationStatCmd) + + return operationGroupZookeeperCmd, nil +} diff --git a/src/cli/cluster_health_response_model.go b/src/cli/cluster_health_response_model.go new file mode 100644 index 0000000..1b9436a --- /dev/null +++ b/src/cli/cluster_health_response_model.go @@ -0,0 +1,189 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ClusterHealthResponse + +// register flags to command +func registerModelClusterHealthResponseFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerClusterHealthResponseTableToErrorSegmentsCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerClusterHealthResponseTableToMisconfiguredSegmentCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerClusterHealthResponseTableToSegmentsWitHMissingColumnsCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerClusterHealthResponseUnhealthyServerCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerClusterHealthResponseTableToErrorSegmentsCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tableToErrorSegmentsCount map[string]int32 map type is not supported by go-swagger cli yet + + return nil +} + +func registerClusterHealthResponseTableToMisconfiguredSegmentCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tableToMisconfiguredSegmentCount map[string]int32 map type is not supported by go-swagger cli yet + + return nil +} + +func registerClusterHealthResponseTableToSegmentsWitHMissingColumnsCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tableToSegmentsWitHMissingColumnsCount map[string]int32 map type is not supported by go-swagger cli yet + + return nil +} + +func registerClusterHealthResponseUnhealthyServerCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + unhealthyServerCountDescription := `` + + var unhealthyServerCountFlagName string + if cmdPrefix == "" { + unhealthyServerCountFlagName = "unhealthyServerCount" + } else { + unhealthyServerCountFlagName = fmt.Sprintf("%v.unhealthyServerCount", cmdPrefix) + } + + var unhealthyServerCountFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(unhealthyServerCountFlagName, unhealthyServerCountFlagDefault, unhealthyServerCountDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelClusterHealthResponseFlags(depth int, m *models.ClusterHealthResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, tableToErrorSegmentsCountAdded := retrieveClusterHealthResponseTableToErrorSegmentsCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableToErrorSegmentsCountAdded + + err, tableToMisconfiguredSegmentCountAdded := retrieveClusterHealthResponseTableToMisconfiguredSegmentCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableToMisconfiguredSegmentCountAdded + + err, tableToSegmentsWitHMissingColumnsCountAdded := retrieveClusterHealthResponseTableToSegmentsWitHMissingColumnsCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableToSegmentsWitHMissingColumnsCountAdded + + err, unhealthyServerCountAdded := retrieveClusterHealthResponseUnhealthyServerCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || unhealthyServerCountAdded + + return nil, retAdded +} + +func retrieveClusterHealthResponseTableToErrorSegmentsCountFlags(depth int, m *models.ClusterHealthResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableToErrorSegmentsCountFlagName := fmt.Sprintf("%v.tableToErrorSegmentsCount", cmdPrefix) + if cmd.Flags().Changed(tableToErrorSegmentsCountFlagName) { + // warning: tableToErrorSegmentsCount map type map[string]int32 is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveClusterHealthResponseTableToMisconfiguredSegmentCountFlags(depth int, m *models.ClusterHealthResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableToMisconfiguredSegmentCountFlagName := fmt.Sprintf("%v.tableToMisconfiguredSegmentCount", cmdPrefix) + if cmd.Flags().Changed(tableToMisconfiguredSegmentCountFlagName) { + // warning: tableToMisconfiguredSegmentCount map type map[string]int32 is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveClusterHealthResponseTableToSegmentsWitHMissingColumnsCountFlags(depth int, m *models.ClusterHealthResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableToSegmentsWitHMissingColumnsCountFlagName := fmt.Sprintf("%v.tableToSegmentsWitHMissingColumnsCount", cmdPrefix) + if cmd.Flags().Changed(tableToSegmentsWitHMissingColumnsCountFlagName) { + // warning: tableToSegmentsWitHMissingColumnsCount map type map[string]int32 is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveClusterHealthResponseUnhealthyServerCountFlags(depth int, m *models.ClusterHealthResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + unhealthyServerCountFlagName := fmt.Sprintf("%v.unhealthyServerCount", cmdPrefix) + if cmd.Flags().Changed(unhealthyServerCountFlagName) { + + var unhealthyServerCountFlagName string + if cmdPrefix == "" { + unhealthyServerCountFlagName = "unhealthyServerCount" + } else { + unhealthyServerCountFlagName = fmt.Sprintf("%v.unhealthyServerCount", cmdPrefix) + } + + unhealthyServerCountFlagValue, err := cmd.Flags().GetInt64(unhealthyServerCountFlagName) + if err != nil { + return err, false + } + m.UnhealthyServerCount = unhealthyServerCountFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/column_partition_config_model.go b/src/cli/column_partition_config_model.go new file mode 100644 index 0000000..2b90f3c --- /dev/null +++ b/src/cli/column_partition_config_model.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ColumnPartitionConfig + +// register flags to command +func registerModelColumnPartitionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerColumnPartitionConfigFunctionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerColumnPartitionConfigFunctionName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerColumnPartitionConfigNumPartitions(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerColumnPartitionConfigFunctionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: functionConfig map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerColumnPartitionConfigFunctionName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + functionNameDescription := `Required. ` + + var functionNameFlagName string + if cmdPrefix == "" { + functionNameFlagName = "functionName" + } else { + functionNameFlagName = fmt.Sprintf("%v.functionName", cmdPrefix) + } + + var functionNameFlagDefault string + + _ = cmd.PersistentFlags().String(functionNameFlagName, functionNameFlagDefault, functionNameDescription) + + return nil +} + +func registerColumnPartitionConfigNumPartitions(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numPartitionsDescription := `Required. ` + + var numPartitionsFlagName string + if cmdPrefix == "" { + numPartitionsFlagName = "numPartitions" + } else { + numPartitionsFlagName = fmt.Sprintf("%v.numPartitions", cmdPrefix) + } + + var numPartitionsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numPartitionsFlagName, numPartitionsFlagDefault, numPartitionsDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelColumnPartitionConfigFlags(depth int, m *models.ColumnPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, functionConfigAdded := retrieveColumnPartitionConfigFunctionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || functionConfigAdded + + err, functionNameAdded := retrieveColumnPartitionConfigFunctionNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || functionNameAdded + + err, numPartitionsAdded := retrieveColumnPartitionConfigNumPartitionsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numPartitionsAdded + + return nil, retAdded +} + +func retrieveColumnPartitionConfigFunctionConfigFlags(depth int, m *models.ColumnPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + functionConfigFlagName := fmt.Sprintf("%v.functionConfig", cmdPrefix) + if cmd.Flags().Changed(functionConfigFlagName) { + // warning: functionConfig map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveColumnPartitionConfigFunctionNameFlags(depth int, m *models.ColumnPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + functionNameFlagName := fmt.Sprintf("%v.functionName", cmdPrefix) + if cmd.Flags().Changed(functionNameFlagName) { + + var functionNameFlagName string + if cmdPrefix == "" { + functionNameFlagName = "functionName" + } else { + functionNameFlagName = fmt.Sprintf("%v.functionName", cmdPrefix) + } + + functionNameFlagValue, err := cmd.Flags().GetString(functionNameFlagName) + if err != nil { + return err, false + } + m.FunctionName = functionNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveColumnPartitionConfigNumPartitionsFlags(depth int, m *models.ColumnPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numPartitionsFlagName := fmt.Sprintf("%v.numPartitions", cmdPrefix) + if cmd.Flags().Changed(numPartitionsFlagName) { + + var numPartitionsFlagName string + if cmdPrefix == "" { + numPartitionsFlagName = "numPartitions" + } else { + numPartitionsFlagName = fmt.Sprintf("%v.numPartitions", cmdPrefix) + } + + numPartitionsFlagValue, err := cmd.Flags().GetInt32(numPartitionsFlagName) + if err != nil { + return err, false + } + m.NumPartitions = numPartitionsFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/completion_config_model.go b/src/cli/completion_config_model.go new file mode 100644 index 0000000..560093d --- /dev/null +++ b/src/cli/completion_config_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for CompletionConfig + +// register flags to command +func registerModelCompletionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerCompletionConfigCompletionMode(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerCompletionConfigCompletionMode(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + completionModeDescription := `Required. ` + + var completionModeFlagName string + if cmdPrefix == "" { + completionModeFlagName = "completionMode" + } else { + completionModeFlagName = fmt.Sprintf("%v.completionMode", cmdPrefix) + } + + var completionModeFlagDefault string + + _ = cmd.PersistentFlags().String(completionModeFlagName, completionModeFlagDefault, completionModeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelCompletionConfigFlags(depth int, m *models.CompletionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, completionModeAdded := retrieveCompletionConfigCompletionModeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || completionModeAdded + + return nil, retAdded +} + +func retrieveCompletionConfigCompletionModeFlags(depth int, m *models.CompletionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + completionModeFlagName := fmt.Sprintf("%v.completionMode", cmdPrefix) + if cmd.Flags().Changed(completionModeFlagName) { + + var completionModeFlagName string + if cmdPrefix == "" { + completionModeFlagName = "completionMode" + } else { + completionModeFlagName = fmt.Sprintf("%v.completionMode", cmdPrefix) + } + + completionModeFlagValue, err := cmd.Flags().GetString(completionModeFlagName) + if err != nil { + return err, false + } + m.CompletionMode = completionModeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/complex_type_config_model.go b/src/cli/complex_type_config_model.go new file mode 100644 index 0000000..d65ca62 --- /dev/null +++ b/src/cli/complex_type_config_model.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ComplexTypeConfig + +// register flags to command +func registerModelComplexTypeConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerComplexTypeConfigCollectionNotUnnestedToJSON(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerComplexTypeConfigDelimiter(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerComplexTypeConfigFieldsToUnnest(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerComplexTypeConfigPrefixesToRename(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerComplexTypeConfigCollectionNotUnnestedToJSON(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + collectionNotUnnestedToJsonDescription := `Enum: ["NONE","NON_PRIMITIVE","ALL"]. ` + + var collectionNotUnnestedToJsonFlagName string + if cmdPrefix == "" { + collectionNotUnnestedToJsonFlagName = "collectionNotUnnestedToJson" + } else { + collectionNotUnnestedToJsonFlagName = fmt.Sprintf("%v.collectionNotUnnestedToJson", cmdPrefix) + } + + var collectionNotUnnestedToJsonFlagDefault string + + _ = cmd.PersistentFlags().String(collectionNotUnnestedToJsonFlagName, collectionNotUnnestedToJsonFlagDefault, collectionNotUnnestedToJsonDescription) + + if err := cmd.RegisterFlagCompletionFunc(collectionNotUnnestedToJsonFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NONE","NON_PRIMITIVE","ALL"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerComplexTypeConfigDelimiter(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + delimiterDescription := `` + + var delimiterFlagName string + if cmdPrefix == "" { + delimiterFlagName = "delimiter" + } else { + delimiterFlagName = fmt.Sprintf("%v.delimiter", cmdPrefix) + } + + var delimiterFlagDefault string + + _ = cmd.PersistentFlags().String(delimiterFlagName, delimiterFlagDefault, delimiterDescription) + + return nil +} + +func registerComplexTypeConfigFieldsToUnnest(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: fieldsToUnnest []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerComplexTypeConfigPrefixesToRename(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: prefixesToRename map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelComplexTypeConfigFlags(depth int, m *models.ComplexTypeConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, collectionNotUnnestedToJsonAdded := retrieveComplexTypeConfigCollectionNotUnnestedToJSONFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || collectionNotUnnestedToJsonAdded + + err, delimiterAdded := retrieveComplexTypeConfigDelimiterFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || delimiterAdded + + err, fieldsToUnnestAdded := retrieveComplexTypeConfigFieldsToUnnestFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fieldsToUnnestAdded + + err, prefixesToRenameAdded := retrieveComplexTypeConfigPrefixesToRenameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || prefixesToRenameAdded + + return nil, retAdded +} + +func retrieveComplexTypeConfigCollectionNotUnnestedToJSONFlags(depth int, m *models.ComplexTypeConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + collectionNotUnnestedToJsonFlagName := fmt.Sprintf("%v.collectionNotUnnestedToJson", cmdPrefix) + if cmd.Flags().Changed(collectionNotUnnestedToJsonFlagName) { + + var collectionNotUnnestedToJsonFlagName string + if cmdPrefix == "" { + collectionNotUnnestedToJsonFlagName = "collectionNotUnnestedToJson" + } else { + collectionNotUnnestedToJsonFlagName = fmt.Sprintf("%v.collectionNotUnnestedToJson", cmdPrefix) + } + + collectionNotUnnestedToJsonFlagValue, err := cmd.Flags().GetString(collectionNotUnnestedToJsonFlagName) + if err != nil { + return err, false + } + m.CollectionNotUnnestedToJSON = collectionNotUnnestedToJsonFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveComplexTypeConfigDelimiterFlags(depth int, m *models.ComplexTypeConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + delimiterFlagName := fmt.Sprintf("%v.delimiter", cmdPrefix) + if cmd.Flags().Changed(delimiterFlagName) { + + var delimiterFlagName string + if cmdPrefix == "" { + delimiterFlagName = "delimiter" + } else { + delimiterFlagName = fmt.Sprintf("%v.delimiter", cmdPrefix) + } + + delimiterFlagValue, err := cmd.Flags().GetString(delimiterFlagName) + if err != nil { + return err, false + } + m.Delimiter = delimiterFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveComplexTypeConfigFieldsToUnnestFlags(depth int, m *models.ComplexTypeConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fieldsToUnnestFlagName := fmt.Sprintf("%v.fieldsToUnnest", cmdPrefix) + if cmd.Flags().Changed(fieldsToUnnestFlagName) { + // warning: fieldsToUnnest array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveComplexTypeConfigPrefixesToRenameFlags(depth int, m *models.ComplexTypeConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + prefixesToRenameFlagName := fmt.Sprintf("%v.prefixesToRename", cmdPrefix) + if cmd.Flags().Changed(prefixesToRenameFlagName) { + // warning: prefixesToRename map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/config_success_response_model.go b/src/cli/config_success_response_model.go new file mode 100644 index 0000000..940f4e8 --- /dev/null +++ b/src/cli/config_success_response_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ConfigSuccessResponse + +// register flags to command +func registerModelConfigSuccessResponseFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerConfigSuccessResponseStatus(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerConfigSuccessResponseUnrecognizedProperties(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerConfigSuccessResponseStatus(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + statusDescription := `` + + var statusFlagName string + if cmdPrefix == "" { + statusFlagName = "status" + } else { + statusFlagName = fmt.Sprintf("%v.status", cmdPrefix) + } + + var statusFlagDefault string + + _ = cmd.PersistentFlags().String(statusFlagName, statusFlagDefault, statusDescription) + + return nil +} + +func registerConfigSuccessResponseUnrecognizedProperties(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: unrecognizedProperties map[string]interface{} map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelConfigSuccessResponseFlags(depth int, m *models.ConfigSuccessResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, statusAdded := retrieveConfigSuccessResponseStatusFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || statusAdded + + err, unrecognizedPropertiesAdded := retrieveConfigSuccessResponseUnrecognizedPropertiesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || unrecognizedPropertiesAdded + + return nil, retAdded +} + +func retrieveConfigSuccessResponseStatusFlags(depth int, m *models.ConfigSuccessResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + statusFlagName := fmt.Sprintf("%v.status", cmdPrefix) + if cmd.Flags().Changed(statusFlagName) { + + var statusFlagName string + if cmdPrefix == "" { + statusFlagName = "status" + } else { + statusFlagName = fmt.Sprintf("%v.status", cmdPrefix) + } + + statusFlagValue, err := cmd.Flags().GetString(statusFlagName) + if err != nil { + return err, false + } + m.Status = statusFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveConfigSuccessResponseUnrecognizedPropertiesFlags(depth int, m *models.ConfigSuccessResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + unrecognizedPropertiesFlagName := fmt.Sprintf("%v.unrecognizedProperties", cmdPrefix) + if cmd.Flags().Changed(unrecognizedPropertiesFlagName) { + // warning: unrecognizedProperties map type map[string]interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/consuming_segment_info_model.go b/src/cli/consuming_segment_info_model.go new file mode 100644 index 0000000..9e025a3 --- /dev/null +++ b/src/cli/consuming_segment_info_model.go @@ -0,0 +1,297 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for ConsumingSegmentInfo + +// register flags to command +func registerModelConsumingSegmentInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerConsumingSegmentInfoConsumerState(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerConsumingSegmentInfoLastConsumedTimestamp(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerConsumingSegmentInfoPartitionOffsetInfo(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerConsumingSegmentInfoPartitionToOffsetMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerConsumingSegmentInfoServerName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerConsumingSegmentInfoConsumerState(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + consumerStateDescription := `` + + var consumerStateFlagName string + if cmdPrefix == "" { + consumerStateFlagName = "consumerState" + } else { + consumerStateFlagName = fmt.Sprintf("%v.consumerState", cmdPrefix) + } + + var consumerStateFlagDefault string + + _ = cmd.PersistentFlags().String(consumerStateFlagName, consumerStateFlagDefault, consumerStateDescription) + + return nil +} + +func registerConsumingSegmentInfoLastConsumedTimestamp(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + lastConsumedTimestampDescription := `` + + var lastConsumedTimestampFlagName string + if cmdPrefix == "" { + lastConsumedTimestampFlagName = "lastConsumedTimestamp" + } else { + lastConsumedTimestampFlagName = fmt.Sprintf("%v.lastConsumedTimestamp", cmdPrefix) + } + + var lastConsumedTimestampFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(lastConsumedTimestampFlagName, lastConsumedTimestampFlagDefault, lastConsumedTimestampDescription) + + return nil +} + +func registerConsumingSegmentInfoPartitionOffsetInfo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var partitionOffsetInfoFlagName string + if cmdPrefix == "" { + partitionOffsetInfoFlagName = "partitionOffsetInfo" + } else { + partitionOffsetInfoFlagName = fmt.Sprintf("%v.partitionOffsetInfo", cmdPrefix) + } + + if err := registerModelPartitionOffsetInfoFlags(depth+1, partitionOffsetInfoFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerConsumingSegmentInfoPartitionToOffsetMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: partitionToOffsetMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerConsumingSegmentInfoServerName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + serverNameDescription := `` + + var serverNameFlagName string + if cmdPrefix == "" { + serverNameFlagName = "serverName" + } else { + serverNameFlagName = fmt.Sprintf("%v.serverName", cmdPrefix) + } + + var serverNameFlagDefault string + + _ = cmd.PersistentFlags().String(serverNameFlagName, serverNameFlagDefault, serverNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelConsumingSegmentInfoFlags(depth int, m *models.ConsumingSegmentInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, consumerStateAdded := retrieveConsumingSegmentInfoConsumerStateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || consumerStateAdded + + err, lastConsumedTimestampAdded := retrieveConsumingSegmentInfoLastConsumedTimestampFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || lastConsumedTimestampAdded + + err, partitionOffsetInfoAdded := retrieveConsumingSegmentInfoPartitionOffsetInfoFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionOffsetInfoAdded + + err, partitionToOffsetMapAdded := retrieveConsumingSegmentInfoPartitionToOffsetMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionToOffsetMapAdded + + err, serverNameAdded := retrieveConsumingSegmentInfoServerNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || serverNameAdded + + return nil, retAdded +} + +func retrieveConsumingSegmentInfoConsumerStateFlags(depth int, m *models.ConsumingSegmentInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + consumerStateFlagName := fmt.Sprintf("%v.consumerState", cmdPrefix) + if cmd.Flags().Changed(consumerStateFlagName) { + + var consumerStateFlagName string + if cmdPrefix == "" { + consumerStateFlagName = "consumerState" + } else { + consumerStateFlagName = fmt.Sprintf("%v.consumerState", cmdPrefix) + } + + consumerStateFlagValue, err := cmd.Flags().GetString(consumerStateFlagName) + if err != nil { + return err, false + } + m.ConsumerState = consumerStateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveConsumingSegmentInfoLastConsumedTimestampFlags(depth int, m *models.ConsumingSegmentInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + lastConsumedTimestampFlagName := fmt.Sprintf("%v.lastConsumedTimestamp", cmdPrefix) + if cmd.Flags().Changed(lastConsumedTimestampFlagName) { + + var lastConsumedTimestampFlagName string + if cmdPrefix == "" { + lastConsumedTimestampFlagName = "lastConsumedTimestamp" + } else { + lastConsumedTimestampFlagName = fmt.Sprintf("%v.lastConsumedTimestamp", cmdPrefix) + } + + lastConsumedTimestampFlagValue, err := cmd.Flags().GetInt64(lastConsumedTimestampFlagName) + if err != nil { + return err, false + } + m.LastConsumedTimestamp = lastConsumedTimestampFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveConsumingSegmentInfoPartitionOffsetInfoFlags(depth int, m *models.ConsumingSegmentInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionOffsetInfoFlagName := fmt.Sprintf("%v.partitionOffsetInfo", cmdPrefix) + if cmd.Flags().Changed(partitionOffsetInfoFlagName) { + // info: complex object partitionOffsetInfo PartitionOffsetInfo is retrieved outside this Changed() block + } + partitionOffsetInfoFlagValue := m.PartitionOffsetInfo + if swag.IsZero(partitionOffsetInfoFlagValue) { + partitionOffsetInfoFlagValue = &models.PartitionOffsetInfo{} + } + + err, partitionOffsetInfoAdded := retrieveModelPartitionOffsetInfoFlags(depth+1, partitionOffsetInfoFlagValue, partitionOffsetInfoFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionOffsetInfoAdded + if partitionOffsetInfoAdded { + m.PartitionOffsetInfo = partitionOffsetInfoFlagValue + } + + return nil, retAdded +} + +func retrieveConsumingSegmentInfoPartitionToOffsetMapFlags(depth int, m *models.ConsumingSegmentInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionToOffsetMapFlagName := fmt.Sprintf("%v.partitionToOffsetMap", cmdPrefix) + if cmd.Flags().Changed(partitionToOffsetMapFlagName) { + // warning: partitionToOffsetMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveConsumingSegmentInfoServerNameFlags(depth int, m *models.ConsumingSegmentInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + serverNameFlagName := fmt.Sprintf("%v.serverName", cmdPrefix) + if cmd.Flags().Changed(serverNameFlagName) { + + var serverNameFlagName string + if cmdPrefix == "" { + serverNameFlagName = "serverName" + } else { + serverNameFlagName = fmt.Sprintf("%v.serverName", cmdPrefix) + } + + serverNameFlagValue, err := cmd.Flags().GetString(serverNameFlagName) + if err != nil { + return err, false + } + m.ServerName = serverNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/consuming_segments_info_map_model.go b/src/cli/consuming_segments_info_map_model.go new file mode 100644 index 0000000..9ec8d45 --- /dev/null +++ b/src/cli/consuming_segments_info_map_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ConsumingSegmentsInfoMap + +// register flags to command +func registerModelConsumingSegmentsInfoMapFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerConsumingSegmentsInfoMapSegmentToConsumingInfoMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerConsumingSegmentsInfoMapSegmentToConsumingInfoMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: _segmentToConsumingInfoMap map[string][]ConsumingSegmentInfo map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelConsumingSegmentsInfoMapFlags(depth int, m *models.ConsumingSegmentsInfoMap, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, segmentToConsumingInfoMapAdded := retrieveConsumingSegmentsInfoMapSegmentToConsumingInfoMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentToConsumingInfoMapAdded + + return nil, retAdded +} + +func retrieveConsumingSegmentsInfoMapSegmentToConsumingInfoMapFlags(depth int, m *models.ConsumingSegmentsInfoMap, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentToConsumingInfoMapFlagName := fmt.Sprintf("%v._segmentToConsumingInfoMap", cmdPrefix) + if cmd.Flags().Changed(segmentToConsumingInfoMapFlagName) { + // warning: _segmentToConsumingInfoMap map type map[string][]ConsumingSegmentInfo is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/content_disposition_model.go b/src/cli/content_disposition_model.go new file mode 100644 index 0000000..8e6d8eb --- /dev/null +++ b/src/cli/content_disposition_model.go @@ -0,0 +1,423 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/strfmt" + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ContentDisposition + +// register flags to command +func registerModelContentDispositionFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerContentDispositionCreationDate(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerContentDispositionFileName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerContentDispositionModificationDate(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerContentDispositionParameters(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerContentDispositionReadDate(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerContentDispositionSize(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerContentDispositionType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerContentDispositionCreationDate(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + creationDateDescription := `` + + var creationDateFlagName string + if cmdPrefix == "" { + creationDateFlagName = "creationDate" + } else { + creationDateFlagName = fmt.Sprintf("%v.creationDate", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(creationDateFlagName, "", creationDateDescription) + + return nil +} + +func registerContentDispositionFileName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + fileNameDescription := `` + + var fileNameFlagName string + if cmdPrefix == "" { + fileNameFlagName = "fileName" + } else { + fileNameFlagName = fmt.Sprintf("%v.fileName", cmdPrefix) + } + + var fileNameFlagDefault string + + _ = cmd.PersistentFlags().String(fileNameFlagName, fileNameFlagDefault, fileNameDescription) + + return nil +} + +func registerContentDispositionModificationDate(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + modificationDateDescription := `` + + var modificationDateFlagName string + if cmdPrefix == "" { + modificationDateFlagName = "modificationDate" + } else { + modificationDateFlagName = fmt.Sprintf("%v.modificationDate", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(modificationDateFlagName, "", modificationDateDescription) + + return nil +} + +func registerContentDispositionParameters(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameters map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerContentDispositionReadDate(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + readDateDescription := `` + + var readDateFlagName string + if cmdPrefix == "" { + readDateFlagName = "readDate" + } else { + readDateFlagName = fmt.Sprintf("%v.readDate", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(readDateFlagName, "", readDateDescription) + + return nil +} + +func registerContentDispositionSize(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + sizeDescription := `` + + var sizeFlagName string + if cmdPrefix == "" { + sizeFlagName = "size" + } else { + sizeFlagName = fmt.Sprintf("%v.size", cmdPrefix) + } + + var sizeFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(sizeFlagName, sizeFlagDefault, sizeDescription) + + return nil +} + +func registerContentDispositionType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + typeDescription := `` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelContentDispositionFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, creationDateAdded := retrieveContentDispositionCreationDateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || creationDateAdded + + err, fileNameAdded := retrieveContentDispositionFileNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fileNameAdded + + err, modificationDateAdded := retrieveContentDispositionModificationDateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || modificationDateAdded + + err, parametersAdded := retrieveContentDispositionParametersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parametersAdded + + err, readDateAdded := retrieveContentDispositionReadDateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || readDateAdded + + err, sizeAdded := retrieveContentDispositionSizeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || sizeAdded + + err, typeAdded := retrieveContentDispositionTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || typeAdded + + return nil, retAdded +} + +func retrieveContentDispositionCreationDateFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + creationDateFlagName := fmt.Sprintf("%v.creationDate", cmdPrefix) + if cmd.Flags().Changed(creationDateFlagName) { + + var creationDateFlagName string + if cmdPrefix == "" { + creationDateFlagName = "creationDate" + } else { + creationDateFlagName = fmt.Sprintf("%v.creationDate", cmdPrefix) + } + + creationDateFlagValueStr, err := cmd.Flags().GetString(creationDateFlagName) + if err != nil { + return err, false + } + var creationDateFlagValue strfmt.DateTime + if err := creationDateFlagValue.UnmarshalText([]byte(creationDateFlagValueStr)); err != nil { + return err, false + } + m.CreationDate = creationDateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveContentDispositionFileNameFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fileNameFlagName := fmt.Sprintf("%v.fileName", cmdPrefix) + if cmd.Flags().Changed(fileNameFlagName) { + + var fileNameFlagName string + if cmdPrefix == "" { + fileNameFlagName = "fileName" + } else { + fileNameFlagName = fmt.Sprintf("%v.fileName", cmdPrefix) + } + + fileNameFlagValue, err := cmd.Flags().GetString(fileNameFlagName) + if err != nil { + return err, false + } + m.FileName = fileNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveContentDispositionModificationDateFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + modificationDateFlagName := fmt.Sprintf("%v.modificationDate", cmdPrefix) + if cmd.Flags().Changed(modificationDateFlagName) { + + var modificationDateFlagName string + if cmdPrefix == "" { + modificationDateFlagName = "modificationDate" + } else { + modificationDateFlagName = fmt.Sprintf("%v.modificationDate", cmdPrefix) + } + + modificationDateFlagValueStr, err := cmd.Flags().GetString(modificationDateFlagName) + if err != nil { + return err, false + } + var modificationDateFlagValue strfmt.DateTime + if err := modificationDateFlagValue.UnmarshalText([]byte(modificationDateFlagValueStr)); err != nil { + return err, false + } + m.ModificationDate = modificationDateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveContentDispositionParametersFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parametersFlagName := fmt.Sprintf("%v.parameters", cmdPrefix) + if cmd.Flags().Changed(parametersFlagName) { + // warning: parameters map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveContentDispositionReadDateFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + readDateFlagName := fmt.Sprintf("%v.readDate", cmdPrefix) + if cmd.Flags().Changed(readDateFlagName) { + + var readDateFlagName string + if cmdPrefix == "" { + readDateFlagName = "readDate" + } else { + readDateFlagName = fmt.Sprintf("%v.readDate", cmdPrefix) + } + + readDateFlagValueStr, err := cmd.Flags().GetString(readDateFlagName) + if err != nil { + return err, false + } + var readDateFlagValue strfmt.DateTime + if err := readDateFlagValue.UnmarshalText([]byte(readDateFlagValueStr)); err != nil { + return err, false + } + m.ReadDate = readDateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveContentDispositionSizeFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + sizeFlagName := fmt.Sprintf("%v.size", cmdPrefix) + if cmd.Flags().Changed(sizeFlagName) { + + var sizeFlagName string + if cmdPrefix == "" { + sizeFlagName = "size" + } else { + sizeFlagName = fmt.Sprintf("%v.size", cmdPrefix) + } + + sizeFlagValue, err := cmd.Flags().GetInt64(sizeFlagName) + if err != nil { + return err, false + } + m.Size = sizeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveContentDispositionTypeFlags(depth int, m *models.ContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + typeFlagName := fmt.Sprintf("%v.type", cmdPrefix) + if cmd.Flags().Changed(typeFlagName) { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/create_tenant_operation.go b/src/cli/create_tenant_operation.go new file mode 100644 index 0000000..69efd49 --- /dev/null +++ b/src/cli/create_tenant_operation.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tenant" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTenantCreateTenantCmd returns a cmd to handle operation createTenant +func makeOperationTenantCreateTenantCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "createTenant", + Short: ``, + RunE: runOperationTenantCreateTenant, + } + + if err := registerOperationTenantCreateTenantParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantCreateTenant uses cmd flags to call endpoint api +func runOperationTenantCreateTenant(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewCreateTenantParams() + if err, _ := retrieveOperationTenantCreateTenantBodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantCreateTenantResult(appCli.Tenant.CreateTenant(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantCreateTenantParamFlags registers all flags needed to fill params +func registerOperationTenantCreateTenantParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantCreateTenantBodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantCreateTenantBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelTenantFlags(0, "tenant", cmd); err != nil { + return err + } + + return nil +} + +func retrieveOperationTenantCreateTenantBodyFlag(m *tenant.CreateTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.Tenant{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.Tenant: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.Tenant{} + } + err, added := retrieveModelTenantFlags(0, bodyValueModel, "tenant", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} + +// parseOperationTenantCreateTenantResult parses request result and return the string content +func parseOperationTenantCreateTenantResult(resp0 *tenant.CreateTenantOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning createTenantOK is not supported + + // Non schema case: warning createTenantInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response createTenantOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/date_time_field_spec_model.go b/src/cli/date_time_field_spec_model.go new file mode 100644 index 0000000..40d8e1e --- /dev/null +++ b/src/cli/date_time_field_spec_model.go @@ -0,0 +1,639 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for DateTimeFieldSpec + +// register flags to command +func registerModelDateTimeFieldSpecFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerDateTimeFieldSpecDataType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecDefaultNullValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecDefaultNullValueString(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecFormat(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecGranularity(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecMaxLength(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecSampleValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecSingleValueField(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecTransformFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDateTimeFieldSpecVirtualColumnProvider(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerDateTimeFieldSpecDataType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + dataTypeDescription := `Enum: ["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]. ` + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + var dataTypeFlagDefault string + + _ = cmd.PersistentFlags().String(dataTypeFlagName, dataTypeFlagDefault, dataTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(dataTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerDateTimeFieldSpecDefaultNullValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: defaultNullValue interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerDateTimeFieldSpecDefaultNullValueString(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + defaultNullValueStringDescription := `` + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + var defaultNullValueStringFlagDefault string + + _ = cmd.PersistentFlags().String(defaultNullValueStringFlagName, defaultNullValueStringFlagDefault, defaultNullValueStringDescription) + + return nil +} + +func registerDateTimeFieldSpecFormat(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + formatDescription := `` + + var formatFlagName string + if cmdPrefix == "" { + formatFlagName = "format" + } else { + formatFlagName = fmt.Sprintf("%v.format", cmdPrefix) + } + + var formatFlagDefault string + + _ = cmd.PersistentFlags().String(formatFlagName, formatFlagDefault, formatDescription) + + return nil +} + +func registerDateTimeFieldSpecGranularity(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + granularityDescription := `` + + var granularityFlagName string + if cmdPrefix == "" { + granularityFlagName = "granularity" + } else { + granularityFlagName = fmt.Sprintf("%v.granularity", cmdPrefix) + } + + var granularityFlagDefault string + + _ = cmd.PersistentFlags().String(granularityFlagName, granularityFlagDefault, granularityDescription) + + return nil +} + +func registerDateTimeFieldSpecMaxLength(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxLengthDescription := `` + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + var maxLengthFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxLengthFlagName, maxLengthFlagDefault, maxLengthDescription) + + return nil +} + +func registerDateTimeFieldSpecName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerDateTimeFieldSpecSampleValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: sampleValue interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerDateTimeFieldSpecSingleValueField(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + singleValueFieldDescription := `` + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + var singleValueFieldFlagDefault bool + + _ = cmd.PersistentFlags().Bool(singleValueFieldFlagName, singleValueFieldFlagDefault, singleValueFieldDescription) + + return nil +} + +func registerDateTimeFieldSpecTransformFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + transformFunctionDescription := `` + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + var transformFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(transformFunctionFlagName, transformFunctionFlagDefault, transformFunctionDescription) + + return nil +} + +func registerDateTimeFieldSpecVirtualColumnProvider(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + virtualColumnProviderDescription := `` + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + var virtualColumnProviderFlagDefault string + + _ = cmd.PersistentFlags().String(virtualColumnProviderFlagName, virtualColumnProviderFlagDefault, virtualColumnProviderDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelDateTimeFieldSpecFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dataTypeAdded := retrieveDateTimeFieldSpecDataTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dataTypeAdded + + err, defaultNullValueAdded := retrieveDateTimeFieldSpecDefaultNullValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueAdded + + err, defaultNullValueStringAdded := retrieveDateTimeFieldSpecDefaultNullValueStringFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueStringAdded + + err, formatAdded := retrieveDateTimeFieldSpecFormatFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || formatAdded + + err, granularityAdded := retrieveDateTimeFieldSpecGranularityFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || granularityAdded + + err, maxLengthAdded := retrieveDateTimeFieldSpecMaxLengthFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxLengthAdded + + err, nameAdded := retrieveDateTimeFieldSpecNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, sampleValueAdded := retrieveDateTimeFieldSpecSampleValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || sampleValueAdded + + err, singleValueFieldAdded := retrieveDateTimeFieldSpecSingleValueFieldFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || singleValueFieldAdded + + err, transformFunctionAdded := retrieveDateTimeFieldSpecTransformFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || transformFunctionAdded + + err, virtualColumnProviderAdded := retrieveDateTimeFieldSpecVirtualColumnProviderFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || virtualColumnProviderAdded + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecDataTypeFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dataTypeFlagName := fmt.Sprintf("%v.dataType", cmdPrefix) + if cmd.Flags().Changed(dataTypeFlagName) { + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + dataTypeFlagValue, err := cmd.Flags().GetString(dataTypeFlagName) + if err != nil { + return err, false + } + m.DataType = dataTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecDefaultNullValueFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueFlagName := fmt.Sprintf("%v.defaultNullValue", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueFlagName) { + // warning: defaultNullValue map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecDefaultNullValueStringFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueStringFlagName := fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueStringFlagName) { + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + defaultNullValueStringFlagValue, err := cmd.Flags().GetString(defaultNullValueStringFlagName) + if err != nil { + return err, false + } + m.DefaultNullValueString = defaultNullValueStringFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecFormatFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + formatFlagName := fmt.Sprintf("%v.format", cmdPrefix) + if cmd.Flags().Changed(formatFlagName) { + + var formatFlagName string + if cmdPrefix == "" { + formatFlagName = "format" + } else { + formatFlagName = fmt.Sprintf("%v.format", cmdPrefix) + } + + formatFlagValue, err := cmd.Flags().GetString(formatFlagName) + if err != nil { + return err, false + } + m.Format = formatFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecGranularityFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + granularityFlagName := fmt.Sprintf("%v.granularity", cmdPrefix) + if cmd.Flags().Changed(granularityFlagName) { + + var granularityFlagName string + if cmdPrefix == "" { + granularityFlagName = "granularity" + } else { + granularityFlagName = fmt.Sprintf("%v.granularity", cmdPrefix) + } + + granularityFlagValue, err := cmd.Flags().GetString(granularityFlagName) + if err != nil { + return err, false + } + m.Granularity = granularityFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecMaxLengthFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxLengthFlagName := fmt.Sprintf("%v.maxLength", cmdPrefix) + if cmd.Flags().Changed(maxLengthFlagName) { + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + maxLengthFlagValue, err := cmd.Flags().GetInt32(maxLengthFlagName) + if err != nil { + return err, false + } + m.MaxLength = maxLengthFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecNameFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecSampleValueFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + sampleValueFlagName := fmt.Sprintf("%v.sampleValue", cmdPrefix) + if cmd.Flags().Changed(sampleValueFlagName) { + // warning: sampleValue map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecSingleValueFieldFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + singleValueFieldFlagName := fmt.Sprintf("%v.singleValueField", cmdPrefix) + if cmd.Flags().Changed(singleValueFieldFlagName) { + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + singleValueFieldFlagValue, err := cmd.Flags().GetBool(singleValueFieldFlagName) + if err != nil { + return err, false + } + m.SingleValueField = singleValueFieldFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecTransformFunctionFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + transformFunctionFlagName := fmt.Sprintf("%v.transformFunction", cmdPrefix) + if cmd.Flags().Changed(transformFunctionFlagName) { + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + transformFunctionFlagValue, err := cmd.Flags().GetString(transformFunctionFlagName) + if err != nil { + return err, false + } + m.TransformFunction = transformFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDateTimeFieldSpecVirtualColumnProviderFlags(depth int, m *models.DateTimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + virtualColumnProviderFlagName := fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + if cmd.Flags().Changed(virtualColumnProviderFlagName) { + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + virtualColumnProviderFlagValue, err := cmd.Flags().GetString(virtualColumnProviderFlagName) + if err != nil { + return err, false + } + m.VirtualColumnProvider = virtualColumnProviderFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/dedup_config_model.go b/src/cli/dedup_config_model.go new file mode 100644 index 0000000..f438e9d --- /dev/null +++ b/src/cli/dedup_config_model.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for DedupConfig + +// register flags to command +func registerModelDedupConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerDedupConfigDedupEnabled(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDedupConfigHashFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerDedupConfigDedupEnabled(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + dedupEnabledDescription := `Required. ` + + var dedupEnabledFlagName string + if cmdPrefix == "" { + dedupEnabledFlagName = "dedupEnabled" + } else { + dedupEnabledFlagName = fmt.Sprintf("%v.dedupEnabled", cmdPrefix) + } + + var dedupEnabledFlagDefault bool + + _ = cmd.PersistentFlags().Bool(dedupEnabledFlagName, dedupEnabledFlagDefault, dedupEnabledDescription) + + return nil +} + +func registerDedupConfigHashFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + hashFunctionDescription := `Enum: ["NONE","MD5","MURMUR3"]. ` + + var hashFunctionFlagName string + if cmdPrefix == "" { + hashFunctionFlagName = "hashFunction" + } else { + hashFunctionFlagName = fmt.Sprintf("%v.hashFunction", cmdPrefix) + } + + var hashFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(hashFunctionFlagName, hashFunctionFlagDefault, hashFunctionDescription) + + if err := cmd.RegisterFlagCompletionFunc(hashFunctionFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NONE","MD5","MURMUR3"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelDedupConfigFlags(depth int, m *models.DedupConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dedupEnabledAdded := retrieveDedupConfigDedupEnabledFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dedupEnabledAdded + + err, hashFunctionAdded := retrieveDedupConfigHashFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || hashFunctionAdded + + return nil, retAdded +} + +func retrieveDedupConfigDedupEnabledFlags(depth int, m *models.DedupConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dedupEnabledFlagName := fmt.Sprintf("%v.dedupEnabled", cmdPrefix) + if cmd.Flags().Changed(dedupEnabledFlagName) { + + var dedupEnabledFlagName string + if cmdPrefix == "" { + dedupEnabledFlagName = "dedupEnabled" + } else { + dedupEnabledFlagName = fmt.Sprintf("%v.dedupEnabled", cmdPrefix) + } + + dedupEnabledFlagValue, err := cmd.Flags().GetBool(dedupEnabledFlagName) + if err != nil { + return err, false + } + m.DedupEnabled = dedupEnabledFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDedupConfigHashFunctionFlags(depth int, m *models.DedupConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + hashFunctionFlagName := fmt.Sprintf("%v.hashFunction", cmdPrefix) + if cmd.Flags().Changed(hashFunctionFlagName) { + + var hashFunctionFlagName string + if cmdPrefix == "" { + hashFunctionFlagName = "hashFunction" + } else { + hashFunctionFlagName = fmt.Sprintf("%v.hashFunction", cmdPrefix) + } + + hashFunctionFlagValue, err := cmd.Flags().GetString(hashFunctionFlagName) + if err != nil { + return err, false + } + m.HashFunction = hashFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/delete_all_segments_operation.go b/src/cli/delete_all_segments_operation.go new file mode 100644 index 0000000..2b7bb1d --- /dev/null +++ b/src/cli/delete_all_segments_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentDeleteAllSegmentsCmd returns a cmd to handle operation deleteAllSegments +func makeOperationSegmentDeleteAllSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteAllSegments", + Short: `Delete all segments`, + RunE: runOperationSegmentDeleteAllSegments, + } + + if err := registerOperationSegmentDeleteAllSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentDeleteAllSegments uses cmd flags to call endpoint api +func runOperationSegmentDeleteAllSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewDeleteAllSegmentsParams() + if err, _ := retrieveOperationSegmentDeleteAllSegmentsRetentionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDeleteAllSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDeleteAllSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentDeleteAllSegmentsResult(appCli.Segment.DeleteAllSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentDeleteAllSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentDeleteAllSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentDeleteAllSegmentsRetentionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDeleteAllSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDeleteAllSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentDeleteAllSegmentsRetentionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + retentionDescription := `Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention` + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + var retentionFlagDefault string + + _ = cmd.PersistentFlags().String(retentionFlagName, retentionFlagDefault, retentionDescription) + + return nil +} +func registerOperationSegmentDeleteAllSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentDeleteAllSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentDeleteAllSegmentsRetentionFlag(m *segment.DeleteAllSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("retention") { + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + retentionFlagValue, err := cmd.Flags().GetString(retentionFlagName) + if err != nil { + return err, false + } + m.Retention = &retentionFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentDeleteAllSegmentsTableNameFlag(m *segment.DeleteAllSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentDeleteAllSegmentsTypeFlag(m *segment.DeleteAllSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentDeleteAllSegmentsResult parses request result and return the string content +func parseOperationSegmentDeleteAllSegmentsResult(resp0 *segment.DeleteAllSegmentsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.DeleteAllSegmentsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_cluster_config_operation.go b/src/cli/delete_cluster_config_operation.go new file mode 100644 index 0000000..79f8f10 --- /dev/null +++ b/src/cli/delete_cluster_config_operation.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/cluster" + + "github.com/spf13/cobra" +) + +// makeOperationClusterDeleteClusterConfigCmd returns a cmd to handle operation deleteClusterConfig +func makeOperationClusterDeleteClusterConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteClusterConfig", + Short: ``, + RunE: runOperationClusterDeleteClusterConfig, + } + + if err := registerOperationClusterDeleteClusterConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterDeleteClusterConfig uses cmd flags to call endpoint api +func runOperationClusterDeleteClusterConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster.NewDeleteClusterConfigParams() + if err, _ := retrieveOperationClusterDeleteClusterConfigConfigNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterDeleteClusterConfigResult(appCli.Cluster.DeleteClusterConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterDeleteClusterConfigParamFlags registers all flags needed to fill params +func registerOperationClusterDeleteClusterConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationClusterDeleteClusterConfigConfigNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationClusterDeleteClusterConfigConfigNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + configNameDescription := `Required. Name of the config to delete` + + var configNameFlagName string + if cmdPrefix == "" { + configNameFlagName = "configName" + } else { + configNameFlagName = fmt.Sprintf("%v.configName", cmdPrefix) + } + + var configNameFlagDefault string + + _ = cmd.PersistentFlags().String(configNameFlagName, configNameFlagDefault, configNameDescription) + + return nil +} + +func retrieveOperationClusterDeleteClusterConfigConfigNameFlag(m *cluster.DeleteClusterConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("configName") { + + var configNameFlagName string + if cmdPrefix == "" { + configNameFlagName = "configName" + } else { + configNameFlagName = fmt.Sprintf("%v.configName", cmdPrefix) + } + + configNameFlagValue, err := cmd.Flags().GetString(configNameFlagName) + if err != nil { + return err, false + } + m.ConfigName = configNameFlagValue + + } + return nil, retAdded +} + +// parseOperationClusterDeleteClusterConfigResult parses request result and return the string content +func parseOperationClusterDeleteClusterConfigResult(resp0 *cluster.DeleteClusterConfigOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning deleteClusterConfigOK is not supported + + // Non schema case: warning deleteClusterConfigInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response deleteClusterConfigOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/delete_config_operation.go b/src/cli/delete_config_operation.go new file mode 100644 index 0000000..09c16b7 --- /dev/null +++ b/src/cli/delete_config_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableDeleteConfigCmd returns a cmd to handle operation deleteConfig +func makeOperationTableDeleteConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteConfig", + Short: `Delete the TableConfigs`, + RunE: runOperationTableDeleteConfig, + } + + if err := registerOperationTableDeleteConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableDeleteConfig uses cmd flags to call endpoint api +func runOperationTableDeleteConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewDeleteConfigParams() + if err, _ := retrieveOperationTableDeleteConfigTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableDeleteConfigResult(appCli.Table.DeleteConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableDeleteConfigParamFlags registers all flags needed to fill params +func registerOperationTableDeleteConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableDeleteConfigTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableDeleteConfigTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. TableConfigs name i.e. raw table name` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableDeleteConfigTableNameFlag(m *table.DeleteConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableDeleteConfigResult parses request result and return the string content +func parseOperationTableDeleteConfigResult(resp0 *table.DeleteConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.DeleteConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_operation.go b/src/cli/delete_operation.go new file mode 100644 index 0000000..c17ff85 --- /dev/null +++ b/src/cli/delete_operation.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperDeleteCmd returns a cmd to handle operation delete +func makeOperationZookeeperDeleteCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "delete", + Short: ``, + RunE: runOperationZookeeperDelete, + } + + if err := registerOperationZookeeperDeleteParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperDelete uses cmd flags to call endpoint api +func runOperationZookeeperDelete(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewDeleteParams() + if err, _ := retrieveOperationZookeeperDeletePathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperDeleteResult(appCli.Zookeeper.Delete(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperDeleteParamFlags registers all flags needed to fill params +func registerOperationZookeeperDeleteParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperDeletePathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperDeletePathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperDeletePathFlag(m *zookeeper.DeleteParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperDeleteResult parses request result and return the string content +func parseOperationZookeeperDeleteResult(resp0 *zookeeper.DeleteOK, resp1 *zookeeper.DeleteNoContent, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning deleteOK is not supported + + // Non schema case: warning deleteNoContent is not supported + + // Non schema case: warning deleteNotFound is not supported + + // Non schema case: warning deleteInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response deleteOK is not supported by go-swagger cli yet. + + // warning: non schema response deleteNoContent is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/delete_schema_operation.go b/src/cli/delete_schema_operation.go new file mode 100644 index 0000000..4a2c8e6 --- /dev/null +++ b/src/cli/delete_schema_operation.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/schema" + + "github.com/spf13/cobra" +) + +// makeOperationSchemaDeleteSchemaCmd returns a cmd to handle operation deleteSchema +func makeOperationSchemaDeleteSchemaCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteSchema", + Short: `Deletes a schema by name`, + RunE: runOperationSchemaDeleteSchema, + } + + if err := registerOperationSchemaDeleteSchemaParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaDeleteSchema uses cmd flags to call endpoint api +func runOperationSchemaDeleteSchema(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewDeleteSchemaParams() + if err, _ := retrieveOperationSchemaDeleteSchemaSchemaNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaDeleteSchemaResult(appCli.Schema.DeleteSchema(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaDeleteSchemaParamFlags registers all flags needed to fill params +func registerOperationSchemaDeleteSchemaParamFlags(cmd *cobra.Command) error { + if err := registerOperationSchemaDeleteSchemaSchemaNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSchemaDeleteSchemaSchemaNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + schemaNameDescription := `Required. Schema name` + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + var schemaNameFlagDefault string + + _ = cmd.PersistentFlags().String(schemaNameFlagName, schemaNameFlagDefault, schemaNameDescription) + + return nil +} + +func retrieveOperationSchemaDeleteSchemaSchemaNameFlag(m *schema.DeleteSchemaParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("schemaName") { + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + schemaNameFlagValue, err := cmd.Flags().GetString(schemaNameFlagName) + if err != nil { + return err, false + } + m.SchemaName = schemaNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSchemaDeleteSchemaResult parses request result and return the string content +func parseOperationSchemaDeleteSchemaResult(resp0 *schema.DeleteSchemaOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning deleteSchemaOK is not supported + + // Non schema case: warning deleteSchemaNotFound is not supported + + // Non schema case: warning deleteSchemaConflict is not supported + + // Non schema case: warning deleteSchemaInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response deleteSchemaOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/delete_segment_operation.go b/src/cli/delete_segment_operation.go new file mode 100644 index 0000000..d0c5de3 --- /dev/null +++ b/src/cli/delete_segment_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentDeleteSegmentCmd returns a cmd to handle operation deleteSegment +func makeOperationSegmentDeleteSegmentCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteSegment", + Short: `Delete a segment`, + RunE: runOperationSegmentDeleteSegment, + } + + if err := registerOperationSegmentDeleteSegmentParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentDeleteSegment uses cmd flags to call endpoint api +func runOperationSegmentDeleteSegment(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewDeleteSegmentParams() + if err, _ := retrieveOperationSegmentDeleteSegmentRetentionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDeleteSegmentSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDeleteSegmentTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentDeleteSegmentResult(appCli.Segment.DeleteSegment(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentDeleteSegmentParamFlags registers all flags needed to fill params +func registerOperationSegmentDeleteSegmentParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentDeleteSegmentRetentionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDeleteSegmentSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDeleteSegmentTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentDeleteSegmentRetentionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + retentionDescription := `Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention` + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + var retentionFlagDefault string + + _ = cmd.PersistentFlags().String(retentionFlagName, retentionFlagDefault, retentionDescription) + + return nil +} +func registerOperationSegmentDeleteSegmentSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentDeleteSegmentTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentDeleteSegmentRetentionFlag(m *segment.DeleteSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("retention") { + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + retentionFlagValue, err := cmd.Flags().GetString(retentionFlagName) + if err != nil { + return err, false + } + m.Retention = &retentionFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentDeleteSegmentSegmentNameFlag(m *segment.DeleteSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentDeleteSegmentTableNameFlag(m *segment.DeleteSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentDeleteSegmentResult parses request result and return the string content +func parseOperationSegmentDeleteSegmentResult(resp0 *segment.DeleteSegmentOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.DeleteSegmentOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_segments_operation.go b/src/cli/delete_segments_operation.go new file mode 100644 index 0000000..59f5af9 --- /dev/null +++ b/src/cli/delete_segments_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentDeleteSegmentsCmd returns a cmd to handle operation deleteSegments +func makeOperationSegmentDeleteSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteSegments", + Short: `Delete the segments in the JSON array payload`, + RunE: runOperationSegmentDeleteSegments, + } + + if err := registerOperationSegmentDeleteSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentDeleteSegments uses cmd flags to call endpoint api +func runOperationSegmentDeleteSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewDeleteSegmentsParams() + if err, _ := retrieveOperationSegmentDeleteSegmentsBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDeleteSegmentsRetentionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDeleteSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentDeleteSegmentsResult(appCli.Segment.DeleteSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentDeleteSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentDeleteSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentDeleteSegmentsBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDeleteSegmentsRetentionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDeleteSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentDeleteSegmentsBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault []string + + _ = cmd.PersistentFlags().StringSlice(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationSegmentDeleteSegmentsRetentionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + retentionDescription := `Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention` + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + var retentionFlagDefault string + + _ = cmd.PersistentFlags().String(retentionFlagName, retentionFlagDefault, retentionDescription) + + return nil +} +func registerOperationSegmentDeleteSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentDeleteSegmentsBodyFlag(m *segment.DeleteSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValues, err := cmd.Flags().GetStringSlice(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValues + + } + return nil, retAdded +} +func retrieveOperationSegmentDeleteSegmentsRetentionFlag(m *segment.DeleteSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("retention") { + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + retentionFlagValue, err := cmd.Flags().GetString(retentionFlagName) + if err != nil { + return err, false + } + m.Retention = &retentionFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentDeleteSegmentsTableNameFlag(m *segment.DeleteSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentDeleteSegmentsResult parses request result and return the string content +func parseOperationSegmentDeleteSegmentsResult(resp0 *segment.DeleteSegmentsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.DeleteSegmentsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_table_operation.go b/src/cli/delete_table_operation.go new file mode 100644 index 0000000..f532445 --- /dev/null +++ b/src/cli/delete_table_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableDeleteTableCmd returns a cmd to handle operation deleteTable +func makeOperationTableDeleteTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTable", + Short: `Deletes a table`, + RunE: runOperationTableDeleteTable, + } + + if err := registerOperationTableDeleteTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableDeleteTable uses cmd flags to call endpoint api +func runOperationTableDeleteTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewDeleteTableParams() + if err, _ := retrieveOperationTableDeleteTableRetentionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableDeleteTableTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableDeleteTableTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableDeleteTableResult(appCli.Table.DeleteTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableDeleteTableParamFlags registers all flags needed to fill params +func registerOperationTableDeleteTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableDeleteTableRetentionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableDeleteTableTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableDeleteTableTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableDeleteTableRetentionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + retentionDescription := `Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention` + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + var retentionFlagDefault string + + _ = cmd.PersistentFlags().String(retentionFlagName, retentionFlagDefault, retentionDescription) + + return nil +} +func registerOperationTableDeleteTableTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table to delete` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableDeleteTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `realtime|offline` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableDeleteTableRetentionFlag(m *table.DeleteTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("retention") { + + var retentionFlagName string + if cmdPrefix == "" { + retentionFlagName = "retention" + } else { + retentionFlagName = fmt.Sprintf("%v.retention", cmdPrefix) + } + + retentionFlagValue, err := cmd.Flags().GetString(retentionFlagName) + if err != nil { + return err, false + } + m.Retention = &retentionFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableDeleteTableTableNameFlag(m *table.DeleteTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableDeleteTableTypeFlag(m *table.DeleteTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableDeleteTableResult parses request result and return the string content +func parseOperationTableDeleteTableResult(resp0 *table.DeleteTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.DeleteTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_task_metadata_by_table_operation.go b/src/cli/delete_task_metadata_by_table_operation.go new file mode 100644 index 0000000..99401a4 --- /dev/null +++ b/src/cli/delete_task_metadata_by_table_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskDeleteTaskMetadataByTableCmd returns a cmd to handle operation deleteTaskMetadataByTable +func makeOperationTaskDeleteTaskMetadataByTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTaskMetadataByTable", + Short: ``, + RunE: runOperationTaskDeleteTaskMetadataByTable, + } + + if err := registerOperationTaskDeleteTaskMetadataByTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskDeleteTaskMetadataByTable uses cmd flags to call endpoint api +func runOperationTaskDeleteTaskMetadataByTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewDeleteTaskMetadataByTableParams() + if err, _ := retrieveOperationTaskDeleteTaskMetadataByTableTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskDeleteTaskMetadataByTableTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskDeleteTaskMetadataByTableResult(appCli.Task.DeleteTaskMetadataByTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskDeleteTaskMetadataByTableParamFlags registers all flags needed to fill params +func registerOperationTaskDeleteTaskMetadataByTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskDeleteTaskMetadataByTableTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskDeleteTaskMetadataByTableTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskDeleteTaskMetadataByTableTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Table name with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationTaskDeleteTaskMetadataByTableTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskDeleteTaskMetadataByTableTableNameWithTypeFlag(m *task.DeleteTaskMetadataByTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskDeleteTaskMetadataByTableTaskTypeFlag(m *task.DeleteTaskMetadataByTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskDeleteTaskMetadataByTableResult parses request result and return the string content +func parseOperationTaskDeleteTaskMetadataByTableResult(resp0 *task.DeleteTaskMetadataByTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.DeleteTaskMetadataByTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_task_operation.go b/src/cli/delete_task_operation.go new file mode 100644 index 0000000..7d8d664 --- /dev/null +++ b/src/cli/delete_task_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskDeleteTaskCmd returns a cmd to handle operation deleteTask +func makeOperationTaskDeleteTaskCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTask", + Short: ``, + RunE: runOperationTaskDeleteTask, + } + + if err := registerOperationTaskDeleteTaskParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskDeleteTask uses cmd flags to call endpoint api +func runOperationTaskDeleteTask(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewDeleteTaskParams() + if err, _ := retrieveOperationTaskDeleteTaskForceDeleteFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskDeleteTaskTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskDeleteTaskResult(appCli.Task.DeleteTask(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskDeleteTaskParamFlags registers all flags needed to fill params +func registerOperationTaskDeleteTaskParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskDeleteTaskForceDeleteParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskDeleteTaskTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskDeleteTaskForceDeleteParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceDeleteDescription := `Whether to force deleting the task (expert only option, enable with cautious` + + var forceDeleteFlagName string + if cmdPrefix == "" { + forceDeleteFlagName = "forceDelete" + } else { + forceDeleteFlagName = fmt.Sprintf("%v.forceDelete", cmdPrefix) + } + + var forceDeleteFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceDeleteFlagName, forceDeleteFlagDefault, forceDeleteDescription) + + return nil +} +func registerOperationTaskDeleteTaskTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskDeleteTaskForceDeleteFlag(m *task.DeleteTaskParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceDelete") { + + var forceDeleteFlagName string + if cmdPrefix == "" { + forceDeleteFlagName = "forceDelete" + } else { + forceDeleteFlagName = fmt.Sprintf("%v.forceDelete", cmdPrefix) + } + + forceDeleteFlagValue, err := cmd.Flags().GetBool(forceDeleteFlagName) + if err != nil { + return err, false + } + m.ForceDelete = &forceDeleteFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskDeleteTaskTaskNameFlag(m *task.DeleteTaskParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskDeleteTaskResult parses request result and return the string content +func parseOperationTaskDeleteTaskResult(resp0 *task.DeleteTaskOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.DeleteTaskOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_task_queue_operation.go b/src/cli/delete_task_queue_operation.go new file mode 100644 index 0000000..3345c9d --- /dev/null +++ b/src/cli/delete_task_queue_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskDeleteTaskQueueCmd returns a cmd to handle operation deleteTaskQueue +func makeOperationTaskDeleteTaskQueueCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTaskQueue", + Short: ``, + RunE: runOperationTaskDeleteTaskQueue, + } + + if err := registerOperationTaskDeleteTaskQueueParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskDeleteTaskQueue uses cmd flags to call endpoint api +func runOperationTaskDeleteTaskQueue(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewDeleteTaskQueueParams() + if err, _ := retrieveOperationTaskDeleteTaskQueueForceDeleteFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskDeleteTaskQueueTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskDeleteTaskQueueResult(appCli.Task.DeleteTaskQueue(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskDeleteTaskQueueParamFlags registers all flags needed to fill params +func registerOperationTaskDeleteTaskQueueParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskDeleteTaskQueueForceDeleteParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskDeleteTaskQueueTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskDeleteTaskQueueForceDeleteParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceDeleteDescription := `Whether to force delete the task queue (expert only option, enable with cautious` + + var forceDeleteFlagName string + if cmdPrefix == "" { + forceDeleteFlagName = "forceDelete" + } else { + forceDeleteFlagName = fmt.Sprintf("%v.forceDelete", cmdPrefix) + } + + var forceDeleteFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceDeleteFlagName, forceDeleteFlagDefault, forceDeleteDescription) + + return nil +} +func registerOperationTaskDeleteTaskQueueTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskDeleteTaskQueueForceDeleteFlag(m *task.DeleteTaskQueueParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceDelete") { + + var forceDeleteFlagName string + if cmdPrefix == "" { + forceDeleteFlagName = "forceDelete" + } else { + forceDeleteFlagName = fmt.Sprintf("%v.forceDelete", cmdPrefix) + } + + forceDeleteFlagValue, err := cmd.Flags().GetBool(forceDeleteFlagName) + if err != nil { + return err, false + } + m.ForceDelete = &forceDeleteFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskDeleteTaskQueueTaskTypeFlag(m *task.DeleteTaskQueueParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskDeleteTaskQueueResult parses request result and return the string content +func parseOperationTaskDeleteTaskQueueResult(resp0 *task.DeleteTaskQueueOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.DeleteTaskQueueOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_tasks_operation.go b/src/cli/delete_tasks_operation.go new file mode 100644 index 0000000..7935d7b --- /dev/null +++ b/src/cli/delete_tasks_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskDeleteTasksCmd returns a cmd to handle operation deleteTasks +func makeOperationTaskDeleteTasksCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTasks", + Short: ``, + RunE: runOperationTaskDeleteTasks, + } + + if err := registerOperationTaskDeleteTasksParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskDeleteTasks uses cmd flags to call endpoint api +func runOperationTaskDeleteTasks(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewDeleteTasksParams() + if err, _ := retrieveOperationTaskDeleteTasksForceDeleteFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskDeleteTasksTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskDeleteTasksResult(appCli.Task.DeleteTasks(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskDeleteTasksParamFlags registers all flags needed to fill params +func registerOperationTaskDeleteTasksParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskDeleteTasksForceDeleteParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskDeleteTasksTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskDeleteTasksForceDeleteParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceDeleteDescription := `Whether to force deleting the tasks (expert only option, enable with cautious` + + var forceDeleteFlagName string + if cmdPrefix == "" { + forceDeleteFlagName = "forceDelete" + } else { + forceDeleteFlagName = fmt.Sprintf("%v.forceDelete", cmdPrefix) + } + + var forceDeleteFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceDeleteFlagName, forceDeleteFlagDefault, forceDeleteDescription) + + return nil +} +func registerOperationTaskDeleteTasksTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskDeleteTasksForceDeleteFlag(m *task.DeleteTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceDelete") { + + var forceDeleteFlagName string + if cmdPrefix == "" { + forceDeleteFlagName = "forceDelete" + } else { + forceDeleteFlagName = fmt.Sprintf("%v.forceDelete", cmdPrefix) + } + + forceDeleteFlagValue, err := cmd.Flags().GetBool(forceDeleteFlagName) + if err != nil { + return err, false + } + m.ForceDelete = &forceDeleteFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskDeleteTasksTaskTypeFlag(m *task.DeleteTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskDeleteTasksResult parses request result and return the string content +func parseOperationTaskDeleteTasksResult(resp0 *task.DeleteTasksOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.DeleteTasksOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_tenant_operation.go b/src/cli/delete_tenant_operation.go new file mode 100644 index 0000000..56c7500 --- /dev/null +++ b/src/cli/delete_tenant_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tenant" + + "github.com/spf13/cobra" +) + +// makeOperationTenantDeleteTenantCmd returns a cmd to handle operation deleteTenant +func makeOperationTenantDeleteTenantCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTenant", + Short: ``, + RunE: runOperationTenantDeleteTenant, + } + + if err := registerOperationTenantDeleteTenantParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantDeleteTenant uses cmd flags to call endpoint api +func runOperationTenantDeleteTenant(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewDeleteTenantParams() + if err, _ := retrieveOperationTenantDeleteTenantTenantNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantDeleteTenantTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantDeleteTenantResult(appCli.Tenant.DeleteTenant(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantDeleteTenantParamFlags registers all flags needed to fill params +func registerOperationTenantDeleteTenantParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantDeleteTenantTenantNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantDeleteTenantTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantDeleteTenantTenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Tenant name` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} +func registerOperationTenantDeleteTenantTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["SERVER","BROKER"]. Required. Tenant type` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["SERVER","BROKER"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTenantDeleteTenantTenantNameFlag(m *tenant.DeleteTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantDeleteTenantTypeFlag(m *tenant.DeleteTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTenantDeleteTenantResult parses request result and return the string content +func parseOperationTenantDeleteTenantResult(resp0 *tenant.DeleteTenantOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning deleteTenantOK is not supported + + // Non schema case: warning deleteTenantBadRequest is not supported + + // Non schema case: warning deleteTenantNotFound is not supported + + // Non schema case: warning deleteTenantInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response deleteTenantOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/delete_time_boundary_operation.go b/src/cli/delete_time_boundary_operation.go new file mode 100644 index 0000000..c6e408d --- /dev/null +++ b/src/cli/delete_time_boundary_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableDeleteTimeBoundaryCmd returns a cmd to handle operation deleteTimeBoundary +func makeOperationTableDeleteTimeBoundaryCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteTimeBoundary", + Short: `Delete hybrid table query time boundary`, + RunE: runOperationTableDeleteTimeBoundary, + } + + if err := registerOperationTableDeleteTimeBoundaryParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableDeleteTimeBoundary uses cmd flags to call endpoint api +func runOperationTableDeleteTimeBoundary(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewDeleteTimeBoundaryParams() + if err, _ := retrieveOperationTableDeleteTimeBoundaryTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableDeleteTimeBoundaryResult(appCli.Table.DeleteTimeBoundary(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableDeleteTimeBoundaryParamFlags registers all flags needed to fill params +func registerOperationTableDeleteTimeBoundaryParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableDeleteTimeBoundaryTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableDeleteTimeBoundaryTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the hybrid table (without type suffix)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableDeleteTimeBoundaryTableNameFlag(m *table.DeleteTimeBoundaryParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableDeleteTimeBoundaryResult parses request result and return the string content +func parseOperationTableDeleteTimeBoundaryResult(resp0 *table.DeleteTimeBoundaryOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.DeleteTimeBoundaryOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/delete_user_operation.go b/src/cli/delete_user_operation.go new file mode 100644 index 0000000..d7bbbf1 --- /dev/null +++ b/src/cli/delete_user_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/user" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationUserDeleteUserCmd returns a cmd to handle operation deleteUser +func makeOperationUserDeleteUserCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "deleteUser", + Short: `Delete a user`, + RunE: runOperationUserDeleteUser, + } + + if err := registerOperationUserDeleteUserParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationUserDeleteUser uses cmd flags to call endpoint api +func runOperationUserDeleteUser(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := user.NewDeleteUserParams() + if err, _ := retrieveOperationUserDeleteUserComponentFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUserDeleteUserUsernameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationUserDeleteUserResult(appCli.User.DeleteUser(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationUserDeleteUserParamFlags registers all flags needed to fill params +func registerOperationUserDeleteUserParamFlags(cmd *cobra.Command) error { + if err := registerOperationUserDeleteUserComponentParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUserDeleteUserUsernameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationUserDeleteUserComponentParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + componentDescription := `` + + var componentFlagName string + if cmdPrefix == "" { + componentFlagName = "component" + } else { + componentFlagName = fmt.Sprintf("%v.component", cmdPrefix) + } + + var componentFlagDefault string + + _ = cmd.PersistentFlags().String(componentFlagName, componentFlagDefault, componentDescription) + + return nil +} +func registerOperationUserDeleteUserUsernameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + usernameDescription := `Required. ` + + var usernameFlagName string + if cmdPrefix == "" { + usernameFlagName = "username" + } else { + usernameFlagName = fmt.Sprintf("%v.username", cmdPrefix) + } + + var usernameFlagDefault string + + _ = cmd.PersistentFlags().String(usernameFlagName, usernameFlagDefault, usernameDescription) + + return nil +} + +func retrieveOperationUserDeleteUserComponentFlag(m *user.DeleteUserParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("component") { + + var componentFlagName string + if cmdPrefix == "" { + componentFlagName = "component" + } else { + componentFlagName = fmt.Sprintf("%v.component", cmdPrefix) + } + + componentFlagValue, err := cmd.Flags().GetString(componentFlagName) + if err != nil { + return err, false + } + m.Component = &componentFlagValue + + } + return nil, retAdded +} +func retrieveOperationUserDeleteUserUsernameFlag(m *user.DeleteUserParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("username") { + + var usernameFlagName string + if cmdPrefix == "" { + usernameFlagName = "username" + } else { + usernameFlagName = fmt.Sprintf("%v.username", cmdPrefix) + } + + usernameFlagValue, err := cmd.Flags().GetString(usernameFlagName) + if err != nil { + return err, false + } + m.Username = usernameFlagValue + + } + return nil, retAdded +} + +// parseOperationUserDeleteUserResult parses request result and return the string content +func parseOperationUserDeleteUserResult(resp0 *user.DeleteUserOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*user.DeleteUserOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/dimension_field_spec_model.go b/src/cli/dimension_field_spec_model.go new file mode 100644 index 0000000..bb71e51 --- /dev/null +++ b/src/cli/dimension_field_spec_model.go @@ -0,0 +1,487 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for DimensionFieldSpec + +// register flags to command +func registerModelDimensionFieldSpecFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerDimensionFieldSpecDataType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecDefaultNullValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecDefaultNullValueString(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecMaxLength(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecSingleValueField(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecTransformFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerDimensionFieldSpecVirtualColumnProvider(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerDimensionFieldSpecDataType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + dataTypeDescription := `Enum: ["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]. ` + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + var dataTypeFlagDefault string + + _ = cmd.PersistentFlags().String(dataTypeFlagName, dataTypeFlagDefault, dataTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(dataTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerDimensionFieldSpecDefaultNullValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: defaultNullValue interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerDimensionFieldSpecDefaultNullValueString(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + defaultNullValueStringDescription := `` + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + var defaultNullValueStringFlagDefault string + + _ = cmd.PersistentFlags().String(defaultNullValueStringFlagName, defaultNullValueStringFlagDefault, defaultNullValueStringDescription) + + return nil +} + +func registerDimensionFieldSpecMaxLength(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxLengthDescription := `` + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + var maxLengthFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxLengthFlagName, maxLengthFlagDefault, maxLengthDescription) + + return nil +} + +func registerDimensionFieldSpecName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerDimensionFieldSpecSingleValueField(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + singleValueFieldDescription := `` + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + var singleValueFieldFlagDefault bool + + _ = cmd.PersistentFlags().Bool(singleValueFieldFlagName, singleValueFieldFlagDefault, singleValueFieldDescription) + + return nil +} + +func registerDimensionFieldSpecTransformFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + transformFunctionDescription := `` + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + var transformFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(transformFunctionFlagName, transformFunctionFlagDefault, transformFunctionDescription) + + return nil +} + +func registerDimensionFieldSpecVirtualColumnProvider(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + virtualColumnProviderDescription := `` + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + var virtualColumnProviderFlagDefault string + + _ = cmd.PersistentFlags().String(virtualColumnProviderFlagName, virtualColumnProviderFlagDefault, virtualColumnProviderDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelDimensionFieldSpecFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dataTypeAdded := retrieveDimensionFieldSpecDataTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dataTypeAdded + + err, defaultNullValueAdded := retrieveDimensionFieldSpecDefaultNullValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueAdded + + err, defaultNullValueStringAdded := retrieveDimensionFieldSpecDefaultNullValueStringFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueStringAdded + + err, maxLengthAdded := retrieveDimensionFieldSpecMaxLengthFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxLengthAdded + + err, nameAdded := retrieveDimensionFieldSpecNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, singleValueFieldAdded := retrieveDimensionFieldSpecSingleValueFieldFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || singleValueFieldAdded + + err, transformFunctionAdded := retrieveDimensionFieldSpecTransformFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || transformFunctionAdded + + err, virtualColumnProviderAdded := retrieveDimensionFieldSpecVirtualColumnProviderFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || virtualColumnProviderAdded + + return nil, retAdded +} + +func retrieveDimensionFieldSpecDataTypeFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dataTypeFlagName := fmt.Sprintf("%v.dataType", cmdPrefix) + if cmd.Flags().Changed(dataTypeFlagName) { + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + dataTypeFlagValue, err := cmd.Flags().GetString(dataTypeFlagName) + if err != nil { + return err, false + } + m.DataType = dataTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecDefaultNullValueFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueFlagName := fmt.Sprintf("%v.defaultNullValue", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueFlagName) { + // warning: defaultNullValue map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecDefaultNullValueStringFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueStringFlagName := fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueStringFlagName) { + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + defaultNullValueStringFlagValue, err := cmd.Flags().GetString(defaultNullValueStringFlagName) + if err != nil { + return err, false + } + m.DefaultNullValueString = defaultNullValueStringFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecMaxLengthFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxLengthFlagName := fmt.Sprintf("%v.maxLength", cmdPrefix) + if cmd.Flags().Changed(maxLengthFlagName) { + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + maxLengthFlagValue, err := cmd.Flags().GetInt32(maxLengthFlagName) + if err != nil { + return err, false + } + m.MaxLength = maxLengthFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecNameFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecSingleValueFieldFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + singleValueFieldFlagName := fmt.Sprintf("%v.singleValueField", cmdPrefix) + if cmd.Flags().Changed(singleValueFieldFlagName) { + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + singleValueFieldFlagValue, err := cmd.Flags().GetBool(singleValueFieldFlagName) + if err != nil { + return err, false + } + m.SingleValueField = singleValueFieldFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecTransformFunctionFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + transformFunctionFlagName := fmt.Sprintf("%v.transformFunction", cmdPrefix) + if cmd.Flags().Changed(transformFunctionFlagName) { + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + transformFunctionFlagValue, err := cmd.Flags().GetString(transformFunctionFlagName) + if err != nil { + return err, false + } + m.TransformFunction = transformFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveDimensionFieldSpecVirtualColumnProviderFlags(depth int, m *models.DimensionFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + virtualColumnProviderFlagName := fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + if cmd.Flags().Changed(virtualColumnProviderFlagName) { + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + virtualColumnProviderFlagValue, err := cmd.Flags().GetString(virtualColumnProviderFlagName) + if err != nil { + return err, false + } + m.VirtualColumnProvider = virtualColumnProviderFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/dimension_table_config_model.go b/src/cli/dimension_table_config_model.go new file mode 100644 index 0000000..89c95cb --- /dev/null +++ b/src/cli/dimension_table_config_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for DimensionTableConfig + +// register flags to command +func registerModelDimensionTableConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerDimensionTableConfigDisablePreload(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerDimensionTableConfigDisablePreload(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + disablePreloadDescription := `Required. ` + + var disablePreloadFlagName string + if cmdPrefix == "" { + disablePreloadFlagName = "disablePreload" + } else { + disablePreloadFlagName = fmt.Sprintf("%v.disablePreload", cmdPrefix) + } + + var disablePreloadFlagDefault bool + + _ = cmd.PersistentFlags().Bool(disablePreloadFlagName, disablePreloadFlagDefault, disablePreloadDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelDimensionTableConfigFlags(depth int, m *models.DimensionTableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, disablePreloadAdded := retrieveDimensionTableConfigDisablePreloadFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || disablePreloadAdded + + return nil, retAdded +} + +func retrieveDimensionTableConfigDisablePreloadFlags(depth int, m *models.DimensionTableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + disablePreloadFlagName := fmt.Sprintf("%v.disablePreload", cmdPrefix) + if cmd.Flags().Changed(disablePreloadFlagName) { + + var disablePreloadFlagName string + if cmdPrefix == "" { + disablePreloadFlagName = "disablePreload" + } else { + disablePreloadFlagName = fmt.Sprintf("%v.disablePreload", cmdPrefix) + } + + disablePreloadFlagValue, err := cmd.Flags().GetBool(disablePreloadFlagName) + if err != nil { + return err, false + } + m.DisablePreload = disablePreloadFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/download_log_file_from_instance_operation.go b/src/cli/download_log_file_from_instance_operation.go new file mode 100644 index 0000000..7d0fcad --- /dev/null +++ b/src/cli/download_log_file_from_instance_operation.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/spf13/cobra" +) + +// makeOperationLoggerDownloadLogFileFromInstanceCmd returns a cmd to handle operation downloadLogFileFromInstance +func makeOperationLoggerDownloadLogFileFromInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "downloadLogFileFromInstance", + Short: ``, + RunE: runOperationLoggerDownloadLogFileFromInstance, + } + + if err := registerOperationLoggerDownloadLogFileFromInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerDownloadLogFileFromInstance uses cmd flags to call endpoint api +func runOperationLoggerDownloadLogFileFromInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewDownloadLogFileFromInstanceParams() + if err, _ := retrieveOperationLoggerDownloadLogFileFromInstanceFilePathFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationLoggerDownloadLogFileFromInstanceInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerDownloadLogFileFromInstanceResult(appCli.Logger.DownloadLogFileFromInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerDownloadLogFileFromInstanceParamFlags registers all flags needed to fill params +func registerOperationLoggerDownloadLogFileFromInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationLoggerDownloadLogFileFromInstanceFilePathParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationLoggerDownloadLogFileFromInstanceInstanceNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationLoggerDownloadLogFileFromInstanceFilePathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + filePathDescription := `Required. Log file path` + + var filePathFlagName string + if cmdPrefix == "" { + filePathFlagName = "filePath" + } else { + filePathFlagName = fmt.Sprintf("%v.filePath", cmdPrefix) + } + + var filePathFlagDefault string + + _ = cmd.PersistentFlags().String(filePathFlagName, filePathFlagDefault, filePathDescription) + + return nil +} +func registerOperationLoggerDownloadLogFileFromInstanceInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance Name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func retrieveOperationLoggerDownloadLogFileFromInstanceFilePathFlag(m *logger.DownloadLogFileFromInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("filePath") { + + var filePathFlagName string + if cmdPrefix == "" { + filePathFlagName = "filePath" + } else { + filePathFlagName = fmt.Sprintf("%v.filePath", cmdPrefix) + } + + filePathFlagValue, err := cmd.Flags().GetString(filePathFlagName) + if err != nil { + return err, false + } + m.FilePath = filePathFlagValue + + } + return nil, retAdded +} +func retrieveOperationLoggerDownloadLogFileFromInstanceInstanceNameFlag(m *logger.DownloadLogFileFromInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} + +// parseOperationLoggerDownloadLogFileFromInstanceResult parses request result and return the string content +func parseOperationLoggerDownloadLogFileFromInstanceResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning downloadLogFileFromInstance default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/download_log_file_operation.go b/src/cli/download_log_file_operation.go new file mode 100644 index 0000000..20e615d --- /dev/null +++ b/src/cli/download_log_file_operation.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/spf13/cobra" +) + +// makeOperationLoggerDownloadLogFileCmd returns a cmd to handle operation downloadLogFile +func makeOperationLoggerDownloadLogFileCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "downloadLogFile", + Short: ``, + RunE: runOperationLoggerDownloadLogFile, + } + + if err := registerOperationLoggerDownloadLogFileParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerDownloadLogFile uses cmd flags to call endpoint api +func runOperationLoggerDownloadLogFile(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewDownloadLogFileParams() + if err, _ := retrieveOperationLoggerDownloadLogFileFilePathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerDownloadLogFileResult(appCli.Logger.DownloadLogFile(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerDownloadLogFileParamFlags registers all flags needed to fill params +func registerOperationLoggerDownloadLogFileParamFlags(cmd *cobra.Command) error { + if err := registerOperationLoggerDownloadLogFileFilePathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationLoggerDownloadLogFileFilePathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + filePathDescription := `Required. Log file path` + + var filePathFlagName string + if cmdPrefix == "" { + filePathFlagName = "filePath" + } else { + filePathFlagName = fmt.Sprintf("%v.filePath", cmdPrefix) + } + + var filePathFlagDefault string + + _ = cmd.PersistentFlags().String(filePathFlagName, filePathFlagDefault, filePathDescription) + + return nil +} + +func retrieveOperationLoggerDownloadLogFileFilePathFlag(m *logger.DownloadLogFileParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("filePath") { + + var filePathFlagName string + if cmdPrefix == "" { + filePathFlagName = "filePath" + } else { + filePathFlagName = fmt.Sprintf("%v.filePath", cmdPrefix) + } + + filePathFlagValue, err := cmd.Flags().GetString(filePathFlagName) + if err != nil { + return err, false + } + m.FilePath = filePathFlagValue + + } + return nil, retAdded +} + +// parseOperationLoggerDownloadLogFileResult parses request result and return the string content +func parseOperationLoggerDownloadLogFileResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning downloadLogFile default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/download_segment_operation.go b/src/cli/download_segment_operation.go new file mode 100644 index 0000000..ec93c6b --- /dev/null +++ b/src/cli/download_segment_operation.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentDownloadSegmentCmd returns a cmd to handle operation downloadSegment +func makeOperationSegmentDownloadSegmentCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "downloadSegment", + Short: `Download a segment`, + RunE: runOperationSegmentDownloadSegment, + } + + if err := registerOperationSegmentDownloadSegmentParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentDownloadSegment uses cmd flags to call endpoint api +func runOperationSegmentDownloadSegment(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewDownloadSegmentParams() + if err, _ := retrieveOperationSegmentDownloadSegmentSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentDownloadSegmentTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentDownloadSegmentResult(appCli.Segment.DownloadSegment(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentDownloadSegmentParamFlags registers all flags needed to fill params +func registerOperationSegmentDownloadSegmentParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentDownloadSegmentSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentDownloadSegmentTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentDownloadSegmentSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentDownloadSegmentTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentDownloadSegmentSegmentNameFlag(m *segment.DownloadSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentDownloadSegmentTableNameFlag(m *segment.DownloadSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentDownloadSegmentResult parses request result and return the string content +func parseOperationSegmentDownloadSegmentResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning downloadSegment default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/drop_instance_operation.go b/src/cli/drop_instance_operation.go new file mode 100644 index 0000000..46a19e4 --- /dev/null +++ b/src/cli/drop_instance_operation.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/instance" + + "github.com/spf13/cobra" +) + +// makeOperationInstanceDropInstanceCmd returns a cmd to handle operation dropInstance +func makeOperationInstanceDropInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "dropInstance", + Short: `Drop an instance`, + RunE: runOperationInstanceDropInstance, + } + + if err := registerOperationInstanceDropInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceDropInstance uses cmd flags to call endpoint api +func runOperationInstanceDropInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewDropInstanceParams() + if err, _ := retrieveOperationInstanceDropInstanceInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceDropInstanceResult(appCli.Instance.DropInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceDropInstanceParamFlags registers all flags needed to fill params +func registerOperationInstanceDropInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceDropInstanceInstanceNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceDropInstanceInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func retrieveOperationInstanceDropInstanceInstanceNameFlag(m *instance.DropInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceDropInstanceResult parses request result and return the string content +func parseOperationInstanceDropInstanceResult(resp0 *instance.DropInstanceOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning dropInstanceOK is not supported + + // Non schema case: warning dropInstanceNotFound is not supported + + // Non schema case: warning dropInstanceConflict is not supported + + // Non schema case: warning dropInstanceInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response dropInstanceOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/end_data_ingest_request_operation.go b/src/cli/end_data_ingest_request_operation.go new file mode 100644 index 0000000..a410747 --- /dev/null +++ b/src/cli/end_data_ingest_request_operation.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/atomic_ingestion" + + "github.com/spf13/cobra" +) + +// makeOperationAtomicIngestionEndDataIngestRequestCmd returns a cmd to handle operation endDataIngestRequest +func makeOperationAtomicIngestionEndDataIngestRequestCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "endDataIngestRequest", + Short: ``, + RunE: runOperationAtomicIngestionEndDataIngestRequest, + } + + if err := registerOperationAtomicIngestionEndDataIngestRequestParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationAtomicIngestionEndDataIngestRequest uses cmd flags to call endpoint api +func runOperationAtomicIngestionEndDataIngestRequest(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := atomic_ingestion.NewEndDataIngestRequestParams() + if err, _ := retrieveOperationAtomicIngestionEndDataIngestRequestCheckpointEntryKeyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAtomicIngestionEndDataIngestRequestTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAtomicIngestionEndDataIngestRequestTableTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAtomicIngestionEndDataIngestRequestTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationAtomicIngestionEndDataIngestRequestResult(appCli.AtomicIngestion.EndDataIngestRequest(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationAtomicIngestionEndDataIngestRequestParamFlags registers all flags needed to fill params +func registerOperationAtomicIngestionEndDataIngestRequestParamFlags(cmd *cobra.Command) error { + if err := registerOperationAtomicIngestionEndDataIngestRequestCheckpointEntryKeyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAtomicIngestionEndDataIngestRequestTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAtomicIngestionEndDataIngestRequestTableTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAtomicIngestionEndDataIngestRequestTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationAtomicIngestionEndDataIngestRequestCheckpointEntryKeyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + checkpointEntryKeyDescription := `Required. Key of checkpoint entry` + + var checkpointEntryKeyFlagName string + if cmdPrefix == "" { + checkpointEntryKeyFlagName = "checkpointEntryKey" + } else { + checkpointEntryKeyFlagName = fmt.Sprintf("%v.checkpointEntryKey", cmdPrefix) + } + + var checkpointEntryKeyFlagDefault string + + _ = cmd.PersistentFlags().String(checkpointEntryKeyFlagName, checkpointEntryKeyFlagDefault, checkpointEntryKeyDescription) + + return nil +} +func registerOperationAtomicIngestionEndDataIngestRequestTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationAtomicIngestionEndDataIngestRequestTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `Required. OFFLINE|REALTIME` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} +func registerOperationAtomicIngestionEndDataIngestRequestTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationAtomicIngestionEndDataIngestRequestCheckpointEntryKeyFlag(m *atomic_ingestion.EndDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("checkpointEntryKey") { + + var checkpointEntryKeyFlagName string + if cmdPrefix == "" { + checkpointEntryKeyFlagName = "checkpointEntryKey" + } else { + checkpointEntryKeyFlagName = fmt.Sprintf("%v.checkpointEntryKey", cmdPrefix) + } + + checkpointEntryKeyFlagValue, err := cmd.Flags().GetString(checkpointEntryKeyFlagName) + if err != nil { + return err, false + } + m.CheckpointEntryKey = checkpointEntryKeyFlagValue + + } + return nil, retAdded +} +func retrieveOperationAtomicIngestionEndDataIngestRequestTableNameFlag(m *atomic_ingestion.EndDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationAtomicIngestionEndDataIngestRequestTableTypeFlag(m *atomic_ingestion.EndDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = tableTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationAtomicIngestionEndDataIngestRequestTaskTypeFlag(m *atomic_ingestion.EndDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationAtomicIngestionEndDataIngestRequestResult parses request result and return the string content +func parseOperationAtomicIngestionEndDataIngestRequestResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning endDataIngestRequest default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/end_replace_segments_operation.go b/src/cli/end_replace_segments_operation.go new file mode 100644 index 0000000..91606a0 --- /dev/null +++ b/src/cli/end_replace_segments_operation.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentEndReplaceSegmentsCmd returns a cmd to handle operation endReplaceSegments +func makeOperationSegmentEndReplaceSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "endReplaceSegments", + Short: `End to replace segments`, + RunE: runOperationSegmentEndReplaceSegments, + } + + if err := registerOperationSegmentEndReplaceSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentEndReplaceSegments uses cmd flags to call endpoint api +func runOperationSegmentEndReplaceSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewEndReplaceSegmentsParams() + if err, _ := retrieveOperationSegmentEndReplaceSegmentsSegmentLineageEntryIDFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentEndReplaceSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentEndReplaceSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentEndReplaceSegmentsResult(appCli.Segment.EndReplaceSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentEndReplaceSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentEndReplaceSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentEndReplaceSegmentsSegmentLineageEntryIDParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentEndReplaceSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentEndReplaceSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentEndReplaceSegmentsSegmentLineageEntryIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentLineageEntryIdDescription := `Required. Segment lineage entry id returned by startReplaceSegments API` + + var segmentLineageEntryIdFlagName string + if cmdPrefix == "" { + segmentLineageEntryIdFlagName = "segmentLineageEntryId" + } else { + segmentLineageEntryIdFlagName = fmt.Sprintf("%v.segmentLineageEntryId", cmdPrefix) + } + + var segmentLineageEntryIdFlagDefault string + + _ = cmd.PersistentFlags().String(segmentLineageEntryIdFlagName, segmentLineageEntryIdFlagDefault, segmentLineageEntryIdDescription) + + return nil +} +func registerOperationSegmentEndReplaceSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentEndReplaceSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentEndReplaceSegmentsSegmentLineageEntryIDFlag(m *segment.EndReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentLineageEntryId") { + + var segmentLineageEntryIdFlagName string + if cmdPrefix == "" { + segmentLineageEntryIdFlagName = "segmentLineageEntryId" + } else { + segmentLineageEntryIdFlagName = fmt.Sprintf("%v.segmentLineageEntryId", cmdPrefix) + } + + segmentLineageEntryIdFlagValue, err := cmd.Flags().GetString(segmentLineageEntryIdFlagName) + if err != nil { + return err, false + } + m.SegmentLineageEntryID = segmentLineageEntryIdFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentEndReplaceSegmentsTableNameFlag(m *segment.EndReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentEndReplaceSegmentsTypeFlag(m *segment.EndReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentEndReplaceSegmentsResult parses request result and return the string content +func parseOperationSegmentEndReplaceSegmentsResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning endReplaceSegments default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/estimate_heap_usage_operation.go b/src/cli/estimate_heap_usage_operation.go new file mode 100644 index 0000000..1f0bbdf --- /dev/null +++ b/src/cli/estimate_heap_usage_operation.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/upsert" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationUpsertEstimateHeapUsageCmd returns a cmd to handle operation estimateHeapUsage +func makeOperationUpsertEstimateHeapUsageCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "estimateHeapUsage", + Short: `This API returns the estimated heap usage based on primary key column stats. This allows us to estimate table size before onboarding.`, + RunE: runOperationUpsertEstimateHeapUsage, + } + + if err := registerOperationUpsertEstimateHeapUsageParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationUpsertEstimateHeapUsage uses cmd flags to call endpoint api +func runOperationUpsertEstimateHeapUsage(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := upsert.NewEstimateHeapUsageParams() + if err, _ := retrieveOperationUpsertEstimateHeapUsageBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUpsertEstimateHeapUsageCardinalityFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUpsertEstimateHeapUsageNumPartitionsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUpsertEstimateHeapUsagePrimaryKeySizeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationUpsertEstimateHeapUsageResult(appCli.Upsert.EstimateHeapUsage(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationUpsertEstimateHeapUsageParamFlags registers all flags needed to fill params +func registerOperationUpsertEstimateHeapUsageParamFlags(cmd *cobra.Command) error { + if err := registerOperationUpsertEstimateHeapUsageBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUpsertEstimateHeapUsageCardinalityParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUpsertEstimateHeapUsageNumPartitionsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUpsertEstimateHeapUsagePrimaryKeySizeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationUpsertEstimateHeapUsageBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationUpsertEstimateHeapUsageCardinalityParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + cardinalityDescription := `Required. cardinality` + + var cardinalityFlagName string + if cmdPrefix == "" { + cardinalityFlagName = "cardinality" + } else { + cardinalityFlagName = fmt.Sprintf("%v.cardinality", cmdPrefix) + } + + var cardinalityFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(cardinalityFlagName, cardinalityFlagDefault, cardinalityDescription) + + return nil +} +func registerOperationUpsertEstimateHeapUsageNumPartitionsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + numPartitionsDescription := `numPartitions` + + var numPartitionsFlagName string + if cmdPrefix == "" { + numPartitionsFlagName = "numPartitions" + } else { + numPartitionsFlagName = fmt.Sprintf("%v.numPartitions", cmdPrefix) + } + + var numPartitionsFlagDefault int32 = -1 + + _ = cmd.PersistentFlags().Int32(numPartitionsFlagName, numPartitionsFlagDefault, numPartitionsDescription) + + return nil +} +func registerOperationUpsertEstimateHeapUsagePrimaryKeySizeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + primaryKeySizeDescription := `primaryKeySize` + + var primaryKeySizeFlagName string + if cmdPrefix == "" { + primaryKeySizeFlagName = "primaryKeySize" + } else { + primaryKeySizeFlagName = fmt.Sprintf("%v.primaryKeySize", cmdPrefix) + } + + var primaryKeySizeFlagDefault int32 = -1 + + _ = cmd.PersistentFlags().Int32(primaryKeySizeFlagName, primaryKeySizeFlagDefault, primaryKeySizeDescription) + + return nil +} + +func retrieveOperationUpsertEstimateHeapUsageBodyFlag(m *upsert.EstimateHeapUsageParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationUpsertEstimateHeapUsageCardinalityFlag(m *upsert.EstimateHeapUsageParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("cardinality") { + + var cardinalityFlagName string + if cmdPrefix == "" { + cardinalityFlagName = "cardinality" + } else { + cardinalityFlagName = fmt.Sprintf("%v.cardinality", cmdPrefix) + } + + cardinalityFlagValue, err := cmd.Flags().GetInt64(cardinalityFlagName) + if err != nil { + return err, false + } + m.Cardinality = cardinalityFlagValue + + } + return nil, retAdded +} +func retrieveOperationUpsertEstimateHeapUsageNumPartitionsFlag(m *upsert.EstimateHeapUsageParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("numPartitions") { + + var numPartitionsFlagName string + if cmdPrefix == "" { + numPartitionsFlagName = "numPartitions" + } else { + numPartitionsFlagName = fmt.Sprintf("%v.numPartitions", cmdPrefix) + } + + numPartitionsFlagValue, err := cmd.Flags().GetInt32(numPartitionsFlagName) + if err != nil { + return err, false + } + m.NumPartitions = &numPartitionsFlagValue + + } + return nil, retAdded +} +func retrieveOperationUpsertEstimateHeapUsagePrimaryKeySizeFlag(m *upsert.EstimateHeapUsageParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("primaryKeySize") { + + var primaryKeySizeFlagName string + if cmdPrefix == "" { + primaryKeySizeFlagName = "primaryKeySize" + } else { + primaryKeySizeFlagName = fmt.Sprintf("%v.primaryKeySize", cmdPrefix) + } + + primaryKeySizeFlagValue, err := cmd.Flags().GetInt32(primaryKeySizeFlagName) + if err != nil { + return err, false + } + m.PrimaryKeySize = &primaryKeySizeFlagValue + + } + return nil, retAdded +} + +// parseOperationUpsertEstimateHeapUsageResult parses request result and return the string content +func parseOperationUpsertEstimateHeapUsageResult(resp0 *upsert.EstimateHeapUsageOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*upsert.EstimateHeapUsageOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/execute_adhoc_task_operation.go b/src/cli/execute_adhoc_task_operation.go new file mode 100644 index 0000000..9bc4510 --- /dev/null +++ b/src/cli/execute_adhoc_task_operation.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskExecuteAdhocTaskCmd returns a cmd to handle operation executeAdhocTask +func makeOperationTaskExecuteAdhocTaskCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "executeAdhocTask", + Short: ``, + RunE: runOperationTaskExecuteAdhocTask, + } + + if err := registerOperationTaskExecuteAdhocTaskParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskExecuteAdhocTask uses cmd flags to call endpoint api +func runOperationTaskExecuteAdhocTask(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewExecuteAdhocTaskParams() + if err, _ := retrieveOperationTaskExecuteAdhocTaskBodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskExecuteAdhocTaskResult(appCli.Task.ExecuteAdhocTask(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskExecuteAdhocTaskParamFlags registers all flags needed to fill params +func registerOperationTaskExecuteAdhocTaskParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskExecuteAdhocTaskBodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskExecuteAdhocTaskBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelAdhocTaskConfigFlags(0, "adhocTaskConfig", cmd); err != nil { + return err + } + + return nil +} + +func retrieveOperationTaskExecuteAdhocTaskBodyFlag(m *task.ExecuteAdhocTaskParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.AdhocTaskConfig{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.AdhocTaskConfig: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.AdhocTaskConfig{} + } + err, added := retrieveModelAdhocTaskConfigFlags(0, bodyValueModel, "adhocTaskConfig", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} + +// parseOperationTaskExecuteAdhocTaskResult parses request result and return the string content +func parseOperationTaskExecuteAdhocTaskResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning executeAdhocTask default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/field_config_model.go b/src/cli/field_config_model.go new file mode 100644 index 0000000..d9a8fe0 --- /dev/null +++ b/src/cli/field_config_model.go @@ -0,0 +1,424 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for FieldConfig + +// register flags to command +func registerModelFieldConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerFieldConfigCompressionCodec(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFieldConfigEncodingType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFieldConfigIndexType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFieldConfigIndexTypes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFieldConfigName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFieldConfigProperties(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFieldConfigTimestampConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerFieldConfigCompressionCodec(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + compressionCodecDescription := `Enum: ["PASS_THROUGH","SNAPPY","ZSTANDARD","LZ4"]. ` + + var compressionCodecFlagName string + if cmdPrefix == "" { + compressionCodecFlagName = "compressionCodec" + } else { + compressionCodecFlagName = fmt.Sprintf("%v.compressionCodec", cmdPrefix) + } + + var compressionCodecFlagDefault string + + _ = cmd.PersistentFlags().String(compressionCodecFlagName, compressionCodecFlagDefault, compressionCodecDescription) + + if err := cmd.RegisterFlagCompletionFunc(compressionCodecFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["PASS_THROUGH","SNAPPY","ZSTANDARD","LZ4"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerFieldConfigEncodingType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + encodingTypeDescription := `Enum: ["RAW","DICTIONARY"]. ` + + var encodingTypeFlagName string + if cmdPrefix == "" { + encodingTypeFlagName = "encodingType" + } else { + encodingTypeFlagName = fmt.Sprintf("%v.encodingType", cmdPrefix) + } + + var encodingTypeFlagDefault string + + _ = cmd.PersistentFlags().String(encodingTypeFlagName, encodingTypeFlagDefault, encodingTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(encodingTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["RAW","DICTIONARY"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerFieldConfigIndexType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + indexTypeDescription := `Enum: ["INVERTED","SORTED","TEXT","FST","H3","JSON","TIMESTAMP","RANGE"]. ` + + var indexTypeFlagName string + if cmdPrefix == "" { + indexTypeFlagName = "indexType" + } else { + indexTypeFlagName = fmt.Sprintf("%v.indexType", cmdPrefix) + } + + var indexTypeFlagDefault string + + _ = cmd.PersistentFlags().String(indexTypeFlagName, indexTypeFlagDefault, indexTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(indexTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INVERTED","SORTED","TEXT","FST","H3","JSON","TIMESTAMP","RANGE"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerFieldConfigIndexTypes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: indexTypes []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerFieldConfigName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `Required. ` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerFieldConfigProperties(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: properties map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerFieldConfigTimestampConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var timestampConfigFlagName string + if cmdPrefix == "" { + timestampConfigFlagName = "timestampConfig" + } else { + timestampConfigFlagName = fmt.Sprintf("%v.timestampConfig", cmdPrefix) + } + + if err := registerModelTimestampConfigFlags(depth+1, timestampConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelFieldConfigFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, compressionCodecAdded := retrieveFieldConfigCompressionCodecFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || compressionCodecAdded + + err, encodingTypeAdded := retrieveFieldConfigEncodingTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || encodingTypeAdded + + err, indexTypeAdded := retrieveFieldConfigIndexTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || indexTypeAdded + + err, indexTypesAdded := retrieveFieldConfigIndexTypesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || indexTypesAdded + + err, nameAdded := retrieveFieldConfigNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, propertiesAdded := retrieveFieldConfigPropertiesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || propertiesAdded + + err, timestampConfigAdded := retrieveFieldConfigTimestampConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timestampConfigAdded + + return nil, retAdded +} + +func retrieveFieldConfigCompressionCodecFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + compressionCodecFlagName := fmt.Sprintf("%v.compressionCodec", cmdPrefix) + if cmd.Flags().Changed(compressionCodecFlagName) { + + var compressionCodecFlagName string + if cmdPrefix == "" { + compressionCodecFlagName = "compressionCodec" + } else { + compressionCodecFlagName = fmt.Sprintf("%v.compressionCodec", cmdPrefix) + } + + compressionCodecFlagValue, err := cmd.Flags().GetString(compressionCodecFlagName) + if err != nil { + return err, false + } + m.CompressionCodec = compressionCodecFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFieldConfigEncodingTypeFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + encodingTypeFlagName := fmt.Sprintf("%v.encodingType", cmdPrefix) + if cmd.Flags().Changed(encodingTypeFlagName) { + + var encodingTypeFlagName string + if cmdPrefix == "" { + encodingTypeFlagName = "encodingType" + } else { + encodingTypeFlagName = fmt.Sprintf("%v.encodingType", cmdPrefix) + } + + encodingTypeFlagValue, err := cmd.Flags().GetString(encodingTypeFlagName) + if err != nil { + return err, false + } + m.EncodingType = encodingTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFieldConfigIndexTypeFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + indexTypeFlagName := fmt.Sprintf("%v.indexType", cmdPrefix) + if cmd.Flags().Changed(indexTypeFlagName) { + + var indexTypeFlagName string + if cmdPrefix == "" { + indexTypeFlagName = "indexType" + } else { + indexTypeFlagName = fmt.Sprintf("%v.indexType", cmdPrefix) + } + + indexTypeFlagValue, err := cmd.Flags().GetString(indexTypeFlagName) + if err != nil { + return err, false + } + m.IndexType = indexTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFieldConfigIndexTypesFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + indexTypesFlagName := fmt.Sprintf("%v.indexTypes", cmdPrefix) + if cmd.Flags().Changed(indexTypesFlagName) { + // warning: indexTypes array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFieldConfigNameFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFieldConfigPropertiesFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + propertiesFlagName := fmt.Sprintf("%v.properties", cmdPrefix) + if cmd.Flags().Changed(propertiesFlagName) { + // warning: properties map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFieldConfigTimestampConfigFlags(depth int, m *models.FieldConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timestampConfigFlagName := fmt.Sprintf("%v.timestampConfig", cmdPrefix) + if cmd.Flags().Changed(timestampConfigFlagName) { + // info: complex object timestampConfig TimestampConfig is retrieved outside this Changed() block + } + timestampConfigFlagValue := m.TimestampConfig + if swag.IsZero(timestampConfigFlagValue) { + timestampConfigFlagValue = &models.TimestampConfig{} + } + + err, timestampConfigAdded := retrieveModelTimestampConfigFlags(depth+1, timestampConfigFlagValue, timestampConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timestampConfigAdded + if timestampConfigAdded { + m.TimestampConfig = timestampConfigFlagValue + } + + return nil, retAdded +} diff --git a/src/cli/filter_config_model.go b/src/cli/filter_config_model.go new file mode 100644 index 0000000..47deb1c --- /dev/null +++ b/src/cli/filter_config_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for FilterConfig + +// register flags to command +func registerModelFilterConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerFilterConfigFilterFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerFilterConfigFilterFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + filterFunctionDescription := `` + + var filterFunctionFlagName string + if cmdPrefix == "" { + filterFunctionFlagName = "filterFunction" + } else { + filterFunctionFlagName = fmt.Sprintf("%v.filterFunction", cmdPrefix) + } + + var filterFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(filterFunctionFlagName, filterFunctionFlagDefault, filterFunctionDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelFilterConfigFlags(depth int, m *models.FilterConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, filterFunctionAdded := retrieveFilterConfigFilterFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || filterFunctionAdded + + return nil, retAdded +} + +func retrieveFilterConfigFilterFunctionFlags(depth int, m *models.FilterConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + filterFunctionFlagName := fmt.Sprintf("%v.filterFunction", cmdPrefix) + if cmd.Flags().Changed(filterFunctionFlagName) { + + var filterFunctionFlagName string + if cmdPrefix == "" { + filterFunctionFlagName = "filterFunction" + } else { + filterFunctionFlagName = fmt.Sprintf("%v.filterFunction", cmdPrefix) + } + + filterFunctionFlagValue, err := cmd.Flags().GetString(filterFunctionFlagName) + if err != nil { + return err, false + } + m.FilterFunction = filterFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/force_commit_operation.go b/src/cli/force_commit_operation.go new file mode 100644 index 0000000..68bef8d --- /dev/null +++ b/src/cli/force_commit_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableForceCommitCmd returns a cmd to handle operation forceCommit +func makeOperationTableForceCommitCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "forceCommit", + Short: `Force commit the current segments in consuming state and restart consumption. This should be used after schema/table config changes. Please note that this is an asynchronous operation, and 200 response does not mean it has actually been done already`, + RunE: runOperationTableForceCommit, + } + + if err := registerOperationTableForceCommitParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableForceCommit uses cmd flags to call endpoint api +func runOperationTableForceCommit(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewForceCommitParams() + if err, _ := retrieveOperationTableForceCommitTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableForceCommitResult(appCli.Table.ForceCommit(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableForceCommitParamFlags registers all flags needed to fill params +func registerOperationTableForceCommitParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableForceCommitTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableForceCommitTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableForceCommitTableNameFlag(m *table.ForceCommitParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableForceCommitResult parses request result and return the string content +func parseOperationTableForceCommitResult(resp0 *table.ForceCommitOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.ForceCommitOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/form_data_body_part_model.go b/src/cli/form_data_body_part_model.go new file mode 100644 index 0000000..d6890f2 --- /dev/null +++ b/src/cli/form_data_body_part_model.go @@ -0,0 +1,601 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for FormDataBodyPart + +// register flags to command +func registerModelFormDataBodyPartFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerFormDataBodyPartContentDisposition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartEntity(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartFormDataContentDisposition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartMediaType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartMessageBodyWorkers(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartParameterizedHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartParent(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartProviders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartSimple(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataBodyPartValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataBodyPartContentDisposition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var contentDispositionFlagName string + if cmdPrefix == "" { + contentDispositionFlagName = "contentDisposition" + } else { + contentDispositionFlagName = fmt.Sprintf("%v.contentDisposition", cmdPrefix) + } + + if err := registerModelContentDispositionFlags(depth+1, contentDispositionFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataBodyPartEntity(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: entity interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataBodyPartFormDataContentDisposition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var formDataContentDispositionFlagName string + if cmdPrefix == "" { + formDataContentDispositionFlagName = "formDataContentDisposition" + } else { + formDataContentDispositionFlagName = fmt.Sprintf("%v.formDataContentDisposition", cmdPrefix) + } + + if err := registerModelFormDataContentDispositionFlags(depth+1, formDataContentDispositionFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataBodyPartHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: headers map[string][]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataBodyPartMediaType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var mediaTypeFlagName string + if cmdPrefix == "" { + mediaTypeFlagName = "mediaType" + } else { + mediaTypeFlagName = fmt.Sprintf("%v.mediaType", cmdPrefix) + } + + if err := registerModelMediaTypeFlags(depth+1, mediaTypeFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataBodyPartMessageBodyWorkers(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: messageBodyWorkers MessageBodyWorkers map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataBodyPartName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerFormDataBodyPartParameterizedHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameterizedHeaders map[string][]ParameterizedHeader map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataBodyPartParent(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var parentFlagName string + if cmdPrefix == "" { + parentFlagName = "parent" + } else { + parentFlagName = fmt.Sprintf("%v.parent", cmdPrefix) + } + + if err := registerModelMultiPartFlags(depth+1, parentFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataBodyPartProviders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: providers Providers map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataBodyPartSimple(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + simpleDescription := `` + + var simpleFlagName string + if cmdPrefix == "" { + simpleFlagName = "simple" + } else { + simpleFlagName = fmt.Sprintf("%v.simple", cmdPrefix) + } + + var simpleFlagDefault bool + + _ = cmd.PersistentFlags().Bool(simpleFlagName, simpleFlagDefault, simpleDescription) + + return nil +} + +func registerFormDataBodyPartValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + valueDescription := `` + + var valueFlagName string + if cmdPrefix == "" { + valueFlagName = "value" + } else { + valueFlagName = fmt.Sprintf("%v.value", cmdPrefix) + } + + var valueFlagDefault string + + _ = cmd.PersistentFlags().String(valueFlagName, valueFlagDefault, valueDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelFormDataBodyPartFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, contentDispositionAdded := retrieveFormDataBodyPartContentDispositionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + + err, entityAdded := retrieveFormDataBodyPartEntityFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || entityAdded + + err, formDataContentDispositionAdded := retrieveFormDataBodyPartFormDataContentDispositionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || formDataContentDispositionAdded + + err, headersAdded := retrieveFormDataBodyPartHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || headersAdded + + err, mediaTypeAdded := retrieveFormDataBodyPartMediaTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + + err, messageBodyWorkersAdded := retrieveFormDataBodyPartMessageBodyWorkersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || messageBodyWorkersAdded + + err, nameAdded := retrieveFormDataBodyPartNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, parameterizedHeadersAdded := retrieveFormDataBodyPartParameterizedHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parameterizedHeadersAdded + + err, parentAdded := retrieveFormDataBodyPartParentFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + + err, providersAdded := retrieveFormDataBodyPartProvidersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || providersAdded + + err, simpleAdded := retrieveFormDataBodyPartSimpleFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || simpleAdded + + err, valueAdded := retrieveFormDataBodyPartValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || valueAdded + + return nil, retAdded +} + +func retrieveFormDataBodyPartContentDispositionFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + contentDispositionFlagName := fmt.Sprintf("%v.contentDisposition", cmdPrefix) + if cmd.Flags().Changed(contentDispositionFlagName) { + // info: complex object contentDisposition ContentDisposition is retrieved outside this Changed() block + } + contentDispositionFlagValue := m.ContentDisposition + if swag.IsZero(contentDispositionFlagValue) { + contentDispositionFlagValue = &models.ContentDisposition{} + } + + err, contentDispositionAdded := retrieveModelContentDispositionFlags(depth+1, contentDispositionFlagValue, contentDispositionFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + if contentDispositionAdded { + m.ContentDisposition = contentDispositionFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartEntityFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + entityFlagName := fmt.Sprintf("%v.entity", cmdPrefix) + if cmd.Flags().Changed(entityFlagName) { + // warning: entity map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartFormDataContentDispositionFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + formDataContentDispositionFlagName := fmt.Sprintf("%v.formDataContentDisposition", cmdPrefix) + if cmd.Flags().Changed(formDataContentDispositionFlagName) { + // info: complex object formDataContentDisposition FormDataContentDisposition is retrieved outside this Changed() block + } + formDataContentDispositionFlagValue := m.FormDataContentDisposition + if swag.IsZero(formDataContentDispositionFlagValue) { + formDataContentDispositionFlagValue = &models.FormDataContentDisposition{} + } + + err, formDataContentDispositionAdded := retrieveModelFormDataContentDispositionFlags(depth+1, formDataContentDispositionFlagValue, formDataContentDispositionFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || formDataContentDispositionAdded + if formDataContentDispositionAdded { + m.FormDataContentDisposition = formDataContentDispositionFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartHeadersFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + headersFlagName := fmt.Sprintf("%v.headers", cmdPrefix) + if cmd.Flags().Changed(headersFlagName) { + // warning: headers map type map[string][]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartMediaTypeFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + mediaTypeFlagName := fmt.Sprintf("%v.mediaType", cmdPrefix) + if cmd.Flags().Changed(mediaTypeFlagName) { + // info: complex object mediaType MediaType is retrieved outside this Changed() block + } + mediaTypeFlagValue := m.MediaType + if swag.IsZero(mediaTypeFlagValue) { + mediaTypeFlagValue = &models.MediaType{} + } + + err, mediaTypeAdded := retrieveModelMediaTypeFlags(depth+1, mediaTypeFlagValue, mediaTypeFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + if mediaTypeAdded { + m.MediaType = mediaTypeFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartMessageBodyWorkersFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + messageBodyWorkersFlagName := fmt.Sprintf("%v.messageBodyWorkers", cmdPrefix) + if cmd.Flags().Changed(messageBodyWorkersFlagName) { + // warning: messageBodyWorkers map type MessageBodyWorkers is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartNameFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartParameterizedHeadersFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parameterizedHeadersFlagName := fmt.Sprintf("%v.parameterizedHeaders", cmdPrefix) + if cmd.Flags().Changed(parameterizedHeadersFlagName) { + // warning: parameterizedHeaders map type map[string][]ParameterizedHeader is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartParentFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parentFlagName := fmt.Sprintf("%v.parent", cmdPrefix) + if cmd.Flags().Changed(parentFlagName) { + // info: complex object parent MultiPart is retrieved outside this Changed() block + } + parentFlagValue := m.Parent + if swag.IsZero(parentFlagValue) { + parentFlagValue = &models.MultiPart{} + } + + err, parentAdded := retrieveModelMultiPartFlags(depth+1, parentFlagValue, parentFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + if parentAdded { + m.Parent = parentFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartProvidersFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + providersFlagName := fmt.Sprintf("%v.providers", cmdPrefix) + if cmd.Flags().Changed(providersFlagName) { + // warning: providers map type Providers is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartSimpleFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + simpleFlagName := fmt.Sprintf("%v.simple", cmdPrefix) + if cmd.Flags().Changed(simpleFlagName) { + + var simpleFlagName string + if cmdPrefix == "" { + simpleFlagName = "simple" + } else { + simpleFlagName = fmt.Sprintf("%v.simple", cmdPrefix) + } + + simpleFlagValue, err := cmd.Flags().GetBool(simpleFlagName) + if err != nil { + return err, false + } + m.Simple = simpleFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataBodyPartValueFlags(depth int, m *models.FormDataBodyPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + valueFlagName := fmt.Sprintf("%v.value", cmdPrefix) + if cmd.Flags().Changed(valueFlagName) { + + var valueFlagName string + if cmdPrefix == "" { + valueFlagName = "value" + } else { + valueFlagName = fmt.Sprintf("%v.value", cmdPrefix) + } + + valueFlagValue, err := cmd.Flags().GetString(valueFlagName) + if err != nil { + return err, false + } + m.Value = valueFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/form_data_content_disposition_model.go b/src/cli/form_data_content_disposition_model.go new file mode 100644 index 0000000..1b87e17 --- /dev/null +++ b/src/cli/form_data_content_disposition_model.go @@ -0,0 +1,482 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/strfmt" + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for FormDataContentDisposition + +// register flags to command +func registerModelFormDataContentDispositionFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerFormDataContentDispositionCreationDate(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionFileName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionModificationDate(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionParameters(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionReadDate(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionSize(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataContentDispositionType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataContentDispositionCreationDate(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + creationDateDescription := `` + + var creationDateFlagName string + if cmdPrefix == "" { + creationDateFlagName = "creationDate" + } else { + creationDateFlagName = fmt.Sprintf("%v.creationDate", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(creationDateFlagName, "", creationDateDescription) + + return nil +} + +func registerFormDataContentDispositionFileName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + fileNameDescription := `` + + var fileNameFlagName string + if cmdPrefix == "" { + fileNameFlagName = "fileName" + } else { + fileNameFlagName = fmt.Sprintf("%v.fileName", cmdPrefix) + } + + var fileNameFlagDefault string + + _ = cmd.PersistentFlags().String(fileNameFlagName, fileNameFlagDefault, fileNameDescription) + + return nil +} + +func registerFormDataContentDispositionModificationDate(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + modificationDateDescription := `` + + var modificationDateFlagName string + if cmdPrefix == "" { + modificationDateFlagName = "modificationDate" + } else { + modificationDateFlagName = fmt.Sprintf("%v.modificationDate", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(modificationDateFlagName, "", modificationDateDescription) + + return nil +} + +func registerFormDataContentDispositionName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerFormDataContentDispositionParameters(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameters map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataContentDispositionReadDate(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + readDateDescription := `` + + var readDateFlagName string + if cmdPrefix == "" { + readDateFlagName = "readDate" + } else { + readDateFlagName = fmt.Sprintf("%v.readDate", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(readDateFlagName, "", readDateDescription) + + return nil +} + +func registerFormDataContentDispositionSize(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + sizeDescription := `` + + var sizeFlagName string + if cmdPrefix == "" { + sizeFlagName = "size" + } else { + sizeFlagName = fmt.Sprintf("%v.size", cmdPrefix) + } + + var sizeFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(sizeFlagName, sizeFlagDefault, sizeDescription) + + return nil +} + +func registerFormDataContentDispositionType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + typeDescription := `` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelFormDataContentDispositionFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, creationDateAdded := retrieveFormDataContentDispositionCreationDateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || creationDateAdded + + err, fileNameAdded := retrieveFormDataContentDispositionFileNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fileNameAdded + + err, modificationDateAdded := retrieveFormDataContentDispositionModificationDateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || modificationDateAdded + + err, nameAdded := retrieveFormDataContentDispositionNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, parametersAdded := retrieveFormDataContentDispositionParametersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parametersAdded + + err, readDateAdded := retrieveFormDataContentDispositionReadDateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || readDateAdded + + err, sizeAdded := retrieveFormDataContentDispositionSizeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || sizeAdded + + err, typeAdded := retrieveFormDataContentDispositionTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || typeAdded + + return nil, retAdded +} + +func retrieveFormDataContentDispositionCreationDateFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + creationDateFlagName := fmt.Sprintf("%v.creationDate", cmdPrefix) + if cmd.Flags().Changed(creationDateFlagName) { + + var creationDateFlagName string + if cmdPrefix == "" { + creationDateFlagName = "creationDate" + } else { + creationDateFlagName = fmt.Sprintf("%v.creationDate", cmdPrefix) + } + + creationDateFlagValueStr, err := cmd.Flags().GetString(creationDateFlagName) + if err != nil { + return err, false + } + var creationDateFlagValue strfmt.DateTime + if err := creationDateFlagValue.UnmarshalText([]byte(creationDateFlagValueStr)); err != nil { + return err, false + } + m.CreationDate = creationDateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionFileNameFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fileNameFlagName := fmt.Sprintf("%v.fileName", cmdPrefix) + if cmd.Flags().Changed(fileNameFlagName) { + + var fileNameFlagName string + if cmdPrefix == "" { + fileNameFlagName = "fileName" + } else { + fileNameFlagName = fmt.Sprintf("%v.fileName", cmdPrefix) + } + + fileNameFlagValue, err := cmd.Flags().GetString(fileNameFlagName) + if err != nil { + return err, false + } + m.FileName = fileNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionModificationDateFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + modificationDateFlagName := fmt.Sprintf("%v.modificationDate", cmdPrefix) + if cmd.Flags().Changed(modificationDateFlagName) { + + var modificationDateFlagName string + if cmdPrefix == "" { + modificationDateFlagName = "modificationDate" + } else { + modificationDateFlagName = fmt.Sprintf("%v.modificationDate", cmdPrefix) + } + + modificationDateFlagValueStr, err := cmd.Flags().GetString(modificationDateFlagName) + if err != nil { + return err, false + } + var modificationDateFlagValue strfmt.DateTime + if err := modificationDateFlagValue.UnmarshalText([]byte(modificationDateFlagValueStr)); err != nil { + return err, false + } + m.ModificationDate = modificationDateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionNameFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionParametersFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parametersFlagName := fmt.Sprintf("%v.parameters", cmdPrefix) + if cmd.Flags().Changed(parametersFlagName) { + // warning: parameters map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionReadDateFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + readDateFlagName := fmt.Sprintf("%v.readDate", cmdPrefix) + if cmd.Flags().Changed(readDateFlagName) { + + var readDateFlagName string + if cmdPrefix == "" { + readDateFlagName = "readDate" + } else { + readDateFlagName = fmt.Sprintf("%v.readDate", cmdPrefix) + } + + readDateFlagValueStr, err := cmd.Flags().GetString(readDateFlagName) + if err != nil { + return err, false + } + var readDateFlagValue strfmt.DateTime + if err := readDateFlagValue.UnmarshalText([]byte(readDateFlagValueStr)); err != nil { + return err, false + } + m.ReadDate = readDateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionSizeFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + sizeFlagName := fmt.Sprintf("%v.size", cmdPrefix) + if cmd.Flags().Changed(sizeFlagName) { + + var sizeFlagName string + if cmdPrefix == "" { + sizeFlagName = "size" + } else { + sizeFlagName = fmt.Sprintf("%v.size", cmdPrefix) + } + + sizeFlagValue, err := cmd.Flags().GetInt64(sizeFlagName) + if err != nil { + return err, false + } + m.Size = sizeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveFormDataContentDispositionTypeFlags(depth int, m *models.FormDataContentDisposition, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + typeFlagName := fmt.Sprintf("%v.type", cmdPrefix) + if cmd.Flags().Changed(typeFlagName) { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/form_data_multi_part_model.go b/src/cli/form_data_multi_part_model.go new file mode 100644 index 0000000..3b1a371 --- /dev/null +++ b/src/cli/form_data_multi_part_model.go @@ -0,0 +1,436 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for FormDataMultiPart + +// register flags to command +func registerModelFormDataMultiPartFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerFormDataMultiPartBodyParts(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartContentDisposition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartEntity(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartFields(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartMediaType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartMessageBodyWorkers(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartParameterizedHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartParent(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerFormDataMultiPartProviders(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataMultiPartBodyParts(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: bodyParts []*BodyPart array type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataMultiPartContentDisposition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var contentDispositionFlagName string + if cmdPrefix == "" { + contentDispositionFlagName = "contentDisposition" + } else { + contentDispositionFlagName = fmt.Sprintf("%v.contentDisposition", cmdPrefix) + } + + if err := registerModelContentDispositionFlags(depth+1, contentDispositionFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataMultiPartEntity(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: entity interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataMultiPartFields(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: fields map[string][]FormDataBodyPart map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataMultiPartHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: headers map[string][]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataMultiPartMediaType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var mediaTypeFlagName string + if cmdPrefix == "" { + mediaTypeFlagName = "mediaType" + } else { + mediaTypeFlagName = fmt.Sprintf("%v.mediaType", cmdPrefix) + } + + if err := registerModelMediaTypeFlags(depth+1, mediaTypeFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataMultiPartMessageBodyWorkers(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: messageBodyWorkers MessageBodyWorkers map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataMultiPartParameterizedHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameterizedHeaders map[string][]ParameterizedHeader map type is not supported by go-swagger cli yet + + return nil +} + +func registerFormDataMultiPartParent(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var parentFlagName string + if cmdPrefix == "" { + parentFlagName = "parent" + } else { + parentFlagName = fmt.Sprintf("%v.parent", cmdPrefix) + } + + if err := registerModelMultiPartFlags(depth+1, parentFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerFormDataMultiPartProviders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: providers Providers map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelFormDataMultiPartFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, bodyPartsAdded := retrieveFormDataMultiPartBodyPartsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || bodyPartsAdded + + err, contentDispositionAdded := retrieveFormDataMultiPartContentDispositionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + + err, entityAdded := retrieveFormDataMultiPartEntityFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || entityAdded + + err, fieldsAdded := retrieveFormDataMultiPartFieldsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fieldsAdded + + err, headersAdded := retrieveFormDataMultiPartHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || headersAdded + + err, mediaTypeAdded := retrieveFormDataMultiPartMediaTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + + err, messageBodyWorkersAdded := retrieveFormDataMultiPartMessageBodyWorkersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || messageBodyWorkersAdded + + err, parameterizedHeadersAdded := retrieveFormDataMultiPartParameterizedHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parameterizedHeadersAdded + + err, parentAdded := retrieveFormDataMultiPartParentFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + + err, providersAdded := retrieveFormDataMultiPartProvidersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || providersAdded + + return nil, retAdded +} + +func retrieveFormDataMultiPartBodyPartsFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + bodyPartsFlagName := fmt.Sprintf("%v.bodyParts", cmdPrefix) + if cmd.Flags().Changed(bodyPartsFlagName) { + // warning: bodyParts array type []*BodyPart is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartContentDispositionFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + contentDispositionFlagName := fmt.Sprintf("%v.contentDisposition", cmdPrefix) + if cmd.Flags().Changed(contentDispositionFlagName) { + // info: complex object contentDisposition ContentDisposition is retrieved outside this Changed() block + } + contentDispositionFlagValue := m.ContentDisposition + if swag.IsZero(contentDispositionFlagValue) { + contentDispositionFlagValue = &models.ContentDisposition{} + } + + err, contentDispositionAdded := retrieveModelContentDispositionFlags(depth+1, contentDispositionFlagValue, contentDispositionFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + if contentDispositionAdded { + m.ContentDisposition = contentDispositionFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartEntityFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + entityFlagName := fmt.Sprintf("%v.entity", cmdPrefix) + if cmd.Flags().Changed(entityFlagName) { + // warning: entity map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartFieldsFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fieldsFlagName := fmt.Sprintf("%v.fields", cmdPrefix) + if cmd.Flags().Changed(fieldsFlagName) { + // warning: fields map type map[string][]FormDataBodyPart is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartHeadersFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + headersFlagName := fmt.Sprintf("%v.headers", cmdPrefix) + if cmd.Flags().Changed(headersFlagName) { + // warning: headers map type map[string][]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartMediaTypeFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + mediaTypeFlagName := fmt.Sprintf("%v.mediaType", cmdPrefix) + if cmd.Flags().Changed(mediaTypeFlagName) { + // info: complex object mediaType MediaType is retrieved outside this Changed() block + } + mediaTypeFlagValue := m.MediaType + if swag.IsZero(mediaTypeFlagValue) { + mediaTypeFlagValue = &models.MediaType{} + } + + err, mediaTypeAdded := retrieveModelMediaTypeFlags(depth+1, mediaTypeFlagValue, mediaTypeFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + if mediaTypeAdded { + m.MediaType = mediaTypeFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartMessageBodyWorkersFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + messageBodyWorkersFlagName := fmt.Sprintf("%v.messageBodyWorkers", cmdPrefix) + if cmd.Flags().Changed(messageBodyWorkersFlagName) { + // warning: messageBodyWorkers map type MessageBodyWorkers is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartParameterizedHeadersFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parameterizedHeadersFlagName := fmt.Sprintf("%v.parameterizedHeaders", cmdPrefix) + if cmd.Flags().Changed(parameterizedHeadersFlagName) { + // warning: parameterizedHeaders map type map[string][]ParameterizedHeader is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartParentFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parentFlagName := fmt.Sprintf("%v.parent", cmdPrefix) + if cmd.Flags().Changed(parentFlagName) { + // info: complex object parent MultiPart is retrieved outside this Changed() block + } + parentFlagValue := m.Parent + if swag.IsZero(parentFlagValue) { + parentFlagValue = &models.MultiPart{} + } + + err, parentAdded := retrieveModelMultiPartFlags(depth+1, parentFlagValue, parentFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + if parentAdded { + m.Parent = parentFlagValue + } + + return nil, retAdded +} + +func retrieveFormDataMultiPartProvidersFlags(depth int, m *models.FormDataMultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + providersFlagName := fmt.Sprintf("%v.providers", cmdPrefix) + if cmd.Flags().Changed(providersFlagName) { + // warning: providers map type Providers is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/get_all_instances_operation.go b/src/cli/get_all_instances_operation.go new file mode 100644 index 0000000..2be96b8 --- /dev/null +++ b/src/cli/get_all_instances_operation.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/instance" + + "github.com/spf13/cobra" +) + +// makeOperationInstanceGetAllInstancesCmd returns a cmd to handle operation getAllInstances +func makeOperationInstanceGetAllInstancesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getAllInstances", + Short: ``, + RunE: runOperationInstanceGetAllInstances, + } + + if err := registerOperationInstanceGetAllInstancesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceGetAllInstances uses cmd flags to call endpoint api +func runOperationInstanceGetAllInstances(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewGetAllInstancesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceGetAllInstancesResult(appCli.Instance.GetAllInstances(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceGetAllInstancesParamFlags registers all flags needed to fill params +func registerOperationInstanceGetAllInstancesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationInstanceGetAllInstancesResult parses request result and return the string content +func parseOperationInstanceGetAllInstancesResult(resp0 *instance.GetAllInstancesOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getAllInstancesOK is not supported + + // Non schema case: warning getAllInstancesInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getAllInstancesOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_all_tenants_operation.go b/src/cli/get_all_tenants_operation.go new file mode 100644 index 0000000..7f259d8 --- /dev/null +++ b/src/cli/get_all_tenants_operation.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tenant" + + "github.com/spf13/cobra" +) + +// makeOperationTenantGetAllTenantsCmd returns a cmd to handle operation getAllTenants +func makeOperationTenantGetAllTenantsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getAllTenants", + Short: ``, + RunE: runOperationTenantGetAllTenants, + } + + if err := registerOperationTenantGetAllTenantsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantGetAllTenants uses cmd flags to call endpoint api +func runOperationTenantGetAllTenants(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewGetAllTenantsParams() + if err, _ := retrieveOperationTenantGetAllTenantsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantGetAllTenantsResult(appCli.Tenant.GetAllTenants(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantGetAllTenantsParamFlags registers all flags needed to fill params +func registerOperationTenantGetAllTenantsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantGetAllTenantsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantGetAllTenantsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["BROKER","SERVER"]. Tenant type` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["BROKER","SERVER"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTenantGetAllTenantsTypeFlag(m *tenant.GetAllTenantsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTenantGetAllTenantsResult parses request result and return the string content +func parseOperationTenantGetAllTenantsResult(resp0 *tenant.GetAllTenantsOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getAllTenantsOK is not supported + + // Non schema case: warning getAllTenantsInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getAllTenantsOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_app_configs_operation.go b/src/cli/get_app_configs_operation.go new file mode 100644 index 0000000..31879a9 --- /dev/null +++ b/src/cli/get_app_configs_operation.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/app_configs" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationAppConfigsGetAppConfigsCmd returns a cmd to handle operation getAppConfigs +func makeOperationAppConfigsGetAppConfigsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getAppConfigs", + Short: ``, + RunE: runOperationAppConfigsGetAppConfigs, + } + + if err := registerOperationAppConfigsGetAppConfigsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationAppConfigsGetAppConfigs uses cmd flags to call endpoint api +func runOperationAppConfigsGetAppConfigs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := app_configs.NewGetAppConfigsParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationAppConfigsGetAppConfigsResult(appCli.AppConfigs.GetAppConfigs(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationAppConfigsGetAppConfigsParamFlags registers all flags needed to fill params +func registerOperationAppConfigsGetAppConfigsParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationAppConfigsGetAppConfigsResult parses request result and return the string content +func parseOperationAppConfigsGetAppConfigsResult(resp0 *app_configs.GetAppConfigsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*app_configs.GetAppConfigsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_brokers_for_table_operation.go b/src/cli/get_brokers_for_table_operation.go new file mode 100644 index 0000000..5d82173 --- /dev/null +++ b/src/cli/get_brokers_for_table_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetBrokersForTableCmd returns a cmd to handle operation getBrokersForTable +func makeOperationBrokerGetBrokersForTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getBrokersForTable", + Short: `List brokers for a given table`, + RunE: runOperationBrokerGetBrokersForTable, + } + + if err := registerOperationBrokerGetBrokersForTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetBrokersForTable uses cmd flags to call endpoint api +func runOperationBrokerGetBrokersForTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetBrokersForTableParams() + if err, _ := retrieveOperationBrokerGetBrokersForTableStateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerGetBrokersForTableTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerGetBrokersForTableTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetBrokersForTableResult(appCli.Broker.GetBrokersForTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetBrokersForTableParamFlags registers all flags needed to fill params +func registerOperationBrokerGetBrokersForTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetBrokersForTableStateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerGetBrokersForTableTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerGetBrokersForTableTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetBrokersForTableStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationBrokerGetBrokersForTableTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationBrokerGetBrokersForTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationBrokerGetBrokersForTableStateFlag(m *broker.GetBrokersForTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerGetBrokersForTableTableNameFlag(m *broker.GetBrokersForTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerGetBrokersForTableTypeFlag(m *broker.GetBrokersForTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetBrokersForTableResult parses request result and return the string content +func parseOperationBrokerGetBrokersForTableResult(resp0 *broker.GetBrokersForTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetBrokersForTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_brokers_for_table_v2_operation.go b/src/cli/get_brokers_for_table_v2_operation.go new file mode 100644 index 0000000..1676984 --- /dev/null +++ b/src/cli/get_brokers_for_table_v2_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetBrokersForTableV2Cmd returns a cmd to handle operation getBrokersForTableV2 +func makeOperationBrokerGetBrokersForTableV2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getBrokersForTableV2", + Short: `List brokers for a given table`, + RunE: runOperationBrokerGetBrokersForTableV2, + } + + if err := registerOperationBrokerGetBrokersForTableV2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetBrokersForTableV2 uses cmd flags to call endpoint api +func runOperationBrokerGetBrokersForTableV2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetBrokersForTableV2Params() + if err, _ := retrieveOperationBrokerGetBrokersForTableV2StateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerGetBrokersForTableV2TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerGetBrokersForTableV2TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetBrokersForTableV2Result(appCli.Broker.GetBrokersForTableV2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetBrokersForTableV2ParamFlags registers all flags needed to fill params +func registerOperationBrokerGetBrokersForTableV2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetBrokersForTableV2StateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerGetBrokersForTableV2TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerGetBrokersForTableV2TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetBrokersForTableV2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationBrokerGetBrokersForTableV2TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationBrokerGetBrokersForTableV2TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationBrokerGetBrokersForTableV2StateFlag(m *broker.GetBrokersForTableV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerGetBrokersForTableV2TableNameFlag(m *broker.GetBrokersForTableV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerGetBrokersForTableV2TypeFlag(m *broker.GetBrokersForTableV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetBrokersForTableV2Result parses request result and return the string content +func parseOperationBrokerGetBrokersForTableV2Result(resp0 *broker.GetBrokersForTableV2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetBrokersForTableV2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_brokers_for_tenant_operation.go b/src/cli/get_brokers_for_tenant_operation.go new file mode 100644 index 0000000..805154a --- /dev/null +++ b/src/cli/get_brokers_for_tenant_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetBrokersForTenantCmd returns a cmd to handle operation getBrokersForTenant +func makeOperationBrokerGetBrokersForTenantCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getBrokersForTenant", + Short: `List brokers for a given tenant`, + RunE: runOperationBrokerGetBrokersForTenant, + } + + if err := registerOperationBrokerGetBrokersForTenantParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetBrokersForTenant uses cmd flags to call endpoint api +func runOperationBrokerGetBrokersForTenant(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetBrokersForTenantParams() + if err, _ := retrieveOperationBrokerGetBrokersForTenantStateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerGetBrokersForTenantTenantNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetBrokersForTenantResult(appCli.Broker.GetBrokersForTenant(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetBrokersForTenantParamFlags registers all flags needed to fill params +func registerOperationBrokerGetBrokersForTenantParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetBrokersForTenantStateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerGetBrokersForTenantTenantNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetBrokersForTenantStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationBrokerGetBrokersForTenantTenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Name of the tenant` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} + +func retrieveOperationBrokerGetBrokersForTenantStateFlag(m *broker.GetBrokersForTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerGetBrokersForTenantTenantNameFlag(m *broker.GetBrokersForTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetBrokersForTenantResult parses request result and return the string content +func parseOperationBrokerGetBrokersForTenantResult(resp0 *broker.GetBrokersForTenantOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetBrokersForTenantOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_brokers_for_tenant_v2_operation.go b/src/cli/get_brokers_for_tenant_v2_operation.go new file mode 100644 index 0000000..e439df7 --- /dev/null +++ b/src/cli/get_brokers_for_tenant_v2_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetBrokersForTenantV2Cmd returns a cmd to handle operation getBrokersForTenantV2 +func makeOperationBrokerGetBrokersForTenantV2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getBrokersForTenantV2", + Short: `List brokers for a given tenant`, + RunE: runOperationBrokerGetBrokersForTenantV2, + } + + if err := registerOperationBrokerGetBrokersForTenantV2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetBrokersForTenantV2 uses cmd flags to call endpoint api +func runOperationBrokerGetBrokersForTenantV2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetBrokersForTenantV2Params() + if err, _ := retrieveOperationBrokerGetBrokersForTenantV2StateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerGetBrokersForTenantV2TenantNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetBrokersForTenantV2Result(appCli.Broker.GetBrokersForTenantV2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetBrokersForTenantV2ParamFlags registers all flags needed to fill params +func registerOperationBrokerGetBrokersForTenantV2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetBrokersForTenantV2StateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerGetBrokersForTenantV2TenantNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetBrokersForTenantV2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationBrokerGetBrokersForTenantV2TenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Name of the tenant` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} + +func retrieveOperationBrokerGetBrokersForTenantV2StateFlag(m *broker.GetBrokersForTenantV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerGetBrokersForTenantV2TenantNameFlag(m *broker.GetBrokersForTenantV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetBrokersForTenantV2Result parses request result and return the string content +func parseOperationBrokerGetBrokersForTenantV2Result(resp0 *broker.GetBrokersForTenantV2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetBrokersForTenantV2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_children_operation.go b/src/cli/get_children_operation.go new file mode 100644 index 0000000..22a6965 --- /dev/null +++ b/src/cli/get_children_operation.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperGetChildrenCmd returns a cmd to handle operation getChildren +func makeOperationZookeeperGetChildrenCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getChildren", + Short: ``, + RunE: runOperationZookeeperGetChildren, + } + + if err := registerOperationZookeeperGetChildrenParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperGetChildren uses cmd flags to call endpoint api +func runOperationZookeeperGetChildren(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewGetChildrenParams() + if err, _ := retrieveOperationZookeeperGetChildrenPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperGetChildrenResult(appCli.Zookeeper.GetChildren(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperGetChildrenParamFlags registers all flags needed to fill params +func registerOperationZookeeperGetChildrenParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperGetChildrenPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperGetChildrenPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperGetChildrenPathFlag(m *zookeeper.GetChildrenParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperGetChildrenResult parses request result and return the string content +func parseOperationZookeeperGetChildrenResult(resp0 *zookeeper.GetChildrenOK, resp1 *zookeeper.GetChildrenNoContent, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getChildrenOK is not supported + + // Non schema case: warning getChildrenNoContent is not supported + + // Non schema case: warning getChildrenNotFound is not supported + + // Non schema case: warning getChildrenInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getChildrenOK is not supported by go-swagger cli yet. + + // warning: non schema response getChildrenNoContent is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_cluster_health_details_operation.go b/src/cli/get_cluster_health_details_operation.go new file mode 100644 index 0000000..21a8461 --- /dev/null +++ b/src/cli/get_cluster_health_details_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/cluster_health" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationClusterHealthGetClusterHealthDetailsCmd returns a cmd to handle operation getClusterHealthDetails +func makeOperationClusterHealthGetClusterHealthDetailsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getClusterHealthDetails", + Short: ``, + RunE: runOperationClusterHealthGetClusterHealthDetails, + } + + if err := registerOperationClusterHealthGetClusterHealthDetailsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterHealthGetClusterHealthDetails uses cmd flags to call endpoint api +func runOperationClusterHealthGetClusterHealthDetails(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster_health.NewGetClusterHealthDetailsParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterHealthGetClusterHealthDetailsResult(appCli.ClusterHealth.GetClusterHealthDetails(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterHealthGetClusterHealthDetailsParamFlags registers all flags needed to fill params +func registerOperationClusterHealthGetClusterHealthDetailsParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationClusterHealthGetClusterHealthDetailsResult parses request result and return the string content +func parseOperationClusterHealthGetClusterHealthDetailsResult(resp0 *cluster_health.GetClusterHealthDetailsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*cluster_health.GetClusterHealthDetailsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_cluster_info_operation.go b/src/cli/get_cluster_info_operation.go new file mode 100644 index 0000000..8256948 --- /dev/null +++ b/src/cli/get_cluster_info_operation.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/cluster" + + "github.com/spf13/cobra" +) + +// makeOperationClusterGetClusterInfoCmd returns a cmd to handle operation getClusterInfo +func makeOperationClusterGetClusterInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getClusterInfo", + Short: `Get cluster Info`, + RunE: runOperationClusterGetClusterInfo, + } + + if err := registerOperationClusterGetClusterInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterGetClusterInfo uses cmd flags to call endpoint api +func runOperationClusterGetClusterInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster.NewGetClusterInfoParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterGetClusterInfoResult(appCli.Cluster.GetClusterInfo(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterGetClusterInfoParamFlags registers all flags needed to fill params +func registerOperationClusterGetClusterInfoParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationClusterGetClusterInfoResult parses request result and return the string content +func parseOperationClusterGetClusterInfoResult(resp0 *cluster.GetClusterInfoOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getClusterInfoOK is not supported + + // Non schema case: warning getClusterInfoInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getClusterInfoOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_config_operation.go b/src/cli/get_config_operation.go new file mode 100644 index 0000000..16309d9 --- /dev/null +++ b/src/cli/get_config_operation.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetConfigCmd returns a cmd to handle operation getConfig +func makeOperationTableGetConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getConfig", + Short: `Get the TableConfigs for a given raw tableName`, + RunE: runOperationTableGetConfig, + } + + if err := registerOperationTableGetConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetConfig uses cmd flags to call endpoint api +func runOperationTableGetConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetConfigParams() + if err, _ := retrieveOperationTableGetConfigTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetConfigResult(appCli.Table.GetConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetConfigParamFlags registers all flags needed to fill params +func registerOperationTableGetConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetConfigTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetConfigTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Raw table name` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableGetConfigTableNameFlag(m *table.GetConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetConfigResult parses request result and return the string content +func parseOperationTableGetConfigResult(resp0 *table.GetConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_consuming_segments_info_operation.go b/src/cli/get_consuming_segments_info_operation.go new file mode 100644 index 0000000..1a25c3a --- /dev/null +++ b/src/cli/get_consuming_segments_info_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableGetConsumingSegmentsInfoCmd returns a cmd to handle operation getConsumingSegmentsInfo +func makeOperationTableGetConsumingSegmentsInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getConsumingSegmentsInfo", + Short: `Gets the status of consumers from all servers.Note that the partitionToOffsetMap has been deprecated and will be removed in the next release. The info is now embedded within each partition's state as currentOffsetsMap.`, + RunE: runOperationTableGetConsumingSegmentsInfo, + } + + if err := registerOperationTableGetConsumingSegmentsInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetConsumingSegmentsInfo uses cmd flags to call endpoint api +func runOperationTableGetConsumingSegmentsInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetConsumingSegmentsInfoParams() + if err, _ := retrieveOperationTableGetConsumingSegmentsInfoTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetConsumingSegmentsInfoResult(appCli.Table.GetConsumingSegmentsInfo(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetConsumingSegmentsInfoParamFlags registers all flags needed to fill params +func registerOperationTableGetConsumingSegmentsInfoParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetConsumingSegmentsInfoTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetConsumingSegmentsInfoTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Realtime table name with or without type` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableGetConsumingSegmentsInfoTableNameFlag(m *table.GetConsumingSegmentsInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetConsumingSegmentsInfoResult parses request result and return the string content +func parseOperationTableGetConsumingSegmentsInfoResult(resp0 *table.GetConsumingSegmentsInfoOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getConsumingSegmentsInfoOK is not supported + + // Non schema case: warning getConsumingSegmentsInfoNotFound is not supported + + // Non schema case: warning getConsumingSegmentsInfoInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getConsumingSegmentsInfoOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_controller_jobs_operation.go b/src/cli/get_controller_jobs_operation.go new file mode 100644 index 0000000..8352c97 --- /dev/null +++ b/src/cli/get_controller_jobs_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetControllerJobsCmd returns a cmd to handle operation getControllerJobs +func makeOperationTableGetControllerJobsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getControllerJobs", + Short: `Get list of controller jobs for this table`, + RunE: runOperationTableGetControllerJobs, + } + + if err := registerOperationTableGetControllerJobsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetControllerJobs uses cmd flags to call endpoint api +func runOperationTableGetControllerJobs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetControllerJobsParams() + if err, _ := retrieveOperationTableGetControllerJobsJobTypesFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetControllerJobsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetControllerJobsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetControllerJobsResult(appCli.Table.GetControllerJobs(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetControllerJobsParamFlags registers all flags needed to fill params +func registerOperationTableGetControllerJobsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetControllerJobsJobTypesParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetControllerJobsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetControllerJobsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetControllerJobsJobTypesParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + jobTypesDescription := `Comma separated list of job types` + + var jobTypesFlagName string + if cmdPrefix == "" { + jobTypesFlagName = "jobTypes" + } else { + jobTypesFlagName = fmt.Sprintf("%v.jobTypes", cmdPrefix) + } + + var jobTypesFlagDefault string + + _ = cmd.PersistentFlags().String(jobTypesFlagName, jobTypesFlagDefault, jobTypesDescription) + + return nil +} +func registerOperationTableGetControllerJobsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetControllerJobsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableGetControllerJobsJobTypesFlag(m *table.GetControllerJobsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("jobTypes") { + + var jobTypesFlagName string + if cmdPrefix == "" { + jobTypesFlagName = "jobTypes" + } else { + jobTypesFlagName = fmt.Sprintf("%v.jobTypes", cmdPrefix) + } + + jobTypesFlagValue, err := cmd.Flags().GetString(jobTypesFlagName) + if err != nil { + return err, false + } + m.JobTypes = &jobTypesFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetControllerJobsTableNameFlag(m *table.GetControllerJobsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetControllerJobsTypeFlag(m *table.GetControllerJobsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetControllerJobsResult parses request result and return the string content +func parseOperationTableGetControllerJobsResult(resp0 *table.GetControllerJobsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetControllerJobsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_cron_scheduler_information_operation.go b/src/cli/get_cron_scheduler_information_operation.go new file mode 100644 index 0000000..02ef8b8 --- /dev/null +++ b/src/cli/get_cron_scheduler_information_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetCronSchedulerInformationCmd returns a cmd to handle operation getCronSchedulerInformation +func makeOperationTaskGetCronSchedulerInformationCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getCronSchedulerInformation", + Short: ``, + RunE: runOperationTaskGetCronSchedulerInformation, + } + + if err := registerOperationTaskGetCronSchedulerInformationParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetCronSchedulerInformation uses cmd flags to call endpoint api +func runOperationTaskGetCronSchedulerInformation(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetCronSchedulerInformationParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetCronSchedulerInformationResult(appCli.Task.GetCronSchedulerInformation(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetCronSchedulerInformationParamFlags registers all flags needed to fill params +func registerOperationTaskGetCronSchedulerInformationParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTaskGetCronSchedulerInformationResult parses request result and return the string content +func parseOperationTaskGetCronSchedulerInformationResult(resp0 *task.GetCronSchedulerInformationOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetCronSchedulerInformationOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_cron_scheduler_job_details_operation.go b/src/cli/get_cron_scheduler_job_details_operation.go new file mode 100644 index 0000000..64bfc1b --- /dev/null +++ b/src/cli/get_cron_scheduler_job_details_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetCronSchedulerJobDetailsCmd returns a cmd to handle operation getCronSchedulerJobDetails +func makeOperationTaskGetCronSchedulerJobDetailsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getCronSchedulerJobDetails", + Short: ``, + RunE: runOperationTaskGetCronSchedulerJobDetails, + } + + if err := registerOperationTaskGetCronSchedulerJobDetailsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetCronSchedulerJobDetails uses cmd flags to call endpoint api +func runOperationTaskGetCronSchedulerJobDetails(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetCronSchedulerJobDetailsParams() + if err, _ := retrieveOperationTaskGetCronSchedulerJobDetailsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetCronSchedulerJobDetailsTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetCronSchedulerJobDetailsResult(appCli.Task.GetCronSchedulerJobDetails(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetCronSchedulerJobDetailsParamFlags registers all flags needed to fill params +func registerOperationTaskGetCronSchedulerJobDetailsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetCronSchedulerJobDetailsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetCronSchedulerJobDetailsTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetCronSchedulerJobDetailsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Table name (with type suffix)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTaskGetCronSchedulerJobDetailsTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetCronSchedulerJobDetailsTableNameFlag(m *task.GetCronSchedulerJobDetailsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = &tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetCronSchedulerJobDetailsTaskTypeFlag(m *task.GetCronSchedulerJobDetailsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = &taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetCronSchedulerJobDetailsResult parses request result and return the string content +func parseOperationTaskGetCronSchedulerJobDetailsResult(resp0 *task.GetCronSchedulerJobDetailsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetCronSchedulerJobDetailsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_cron_scheduler_job_keys_operation.go b/src/cli/get_cron_scheduler_job_keys_operation.go new file mode 100644 index 0000000..2b7b050 --- /dev/null +++ b/src/cli/get_cron_scheduler_job_keys_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetCronSchedulerJobKeysCmd returns a cmd to handle operation getCronSchedulerJobKeys +func makeOperationTaskGetCronSchedulerJobKeysCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getCronSchedulerJobKeys", + Short: ``, + RunE: runOperationTaskGetCronSchedulerJobKeys, + } + + if err := registerOperationTaskGetCronSchedulerJobKeysParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetCronSchedulerJobKeys uses cmd flags to call endpoint api +func runOperationTaskGetCronSchedulerJobKeys(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetCronSchedulerJobKeysParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetCronSchedulerJobKeysResult(appCli.Task.GetCronSchedulerJobKeys(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetCronSchedulerJobKeysParamFlags registers all flags needed to fill params +func registerOperationTaskGetCronSchedulerJobKeysParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTaskGetCronSchedulerJobKeysResult parses request result and return the string content +func parseOperationTaskGetCronSchedulerJobKeysResult(resp0 *task.GetCronSchedulerJobKeysOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetCronSchedulerJobKeysOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_data_operation.go b/src/cli/get_data_operation.go new file mode 100644 index 0000000..f3158b0 --- /dev/null +++ b/src/cli/get_data_operation.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperGetDataCmd returns a cmd to handle operation getData +func makeOperationZookeeperGetDataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getData", + Short: ``, + RunE: runOperationZookeeperGetData, + } + + if err := registerOperationZookeeperGetDataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperGetData uses cmd flags to call endpoint api +func runOperationZookeeperGetData(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewGetDataParams() + if err, _ := retrieveOperationZookeeperGetDataPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperGetDataResult(appCli.Zookeeper.GetData(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperGetDataParamFlags registers all flags needed to fill params +func registerOperationZookeeperGetDataParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperGetDataPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperGetDataPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperGetDataPathFlag(m *zookeeper.GetDataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperGetDataResult parses request result and return the string content +func parseOperationZookeeperGetDataResult(resp0 *zookeeper.GetDataOK, resp1 *zookeeper.GetDataNoContent, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getDataOK is not supported + + // Non schema case: warning getDataNoContent is not supported + + // Non schema case: warning getDataNotFound is not supported + + // Non schema case: warning getDataInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getDataOK is not supported by go-swagger cli yet. + + // warning: non schema response getDataNoContent is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_external_view_operation.go b/src/cli/get_external_view_operation.go new file mode 100644 index 0000000..e4a3533 --- /dev/null +++ b/src/cli/get_external_view_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetExternalViewCmd returns a cmd to handle operation getExternalView +func makeOperationTableGetExternalViewCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getExternalView", + Short: `Get table external view`, + RunE: runOperationTableGetExternalView, + } + + if err := registerOperationTableGetExternalViewParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetExternalView uses cmd flags to call endpoint api +func runOperationTableGetExternalView(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetExternalViewParams() + if err, _ := retrieveOperationTableGetExternalViewTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetExternalViewTableTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetExternalViewResult(appCli.Table.GetExternalView(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetExternalViewParamFlags registers all flags needed to fill params +func registerOperationTableGetExternalViewParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetExternalViewTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetExternalViewTableTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetExternalViewTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetExternalViewTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `realtime|offline` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} + +func retrieveOperationTableGetExternalViewTableNameFlag(m *table.GetExternalViewParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetExternalViewTableTypeFlag(m *table.GetExternalViewParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = &tableTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetExternalViewResult parses request result and return the string content +func parseOperationTableGetExternalViewResult(resp0 *table.GetExternalViewOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetExternalViewOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_force_commit_job_status_operation.go b/src/cli/get_force_commit_job_status_operation.go new file mode 100644 index 0000000..bb44ff2 --- /dev/null +++ b/src/cli/get_force_commit_job_status_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetForceCommitJobStatusCmd returns a cmd to handle operation getForceCommitJobStatus +func makeOperationTableGetForceCommitJobStatusCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getForceCommitJobStatus", + Short: `Get status for a submitted force commit operation`, + RunE: runOperationTableGetForceCommitJobStatus, + } + + if err := registerOperationTableGetForceCommitJobStatusParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetForceCommitJobStatus uses cmd flags to call endpoint api +func runOperationTableGetForceCommitJobStatus(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetForceCommitJobStatusParams() + if err, _ := retrieveOperationTableGetForceCommitJobStatusJobIDFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetForceCommitJobStatusResult(appCli.Table.GetForceCommitJobStatus(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetForceCommitJobStatusParamFlags registers all flags needed to fill params +func registerOperationTableGetForceCommitJobStatusParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetForceCommitJobStatusJobIDParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetForceCommitJobStatusJobIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + jobIdDescription := `Required. Force commit job id` + + var jobIdFlagName string + if cmdPrefix == "" { + jobIdFlagName = "jobId" + } else { + jobIdFlagName = fmt.Sprintf("%v.jobId", cmdPrefix) + } + + var jobIdFlagDefault string + + _ = cmd.PersistentFlags().String(jobIdFlagName, jobIdFlagDefault, jobIdDescription) + + return nil +} + +func retrieveOperationTableGetForceCommitJobStatusJobIDFlag(m *table.GetForceCommitJobStatusParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("jobId") { + + var jobIdFlagName string + if cmdPrefix == "" { + jobIdFlagName = "jobId" + } else { + jobIdFlagName = fmt.Sprintf("%v.jobId", cmdPrefix) + } + + jobIdFlagValue, err := cmd.Flags().GetString(jobIdFlagName) + if err != nil { + return err, false + } + m.JobID = jobIdFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetForceCommitJobStatusResult parses request result and return the string content +func parseOperationTableGetForceCommitJobStatusResult(resp0 *table.GetForceCommitJobStatusOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetForceCommitJobStatusOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_ideal_state_operation.go b/src/cli/get_ideal_state_operation.go new file mode 100644 index 0000000..66359de --- /dev/null +++ b/src/cli/get_ideal_state_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetIdealStateCmd returns a cmd to handle operation getIdealState +func makeOperationTableGetIdealStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getIdealState", + Short: `Get table ideal state`, + RunE: runOperationTableGetIdealState, + } + + if err := registerOperationTableGetIdealStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetIdealState uses cmd flags to call endpoint api +func runOperationTableGetIdealState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetIdealStateParams() + if err, _ := retrieveOperationTableGetIdealStateTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetIdealStateTableTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetIdealStateResult(appCli.Table.GetIdealState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetIdealStateParamFlags registers all flags needed to fill params +func registerOperationTableGetIdealStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetIdealStateTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetIdealStateTableTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetIdealStateTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetIdealStateTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `realtime|offline` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} + +func retrieveOperationTableGetIdealStateTableNameFlag(m *table.GetIdealStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetIdealStateTableTypeFlag(m *table.GetIdealStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = &tableTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetIdealStateResult parses request result and return the string content +func parseOperationTableGetIdealStateResult(resp0 *table.GetIdealStateOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetIdealStateOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_instance_operation.go b/src/cli/get_instance_operation.go new file mode 100644 index 0000000..df814cd --- /dev/null +++ b/src/cli/get_instance_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/instance" + + "github.com/spf13/cobra" +) + +// makeOperationInstanceGetInstanceCmd returns a cmd to handle operation getInstance +func makeOperationInstanceGetInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getInstance", + Short: ``, + RunE: runOperationInstanceGetInstance, + } + + if err := registerOperationInstanceGetInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceGetInstance uses cmd flags to call endpoint api +func runOperationInstanceGetInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewGetInstanceParams() + if err, _ := retrieveOperationInstanceGetInstanceInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceGetInstanceResult(appCli.Instance.GetInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceGetInstanceParamFlags registers all flags needed to fill params +func registerOperationInstanceGetInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceGetInstanceInstanceNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceGetInstanceInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func retrieveOperationInstanceGetInstanceInstanceNameFlag(m *instance.GetInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceGetInstanceResult parses request result and return the string content +func parseOperationInstanceGetInstanceResult(resp0 *instance.GetInstanceOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getInstanceOK is not supported + + // Non schema case: warning getInstanceNotFound is not supported + + // Non schema case: warning getInstanceInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getInstanceOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_instance_partitions_operation.go b/src/cli/get_instance_partitions_operation.go new file mode 100644 index 0000000..5a0a686 --- /dev/null +++ b/src/cli/get_instance_partitions_operation.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetInstancePartitionsCmd returns a cmd to handle operation getInstancePartitions +func makeOperationTableGetInstancePartitionsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getInstancePartitions", + Short: ``, + RunE: runOperationTableGetInstancePartitions, + } + + if err := registerOperationTableGetInstancePartitionsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetInstancePartitions uses cmd flags to call endpoint api +func runOperationTableGetInstancePartitions(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetInstancePartitionsParams() + if err, _ := retrieveOperationTableGetInstancePartitionsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetInstancePartitionsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetInstancePartitionsResult(appCli.Table.GetInstancePartitions(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetInstancePartitionsParamFlags registers all flags needed to fill params +func registerOperationTableGetInstancePartitionsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetInstancePartitionsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetInstancePartitionsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetInstancePartitionsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetInstancePartitionsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["OFFLINE","CONSUMING","COMPLETED"]. OFFLINE|CONSUMING|COMPLETED` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["OFFLINE","CONSUMING","COMPLETED"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTableGetInstancePartitionsTableNameFlag(m *table.GetInstancePartitionsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetInstancePartitionsTypeFlag(m *table.GetInstancePartitionsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetInstancePartitionsResult parses request result and return the string content +func parseOperationTableGetInstancePartitionsResult(resp0 *table.GetInstancePartitionsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetInstancePartitionsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_leader_for_table_operation.go b/src/cli/get_leader_for_table_operation.go new file mode 100644 index 0000000..1b9f5e9 --- /dev/null +++ b/src/cli/get_leader_for_table_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/leader" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLeaderGetLeaderForTableCmd returns a cmd to handle operation getLeaderForTable +func makeOperationLeaderGetLeaderForTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLeaderForTable", + Short: `Gets leader for a given table`, + RunE: runOperationLeaderGetLeaderForTable, + } + + if err := registerOperationLeaderGetLeaderForTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLeaderGetLeaderForTable uses cmd flags to call endpoint api +func runOperationLeaderGetLeaderForTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := leader.NewGetLeaderForTableParams() + if err, _ := retrieveOperationLeaderGetLeaderForTableTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLeaderGetLeaderForTableResult(appCli.Leader.GetLeaderForTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLeaderGetLeaderForTableParamFlags registers all flags needed to fill params +func registerOperationLeaderGetLeaderForTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationLeaderGetLeaderForTableTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationLeaderGetLeaderForTableTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationLeaderGetLeaderForTableTableNameFlag(m *leader.GetLeaderForTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationLeaderGetLeaderForTableResult parses request result and return the string content +func parseOperationLeaderGetLeaderForTableResult(resp0 *leader.GetLeaderForTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*leader.GetLeaderForTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_leaders_for_all_tables_operation.go b/src/cli/get_leaders_for_all_tables_operation.go new file mode 100644 index 0000000..b77429f --- /dev/null +++ b/src/cli/get_leaders_for_all_tables_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/leader" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLeaderGetLeadersForAllTablesCmd returns a cmd to handle operation getLeadersForAllTables +func makeOperationLeaderGetLeadersForAllTablesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLeadersForAllTables", + Short: `Gets leaders for all tables`, + RunE: runOperationLeaderGetLeadersForAllTables, + } + + if err := registerOperationLeaderGetLeadersForAllTablesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLeaderGetLeadersForAllTables uses cmd flags to call endpoint api +func runOperationLeaderGetLeadersForAllTables(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := leader.NewGetLeadersForAllTablesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLeaderGetLeadersForAllTablesResult(appCli.Leader.GetLeadersForAllTables(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLeaderGetLeadersForAllTablesParamFlags registers all flags needed to fill params +func registerOperationLeaderGetLeadersForAllTablesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationLeaderGetLeadersForAllTablesResult parses request result and return the string content +func parseOperationLeaderGetLeadersForAllTablesResult(resp0 *leader.GetLeadersForAllTablesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*leader.GetLeadersForAllTablesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_live_brokers_for_table_operation.go b/src/cli/get_live_brokers_for_table_operation.go new file mode 100644 index 0000000..9b0eb44 --- /dev/null +++ b/src/cli/get_live_brokers_for_table_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableGetLiveBrokersForTableCmd returns a cmd to handle operation getLiveBrokersForTable +func makeOperationTableGetLiveBrokersForTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLiveBrokersForTable", + Short: `List live brokers of the given table based on EV`, + RunE: runOperationTableGetLiveBrokersForTable, + } + + if err := registerOperationTableGetLiveBrokersForTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetLiveBrokersForTable uses cmd flags to call endpoint api +func runOperationTableGetLiveBrokersForTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetLiveBrokersForTableParams() + if err, _ := retrieveOperationTableGetLiveBrokersForTableTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetLiveBrokersForTableResult(appCli.Table.GetLiveBrokersForTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetLiveBrokersForTableParamFlags registers all flags needed to fill params +func registerOperationTableGetLiveBrokersForTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetLiveBrokersForTableTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetLiveBrokersForTableTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name (with or without type)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableGetLiveBrokersForTableTableNameFlag(m *table.GetLiveBrokersForTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetLiveBrokersForTableResult parses request result and return the string content +func parseOperationTableGetLiveBrokersForTableResult(resp0 *table.GetLiveBrokersForTableOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getLiveBrokersForTableOK is not supported + + // Non schema case: warning getLiveBrokersForTableNotFound is not supported + + // Non schema case: warning getLiveBrokersForTableInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getLiveBrokersForTableOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_live_brokers_operation.go b/src/cli/get_live_brokers_operation.go new file mode 100644 index 0000000..46d63e6 --- /dev/null +++ b/src/cli/get_live_brokers_operation.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableGetLiveBrokersCmd returns a cmd to handle operation getLiveBrokers +func makeOperationTableGetLiveBrokersCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLiveBrokers", + Short: `List tables to live brokers mappings based on EV`, + RunE: runOperationTableGetLiveBrokers, + } + + if err := registerOperationTableGetLiveBrokersParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetLiveBrokers uses cmd flags to call endpoint api +func runOperationTableGetLiveBrokers(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetLiveBrokersParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetLiveBrokersResult(appCli.Table.GetLiveBrokers(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetLiveBrokersParamFlags registers all flags needed to fill params +func registerOperationTableGetLiveBrokersParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTableGetLiveBrokersResult parses request result and return the string content +func parseOperationTableGetLiveBrokersResult(resp0 *table.GetLiveBrokersOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getLiveBrokersOK is not supported + + // Non schema case: warning getLiveBrokersInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getLiveBrokersOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_local_log_files_operation.go b/src/cli/get_local_log_files_operation.go new file mode 100644 index 0000000..67cc2c9 --- /dev/null +++ b/src/cli/get_local_log_files_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLoggerGetLocalLogFilesCmd returns a cmd to handle operation getLocalLogFiles +func makeOperationLoggerGetLocalLogFilesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLocalLogFiles", + Short: ``, + RunE: runOperationLoggerGetLocalLogFiles, + } + + if err := registerOperationLoggerGetLocalLogFilesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerGetLocalLogFiles uses cmd flags to call endpoint api +func runOperationLoggerGetLocalLogFiles(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewGetLocalLogFilesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerGetLocalLogFilesResult(appCli.Logger.GetLocalLogFiles(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerGetLocalLogFilesParamFlags registers all flags needed to fill params +func registerOperationLoggerGetLocalLogFilesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationLoggerGetLocalLogFilesResult parses request result and return the string content +func parseOperationLoggerGetLocalLogFilesResult(resp0 *logger.GetLocalLogFilesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*logger.GetLocalLogFilesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_log_files_from_all_instances_operation.go b/src/cli/get_log_files_from_all_instances_operation.go new file mode 100644 index 0000000..1526d31 --- /dev/null +++ b/src/cli/get_log_files_from_all_instances_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLoggerGetLogFilesFromAllInstancesCmd returns a cmd to handle operation getLogFilesFromAllInstances +func makeOperationLoggerGetLogFilesFromAllInstancesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLogFilesFromAllInstances", + Short: ``, + RunE: runOperationLoggerGetLogFilesFromAllInstances, + } + + if err := registerOperationLoggerGetLogFilesFromAllInstancesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerGetLogFilesFromAllInstances uses cmd flags to call endpoint api +func runOperationLoggerGetLogFilesFromAllInstances(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewGetLogFilesFromAllInstancesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerGetLogFilesFromAllInstancesResult(appCli.Logger.GetLogFilesFromAllInstances(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerGetLogFilesFromAllInstancesParamFlags registers all flags needed to fill params +func registerOperationLoggerGetLogFilesFromAllInstancesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationLoggerGetLogFilesFromAllInstancesResult parses request result and return the string content +func parseOperationLoggerGetLogFilesFromAllInstancesResult(resp0 *logger.GetLogFilesFromAllInstancesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*logger.GetLogFilesFromAllInstancesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_log_files_from_instance_operation.go b/src/cli/get_log_files_from_instance_operation.go new file mode 100644 index 0000000..1a1b76a --- /dev/null +++ b/src/cli/get_log_files_from_instance_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLoggerGetLogFilesFromInstanceCmd returns a cmd to handle operation getLogFilesFromInstance +func makeOperationLoggerGetLogFilesFromInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLogFilesFromInstance", + Short: ``, + RunE: runOperationLoggerGetLogFilesFromInstance, + } + + if err := registerOperationLoggerGetLogFilesFromInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerGetLogFilesFromInstance uses cmd flags to call endpoint api +func runOperationLoggerGetLogFilesFromInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewGetLogFilesFromInstanceParams() + if err, _ := retrieveOperationLoggerGetLogFilesFromInstanceInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerGetLogFilesFromInstanceResult(appCli.Logger.GetLogFilesFromInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerGetLogFilesFromInstanceParamFlags registers all flags needed to fill params +func registerOperationLoggerGetLogFilesFromInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationLoggerGetLogFilesFromInstanceInstanceNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationLoggerGetLogFilesFromInstanceInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance Name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func retrieveOperationLoggerGetLogFilesFromInstanceInstanceNameFlag(m *logger.GetLogFilesFromInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} + +// parseOperationLoggerGetLogFilesFromInstanceResult parses request result and return the string content +func parseOperationLoggerGetLogFilesFromInstanceResult(resp0 *logger.GetLogFilesFromInstanceOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*logger.GetLogFilesFromInstanceOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_logger_operation.go b/src/cli/get_logger_operation.go new file mode 100644 index 0000000..55f81f7 --- /dev/null +++ b/src/cli/get_logger_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLoggerGetLoggerCmd returns a cmd to handle operation getLogger +func makeOperationLoggerGetLoggerCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLogger", + Short: `Return logger info`, + RunE: runOperationLoggerGetLogger, + } + + if err := registerOperationLoggerGetLoggerParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerGetLogger uses cmd flags to call endpoint api +func runOperationLoggerGetLogger(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewGetLoggerParams() + if err, _ := retrieveOperationLoggerGetLoggerLoggerNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerGetLoggerResult(appCli.Logger.GetLogger(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerGetLoggerParamFlags registers all flags needed to fill params +func registerOperationLoggerGetLoggerParamFlags(cmd *cobra.Command) error { + if err := registerOperationLoggerGetLoggerLoggerNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationLoggerGetLoggerLoggerNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + loggerNameDescription := `Required. Logger name` + + var loggerNameFlagName string + if cmdPrefix == "" { + loggerNameFlagName = "loggerName" + } else { + loggerNameFlagName = fmt.Sprintf("%v.loggerName", cmdPrefix) + } + + var loggerNameFlagDefault string + + _ = cmd.PersistentFlags().String(loggerNameFlagName, loggerNameFlagDefault, loggerNameDescription) + + return nil +} + +func retrieveOperationLoggerGetLoggerLoggerNameFlag(m *logger.GetLoggerParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("loggerName") { + + var loggerNameFlagName string + if cmdPrefix == "" { + loggerNameFlagName = "loggerName" + } else { + loggerNameFlagName = fmt.Sprintf("%v.loggerName", cmdPrefix) + } + + loggerNameFlagValue, err := cmd.Flags().GetString(loggerNameFlagName) + if err != nil { + return err, false + } + m.LoggerName = loggerNameFlagValue + + } + return nil, retAdded +} + +// parseOperationLoggerGetLoggerResult parses request result and return the string content +func parseOperationLoggerGetLoggerResult(resp0 *logger.GetLoggerOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*logger.GetLoggerOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_loggers_operation.go b/src/cli/get_loggers_operation.go new file mode 100644 index 0000000..b617d1a --- /dev/null +++ b/src/cli/get_loggers_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLoggerGetLoggersCmd returns a cmd to handle operation getLoggers +func makeOperationLoggerGetLoggersCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getLoggers", + Short: `Return all the logger names`, + RunE: runOperationLoggerGetLoggers, + } + + if err := registerOperationLoggerGetLoggersParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerGetLoggers uses cmd flags to call endpoint api +func runOperationLoggerGetLoggers(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewGetLoggersParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerGetLoggersResult(appCli.Logger.GetLoggers(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerGetLoggersParamFlags registers all flags needed to fill params +func registerOperationLoggerGetLoggersParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationLoggerGetLoggersResult parses request result and return the string content +func parseOperationLoggerGetLoggersResult(resp0 *logger.GetLoggersOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*logger.GetLoggersOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_pause_status_operation.go b/src/cli/get_pause_status_operation.go new file mode 100644 index 0000000..06bae3b --- /dev/null +++ b/src/cli/get_pause_status_operation.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableGetPauseStatusCmd returns a cmd to handle operation getPauseStatus +func makeOperationTableGetPauseStatusCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getPauseStatus", + Short: `Return pause status of a realtime table along with list of consuming segments.`, + RunE: runOperationTableGetPauseStatus, + } + + if err := registerOperationTableGetPauseStatusParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetPauseStatus uses cmd flags to call endpoint api +func runOperationTableGetPauseStatus(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetPauseStatusParams() + if err, _ := retrieveOperationTableGetPauseStatusTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetPauseStatusResult(appCli.Table.GetPauseStatus(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetPauseStatusParamFlags registers all flags needed to fill params +func registerOperationTableGetPauseStatusParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetPauseStatusTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetPauseStatusTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableGetPauseStatusTableNameFlag(m *table.GetPauseStatusParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetPauseStatusResult parses request result and return the string content +func parseOperationTableGetPauseStatusResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getPauseStatus default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/get_periodic_task_names_operation.go b/src/cli/get_periodic_task_names_operation.go new file mode 100644 index 0000000..6c239d8 --- /dev/null +++ b/src/cli/get_periodic_task_names_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/periodic_task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationPeriodicTaskGetPeriodicTaskNamesCmd returns a cmd to handle operation getPeriodicTaskNames +func makeOperationPeriodicTaskGetPeriodicTaskNamesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getPeriodicTaskNames", + Short: ``, + RunE: runOperationPeriodicTaskGetPeriodicTaskNames, + } + + if err := registerOperationPeriodicTaskGetPeriodicTaskNamesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationPeriodicTaskGetPeriodicTaskNames uses cmd flags to call endpoint api +func runOperationPeriodicTaskGetPeriodicTaskNames(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := periodic_task.NewGetPeriodicTaskNamesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationPeriodicTaskGetPeriodicTaskNamesResult(appCli.PeriodicTask.GetPeriodicTaskNames(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationPeriodicTaskGetPeriodicTaskNamesParamFlags registers all flags needed to fill params +func registerOperationPeriodicTaskGetPeriodicTaskNamesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationPeriodicTaskGetPeriodicTaskNamesResult parses request result and return the string content +func parseOperationPeriodicTaskGetPeriodicTaskNamesResult(resp0 *periodic_task.GetPeriodicTaskNamesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*periodic_task.GetPeriodicTaskNamesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_reload_job_status_operation.go b/src/cli/get_reload_job_status_operation.go new file mode 100644 index 0000000..d05641c --- /dev/null +++ b/src/cli/get_reload_job_status_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetReloadJobStatusCmd returns a cmd to handle operation getReloadJobStatus +func makeOperationSegmentGetReloadJobStatusCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getReloadJobStatus", + Short: `Get status for a submitted reload operation`, + RunE: runOperationSegmentGetReloadJobStatus, + } + + if err := registerOperationSegmentGetReloadJobStatusParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetReloadJobStatus uses cmd flags to call endpoint api +func runOperationSegmentGetReloadJobStatus(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetReloadJobStatusParams() + if err, _ := retrieveOperationSegmentGetReloadJobStatusJobIDFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetReloadJobStatusResult(appCli.Segment.GetReloadJobStatus(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetReloadJobStatusParamFlags registers all flags needed to fill params +func registerOperationSegmentGetReloadJobStatusParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetReloadJobStatusJobIDParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetReloadJobStatusJobIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + jobIdDescription := `Required. Reload job id` + + var jobIdFlagName string + if cmdPrefix == "" { + jobIdFlagName = "jobId" + } else { + jobIdFlagName = fmt.Sprintf("%v.jobId", cmdPrefix) + } + + var jobIdFlagDefault string + + _ = cmd.PersistentFlags().String(jobIdFlagName, jobIdFlagDefault, jobIdDescription) + + return nil +} + +func retrieveOperationSegmentGetReloadJobStatusJobIDFlag(m *segment.GetReloadJobStatusParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("jobId") { + + var jobIdFlagName string + if cmdPrefix == "" { + jobIdFlagName = "jobId" + } else { + jobIdFlagName = fmt.Sprintf("%v.jobId", cmdPrefix) + } + + jobIdFlagValue, err := cmd.Flags().GetString(jobIdFlagName) + if err != nil { + return err, false + } + m.JobID = jobIdFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetReloadJobStatusResult parses request result and return the string content +func parseOperationSegmentGetReloadJobStatusResult(resp0 *segment.GetReloadJobStatusOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetReloadJobStatusOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_running_queries_operation.go b/src/cli/get_running_queries_operation.go new file mode 100644 index 0000000..a41c61a --- /dev/null +++ b/src/cli/get_running_queries_operation.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/query" + + "github.com/spf13/cobra" +) + +// makeOperationQueryGetRunningQueriesCmd returns a cmd to handle operation getRunningQueries +func makeOperationQueryGetRunningQueriesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getRunningQueries", + Short: `The queries are returned with brokers running them`, + RunE: runOperationQueryGetRunningQueries, + } + + if err := registerOperationQueryGetRunningQueriesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationQueryGetRunningQueries uses cmd flags to call endpoint api +func runOperationQueryGetRunningQueries(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := query.NewGetRunningQueriesParams() + if err, _ := retrieveOperationQueryGetRunningQueriesTimeoutMsFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationQueryGetRunningQueriesResult(appCli.Query.GetRunningQueries(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationQueryGetRunningQueriesParamFlags registers all flags needed to fill params +func registerOperationQueryGetRunningQueriesParamFlags(cmd *cobra.Command) error { + if err := registerOperationQueryGetRunningQueriesTimeoutMsParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationQueryGetRunningQueriesTimeoutMsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + timeoutMsDescription := `Timeout for brokers to return running queries` + + var timeoutMsFlagName string + if cmdPrefix == "" { + timeoutMsFlagName = "timeoutMs" + } else { + timeoutMsFlagName = fmt.Sprintf("%v.timeoutMs", cmdPrefix) + } + + var timeoutMsFlagDefault int32 = 3000 + + _ = cmd.PersistentFlags().Int32(timeoutMsFlagName, timeoutMsFlagDefault, timeoutMsDescription) + + return nil +} + +func retrieveOperationQueryGetRunningQueriesTimeoutMsFlag(m *query.GetRunningQueriesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("timeoutMs") { + + var timeoutMsFlagName string + if cmdPrefix == "" { + timeoutMsFlagName = "timeoutMs" + } else { + timeoutMsFlagName = fmt.Sprintf("%v.timeoutMs", cmdPrefix) + } + + timeoutMsFlagValue, err := cmd.Flags().GetInt32(timeoutMsFlagName) + if err != nil { + return err, false + } + m.TimeoutMs = &timeoutMsFlagValue + + } + return nil, retAdded +} + +// parseOperationQueryGetRunningQueriesResult parses request result and return the string content +func parseOperationQueryGetRunningQueriesResult(resp0 *query.GetRunningQueriesOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getRunningQueriesOK is not supported + + // Non schema case: warning getRunningQueriesInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getRunningQueriesOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_schema_operation.go b/src/cli/get_schema_operation.go new file mode 100644 index 0000000..747d80f --- /dev/null +++ b/src/cli/get_schema_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/schema" + + "github.com/spf13/cobra" +) + +// makeOperationSchemaGetSchemaCmd returns a cmd to handle operation getSchema +func makeOperationSchemaGetSchemaCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSchema", + Short: `Gets a schema by name`, + RunE: runOperationSchemaGetSchema, + } + + if err := registerOperationSchemaGetSchemaParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaGetSchema uses cmd flags to call endpoint api +func runOperationSchemaGetSchema(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewGetSchemaParams() + if err, _ := retrieveOperationSchemaGetSchemaSchemaNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaGetSchemaResult(appCli.Schema.GetSchema(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaGetSchemaParamFlags registers all flags needed to fill params +func registerOperationSchemaGetSchemaParamFlags(cmd *cobra.Command) error { + if err := registerOperationSchemaGetSchemaSchemaNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSchemaGetSchemaSchemaNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + schemaNameDescription := `Required. Schema name` + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + var schemaNameFlagDefault string + + _ = cmd.PersistentFlags().String(schemaNameFlagName, schemaNameFlagDefault, schemaNameDescription) + + return nil +} + +func retrieveOperationSchemaGetSchemaSchemaNameFlag(m *schema.GetSchemaParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("schemaName") { + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + schemaNameFlagValue, err := cmd.Flags().GetString(schemaNameFlagName) + if err != nil { + return err, false + } + m.SchemaName = schemaNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSchemaGetSchemaResult parses request result and return the string content +func parseOperationSchemaGetSchemaResult(resp0 *schema.GetSchemaOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getSchemaOK is not supported + + // Non schema case: warning getSchemaNotFound is not supported + + // Non schema case: warning getSchemaInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getSchemaOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_segment_debug_info_operation.go b/src/cli/get_segment_debug_info_operation.go new file mode 100644 index 0000000..a13e9b8 --- /dev/null +++ b/src/cli/get_segment_debug_info_operation.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/cluster" + + "github.com/spf13/cobra" +) + +// makeOperationClusterGetSegmentDebugInfoCmd returns a cmd to handle operation getSegmentDebugInfo +func makeOperationClusterGetSegmentDebugInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentDebugInfo", + Short: `Debug information for segment.`, + RunE: runOperationClusterGetSegmentDebugInfo, + } + + if err := registerOperationClusterGetSegmentDebugInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterGetSegmentDebugInfo uses cmd flags to call endpoint api +func runOperationClusterGetSegmentDebugInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster.NewGetSegmentDebugInfoParams() + if err, _ := retrieveOperationClusterGetSegmentDebugInfoSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationClusterGetSegmentDebugInfoTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterGetSegmentDebugInfoResult(appCli.Cluster.GetSegmentDebugInfo(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterGetSegmentDebugInfoParamFlags registers all flags needed to fill params +func registerOperationClusterGetSegmentDebugInfoParamFlags(cmd *cobra.Command) error { + if err := registerOperationClusterGetSegmentDebugInfoSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationClusterGetSegmentDebugInfoTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationClusterGetSegmentDebugInfoSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationClusterGetSegmentDebugInfoTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table (with type)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationClusterGetSegmentDebugInfoSegmentNameFlag(m *cluster.GetSegmentDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationClusterGetSegmentDebugInfoTableNameFlag(m *cluster.GetSegmentDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationClusterGetSegmentDebugInfoResult parses request result and return the string content +func parseOperationClusterGetSegmentDebugInfoResult(resp0 *cluster.GetSegmentDebugInfoOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getSegmentDebugInfoOK is not supported + + // Non schema case: warning getSegmentDebugInfoNotFound is not supported + + // Non schema case: warning getSegmentDebugInfoInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getSegmentDebugInfoOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_segment_metadata_deprecated1_operation.go b/src/cli/get_segment_metadata_deprecated1_operation.go new file mode 100644 index 0000000..3383e35 --- /dev/null +++ b/src/cli/get_segment_metadata_deprecated1_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentMetadataDeprecated1Cmd returns a cmd to handle operation getSegmentMetadataDeprecated1 +func makeOperationSegmentGetSegmentMetadataDeprecated1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentMetadataDeprecated1", + Short: `Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead)`, + RunE: runOperationSegmentGetSegmentMetadataDeprecated1, + } + + if err := registerOperationSegmentGetSegmentMetadataDeprecated1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegmentMetadataDeprecated1 uses cmd flags to call endpoint api +func runOperationSegmentGetSegmentMetadataDeprecated1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentMetadataDeprecated1Params() + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated1SegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated1TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated1TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentMetadataDeprecated1Result(appCli.Segment.GetSegmentMetadataDeprecated1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentMetadataDeprecated1ParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentMetadataDeprecated1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentMetadataDeprecated1SegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataDeprecated1TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataDeprecated1TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentMetadataDeprecated1SegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataDeprecated1TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataDeprecated1TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentMetadataDeprecated1SegmentNameFlag(m *segment.GetSegmentMetadataDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataDeprecated1TableNameFlag(m *segment.GetSegmentMetadataDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataDeprecated1TypeFlag(m *segment.GetSegmentMetadataDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentMetadataDeprecated1Result parses request result and return the string content +func parseOperationSegmentGetSegmentMetadataDeprecated1Result(resp0 *segment.GetSegmentMetadataDeprecated1OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSegmentMetadataDeprecated1OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_segment_metadata_deprecated2_operation.go b/src/cli/get_segment_metadata_deprecated2_operation.go new file mode 100644 index 0000000..a3aece0 --- /dev/null +++ b/src/cli/get_segment_metadata_deprecated2_operation.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentMetadataDeprecated2Cmd returns a cmd to handle operation getSegmentMetadataDeprecated2 +func makeOperationSegmentGetSegmentMetadataDeprecated2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentMetadataDeprecated2", + Short: `Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead)`, + RunE: runOperationSegmentGetSegmentMetadataDeprecated2, + } + + if err := registerOperationSegmentGetSegmentMetadataDeprecated2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegmentMetadataDeprecated2 uses cmd flags to call endpoint api +func runOperationSegmentGetSegmentMetadataDeprecated2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentMetadataDeprecated2Params() + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated2SegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated2StateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated2TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataDeprecated2TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentMetadataDeprecated2Result(appCli.Segment.GetSegmentMetadataDeprecated2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentMetadataDeprecated2ParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentMetadataDeprecated2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentMetadataDeprecated2SegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataDeprecated2StateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataDeprecated2TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataDeprecated2TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentMetadataDeprecated2SegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataDeprecated2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `MUST be null` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataDeprecated2TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataDeprecated2TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentMetadataDeprecated2SegmentNameFlag(m *segment.GetSegmentMetadataDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataDeprecated2StateFlag(m *segment.GetSegmentMetadataDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataDeprecated2TableNameFlag(m *segment.GetSegmentMetadataDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataDeprecated2TypeFlag(m *segment.GetSegmentMetadataDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentMetadataDeprecated2Result parses request result and return the string content +func parseOperationSegmentGetSegmentMetadataDeprecated2Result(resp0 *segment.GetSegmentMetadataDeprecated2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSegmentMetadataDeprecated2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_segment_metadata_operation.go b/src/cli/get_segment_metadata_operation.go new file mode 100644 index 0000000..af698e4 --- /dev/null +++ b/src/cli/get_segment_metadata_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentMetadataCmd returns a cmd to handle operation getSegmentMetadata +func makeOperationSegmentGetSegmentMetadataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentMetadata", + Short: `Get the metadata for a segment`, + RunE: runOperationSegmentGetSegmentMetadata, + } + + if err := registerOperationSegmentGetSegmentMetadataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegmentMetadata uses cmd flags to call endpoint api +func runOperationSegmentGetSegmentMetadata(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentMetadataParams() + if err, _ := retrieveOperationSegmentGetSegmentMetadataColumnsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentMetadataTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentMetadataResult(appCli.Segment.GetSegmentMetadata(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentMetadataParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentMetadataParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentMetadataColumnsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentMetadataTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentMetadataColumnsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + columnsDescription := `Columns name` + + var columnsFlagName string + if cmdPrefix == "" { + columnsFlagName = "columns" + } else { + columnsFlagName = fmt.Sprintf("%v.columns", cmdPrefix) + } + + var columnsFlagDefault []string + + _ = cmd.PersistentFlags().StringSlice(columnsFlagName, columnsFlagDefault, columnsDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentMetadataTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentMetadataColumnsFlag(m *segment.GetSegmentMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("columns") { + + var columnsFlagName string + if cmdPrefix == "" { + columnsFlagName = "columns" + } else { + columnsFlagName = fmt.Sprintf("%v.columns", cmdPrefix) + } + + columnsFlagValues, err := cmd.Flags().GetStringSlice(columnsFlagName) + if err != nil { + return err, false + } + m.Columns = columnsFlagValues + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataSegmentNameFlag(m *segment.GetSegmentMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentMetadataTableNameFlag(m *segment.GetSegmentMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentMetadataResult parses request result and return the string content +func parseOperationSegmentGetSegmentMetadataResult(resp0 *segment.GetSegmentMetadataOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSegmentMetadataOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_segment_tiers_operation.go b/src/cli/get_segment_tiers_operation.go new file mode 100644 index 0000000..7bd5a53 --- /dev/null +++ b/src/cli/get_segment_tiers_operation.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentTiersCmd returns a cmd to handle operation getSegmentTiers +func makeOperationSegmentGetSegmentTiersCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentTiers", + Short: `Get storage tiers for the given segment`, + RunE: runOperationSegmentGetSegmentTiers, + } + + if err := registerOperationSegmentGetSegmentTiersParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegmentTiers uses cmd flags to call endpoint api +func runOperationSegmentGetSegmentTiers(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentTiersParams() + if err, _ := retrieveOperationSegmentGetSegmentTiersSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentTiersTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentTiersTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentTiersResult(appCli.Segment.GetSegmentTiers(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentTiersParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentTiersParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentTiersSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentTiersTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentTiersTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentTiersSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentTiersTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentTiersTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentTiersSegmentNameFlag(m *segment.GetSegmentTiersParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentTiersTableNameFlag(m *segment.GetSegmentTiersParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentTiersTypeFlag(m *segment.GetSegmentTiersParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentTiersResult parses request result and return the string content +func parseOperationSegmentGetSegmentTiersResult(resp0 *segment.GetSegmentTiersOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getSegmentTiersOK is not supported + + // Non schema case: warning getSegmentTiersNotFound is not supported + + // Non schema case: warning getSegmentTiersInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getSegmentTiersOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_segment_to_crc_map_deprecated_operation.go b/src/cli/get_segment_to_crc_map_deprecated_operation.go new file mode 100644 index 0000000..8cfd0e3 --- /dev/null +++ b/src/cli/get_segment_to_crc_map_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentToCrcMapDeprecatedCmd returns a cmd to handle operation getSegmentToCrcMapDeprecated +func makeOperationSegmentGetSegmentToCrcMapDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentToCrcMapDeprecated", + Short: `Get a map from segment to CRC of the segment (deprecated, use 'GET /segments/{tableName}/crc' instead)`, + RunE: runOperationSegmentGetSegmentToCrcMapDeprecated, + } + + if err := registerOperationSegmentGetSegmentToCrcMapDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegmentToCrcMapDeprecated uses cmd flags to call endpoint api +func runOperationSegmentGetSegmentToCrcMapDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentToCrcMapDeprecatedParams() + if err, _ := retrieveOperationSegmentGetSegmentToCrcMapDeprecatedTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentToCrcMapDeprecatedResult(appCli.Segment.GetSegmentToCrcMapDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentToCrcMapDeprecatedParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentToCrcMapDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentToCrcMapDeprecatedTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentToCrcMapDeprecatedTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentToCrcMapDeprecatedTableNameFlag(m *segment.GetSegmentToCrcMapDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentToCrcMapDeprecatedResult parses request result and return the string content +func parseOperationSegmentGetSegmentToCrcMapDeprecatedResult(resp0 *segment.GetSegmentToCrcMapDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSegmentToCrcMapDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_segment_to_crc_map_operation.go b/src/cli/get_segment_to_crc_map_operation.go new file mode 100644 index 0000000..172b9f3 --- /dev/null +++ b/src/cli/get_segment_to_crc_map_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentToCrcMapCmd returns a cmd to handle operation getSegmentToCrcMap +func makeOperationSegmentGetSegmentToCrcMapCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegmentToCrcMap", + Short: `Get a map from segment to CRC of the segment (only apply to OFFLINE table)`, + RunE: runOperationSegmentGetSegmentToCrcMap, + } + + if err := registerOperationSegmentGetSegmentToCrcMapParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegmentToCrcMap uses cmd flags to call endpoint api +func runOperationSegmentGetSegmentToCrcMap(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentToCrcMapParams() + if err, _ := retrieveOperationSegmentGetSegmentToCrcMapTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentToCrcMapResult(appCli.Segment.GetSegmentToCrcMap(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentToCrcMapParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentToCrcMapParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentToCrcMapTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentToCrcMapTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentToCrcMapTableNameFlag(m *segment.GetSegmentToCrcMapParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentToCrcMapResult parses request result and return the string content +func parseOperationSegmentGetSegmentToCrcMapResult(resp0 *segment.GetSegmentToCrcMapOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSegmentToCrcMapOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_segments_operation.go b/src/cli/get_segments_operation.go new file mode 100644 index 0000000..13ab32a --- /dev/null +++ b/src/cli/get_segments_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSegmentsCmd returns a cmd to handle operation getSegments +func makeOperationSegmentGetSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSegments", + Short: `List all segments`, + RunE: runOperationSegmentGetSegments, + } + + if err := registerOperationSegmentGetSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSegments uses cmd flags to call endpoint api +func runOperationSegmentGetSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSegmentsParams() + if err, _ := retrieveOperationSegmentGetSegmentsExcludeReplacedSegmentsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSegmentsResult(appCli.Segment.GetSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSegmentsExcludeReplacedSegmentsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSegmentsExcludeReplacedSegmentsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + excludeReplacedSegmentsDescription := `Whether to exclude replaced segments in the response, which have been replaced specified in the segment lineage entries and cannot be queried from the table` + + var excludeReplacedSegmentsFlagName string + if cmdPrefix == "" { + excludeReplacedSegmentsFlagName = "excludeReplacedSegments" + } else { + excludeReplacedSegmentsFlagName = fmt.Sprintf("%v.excludeReplacedSegments", cmdPrefix) + } + + var excludeReplacedSegmentsFlagDefault string + + _ = cmd.PersistentFlags().String(excludeReplacedSegmentsFlagName, excludeReplacedSegmentsFlagDefault, excludeReplacedSegmentsDescription) + + return nil +} +func registerOperationSegmentGetSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetSegmentsExcludeReplacedSegmentsFlag(m *segment.GetSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("excludeReplacedSegments") { + + var excludeReplacedSegmentsFlagName string + if cmdPrefix == "" { + excludeReplacedSegmentsFlagName = "excludeReplacedSegments" + } else { + excludeReplacedSegmentsFlagName = fmt.Sprintf("%v.excludeReplacedSegments", cmdPrefix) + } + + excludeReplacedSegmentsFlagValue, err := cmd.Flags().GetString(excludeReplacedSegmentsFlagName) + if err != nil { + return err, false + } + m.ExcludeReplacedSegments = &excludeReplacedSegmentsFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentsTableNameFlag(m *segment.GetSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSegmentsTypeFlag(m *segment.GetSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSegmentsResult parses request result and return the string content +func parseOperationSegmentGetSegmentsResult(resp0 *segment.GetSegmentsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSegmentsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_selected_segments_operation.go b/src/cli/get_selected_segments_operation.go new file mode 100644 index 0000000..d810b75 --- /dev/null +++ b/src/cli/get_selected_segments_operation.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetSelectedSegmentsCmd returns a cmd to handle operation getSelectedSegments +func makeOperationSegmentGetSelectedSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSelectedSegments", + Short: `Get the selected segments given the start and end timestamps in milliseconds`, + RunE: runOperationSegmentGetSelectedSegments, + } + + if err := registerOperationSegmentGetSelectedSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetSelectedSegments uses cmd flags to call endpoint api +func runOperationSegmentGetSelectedSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetSelectedSegmentsParams() + if err, _ := retrieveOperationSegmentGetSelectedSegmentsEndTimestampFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSelectedSegmentsExcludeOverlappingFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSelectedSegmentsStartTimestampFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSelectedSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetSelectedSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetSelectedSegmentsResult(appCli.Segment.GetSelectedSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetSelectedSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentGetSelectedSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetSelectedSegmentsEndTimestampParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSelectedSegmentsExcludeOverlappingParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSelectedSegmentsStartTimestampParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSelectedSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetSelectedSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetSelectedSegmentsEndTimestampParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + endTimestampDescription := `End timestamp (exclusive)` + + var endTimestampFlagName string + if cmdPrefix == "" { + endTimestampFlagName = "endTimestamp" + } else { + endTimestampFlagName = fmt.Sprintf("%v.endTimestamp", cmdPrefix) + } + + var endTimestampFlagDefault string + + _ = cmd.PersistentFlags().String(endTimestampFlagName, endTimestampFlagDefault, endTimestampDescription) + + return nil +} +func registerOperationSegmentGetSelectedSegmentsExcludeOverlappingParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + excludeOverlappingDescription := `Whether to exclude the segments overlapping with the timestamps, false by default` + + var excludeOverlappingFlagName string + if cmdPrefix == "" { + excludeOverlappingFlagName = "excludeOverlapping" + } else { + excludeOverlappingFlagName = fmt.Sprintf("%v.excludeOverlapping", cmdPrefix) + } + + var excludeOverlappingFlagDefault bool + + _ = cmd.PersistentFlags().Bool(excludeOverlappingFlagName, excludeOverlappingFlagDefault, excludeOverlappingDescription) + + return nil +} +func registerOperationSegmentGetSelectedSegmentsStartTimestampParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + startTimestampDescription := `Start timestamp (inclusive)` + + var startTimestampFlagName string + if cmdPrefix == "" { + startTimestampFlagName = "startTimestamp" + } else { + startTimestampFlagName = fmt.Sprintf("%v.startTimestamp", cmdPrefix) + } + + var startTimestampFlagDefault string + + _ = cmd.PersistentFlags().String(startTimestampFlagName, startTimestampFlagDefault, startTimestampDescription) + + return nil +} +func registerOperationSegmentGetSelectedSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetSelectedSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetSelectedSegmentsEndTimestampFlag(m *segment.GetSelectedSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("endTimestamp") { + + var endTimestampFlagName string + if cmdPrefix == "" { + endTimestampFlagName = "endTimestamp" + } else { + endTimestampFlagName = fmt.Sprintf("%v.endTimestamp", cmdPrefix) + } + + endTimestampFlagValue, err := cmd.Flags().GetString(endTimestampFlagName) + if err != nil { + return err, false + } + m.EndTimestamp = &endTimestampFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSelectedSegmentsExcludeOverlappingFlag(m *segment.GetSelectedSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("excludeOverlapping") { + + var excludeOverlappingFlagName string + if cmdPrefix == "" { + excludeOverlappingFlagName = "excludeOverlapping" + } else { + excludeOverlappingFlagName = fmt.Sprintf("%v.excludeOverlapping", cmdPrefix) + } + + excludeOverlappingFlagValue, err := cmd.Flags().GetBool(excludeOverlappingFlagName) + if err != nil { + return err, false + } + m.ExcludeOverlapping = &excludeOverlappingFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSelectedSegmentsStartTimestampFlag(m *segment.GetSelectedSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("startTimestamp") { + + var startTimestampFlagName string + if cmdPrefix == "" { + startTimestampFlagName = "startTimestamp" + } else { + startTimestampFlagName = fmt.Sprintf("%v.startTimestamp", cmdPrefix) + } + + startTimestampFlagValue, err := cmd.Flags().GetString(startTimestampFlagName) + if err != nil { + return err, false + } + m.StartTimestamp = &startTimestampFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSelectedSegmentsTableNameFlag(m *segment.GetSelectedSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetSelectedSegmentsTypeFlag(m *segment.GetSelectedSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetSelectedSegmentsResult parses request result and return the string content +func parseOperationSegmentGetSelectedSegmentsResult(resp0 *segment.GetSelectedSegmentsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetSelectedSegmentsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_server_metadata_operation.go b/src/cli/get_server_metadata_operation.go new file mode 100644 index 0000000..3430364 --- /dev/null +++ b/src/cli/get_server_metadata_operation.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetServerMetadataCmd returns a cmd to handle operation getServerMetadata +func makeOperationSegmentGetServerMetadataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getServerMetadata", + Short: `Get the server metadata for all table segments`, + RunE: runOperationSegmentGetServerMetadata, + } + + if err := registerOperationSegmentGetServerMetadataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetServerMetadata uses cmd flags to call endpoint api +func runOperationSegmentGetServerMetadata(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetServerMetadataParams() + if err, _ := retrieveOperationSegmentGetServerMetadataColumnsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerMetadataTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerMetadataTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetServerMetadataResult(appCli.Segment.GetServerMetadata(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetServerMetadataParamFlags registers all flags needed to fill params +func registerOperationSegmentGetServerMetadataParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetServerMetadataColumnsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerMetadataTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerMetadataTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetServerMetadataColumnsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + columnsDescription := `Columns name` + + var columnsFlagName string + if cmdPrefix == "" { + columnsFlagName = "columns" + } else { + columnsFlagName = fmt.Sprintf("%v.columns", cmdPrefix) + } + + var columnsFlagDefault []string + + _ = cmd.PersistentFlags().StringSlice(columnsFlagName, columnsFlagDefault, columnsDescription) + + return nil +} +func registerOperationSegmentGetServerMetadataTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetServerMetadataTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetServerMetadataColumnsFlag(m *segment.GetServerMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("columns") { + + var columnsFlagName string + if cmdPrefix == "" { + columnsFlagName = "columns" + } else { + columnsFlagName = fmt.Sprintf("%v.columns", cmdPrefix) + } + + columnsFlagValues, err := cmd.Flags().GetStringSlice(columnsFlagName) + if err != nil { + return err, false + } + m.Columns = columnsFlagValues + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerMetadataTableNameFlag(m *segment.GetServerMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerMetadataTypeFlag(m *segment.GetServerMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetServerMetadataResult parses request result and return the string content +func parseOperationSegmentGetServerMetadataResult(resp0 *segment.GetServerMetadataOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetServerMetadataOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_server_to_segments_map_deprecated1_operation.go b/src/cli/get_server_to_segments_map_deprecated1_operation.go new file mode 100644 index 0000000..75fa725 --- /dev/null +++ b/src/cli/get_server_to_segments_map_deprecated1_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetServerToSegmentsMapDeprecated1Cmd returns a cmd to handle operation getServerToSegmentsMapDeprecated1 +func makeOperationSegmentGetServerToSegmentsMapDeprecated1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getServerToSegmentsMapDeprecated1", + Short: `Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead)`, + RunE: runOperationSegmentGetServerToSegmentsMapDeprecated1, + } + + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetServerToSegmentsMapDeprecated1 uses cmd flags to call endpoint api +func runOperationSegmentGetServerToSegmentsMapDeprecated1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetServerToSegmentsMapDeprecated1Params() + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapDeprecated1StateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapDeprecated1TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapDeprecated1TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetServerToSegmentsMapDeprecated1Result(appCli.Segment.GetServerToSegmentsMapDeprecated1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetServerToSegmentsMapDeprecated1ParamFlags registers all flags needed to fill params +func registerOperationSegmentGetServerToSegmentsMapDeprecated1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated1StateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated1TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated1TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetServerToSegmentsMapDeprecated1StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `MUST be null` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationSegmentGetServerToSegmentsMapDeprecated1TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetServerToSegmentsMapDeprecated1TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetServerToSegmentsMapDeprecated1StateFlag(m *segment.GetServerToSegmentsMapDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerToSegmentsMapDeprecated1TableNameFlag(m *segment.GetServerToSegmentsMapDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerToSegmentsMapDeprecated1TypeFlag(m *segment.GetServerToSegmentsMapDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetServerToSegmentsMapDeprecated1Result parses request result and return the string content +func parseOperationSegmentGetServerToSegmentsMapDeprecated1Result(resp0 *segment.GetServerToSegmentsMapDeprecated1OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetServerToSegmentsMapDeprecated1OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_server_to_segments_map_deprecated2_operation.go b/src/cli/get_server_to_segments_map_deprecated2_operation.go new file mode 100644 index 0000000..933ee04 --- /dev/null +++ b/src/cli/get_server_to_segments_map_deprecated2_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetServerToSegmentsMapDeprecated2Cmd returns a cmd to handle operation getServerToSegmentsMapDeprecated2 +func makeOperationSegmentGetServerToSegmentsMapDeprecated2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getServerToSegmentsMapDeprecated2", + Short: `Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead)`, + RunE: runOperationSegmentGetServerToSegmentsMapDeprecated2, + } + + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetServerToSegmentsMapDeprecated2 uses cmd flags to call endpoint api +func runOperationSegmentGetServerToSegmentsMapDeprecated2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetServerToSegmentsMapDeprecated2Params() + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapDeprecated2StateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapDeprecated2TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapDeprecated2TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetServerToSegmentsMapDeprecated2Result(appCli.Segment.GetServerToSegmentsMapDeprecated2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetServerToSegmentsMapDeprecated2ParamFlags registers all flags needed to fill params +func registerOperationSegmentGetServerToSegmentsMapDeprecated2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated2StateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated2TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerToSegmentsMapDeprecated2TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetServerToSegmentsMapDeprecated2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `MUST be null` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationSegmentGetServerToSegmentsMapDeprecated2TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetServerToSegmentsMapDeprecated2TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetServerToSegmentsMapDeprecated2StateFlag(m *segment.GetServerToSegmentsMapDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerToSegmentsMapDeprecated2TableNameFlag(m *segment.GetServerToSegmentsMapDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerToSegmentsMapDeprecated2TypeFlag(m *segment.GetServerToSegmentsMapDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetServerToSegmentsMapDeprecated2Result parses request result and return the string content +func parseOperationSegmentGetServerToSegmentsMapDeprecated2Result(resp0 *segment.GetServerToSegmentsMapDeprecated2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetServerToSegmentsMapDeprecated2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_server_to_segments_map_operation.go b/src/cli/get_server_to_segments_map_operation.go new file mode 100644 index 0000000..f53b6ca --- /dev/null +++ b/src/cli/get_server_to_segments_map_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetServerToSegmentsMapCmd returns a cmd to handle operation getServerToSegmentsMap +func makeOperationSegmentGetServerToSegmentsMapCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getServerToSegmentsMap", + Short: `Get a map from server to segments hosted by the server`, + RunE: runOperationSegmentGetServerToSegmentsMap, + } + + if err := registerOperationSegmentGetServerToSegmentsMapParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetServerToSegmentsMap uses cmd flags to call endpoint api +func runOperationSegmentGetServerToSegmentsMap(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetServerToSegmentsMapParams() + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetServerToSegmentsMapTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetServerToSegmentsMapResult(appCli.Segment.GetServerToSegmentsMap(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetServerToSegmentsMapParamFlags registers all flags needed to fill params +func registerOperationSegmentGetServerToSegmentsMapParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetServerToSegmentsMapTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetServerToSegmentsMapTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetServerToSegmentsMapTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetServerToSegmentsMapTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetServerToSegmentsMapTableNameFlag(m *segment.GetServerToSegmentsMapParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetServerToSegmentsMapTypeFlag(m *segment.GetServerToSegmentsMapParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetServerToSegmentsMapResult parses request result and return the string content +func parseOperationSegmentGetServerToSegmentsMapResult(resp0 *segment.GetServerToSegmentsMapOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.GetServerToSegmentsMapOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_subtask_configs_operation.go b/src/cli/get_subtask_configs_operation.go new file mode 100644 index 0000000..d00cb73 --- /dev/null +++ b/src/cli/get_subtask_configs_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetSubtaskConfigsCmd returns a cmd to handle operation getSubtaskConfigs +func makeOperationTaskGetSubtaskConfigsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSubtaskConfigs", + Short: ``, + RunE: runOperationTaskGetSubtaskConfigs, + } + + if err := registerOperationTaskGetSubtaskConfigsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetSubtaskConfigs uses cmd flags to call endpoint api +func runOperationTaskGetSubtaskConfigs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetSubtaskConfigsParams() + if err, _ := retrieveOperationTaskGetSubtaskConfigsSubtaskNamesFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetSubtaskConfigsTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetSubtaskConfigsResult(appCli.Task.GetSubtaskConfigs(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetSubtaskConfigsParamFlags registers all flags needed to fill params +func registerOperationTaskGetSubtaskConfigsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetSubtaskConfigsSubtaskNamesParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetSubtaskConfigsTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetSubtaskConfigsSubtaskNamesParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + subtaskNamesDescription := `Sub task names separated by comma` + + var subtaskNamesFlagName string + if cmdPrefix == "" { + subtaskNamesFlagName = "subtaskNames" + } else { + subtaskNamesFlagName = fmt.Sprintf("%v.subtaskNames", cmdPrefix) + } + + var subtaskNamesFlagDefault string + + _ = cmd.PersistentFlags().String(subtaskNamesFlagName, subtaskNamesFlagDefault, subtaskNamesDescription) + + return nil +} +func registerOperationTaskGetSubtaskConfigsTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetSubtaskConfigsSubtaskNamesFlag(m *task.GetSubtaskConfigsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("subtaskNames") { + + var subtaskNamesFlagName string + if cmdPrefix == "" { + subtaskNamesFlagName = "subtaskNames" + } else { + subtaskNamesFlagName = fmt.Sprintf("%v.subtaskNames", cmdPrefix) + } + + subtaskNamesFlagValue, err := cmd.Flags().GetString(subtaskNamesFlagName) + if err != nil { + return err, false + } + m.SubtaskNames = &subtaskNamesFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetSubtaskConfigsTaskNameFlag(m *task.GetSubtaskConfigsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetSubtaskConfigsResult parses request result and return the string content +func parseOperationTaskGetSubtaskConfigsResult(resp0 *task.GetSubtaskConfigsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetSubtaskConfigsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_subtask_on_worker_progress_operation.go b/src/cli/get_subtask_on_worker_progress_operation.go new file mode 100644 index 0000000..5931d0f --- /dev/null +++ b/src/cli/get_subtask_on_worker_progress_operation.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/task" + + "github.com/spf13/cobra" +) + +// makeOperationTaskGetSubtaskOnWorkerProgressCmd returns a cmd to handle operation getSubtaskOnWorkerProgress +func makeOperationTaskGetSubtaskOnWorkerProgressCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSubtaskOnWorkerProgress", + Short: ``, + RunE: runOperationTaskGetSubtaskOnWorkerProgress, + } + + if err := registerOperationTaskGetSubtaskOnWorkerProgressParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetSubtaskOnWorkerProgress uses cmd flags to call endpoint api +func runOperationTaskGetSubtaskOnWorkerProgress(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetSubtaskOnWorkerProgressParams() + if err, _ := retrieveOperationTaskGetSubtaskOnWorkerProgressMinionWorkerIdsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetSubtaskOnWorkerProgressSubTaskStateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetSubtaskOnWorkerProgressResult(appCli.Task.GetSubtaskOnWorkerProgress(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetSubtaskOnWorkerProgressParamFlags registers all flags needed to fill params +func registerOperationTaskGetSubtaskOnWorkerProgressParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetSubtaskOnWorkerProgressMinionWorkerIdsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetSubtaskOnWorkerProgressSubTaskStateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetSubtaskOnWorkerProgressMinionWorkerIdsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + minionWorkerIdsDescription := `Minion worker IDs separated by comma` + + var minionWorkerIdsFlagName string + if cmdPrefix == "" { + minionWorkerIdsFlagName = "minionWorkerIds" + } else { + minionWorkerIdsFlagName = fmt.Sprintf("%v.minionWorkerIds", cmdPrefix) + } + + var minionWorkerIdsFlagDefault string + + _ = cmd.PersistentFlags().String(minionWorkerIdsFlagName, minionWorkerIdsFlagDefault, minionWorkerIdsDescription) + + return nil +} +func registerOperationTaskGetSubtaskOnWorkerProgressSubTaskStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + subTaskStateDescription := `Required. Subtask state (UNKNOWN,IN_PROGRESS,SUCCEEDED,CANCELLED,ERROR)` + + var subTaskStateFlagName string + if cmdPrefix == "" { + subTaskStateFlagName = "subTaskState" + } else { + subTaskStateFlagName = fmt.Sprintf("%v.subTaskState", cmdPrefix) + } + + var subTaskStateFlagDefault string + + _ = cmd.PersistentFlags().String(subTaskStateFlagName, subTaskStateFlagDefault, subTaskStateDescription) + + return nil +} + +func retrieveOperationTaskGetSubtaskOnWorkerProgressMinionWorkerIdsFlag(m *task.GetSubtaskOnWorkerProgressParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("minionWorkerIds") { + + var minionWorkerIdsFlagName string + if cmdPrefix == "" { + minionWorkerIdsFlagName = "minionWorkerIds" + } else { + minionWorkerIdsFlagName = fmt.Sprintf("%v.minionWorkerIds", cmdPrefix) + } + + minionWorkerIdsFlagValue, err := cmd.Flags().GetString(minionWorkerIdsFlagName) + if err != nil { + return err, false + } + m.MinionWorkerIds = &minionWorkerIdsFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetSubtaskOnWorkerProgressSubTaskStateFlag(m *task.GetSubtaskOnWorkerProgressParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("subTaskState") { + + var subTaskStateFlagName string + if cmdPrefix == "" { + subTaskStateFlagName = "subTaskState" + } else { + subTaskStateFlagName = fmt.Sprintf("%v.subTaskState", cmdPrefix) + } + + subTaskStateFlagValue, err := cmd.Flags().GetString(subTaskStateFlagName) + if err != nil { + return err, false + } + m.SubTaskState = subTaskStateFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetSubtaskOnWorkerProgressResult parses request result and return the string content +func parseOperationTaskGetSubtaskOnWorkerProgressResult(resp0 *task.GetSubtaskOnWorkerProgressOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getSubtaskOnWorkerProgressOK is not supported + + // Non schema case: warning getSubtaskOnWorkerProgressInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getSubtaskOnWorkerProgressOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_subtask_progress_operation.go b/src/cli/get_subtask_progress_operation.go new file mode 100644 index 0000000..ab69d7c --- /dev/null +++ b/src/cli/get_subtask_progress_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetSubtaskProgressCmd returns a cmd to handle operation getSubtaskProgress +func makeOperationTaskGetSubtaskProgressCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSubtaskProgress", + Short: ``, + RunE: runOperationTaskGetSubtaskProgress, + } + + if err := registerOperationTaskGetSubtaskProgressParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetSubtaskProgress uses cmd flags to call endpoint api +func runOperationTaskGetSubtaskProgress(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetSubtaskProgressParams() + if err, _ := retrieveOperationTaskGetSubtaskProgressSubtaskNamesFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetSubtaskProgressTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetSubtaskProgressResult(appCli.Task.GetSubtaskProgress(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetSubtaskProgressParamFlags registers all flags needed to fill params +func registerOperationTaskGetSubtaskProgressParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetSubtaskProgressSubtaskNamesParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetSubtaskProgressTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetSubtaskProgressSubtaskNamesParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + subtaskNamesDescription := `Sub task names separated by comma` + + var subtaskNamesFlagName string + if cmdPrefix == "" { + subtaskNamesFlagName = "subtaskNames" + } else { + subtaskNamesFlagName = fmt.Sprintf("%v.subtaskNames", cmdPrefix) + } + + var subtaskNamesFlagDefault string + + _ = cmd.PersistentFlags().String(subtaskNamesFlagName, subtaskNamesFlagDefault, subtaskNamesDescription) + + return nil +} +func registerOperationTaskGetSubtaskProgressTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetSubtaskProgressSubtaskNamesFlag(m *task.GetSubtaskProgressParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("subtaskNames") { + + var subtaskNamesFlagName string + if cmdPrefix == "" { + subtaskNamesFlagName = "subtaskNames" + } else { + subtaskNamesFlagName = fmt.Sprintf("%v.subtaskNames", cmdPrefix) + } + + subtaskNamesFlagValue, err := cmd.Flags().GetString(subtaskNamesFlagName) + if err != nil { + return err, false + } + m.SubtaskNames = &subtaskNamesFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetSubtaskProgressTaskNameFlag(m *task.GetSubtaskProgressParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetSubtaskProgressResult parses request result and return the string content +func parseOperationTaskGetSubtaskProgressResult(resp0 *task.GetSubtaskProgressOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetSubtaskProgressOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_subtask_states_operation.go b/src/cli/get_subtask_states_operation.go new file mode 100644 index 0000000..c084a7f --- /dev/null +++ b/src/cli/get_subtask_states_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetSubtaskStatesCmd returns a cmd to handle operation getSubtaskStates +func makeOperationTaskGetSubtaskStatesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getSubtaskStates", + Short: ``, + RunE: runOperationTaskGetSubtaskStates, + } + + if err := registerOperationTaskGetSubtaskStatesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetSubtaskStates uses cmd flags to call endpoint api +func runOperationTaskGetSubtaskStates(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetSubtaskStatesParams() + if err, _ := retrieveOperationTaskGetSubtaskStatesTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetSubtaskStatesResult(appCli.Task.GetSubtaskStates(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetSubtaskStatesParamFlags registers all flags needed to fill params +func registerOperationTaskGetSubtaskStatesParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetSubtaskStatesTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetSubtaskStatesTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetSubtaskStatesTaskNameFlag(m *task.GetSubtaskStatesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetSubtaskStatesResult parses request result and return the string content +func parseOperationTaskGetSubtaskStatesResult(resp0 *task.GetSubtaskStatesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetSubtaskStatesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_table_aggregate_metadata_operation.go b/src/cli/get_table_aggregate_metadata_operation.go new file mode 100644 index 0000000..645f06e --- /dev/null +++ b/src/cli/get_table_aggregate_metadata_operation.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetTableAggregateMetadataCmd returns a cmd to handle operation getTableAggregateMetadata +func makeOperationTableGetTableAggregateMetadataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableAggregateMetadata", + Short: `Get the aggregate metadata of all segments for a table`, + RunE: runOperationTableGetTableAggregateMetadata, + } + + if err := registerOperationTableGetTableAggregateMetadataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetTableAggregateMetadata uses cmd flags to call endpoint api +func runOperationTableGetTableAggregateMetadata(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetTableAggregateMetadataParams() + if err, _ := retrieveOperationTableGetTableAggregateMetadataColumnsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableAggregateMetadataTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableAggregateMetadataTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetTableAggregateMetadataResult(appCli.Table.GetTableAggregateMetadata(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetTableAggregateMetadataParamFlags registers all flags needed to fill params +func registerOperationTableGetTableAggregateMetadataParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetTableAggregateMetadataColumnsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableAggregateMetadataTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableAggregateMetadataTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetTableAggregateMetadataColumnsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + columnsDescription := `Columns name` + + var columnsFlagName string + if cmdPrefix == "" { + columnsFlagName = "columns" + } else { + columnsFlagName = fmt.Sprintf("%v.columns", cmdPrefix) + } + + var columnsFlagDefault []string + + _ = cmd.PersistentFlags().StringSlice(columnsFlagName, columnsFlagDefault, columnsDescription) + + return nil +} +func registerOperationTableGetTableAggregateMetadataTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetTableAggregateMetadataTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableGetTableAggregateMetadataColumnsFlag(m *table.GetTableAggregateMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("columns") { + + var columnsFlagName string + if cmdPrefix == "" { + columnsFlagName = "columns" + } else { + columnsFlagName = fmt.Sprintf("%v.columns", cmdPrefix) + } + + columnsFlagValues, err := cmd.Flags().GetStringSlice(columnsFlagName) + if err != nil { + return err, false + } + m.Columns = columnsFlagValues + + } + return nil, retAdded +} +func retrieveOperationTableGetTableAggregateMetadataTableNameFlag(m *table.GetTableAggregateMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetTableAggregateMetadataTypeFlag(m *table.GetTableAggregateMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetTableAggregateMetadataResult parses request result and return the string content +func parseOperationTableGetTableAggregateMetadataResult(resp0 *table.GetTableAggregateMetadataOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetTableAggregateMetadataOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_table_debug_info_operation.go b/src/cli/get_table_debug_info_operation.go new file mode 100644 index 0000000..1b72bd1 --- /dev/null +++ b/src/cli/get_table_debug_info_operation.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/cluster" + + "github.com/spf13/cobra" +) + +// makeOperationClusterGetTableDebugInfoCmd returns a cmd to handle operation getTableDebugInfo +func makeOperationClusterGetTableDebugInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableDebugInfo", + Short: `Debug information for table.`, + RunE: runOperationClusterGetTableDebugInfo, + } + + if err := registerOperationClusterGetTableDebugInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterGetTableDebugInfo uses cmd flags to call endpoint api +func runOperationClusterGetTableDebugInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster.NewGetTableDebugInfoParams() + if err, _ := retrieveOperationClusterGetTableDebugInfoTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationClusterGetTableDebugInfoTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationClusterGetTableDebugInfoVerbosityFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterGetTableDebugInfoResult(appCli.Cluster.GetTableDebugInfo(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterGetTableDebugInfoParamFlags registers all flags needed to fill params +func registerOperationClusterGetTableDebugInfoParamFlags(cmd *cobra.Command) error { + if err := registerOperationClusterGetTableDebugInfoTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationClusterGetTableDebugInfoTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationClusterGetTableDebugInfoVerbosityParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationClusterGetTableDebugInfoTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationClusterGetTableDebugInfoTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} +func registerOperationClusterGetTableDebugInfoVerbosityParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + verbosityDescription := `Verbosity of debug information` + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + var verbosityFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(verbosityFlagName, verbosityFlagDefault, verbosityDescription) + + return nil +} + +func retrieveOperationClusterGetTableDebugInfoTableNameFlag(m *cluster.GetTableDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationClusterGetTableDebugInfoTypeFlag(m *cluster.GetTableDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} +func retrieveOperationClusterGetTableDebugInfoVerbosityFlag(m *cluster.GetTableDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("verbosity") { + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + verbosityFlagValue, err := cmd.Flags().GetInt32(verbosityFlagName) + if err != nil { + return err, false + } + m.Verbosity = &verbosityFlagValue + + } + return nil, retAdded +} + +// parseOperationClusterGetTableDebugInfoResult parses request result and return the string content +func parseOperationClusterGetTableDebugInfoResult(resp0 *cluster.GetTableDebugInfoOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getTableDebugInfoOK is not supported + + // Non schema case: warning getTableDebugInfoNotFound is not supported + + // Non schema case: warning getTableDebugInfoInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getTableDebugInfoOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_table_instances_operation.go b/src/cli/get_table_instances_operation.go new file mode 100644 index 0000000..a2cae73 --- /dev/null +++ b/src/cli/get_table_instances_operation.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableGetTableInstancesCmd returns a cmd to handle operation getTableInstances +func makeOperationTableGetTableInstancesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableInstances", + Short: `List instances of the given table`, + RunE: runOperationTableGetTableInstances, + } + + if err := registerOperationTableGetTableInstancesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetTableInstances uses cmd flags to call endpoint api +func runOperationTableGetTableInstances(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetTableInstancesParams() + if err, _ := retrieveOperationTableGetTableInstancesTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableInstancesTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetTableInstancesResult(appCli.Table.GetTableInstances(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetTableInstancesParamFlags registers all flags needed to fill params +func registerOperationTableGetTableInstancesParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetTableInstancesTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableInstancesTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetTableInstancesTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name without type` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetTableInstancesTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["BROKER","SERVER"]. Instance type` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["BROKER","SERVER"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTableGetTableInstancesTableNameFlag(m *table.GetTableInstancesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetTableInstancesTypeFlag(m *table.GetTableInstancesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetTableInstancesResult parses request result and return the string content +func parseOperationTableGetTableInstancesResult(resp0 *table.GetTableInstancesOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getTableInstancesOK is not supported + + // Non schema case: warning getTableInstancesNotFound is not supported + + // Non schema case: warning getTableInstancesInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getTableInstancesOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_table_schema_operation.go b/src/cli/get_table_schema_operation.go new file mode 100644 index 0000000..b8ed681 --- /dev/null +++ b/src/cli/get_table_schema_operation.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/schema" + + "github.com/spf13/cobra" +) + +// makeOperationSchemaGetTableSchemaCmd returns a cmd to handle operation getTableSchema +func makeOperationSchemaGetTableSchemaCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableSchema", + Short: `Read table schema`, + RunE: runOperationSchemaGetTableSchema, + } + + if err := registerOperationSchemaGetTableSchemaParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaGetTableSchema uses cmd flags to call endpoint api +func runOperationSchemaGetTableSchema(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewGetTableSchemaParams() + if err, _ := retrieveOperationSchemaGetTableSchemaTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaGetTableSchemaResult(appCli.Schema.GetTableSchema(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaGetTableSchemaParamFlags registers all flags needed to fill params +func registerOperationSchemaGetTableSchemaParamFlags(cmd *cobra.Command) error { + if err := registerOperationSchemaGetTableSchemaTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSchemaGetTableSchemaTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name (without type)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSchemaGetTableSchemaTableNameFlag(m *schema.GetTableSchemaParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSchemaGetTableSchemaResult parses request result and return the string content +func parseOperationSchemaGetTableSchemaResult(resp0 *schema.GetTableSchemaOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getTableSchemaOK is not supported + + // Non schema case: warning getTableSchemaNotFound is not supported + + return "", respErr + } + + // warning: non schema response getTableSchemaOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_table_size_operation.go b/src/cli/get_table_size_operation.go new file mode 100644 index 0000000..3635954 --- /dev/null +++ b/src/cli/get_table_size_operation.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableGetTableSizeCmd returns a cmd to handle operation getTableSize +func makeOperationTableGetTableSizeCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableSize", + Short: `Get table size details. Table size is the size of untarred segments including replication`, + RunE: runOperationTableGetTableSize, + } + + if err := registerOperationTableGetTableSizeParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetTableSize uses cmd flags to call endpoint api +func runOperationTableGetTableSize(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetTableSizeParams() + if err, _ := retrieveOperationTableGetTableSizeDetailedFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableSizeTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetTableSizeResult(appCli.Table.GetTableSize(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetTableSizeParamFlags registers all flags needed to fill params +func registerOperationTableGetTableSizeParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetTableSizeDetailedParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableSizeTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetTableSizeDetailedParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + detailedDescription := `Get detailed information` + + var detailedFlagName string + if cmdPrefix == "" { + detailedFlagName = "detailed" + } else { + detailedFlagName = fmt.Sprintf("%v.detailed", cmdPrefix) + } + + var detailedFlagDefault bool = true + + _ = cmd.PersistentFlags().Bool(detailedFlagName, detailedFlagDefault, detailedDescription) + + return nil +} +func registerOperationTableGetTableSizeTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name without type` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableGetTableSizeDetailedFlag(m *table.GetTableSizeParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("detailed") { + + var detailedFlagName string + if cmdPrefix == "" { + detailedFlagName = "detailed" + } else { + detailedFlagName = fmt.Sprintf("%v.detailed", cmdPrefix) + } + + detailedFlagValue, err := cmd.Flags().GetBool(detailedFlagName) + if err != nil { + return err, false + } + m.Detailed = &detailedFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetTableSizeTableNameFlag(m *table.GetTableSizeParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetTableSizeResult parses request result and return the string content +func parseOperationTableGetTableSizeResult(resp0 *table.GetTableSizeOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getTableSizeOK is not supported + + // Non schema case: warning getTableSizeNotFound is not supported + + // Non schema case: warning getTableSizeInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getTableSizeOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_table_state_operation.go b/src/cli/get_table_state_operation.go new file mode 100644 index 0000000..9e71075 --- /dev/null +++ b/src/cli/get_table_state_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetTableStateCmd returns a cmd to handle operation getTableState +func makeOperationTableGetTableStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableState", + Short: `Get current table state`, + RunE: runOperationTableGetTableState, + } + + if err := registerOperationTableGetTableStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetTableState uses cmd flags to call endpoint api +func runOperationTableGetTableState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetTableStateParams() + if err, _ := retrieveOperationTableGetTableStateTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableStateTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetTableStateResult(appCli.Table.GetTableState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetTableStateParamFlags registers all flags needed to fill params +func registerOperationTableGetTableStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetTableStateTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableStateTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetTableStateTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table to get its state` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetTableStateTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. realtime|offline` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableGetTableStateTableNameFlag(m *table.GetTableStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetTableStateTypeFlag(m *table.GetTableStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetTableStateResult parses request result and return the string content +func parseOperationTableGetTableStateResult(resp0 *table.GetTableStateOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetTableStateOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_table_stats_operation.go b/src/cli/get_table_stats_operation.go new file mode 100644 index 0000000..0992731 --- /dev/null +++ b/src/cli/get_table_stats_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetTableStatsCmd returns a cmd to handle operation getTableStats +func makeOperationTableGetTableStatsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableStats", + Short: `Provides metadata info/stats about the table.`, + RunE: runOperationTableGetTableStats, + } + + if err := registerOperationTableGetTableStatsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetTableStats uses cmd flags to call endpoint api +func runOperationTableGetTableStats(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetTableStatsParams() + if err, _ := retrieveOperationTableGetTableStatsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableStatsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetTableStatsResult(appCli.Table.GetTableStats(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetTableStatsParamFlags registers all flags needed to fill params +func registerOperationTableGetTableStatsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetTableStatsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableStatsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetTableStatsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetTableStatsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `realtime|offline` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableGetTableStatsTableNameFlag(m *table.GetTableStatsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetTableStatsTypeFlag(m *table.GetTableStatsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetTableStatsResult parses request result and return the string content +func parseOperationTableGetTableStatsResult(resp0 *table.GetTableStatsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetTableStatsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_table_status_operation.go b/src/cli/get_table_status_operation.go new file mode 100644 index 0000000..3433056 --- /dev/null +++ b/src/cli/get_table_status_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableGetTableStatusCmd returns a cmd to handle operation getTableStatus +func makeOperationTableGetTableStatusCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableStatus", + Short: `Provides status of the table including ingestion status`, + RunE: runOperationTableGetTableStatus, + } + + if err := registerOperationTableGetTableStatusParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableGetTableStatus uses cmd flags to call endpoint api +func runOperationTableGetTableStatus(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewGetTableStatusParams() + if err, _ := retrieveOperationTableGetTableStatusTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableGetTableStatusTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableGetTableStatusResult(appCli.Table.GetTableStatus(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableGetTableStatusParamFlags registers all flags needed to fill params +func registerOperationTableGetTableStatusParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableGetTableStatusTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableGetTableStatusTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableGetTableStatusTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableGetTableStatusTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `realtime|offline` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableGetTableStatusTableNameFlag(m *table.GetTableStatusParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableGetTableStatusTypeFlag(m *table.GetTableStatusParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableGetTableStatusResult parses request result and return the string content +func parseOperationTableGetTableStatusResult(resp0 *table.GetTableStatusOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.GetTableStatusOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_table_tiers_operation.go b/src/cli/get_table_tiers_operation.go new file mode 100644 index 0000000..686c8dd --- /dev/null +++ b/src/cli/get_table_tiers_operation.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentGetTableTiersCmd returns a cmd to handle operation getTableTiers +func makeOperationSegmentGetTableTiersCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTableTiers", + Short: `Get storage tier for all segments in the given table`, + RunE: runOperationSegmentGetTableTiers, + } + + if err := registerOperationSegmentGetTableTiersParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentGetTableTiers uses cmd flags to call endpoint api +func runOperationSegmentGetTableTiers(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewGetTableTiersParams() + if err, _ := retrieveOperationSegmentGetTableTiersTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentGetTableTiersTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentGetTableTiersResult(appCli.Segment.GetTableTiers(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentGetTableTiersParamFlags registers all flags needed to fill params +func registerOperationSegmentGetTableTiersParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentGetTableTiersTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentGetTableTiersTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentGetTableTiersTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentGetTableTiersTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentGetTableTiersTableNameFlag(m *segment.GetTableTiersParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentGetTableTiersTypeFlag(m *segment.GetTableTiersParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentGetTableTiersResult parses request result and return the string content +func parseOperationSegmentGetTableTiersResult(resp0 *segment.GetTableTiersOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getTableTiersOK is not supported + + // Non schema case: warning getTableTiersNotFound is not supported + + // Non schema case: warning getTableTiersInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getTableTiersOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_tables_on_tenant_operation.go b/src/cli/get_tables_on_tenant_operation.go new file mode 100644 index 0000000..0355cdc --- /dev/null +++ b/src/cli/get_tables_on_tenant_operation.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/tenant" + + "github.com/spf13/cobra" +) + +// makeOperationTenantGetTablesOnTenantCmd returns a cmd to handle operation getTablesOnTenant +func makeOperationTenantGetTablesOnTenantCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTablesOnTenant", + Short: ``, + RunE: runOperationTenantGetTablesOnTenant, + } + + if err := registerOperationTenantGetTablesOnTenantParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantGetTablesOnTenant uses cmd flags to call endpoint api +func runOperationTenantGetTablesOnTenant(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewGetTablesOnTenantParams() + if err, _ := retrieveOperationTenantGetTablesOnTenantTenantNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantGetTablesOnTenantResult(appCli.Tenant.GetTablesOnTenant(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantGetTablesOnTenantParamFlags registers all flags needed to fill params +func registerOperationTenantGetTablesOnTenantParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantGetTablesOnTenantTenantNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantGetTablesOnTenantTenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Tenant name` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} + +func retrieveOperationTenantGetTablesOnTenantTenantNameFlag(m *tenant.GetTablesOnTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTenantGetTablesOnTenantResult parses request result and return the string content +func parseOperationTenantGetTablesOnTenantResult(resp0 *tenant.GetTablesOnTenantOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getTablesOnTenantOK is not supported + + // Non schema case: warning getTablesOnTenantInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response getTablesOnTenantOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_tables_to_brokers_mapping_operation.go b/src/cli/get_tables_to_brokers_mapping_operation.go new file mode 100644 index 0000000..662458d --- /dev/null +++ b/src/cli/get_tables_to_brokers_mapping_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetTablesToBrokersMappingCmd returns a cmd to handle operation getTablesToBrokersMapping +func makeOperationBrokerGetTablesToBrokersMappingCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTablesToBrokersMapping", + Short: `List tables to brokers mappings`, + RunE: runOperationBrokerGetTablesToBrokersMapping, + } + + if err := registerOperationBrokerGetTablesToBrokersMappingParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetTablesToBrokersMapping uses cmd flags to call endpoint api +func runOperationBrokerGetTablesToBrokersMapping(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetTablesToBrokersMappingParams() + if err, _ := retrieveOperationBrokerGetTablesToBrokersMappingStateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetTablesToBrokersMappingResult(appCli.Broker.GetTablesToBrokersMapping(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetTablesToBrokersMappingParamFlags registers all flags needed to fill params +func registerOperationBrokerGetTablesToBrokersMappingParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetTablesToBrokersMappingStateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetTablesToBrokersMappingStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} + +func retrieveOperationBrokerGetTablesToBrokersMappingStateFlag(m *broker.GetTablesToBrokersMappingParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetTablesToBrokersMappingResult parses request result and return the string content +func parseOperationBrokerGetTablesToBrokersMappingResult(resp0 *broker.GetTablesToBrokersMappingOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetTablesToBrokersMappingOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tables_to_brokers_mapping_v2_operation.go b/src/cli/get_tables_to_brokers_mapping_v2_operation.go new file mode 100644 index 0000000..c2d766f --- /dev/null +++ b/src/cli/get_tables_to_brokers_mapping_v2_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetTablesToBrokersMappingV2Cmd returns a cmd to handle operation getTablesToBrokersMappingV2 +func makeOperationBrokerGetTablesToBrokersMappingV2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTablesToBrokersMappingV2", + Short: `List tables to brokers mappings`, + RunE: runOperationBrokerGetTablesToBrokersMappingV2, + } + + if err := registerOperationBrokerGetTablesToBrokersMappingV2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetTablesToBrokersMappingV2 uses cmd flags to call endpoint api +func runOperationBrokerGetTablesToBrokersMappingV2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetTablesToBrokersMappingV2Params() + if err, _ := retrieveOperationBrokerGetTablesToBrokersMappingV2StateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetTablesToBrokersMappingV2Result(appCli.Broker.GetTablesToBrokersMappingV2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetTablesToBrokersMappingV2ParamFlags registers all flags needed to fill params +func registerOperationBrokerGetTablesToBrokersMappingV2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetTablesToBrokersMappingV2StateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetTablesToBrokersMappingV2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} + +func retrieveOperationBrokerGetTablesToBrokersMappingV2StateFlag(m *broker.GetTablesToBrokersMappingV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetTablesToBrokersMappingV2Result parses request result and return the string content +func parseOperationBrokerGetTablesToBrokersMappingV2Result(resp0 *broker.GetTablesToBrokersMappingV2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetTablesToBrokersMappingV2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_config_operation.go b/src/cli/get_task_config_operation.go new file mode 100644 index 0000000..39e81bf --- /dev/null +++ b/src/cli/get_task_config_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskConfigCmd returns a cmd to handle operation getTaskConfig +func makeOperationTaskGetTaskConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskConfig", + Short: ``, + RunE: runOperationTaskGetTaskConfig, + } + + if err := registerOperationTaskGetTaskConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskConfig uses cmd flags to call endpoint api +func runOperationTaskGetTaskConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskConfigParams() + if err, _ := retrieveOperationTaskGetTaskConfigTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskConfigResult(appCli.Task.GetTaskConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskConfigParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskConfigTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskConfigTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetTaskConfigTaskNameFlag(m *task.GetTaskConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskConfigResult parses request result and return the string content +func parseOperationTaskGetTaskConfigResult(resp0 *task.GetTaskConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_configs_deprecated_operation.go b/src/cli/get_task_configs_deprecated_operation.go new file mode 100644 index 0000000..6255910 --- /dev/null +++ b/src/cli/get_task_configs_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskConfigsDeprecatedCmd returns a cmd to handle operation getTaskConfigsDeprecated +func makeOperationTaskGetTaskConfigsDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskConfigsDeprecated", + Short: ``, + RunE: runOperationTaskGetTaskConfigsDeprecated, + } + + if err := registerOperationTaskGetTaskConfigsDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskConfigsDeprecated uses cmd flags to call endpoint api +func runOperationTaskGetTaskConfigsDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskConfigsDeprecatedParams() + if err, _ := retrieveOperationTaskGetTaskConfigsDeprecatedTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskConfigsDeprecatedResult(appCli.Task.GetTaskConfigsDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskConfigsDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskConfigsDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskConfigsDeprecatedTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskConfigsDeprecatedTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetTaskConfigsDeprecatedTaskNameFlag(m *task.GetTaskConfigsDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskConfigsDeprecatedResult parses request result and return the string content +func parseOperationTaskGetTaskConfigsDeprecatedResult(resp0 *task.GetTaskConfigsDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskConfigsDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_configs_operation.go b/src/cli/get_task_configs_operation.go new file mode 100644 index 0000000..6f97123 --- /dev/null +++ b/src/cli/get_task_configs_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskConfigsCmd returns a cmd to handle operation getTaskConfigs +func makeOperationTaskGetTaskConfigsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskConfigs", + Short: ``, + RunE: runOperationTaskGetTaskConfigs, + } + + if err := registerOperationTaskGetTaskConfigsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskConfigs uses cmd flags to call endpoint api +func runOperationTaskGetTaskConfigs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskConfigsParams() + if err, _ := retrieveOperationTaskGetTaskConfigsTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskConfigsResult(appCli.Task.GetTaskConfigs(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskConfigsParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskConfigsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskConfigsTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskConfigsTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetTaskConfigsTaskNameFlag(m *task.GetTaskConfigsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskConfigsResult parses request result and return the string content +func parseOperationTaskGetTaskConfigsResult(resp0 *task.GetTaskConfigsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskConfigsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_counts_operation.go b/src/cli/get_task_counts_operation.go new file mode 100644 index 0000000..e9a5e4b --- /dev/null +++ b/src/cli/get_task_counts_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskCountsCmd returns a cmd to handle operation getTaskCounts +func makeOperationTaskGetTaskCountsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskCounts", + Short: ``, + RunE: runOperationTaskGetTaskCounts, + } + + if err := registerOperationTaskGetTaskCountsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskCounts uses cmd flags to call endpoint api +func runOperationTaskGetTaskCounts(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskCountsParams() + if err, _ := retrieveOperationTaskGetTaskCountsTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskCountsResult(appCli.Task.GetTaskCounts(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskCountsParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskCountsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskCountsTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskCountsTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskCountsTaskTypeFlag(m *task.GetTaskCountsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskCountsResult parses request result and return the string content +func parseOperationTaskGetTaskCountsResult(resp0 *task.GetTaskCountsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskCountsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_debug_info_operation.go b/src/cli/get_task_debug_info_operation.go new file mode 100644 index 0000000..c52f08b --- /dev/null +++ b/src/cli/get_task_debug_info_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskDebugInfoCmd returns a cmd to handle operation getTaskDebugInfo +func makeOperationTaskGetTaskDebugInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskDebugInfo", + Short: ``, + RunE: runOperationTaskGetTaskDebugInfo, + } + + if err := registerOperationTaskGetTaskDebugInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskDebugInfo uses cmd flags to call endpoint api +func runOperationTaskGetTaskDebugInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskDebugInfoParams() + if err, _ := retrieveOperationTaskGetTaskDebugInfoTaskNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTaskDebugInfoVerbosityFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskDebugInfoResult(appCli.Task.GetTaskDebugInfo(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskDebugInfoParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskDebugInfoParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskDebugInfoTaskNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTaskDebugInfoVerbosityParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskDebugInfoTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} +func registerOperationTaskGetTaskDebugInfoVerbosityParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + verbosityDescription := `verbosity (Prints information for the given task name.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks)` + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + var verbosityFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(verbosityFlagName, verbosityFlagDefault, verbosityDescription) + + return nil +} + +func retrieveOperationTaskGetTaskDebugInfoTaskNameFlag(m *task.GetTaskDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTaskDebugInfoVerbosityFlag(m *task.GetTaskDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("verbosity") { + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + verbosityFlagValue, err := cmd.Flags().GetInt32(verbosityFlagName) + if err != nil { + return err, false + } + m.Verbosity = &verbosityFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskDebugInfoResult parses request result and return the string content +func parseOperationTaskGetTaskDebugInfoResult(resp0 *task.GetTaskDebugInfoOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskDebugInfoOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_generation_debug_into_operation.go b/src/cli/get_task_generation_debug_into_operation.go new file mode 100644 index 0000000..a162c7f --- /dev/null +++ b/src/cli/get_task_generation_debug_into_operation.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskGenerationDebugIntoCmd returns a cmd to handle operation getTaskGenerationDebugInto +func makeOperationTaskGetTaskGenerationDebugIntoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskGenerationDebugInto", + Short: ``, + RunE: runOperationTaskGetTaskGenerationDebugInto, + } + + if err := registerOperationTaskGetTaskGenerationDebugIntoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskGenerationDebugInto uses cmd flags to call endpoint api +func runOperationTaskGetTaskGenerationDebugInto(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskGenerationDebugIntoParams() + if err, _ := retrieveOperationTaskGetTaskGenerationDebugIntoLocalOnlyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTaskGenerationDebugIntoTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTaskGenerationDebugIntoTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskGenerationDebugIntoResult(appCli.Task.GetTaskGenerationDebugInto(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskGenerationDebugIntoParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskGenerationDebugIntoParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskGenerationDebugIntoLocalOnlyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTaskGenerationDebugIntoTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTaskGenerationDebugIntoTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskGenerationDebugIntoLocalOnlyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + localOnlyDescription := `Whether to only lookup local cache for logs` + + var localOnlyFlagName string + if cmdPrefix == "" { + localOnlyFlagName = "localOnly" + } else { + localOnlyFlagName = fmt.Sprintf("%v.localOnly", cmdPrefix) + } + + var localOnlyFlagDefault bool + + _ = cmd.PersistentFlags().Bool(localOnlyFlagName, localOnlyFlagDefault, localOnlyDescription) + + return nil +} +func registerOperationTaskGetTaskGenerationDebugIntoTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Table name with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationTaskGetTaskGenerationDebugIntoTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskGenerationDebugIntoLocalOnlyFlag(m *task.GetTaskGenerationDebugIntoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("localOnly") { + + var localOnlyFlagName string + if cmdPrefix == "" { + localOnlyFlagName = "localOnly" + } else { + localOnlyFlagName = fmt.Sprintf("%v.localOnly", cmdPrefix) + } + + localOnlyFlagValue, err := cmd.Flags().GetBool(localOnlyFlagName) + if err != nil { + return err, false + } + m.LocalOnly = &localOnlyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTaskGenerationDebugIntoTableNameWithTypeFlag(m *task.GetTaskGenerationDebugIntoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTaskGenerationDebugIntoTaskTypeFlag(m *task.GetTaskGenerationDebugIntoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskGenerationDebugIntoResult parses request result and return the string content +func parseOperationTaskGetTaskGenerationDebugIntoResult(resp0 *task.GetTaskGenerationDebugIntoOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskGenerationDebugIntoOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_metadata_by_table_operation.go b/src/cli/get_task_metadata_by_table_operation.go new file mode 100644 index 0000000..1cc92b6 --- /dev/null +++ b/src/cli/get_task_metadata_by_table_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskMetadataByTableCmd returns a cmd to handle operation getTaskMetadataByTable +func makeOperationTaskGetTaskMetadataByTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskMetadataByTable", + Short: ``, + RunE: runOperationTaskGetTaskMetadataByTable, + } + + if err := registerOperationTaskGetTaskMetadataByTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskMetadataByTable uses cmd flags to call endpoint api +func runOperationTaskGetTaskMetadataByTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskMetadataByTableParams() + if err, _ := retrieveOperationTaskGetTaskMetadataByTableTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTaskMetadataByTableTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskMetadataByTableResult(appCli.Task.GetTaskMetadataByTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskMetadataByTableParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskMetadataByTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskMetadataByTableTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTaskMetadataByTableTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskMetadataByTableTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Table name with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationTaskGetTaskMetadataByTableTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskMetadataByTableTableNameWithTypeFlag(m *task.GetTaskMetadataByTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTaskMetadataByTableTaskTypeFlag(m *task.GetTaskMetadataByTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskMetadataByTableResult parses request result and return the string content +func parseOperationTaskGetTaskMetadataByTableResult(resp0 *task.GetTaskMetadataByTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskMetadataByTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_queue_state_deprecated_operation.go b/src/cli/get_task_queue_state_deprecated_operation.go new file mode 100644 index 0000000..7aa6be1 --- /dev/null +++ b/src/cli/get_task_queue_state_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskQueueStateDeprecatedCmd returns a cmd to handle operation getTaskQueueStateDeprecated +func makeOperationTaskGetTaskQueueStateDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskQueueStateDeprecated", + Short: ``, + RunE: runOperationTaskGetTaskQueueStateDeprecated, + } + + if err := registerOperationTaskGetTaskQueueStateDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskQueueStateDeprecated uses cmd flags to call endpoint api +func runOperationTaskGetTaskQueueStateDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskQueueStateDeprecatedParams() + if err, _ := retrieveOperationTaskGetTaskQueueStateDeprecatedTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskQueueStateDeprecatedResult(appCli.Task.GetTaskQueueStateDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskQueueStateDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskQueueStateDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskQueueStateDeprecatedTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskQueueStateDeprecatedTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskQueueStateDeprecatedTaskTypeFlag(m *task.GetTaskQueueStateDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskQueueStateDeprecatedResult parses request result and return the string content +func parseOperationTaskGetTaskQueueStateDeprecatedResult(resp0 *task.GetTaskQueueStateDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskQueueStateDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_queue_state_operation.go b/src/cli/get_task_queue_state_operation.go new file mode 100644 index 0000000..8b1a0f2 --- /dev/null +++ b/src/cli/get_task_queue_state_operation.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskQueueStateCmd returns a cmd to handle operation getTaskQueueState +func makeOperationTaskGetTaskQueueStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskQueueState", + Short: ``, + RunE: runOperationTaskGetTaskQueueState, + } + + if err := registerOperationTaskGetTaskQueueStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskQueueState uses cmd flags to call endpoint api +func runOperationTaskGetTaskQueueState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskQueueStateParams() + if err, _ := retrieveOperationTaskGetTaskQueueStateTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskQueueStateResult(appCli.Task.GetTaskQueueState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskQueueStateParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskQueueStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskQueueStateTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskQueueStateTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskQueueStateTaskTypeFlag(m *task.GetTaskQueueStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskQueueStateResult parses request result and return the string content +func parseOperationTaskGetTaskQueueStateResult(resp0 *task.GetTaskQueueStateOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskQueueStateOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_queues_operation.go b/src/cli/get_task_queues_operation.go new file mode 100644 index 0000000..f4eaabe --- /dev/null +++ b/src/cli/get_task_queues_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskQueuesCmd returns a cmd to handle operation getTaskQueues +func makeOperationTaskGetTaskQueuesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskQueues", + Short: ``, + RunE: runOperationTaskGetTaskQueues, + } + + if err := registerOperationTaskGetTaskQueuesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskQueues uses cmd flags to call endpoint api +func runOperationTaskGetTaskQueues(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskQueuesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskQueuesResult(appCli.Task.GetTaskQueues(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskQueuesParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskQueuesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTaskGetTaskQueuesResult parses request result and return the string content +func parseOperationTaskGetTaskQueuesResult(resp0 *task.GetTaskQueuesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskQueuesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_state_deprecated_operation.go b/src/cli/get_task_state_deprecated_operation.go new file mode 100644 index 0000000..c337855 --- /dev/null +++ b/src/cli/get_task_state_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskStateDeprecatedCmd returns a cmd to handle operation getTaskStateDeprecated +func makeOperationTaskGetTaskStateDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskStateDeprecated", + Short: ``, + RunE: runOperationTaskGetTaskStateDeprecated, + } + + if err := registerOperationTaskGetTaskStateDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskStateDeprecated uses cmd flags to call endpoint api +func runOperationTaskGetTaskStateDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskStateDeprecatedParams() + if err, _ := retrieveOperationTaskGetTaskStateDeprecatedTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskStateDeprecatedResult(appCli.Task.GetTaskStateDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskStateDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskStateDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskStateDeprecatedTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskStateDeprecatedTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetTaskStateDeprecatedTaskNameFlag(m *task.GetTaskStateDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskStateDeprecatedResult parses request result and return the string content +func parseOperationTaskGetTaskStateDeprecatedResult(resp0 *task.GetTaskStateDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskStateDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_state_operation.go b/src/cli/get_task_state_operation.go new file mode 100644 index 0000000..4be4996 --- /dev/null +++ b/src/cli/get_task_state_operation.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskStateCmd returns a cmd to handle operation getTaskState +func makeOperationTaskGetTaskStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskState", + Short: ``, + RunE: runOperationTaskGetTaskState, + } + + if err := registerOperationTaskGetTaskStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskState uses cmd flags to call endpoint api +func runOperationTaskGetTaskState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskStateParams() + if err, _ := retrieveOperationTaskGetTaskStateTaskNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskStateResult(appCli.Task.GetTaskState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskStateParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskStateTaskNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskStateTaskNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskNameDescription := `Required. Task name` + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + var taskNameFlagDefault string + + _ = cmd.PersistentFlags().String(taskNameFlagName, taskNameFlagDefault, taskNameDescription) + + return nil +} + +func retrieveOperationTaskGetTaskStateTaskNameFlag(m *task.GetTaskStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskName") { + + var taskNameFlagName string + if cmdPrefix == "" { + taskNameFlagName = "taskName" + } else { + taskNameFlagName = fmt.Sprintf("%v.taskName", cmdPrefix) + } + + taskNameFlagValue, err := cmd.Flags().GetString(taskNameFlagName) + if err != nil { + return err, false + } + m.TaskName = taskNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskStateResult parses request result and return the string content +func parseOperationTaskGetTaskStateResult(resp0 *task.GetTaskStateOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskStateOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_states_by_table_operation.go b/src/cli/get_task_states_by_table_operation.go new file mode 100644 index 0000000..2dcdcd5 --- /dev/null +++ b/src/cli/get_task_states_by_table_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskStatesByTableCmd returns a cmd to handle operation getTaskStatesByTable +func makeOperationTaskGetTaskStatesByTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskStatesByTable", + Short: ``, + RunE: runOperationTaskGetTaskStatesByTable, + } + + if err := registerOperationTaskGetTaskStatesByTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskStatesByTable uses cmd flags to call endpoint api +func runOperationTaskGetTaskStatesByTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskStatesByTableParams() + if err, _ := retrieveOperationTaskGetTaskStatesByTableTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTaskStatesByTableTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskStatesByTableResult(appCli.Task.GetTaskStatesByTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskStatesByTableParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskStatesByTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskStatesByTableTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTaskStatesByTableTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskStatesByTableTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Table name with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationTaskGetTaskStatesByTableTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskStatesByTableTableNameWithTypeFlag(m *task.GetTaskStatesByTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTaskStatesByTableTaskTypeFlag(m *task.GetTaskStatesByTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskStatesByTableResult parses request result and return the string content +func parseOperationTaskGetTaskStatesByTableResult(resp0 *task.GetTaskStatesByTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskStatesByTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_states_deprecated_operation.go b/src/cli/get_task_states_deprecated_operation.go new file mode 100644 index 0000000..cb912d9 --- /dev/null +++ b/src/cli/get_task_states_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskStatesDeprecatedCmd returns a cmd to handle operation getTaskStatesDeprecated +func makeOperationTaskGetTaskStatesDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskStatesDeprecated", + Short: ``, + RunE: runOperationTaskGetTaskStatesDeprecated, + } + + if err := registerOperationTaskGetTaskStatesDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskStatesDeprecated uses cmd flags to call endpoint api +func runOperationTaskGetTaskStatesDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskStatesDeprecatedParams() + if err, _ := retrieveOperationTaskGetTaskStatesDeprecatedTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskStatesDeprecatedResult(appCli.Task.GetTaskStatesDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskStatesDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskStatesDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskStatesDeprecatedTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskStatesDeprecatedTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskStatesDeprecatedTaskTypeFlag(m *task.GetTaskStatesDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskStatesDeprecatedResult parses request result and return the string content +func parseOperationTaskGetTaskStatesDeprecatedResult(resp0 *task.GetTaskStatesDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskStatesDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_task_states_operation.go b/src/cli/get_task_states_operation.go new file mode 100644 index 0000000..bab58b8 --- /dev/null +++ b/src/cli/get_task_states_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTaskStatesCmd returns a cmd to handle operation getTaskStates +func makeOperationTaskGetTaskStatesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTaskStates", + Short: ``, + RunE: runOperationTaskGetTaskStates, + } + + if err := registerOperationTaskGetTaskStatesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTaskStates uses cmd flags to call endpoint api +func runOperationTaskGetTaskStates(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTaskStatesParams() + if err, _ := retrieveOperationTaskGetTaskStatesTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTaskStatesResult(appCli.Task.GetTaskStates(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTaskStatesParamFlags registers all flags needed to fill params +func registerOperationTaskGetTaskStatesParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTaskStatesTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTaskStatesTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTaskStatesTaskTypeFlag(m *task.GetTaskStatesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTaskStatesResult parses request result and return the string content +func parseOperationTaskGetTaskStatesResult(resp0 *task.GetTaskStatesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTaskStatesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tasks_debug_info1_operation.go b/src/cli/get_tasks_debug_info1_operation.go new file mode 100644 index 0000000..99ee7ac --- /dev/null +++ b/src/cli/get_tasks_debug_info1_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTasksDebugInfo1Cmd returns a cmd to handle operation getTasksDebugInfo1 +func makeOperationTaskGetTasksDebugInfo1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTasksDebugInfo_1", + Short: ``, + RunE: runOperationTaskGetTasksDebugInfo1, + } + + if err := registerOperationTaskGetTasksDebugInfo1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTasksDebugInfo1 uses cmd flags to call endpoint api +func runOperationTaskGetTasksDebugInfo1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTasksDebugInfo1Params() + if err, _ := retrieveOperationTaskGetTasksDebugInfo1TableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTasksDebugInfo1TaskTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTasksDebugInfo1VerbosityFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTasksDebugInfo1Result(appCli.Task.GetTasksDebugInfo1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTasksDebugInfo1ParamFlags registers all flags needed to fill params +func registerOperationTaskGetTasksDebugInfo1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTasksDebugInfo1TableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTasksDebugInfo1TaskTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTasksDebugInfo1VerbosityParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTasksDebugInfo1TableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Table name with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationTaskGetTasksDebugInfo1TaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} +func registerOperationTaskGetTasksDebugInfo1VerbosityParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + verbosityDescription := `verbosity (Prints information for all the tasks for the given task type and table.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks)` + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + var verbosityFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(verbosityFlagName, verbosityFlagDefault, verbosityDescription) + + return nil +} + +func retrieveOperationTaskGetTasksDebugInfo1TableNameWithTypeFlag(m *task.GetTasksDebugInfo1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTasksDebugInfo1TaskTypeFlag(m *task.GetTasksDebugInfo1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTasksDebugInfo1VerbosityFlag(m *task.GetTasksDebugInfo1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("verbosity") { + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + verbosityFlagValue, err := cmd.Flags().GetInt32(verbosityFlagName) + if err != nil { + return err, false + } + m.Verbosity = &verbosityFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTasksDebugInfo1Result parses request result and return the string content +func parseOperationTaskGetTasksDebugInfo1Result(resp0 *task.GetTasksDebugInfo1OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTasksDebugInfo1OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tasks_debug_info_operation.go b/src/cli/get_tasks_debug_info_operation.go new file mode 100644 index 0000000..10779bc --- /dev/null +++ b/src/cli/get_tasks_debug_info_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTasksDebugInfoCmd returns a cmd to handle operation getTasksDebugInfo +func makeOperationTaskGetTasksDebugInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTasksDebugInfo", + Short: ``, + RunE: runOperationTaskGetTasksDebugInfo, + } + + if err := registerOperationTaskGetTasksDebugInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTasksDebugInfo uses cmd flags to call endpoint api +func runOperationTaskGetTasksDebugInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTasksDebugInfoParams() + if err, _ := retrieveOperationTaskGetTasksDebugInfoTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskGetTasksDebugInfoVerbosityFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTasksDebugInfoResult(appCli.Task.GetTasksDebugInfo(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTasksDebugInfoParamFlags registers all flags needed to fill params +func registerOperationTaskGetTasksDebugInfoParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTasksDebugInfoTaskTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskGetTasksDebugInfoVerbosityParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTasksDebugInfoTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} +func registerOperationTaskGetTasksDebugInfoVerbosityParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + verbosityDescription := `verbosity (Prints information for all the tasks for the given task type.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks)` + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + var verbosityFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(verbosityFlagName, verbosityFlagDefault, verbosityDescription) + + return nil +} + +func retrieveOperationTaskGetTasksDebugInfoTaskTypeFlag(m *task.GetTasksDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskGetTasksDebugInfoVerbosityFlag(m *task.GetTasksDebugInfoParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("verbosity") { + + var verbosityFlagName string + if cmdPrefix == "" { + verbosityFlagName = "verbosity" + } else { + verbosityFlagName = fmt.Sprintf("%v.verbosity", cmdPrefix) + } + + verbosityFlagValue, err := cmd.Flags().GetInt32(verbosityFlagName) + if err != nil { + return err, false + } + m.Verbosity = &verbosityFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTasksDebugInfoResult parses request result and return the string content +func parseOperationTaskGetTasksDebugInfoResult(resp0 *task.GetTasksDebugInfoOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTasksDebugInfoOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tasks_deprecated_operation.go b/src/cli/get_tasks_deprecated_operation.go new file mode 100644 index 0000000..a28276f --- /dev/null +++ b/src/cli/get_tasks_deprecated_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTasksDeprecatedCmd returns a cmd to handle operation getTasksDeprecated +func makeOperationTaskGetTasksDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTasksDeprecated", + Short: ``, + RunE: runOperationTaskGetTasksDeprecated, + } + + if err := registerOperationTaskGetTasksDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTasksDeprecated uses cmd flags to call endpoint api +func runOperationTaskGetTasksDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTasksDeprecatedParams() + if err, _ := retrieveOperationTaskGetTasksDeprecatedTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTasksDeprecatedResult(appCli.Task.GetTasksDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTasksDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskGetTasksDeprecatedParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTasksDeprecatedTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTasksDeprecatedTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTasksDeprecatedTaskTypeFlag(m *task.GetTasksDeprecatedParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTasksDeprecatedResult parses request result and return the string content +func parseOperationTaskGetTasksDeprecatedResult(resp0 *task.GetTasksDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTasksDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tasks_operation.go b/src/cli/get_tasks_operation.go new file mode 100644 index 0000000..efe234a --- /dev/null +++ b/src/cli/get_tasks_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskGetTasksCmd returns a cmd to handle operation getTasks +func makeOperationTaskGetTasksCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTasks", + Short: ``, + RunE: runOperationTaskGetTasks, + } + + if err := registerOperationTaskGetTasksParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskGetTasks uses cmd flags to call endpoint api +func runOperationTaskGetTasks(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewGetTasksParams() + if err, _ := retrieveOperationTaskGetTasksTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskGetTasksResult(appCli.Task.GetTasks(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskGetTasksParamFlags registers all flags needed to fill params +func registerOperationTaskGetTasksParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskGetTasksTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskGetTasksTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskGetTasksTaskTypeFlag(m *task.GetTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskGetTasksResult parses request result and return the string content +func parseOperationTaskGetTasksResult(resp0 *task.GetTasksOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.GetTasksOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tenant_metadata_operation.go b/src/cli/get_tenant_metadata_operation.go new file mode 100644 index 0000000..e12a2df --- /dev/null +++ b/src/cli/get_tenant_metadata_operation.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tenant" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTenantGetTenantMetadataCmd returns a cmd to handle operation getTenantMetadata +func makeOperationTenantGetTenantMetadataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTenantMetadata", + Short: ``, + RunE: runOperationTenantGetTenantMetadata, + } + + if err := registerOperationTenantGetTenantMetadataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantGetTenantMetadata uses cmd flags to call endpoint api +func runOperationTenantGetTenantMetadata(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewGetTenantMetadataParams() + if err, _ := retrieveOperationTenantGetTenantMetadataTenantNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantGetTenantMetadataTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantGetTenantMetadataResult(appCli.Tenant.GetTenantMetadata(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantGetTenantMetadataParamFlags registers all flags needed to fill params +func registerOperationTenantGetTenantMetadataParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantGetTenantMetadataTenantNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantGetTenantMetadataTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantGetTenantMetadataTenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Tenant name` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} +func registerOperationTenantGetTenantMetadataTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["SERVER","BROKER"]. tenant type` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["SERVER","BROKER"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTenantGetTenantMetadataTenantNameFlag(m *tenant.GetTenantMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantGetTenantMetadataTypeFlag(m *tenant.GetTenantMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTenantGetTenantMetadataResult parses request result and return the string content +func parseOperationTenantGetTenantMetadataResult(resp0 *tenant.GetTenantMetadataOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*tenant.GetTenantMetadataOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + // Non schema case: warning getTenantMetadataNotFound is not supported + + // Non schema case: warning getTenantMetadataInternalServerError is not supported + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tenants_to_brokers_mapping_operation.go b/src/cli/get_tenants_to_brokers_mapping_operation.go new file mode 100644 index 0000000..94f1ba7 --- /dev/null +++ b/src/cli/get_tenants_to_brokers_mapping_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetTenantsToBrokersMappingCmd returns a cmd to handle operation getTenantsToBrokersMapping +func makeOperationBrokerGetTenantsToBrokersMappingCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTenantsToBrokersMapping", + Short: `List tenants to brokers mappings`, + RunE: runOperationBrokerGetTenantsToBrokersMapping, + } + + if err := registerOperationBrokerGetTenantsToBrokersMappingParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetTenantsToBrokersMapping uses cmd flags to call endpoint api +func runOperationBrokerGetTenantsToBrokersMapping(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetTenantsToBrokersMappingParams() + if err, _ := retrieveOperationBrokerGetTenantsToBrokersMappingStateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetTenantsToBrokersMappingResult(appCli.Broker.GetTenantsToBrokersMapping(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetTenantsToBrokersMappingParamFlags registers all flags needed to fill params +func registerOperationBrokerGetTenantsToBrokersMappingParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetTenantsToBrokersMappingStateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetTenantsToBrokersMappingStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} + +func retrieveOperationBrokerGetTenantsToBrokersMappingStateFlag(m *broker.GetTenantsToBrokersMappingParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetTenantsToBrokersMappingResult parses request result and return the string content +func parseOperationBrokerGetTenantsToBrokersMappingResult(resp0 *broker.GetTenantsToBrokersMappingOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetTenantsToBrokersMappingOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_tenants_to_brokers_mapping_v2_operation.go b/src/cli/get_tenants_to_brokers_mapping_v2_operation.go new file mode 100644 index 0000000..1253c44 --- /dev/null +++ b/src/cli/get_tenants_to_brokers_mapping_v2_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerGetTenantsToBrokersMappingV2Cmd returns a cmd to handle operation getTenantsToBrokersMappingV2 +func makeOperationBrokerGetTenantsToBrokersMappingV2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getTenantsToBrokersMappingV2", + Short: `List tenants to brokers mappings`, + RunE: runOperationBrokerGetTenantsToBrokersMappingV2, + } + + if err := registerOperationBrokerGetTenantsToBrokersMappingV2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerGetTenantsToBrokersMappingV2 uses cmd flags to call endpoint api +func runOperationBrokerGetTenantsToBrokersMappingV2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewGetTenantsToBrokersMappingV2Params() + if err, _ := retrieveOperationBrokerGetTenantsToBrokersMappingV2StateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerGetTenantsToBrokersMappingV2Result(appCli.Broker.GetTenantsToBrokersMappingV2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerGetTenantsToBrokersMappingV2ParamFlags registers all flags needed to fill params +func registerOperationBrokerGetTenantsToBrokersMappingV2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerGetTenantsToBrokersMappingV2StateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerGetTenantsToBrokersMappingV2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} + +func retrieveOperationBrokerGetTenantsToBrokersMappingV2StateFlag(m *broker.GetTenantsToBrokersMappingV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerGetTenantsToBrokersMappingV2Result parses request result and return the string content +func parseOperationBrokerGetTenantsToBrokersMappingV2Result(resp0 *broker.GetTenantsToBrokersMappingV2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.GetTenantsToBrokersMappingV2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_user_operation.go b/src/cli/get_user_operation.go new file mode 100644 index 0000000..783cb27 --- /dev/null +++ b/src/cli/get_user_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/user" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationUserGetUserCmd returns a cmd to handle operation getUser +func makeOperationUserGetUserCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getUser", + Short: `Get an user in cluster`, + RunE: runOperationUserGetUser, + } + + if err := registerOperationUserGetUserParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationUserGetUser uses cmd flags to call endpoint api +func runOperationUserGetUser(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := user.NewGetUserParams() + if err, _ := retrieveOperationUserGetUserComponentFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUserGetUserUsernameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationUserGetUserResult(appCli.User.GetUser(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationUserGetUserParamFlags registers all flags needed to fill params +func registerOperationUserGetUserParamFlags(cmd *cobra.Command) error { + if err := registerOperationUserGetUserComponentParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUserGetUserUsernameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationUserGetUserComponentParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + componentDescription := `` + + var componentFlagName string + if cmdPrefix == "" { + componentFlagName = "component" + } else { + componentFlagName = fmt.Sprintf("%v.component", cmdPrefix) + } + + var componentFlagDefault string + + _ = cmd.PersistentFlags().String(componentFlagName, componentFlagDefault, componentDescription) + + return nil +} +func registerOperationUserGetUserUsernameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + usernameDescription := `Required. ` + + var usernameFlagName string + if cmdPrefix == "" { + usernameFlagName = "username" + } else { + usernameFlagName = fmt.Sprintf("%v.username", cmdPrefix) + } + + var usernameFlagDefault string + + _ = cmd.PersistentFlags().String(usernameFlagName, usernameFlagDefault, usernameDescription) + + return nil +} + +func retrieveOperationUserGetUserComponentFlag(m *user.GetUserParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("component") { + + var componentFlagName string + if cmdPrefix == "" { + componentFlagName = "component" + } else { + componentFlagName = fmt.Sprintf("%v.component", cmdPrefix) + } + + componentFlagValue, err := cmd.Flags().GetString(componentFlagName) + if err != nil { + return err, false + } + m.Component = &componentFlagValue + + } + return nil, retAdded +} +func retrieveOperationUserGetUserUsernameFlag(m *user.GetUserParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("username") { + + var usernameFlagName string + if cmdPrefix == "" { + usernameFlagName = "username" + } else { + usernameFlagName = fmt.Sprintf("%v.username", cmdPrefix) + } + + usernameFlagValue, err := cmd.Flags().GetString(usernameFlagName) + if err != nil { + return err, false + } + m.Username = usernameFlagValue + + } + return nil, retAdded +} + +// parseOperationUserGetUserResult parses request result and return the string content +func parseOperationUserGetUserResult(resp0 *user.GetUserOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*user.GetUserOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/get_version_number_operation.go b/src/cli/get_version_number_operation.go new file mode 100644 index 0000000..f7293be --- /dev/null +++ b/src/cli/get_version_number_operation.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/version" + + "github.com/spf13/cobra" +) + +// makeOperationVersionGetVersionNumberCmd returns a cmd to handle operation getVersionNumber +func makeOperationVersionGetVersionNumberCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getVersionNumber", + Short: ``, + RunE: runOperationVersionGetVersionNumber, + } + + if err := registerOperationVersionGetVersionNumberParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationVersionGetVersionNumber uses cmd flags to call endpoint api +func runOperationVersionGetVersionNumber(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := version.NewGetVersionNumberParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationVersionGetVersionNumberResult(appCli.Version.GetVersionNumber(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationVersionGetVersionNumberParamFlags registers all flags needed to fill params +func registerOperationVersionGetVersionNumberParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationVersionGetVersionNumberResult parses request result and return the string content +func parseOperationVersionGetVersionNumberResult(resp0 *version.GetVersionNumberOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getVersionNumberOK is not supported + + return "", respErr + } + + // warning: non schema response getVersionNumberOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/get_write_config_operation.go b/src/cli/get_write_config_operation.go new file mode 100644 index 0000000..457d5ce --- /dev/null +++ b/src/cli/get_write_config_operation.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/write_api" + + "github.com/spf13/cobra" +) + +// makeOperationWriteAPIGetWriteConfigCmd returns a cmd to handle operation getWriteConfig +func makeOperationWriteAPIGetWriteConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "getWriteConfig", + Short: `Gets a config for specific table. May contain Kafka producer configs`, + RunE: runOperationWriteAPIGetWriteConfig, + } + + if err := registerOperationWriteAPIGetWriteConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationWriteAPIGetWriteConfig uses cmd flags to call endpoint api +func runOperationWriteAPIGetWriteConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := write_api.NewGetWriteConfigParams() + if err, _ := retrieveOperationWriteAPIGetWriteConfigTableFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationWriteAPIGetWriteConfigResult(appCli.WriteAPI.GetWriteConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationWriteAPIGetWriteConfigParamFlags registers all flags needed to fill params +func registerOperationWriteAPIGetWriteConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationWriteAPIGetWriteConfigTableParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationWriteAPIGetWriteConfigTableParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableDescription := `Required. ` + + var tableFlagName string + if cmdPrefix == "" { + tableFlagName = "table" + } else { + tableFlagName = fmt.Sprintf("%v.table", cmdPrefix) + } + + var tableFlagDefault string + + _ = cmd.PersistentFlags().String(tableFlagName, tableFlagDefault, tableDescription) + + return nil +} + +func retrieveOperationWriteAPIGetWriteConfigTableFlag(m *write_api.GetWriteConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("table") { + + var tableFlagName string + if cmdPrefix == "" { + tableFlagName = "table" + } else { + tableFlagName = fmt.Sprintf("%v.table", cmdPrefix) + } + + tableFlagValue, err := cmd.Flags().GetString(tableFlagName) + if err != nil { + return err, false + } + m.Table = tableFlagValue + + } + return nil, retAdded +} + +// parseOperationWriteAPIGetWriteConfigResult parses request result and return the string content +func parseOperationWriteAPIGetWriteConfigResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning getWriteConfig default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/indexing_config_model.go b/src/cli/indexing_config_model.go new file mode 100644 index 0000000..a0f25a4 --- /dev/null +++ b/src/cli/indexing_config_model.go @@ -0,0 +1,1425 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for IndexingConfig + +// register flags to command +func registerModelIndexingConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerIndexingConfigAggregateMetrics(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigAutoGeneratedInvertedIndex(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigBloomFilterColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigBloomFilterConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigColumnMinMaxValueGeneratorMode(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigCreateInvertedIndexDuringSegmentGeneration(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigEnableDefaultStarTree(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigEnableDynamicStarTreeCreation(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigFstindexType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigInvertedIndexColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigJSONIndexColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigJSONIndexConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigLoadMode(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigNoDictionaryColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigNoDictionaryConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigNoDictionarySizeRatioThreshold(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigNullHandlingEnabled(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigOnHeapDictionaryColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigOptimizeDictionary(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigOptimizeDictionaryForMetrics(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigRangeIndexColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigRangeIndexVersion(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigSegmentFormatVersion(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigSegmentNameGeneratorType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigSegmentPartitionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigSortedColumn(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigStarTreeIndexConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigStreamConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIndexingConfigVarLengthDictionaryColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerIndexingConfigAggregateMetrics(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + aggregateMetricsDescription := `` + + var aggregateMetricsFlagName string + if cmdPrefix == "" { + aggregateMetricsFlagName = "aggregateMetrics" + } else { + aggregateMetricsFlagName = fmt.Sprintf("%v.aggregateMetrics", cmdPrefix) + } + + var aggregateMetricsFlagDefault bool + + _ = cmd.PersistentFlags().Bool(aggregateMetricsFlagName, aggregateMetricsFlagDefault, aggregateMetricsDescription) + + return nil +} + +func registerIndexingConfigAutoGeneratedInvertedIndex(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + autoGeneratedInvertedIndexDescription := `` + + var autoGeneratedInvertedIndexFlagName string + if cmdPrefix == "" { + autoGeneratedInvertedIndexFlagName = "autoGeneratedInvertedIndex" + } else { + autoGeneratedInvertedIndexFlagName = fmt.Sprintf("%v.autoGeneratedInvertedIndex", cmdPrefix) + } + + var autoGeneratedInvertedIndexFlagDefault bool + + _ = cmd.PersistentFlags().Bool(autoGeneratedInvertedIndexFlagName, autoGeneratedInvertedIndexFlagDefault, autoGeneratedInvertedIndexDescription) + + return nil +} + +func registerIndexingConfigBloomFilterColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: bloomFilterColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigBloomFilterConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: bloomFilterConfigs map[string]BloomFilterConfig map type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigColumnMinMaxValueGeneratorMode(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + columnMinMaxValueGeneratorModeDescription := `` + + var columnMinMaxValueGeneratorModeFlagName string + if cmdPrefix == "" { + columnMinMaxValueGeneratorModeFlagName = "columnMinMaxValueGeneratorMode" + } else { + columnMinMaxValueGeneratorModeFlagName = fmt.Sprintf("%v.columnMinMaxValueGeneratorMode", cmdPrefix) + } + + var columnMinMaxValueGeneratorModeFlagDefault string + + _ = cmd.PersistentFlags().String(columnMinMaxValueGeneratorModeFlagName, columnMinMaxValueGeneratorModeFlagDefault, columnMinMaxValueGeneratorModeDescription) + + return nil +} + +func registerIndexingConfigCreateInvertedIndexDuringSegmentGeneration(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + createInvertedIndexDuringSegmentGenerationDescription := `` + + var createInvertedIndexDuringSegmentGenerationFlagName string + if cmdPrefix == "" { + createInvertedIndexDuringSegmentGenerationFlagName = "createInvertedIndexDuringSegmentGeneration" + } else { + createInvertedIndexDuringSegmentGenerationFlagName = fmt.Sprintf("%v.createInvertedIndexDuringSegmentGeneration", cmdPrefix) + } + + var createInvertedIndexDuringSegmentGenerationFlagDefault bool + + _ = cmd.PersistentFlags().Bool(createInvertedIndexDuringSegmentGenerationFlagName, createInvertedIndexDuringSegmentGenerationFlagDefault, createInvertedIndexDuringSegmentGenerationDescription) + + return nil +} + +func registerIndexingConfigEnableDefaultStarTree(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + enableDefaultStarTreeDescription := `` + + var enableDefaultStarTreeFlagName string + if cmdPrefix == "" { + enableDefaultStarTreeFlagName = "enableDefaultStarTree" + } else { + enableDefaultStarTreeFlagName = fmt.Sprintf("%v.enableDefaultStarTree", cmdPrefix) + } + + var enableDefaultStarTreeFlagDefault bool + + _ = cmd.PersistentFlags().Bool(enableDefaultStarTreeFlagName, enableDefaultStarTreeFlagDefault, enableDefaultStarTreeDescription) + + return nil +} + +func registerIndexingConfigEnableDynamicStarTreeCreation(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + enableDynamicStarTreeCreationDescription := `` + + var enableDynamicStarTreeCreationFlagName string + if cmdPrefix == "" { + enableDynamicStarTreeCreationFlagName = "enableDynamicStarTreeCreation" + } else { + enableDynamicStarTreeCreationFlagName = fmt.Sprintf("%v.enableDynamicStarTreeCreation", cmdPrefix) + } + + var enableDynamicStarTreeCreationFlagDefault bool + + _ = cmd.PersistentFlags().Bool(enableDynamicStarTreeCreationFlagName, enableDynamicStarTreeCreationFlagDefault, enableDynamicStarTreeCreationDescription) + + return nil +} + +func registerIndexingConfigFstindexType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + fstindexTypeDescription := `Enum: ["LUCENE","NATIVE"]. ` + + var fstindexTypeFlagName string + if cmdPrefix == "" { + fstindexTypeFlagName = "fstindexType" + } else { + fstindexTypeFlagName = fmt.Sprintf("%v.fstindexType", cmdPrefix) + } + + var fstindexTypeFlagDefault string + + _ = cmd.PersistentFlags().String(fstindexTypeFlagName, fstindexTypeFlagDefault, fstindexTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(fstindexTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["LUCENE","NATIVE"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerIndexingConfigInvertedIndexColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: invertedIndexColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigJSONIndexColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: jsonIndexColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigJSONIndexConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: jsonIndexConfigs map[string]JSONIndexConfig map type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigLoadMode(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + loadModeDescription := `` + + var loadModeFlagName string + if cmdPrefix == "" { + loadModeFlagName = "loadMode" + } else { + loadModeFlagName = fmt.Sprintf("%v.loadMode", cmdPrefix) + } + + var loadModeFlagDefault string + + _ = cmd.PersistentFlags().String(loadModeFlagName, loadModeFlagDefault, loadModeDescription) + + return nil +} + +func registerIndexingConfigNoDictionaryColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: noDictionaryColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigNoDictionaryConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: noDictionaryConfig map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigNoDictionarySizeRatioThreshold(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + noDictionarySizeRatioThresholdDescription := `` + + var noDictionarySizeRatioThresholdFlagName string + if cmdPrefix == "" { + noDictionarySizeRatioThresholdFlagName = "noDictionarySizeRatioThreshold" + } else { + noDictionarySizeRatioThresholdFlagName = fmt.Sprintf("%v.noDictionarySizeRatioThreshold", cmdPrefix) + } + + var noDictionarySizeRatioThresholdFlagDefault float64 + + _ = cmd.PersistentFlags().Float64(noDictionarySizeRatioThresholdFlagName, noDictionarySizeRatioThresholdFlagDefault, noDictionarySizeRatioThresholdDescription) + + return nil +} + +func registerIndexingConfigNullHandlingEnabled(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nullHandlingEnabledDescription := `` + + var nullHandlingEnabledFlagName string + if cmdPrefix == "" { + nullHandlingEnabledFlagName = "nullHandlingEnabled" + } else { + nullHandlingEnabledFlagName = fmt.Sprintf("%v.nullHandlingEnabled", cmdPrefix) + } + + var nullHandlingEnabledFlagDefault bool + + _ = cmd.PersistentFlags().Bool(nullHandlingEnabledFlagName, nullHandlingEnabledFlagDefault, nullHandlingEnabledDescription) + + return nil +} + +func registerIndexingConfigOnHeapDictionaryColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: onHeapDictionaryColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigOptimizeDictionary(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + optimizeDictionaryDescription := `` + + var optimizeDictionaryFlagName string + if cmdPrefix == "" { + optimizeDictionaryFlagName = "optimizeDictionary" + } else { + optimizeDictionaryFlagName = fmt.Sprintf("%v.optimizeDictionary", cmdPrefix) + } + + var optimizeDictionaryFlagDefault bool + + _ = cmd.PersistentFlags().Bool(optimizeDictionaryFlagName, optimizeDictionaryFlagDefault, optimizeDictionaryDescription) + + return nil +} + +func registerIndexingConfigOptimizeDictionaryForMetrics(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + optimizeDictionaryForMetricsDescription := `` + + var optimizeDictionaryForMetricsFlagName string + if cmdPrefix == "" { + optimizeDictionaryForMetricsFlagName = "optimizeDictionaryForMetrics" + } else { + optimizeDictionaryForMetricsFlagName = fmt.Sprintf("%v.optimizeDictionaryForMetrics", cmdPrefix) + } + + var optimizeDictionaryForMetricsFlagDefault bool + + _ = cmd.PersistentFlags().Bool(optimizeDictionaryForMetricsFlagName, optimizeDictionaryForMetricsFlagDefault, optimizeDictionaryForMetricsDescription) + + return nil +} + +func registerIndexingConfigRangeIndexColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: rangeIndexColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigRangeIndexVersion(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + rangeIndexVersionDescription := `` + + var rangeIndexVersionFlagName string + if cmdPrefix == "" { + rangeIndexVersionFlagName = "rangeIndexVersion" + } else { + rangeIndexVersionFlagName = fmt.Sprintf("%v.rangeIndexVersion", cmdPrefix) + } + + var rangeIndexVersionFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(rangeIndexVersionFlagName, rangeIndexVersionFlagDefault, rangeIndexVersionDescription) + + return nil +} + +func registerIndexingConfigSegmentFormatVersion(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentFormatVersionDescription := `` + + var segmentFormatVersionFlagName string + if cmdPrefix == "" { + segmentFormatVersionFlagName = "segmentFormatVersion" + } else { + segmentFormatVersionFlagName = fmt.Sprintf("%v.segmentFormatVersion", cmdPrefix) + } + + var segmentFormatVersionFlagDefault string + + _ = cmd.PersistentFlags().String(segmentFormatVersionFlagName, segmentFormatVersionFlagDefault, segmentFormatVersionDescription) + + return nil +} + +func registerIndexingConfigSegmentNameGeneratorType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentNameGeneratorTypeDescription := `` + + var segmentNameGeneratorTypeFlagName string + if cmdPrefix == "" { + segmentNameGeneratorTypeFlagName = "segmentNameGeneratorType" + } else { + segmentNameGeneratorTypeFlagName = fmt.Sprintf("%v.segmentNameGeneratorType", cmdPrefix) + } + + var segmentNameGeneratorTypeFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameGeneratorTypeFlagName, segmentNameGeneratorTypeFlagDefault, segmentNameGeneratorTypeDescription) + + return nil +} + +func registerIndexingConfigSegmentPartitionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var segmentPartitionConfigFlagName string + if cmdPrefix == "" { + segmentPartitionConfigFlagName = "segmentPartitionConfig" + } else { + segmentPartitionConfigFlagName = fmt.Sprintf("%v.segmentPartitionConfig", cmdPrefix) + } + + if err := registerModelSegmentPartitionConfigFlags(depth+1, segmentPartitionConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerIndexingConfigSortedColumn(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: sortedColumn []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigStarTreeIndexConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: starTreeIndexConfigs []*StarTreeIndexConfig array type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigStreamConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: streamConfigs map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerIndexingConfigVarLengthDictionaryColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: varLengthDictionaryColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelIndexingConfigFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, aggregateMetricsAdded := retrieveIndexingConfigAggregateMetricsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || aggregateMetricsAdded + + err, autoGeneratedInvertedIndexAdded := retrieveIndexingConfigAutoGeneratedInvertedIndexFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || autoGeneratedInvertedIndexAdded + + err, bloomFilterColumnsAdded := retrieveIndexingConfigBloomFilterColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || bloomFilterColumnsAdded + + err, bloomFilterConfigsAdded := retrieveIndexingConfigBloomFilterConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || bloomFilterConfigsAdded + + err, columnMinMaxValueGeneratorModeAdded := retrieveIndexingConfigColumnMinMaxValueGeneratorModeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || columnMinMaxValueGeneratorModeAdded + + err, createInvertedIndexDuringSegmentGenerationAdded := retrieveIndexingConfigCreateInvertedIndexDuringSegmentGenerationFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || createInvertedIndexDuringSegmentGenerationAdded + + err, enableDefaultStarTreeAdded := retrieveIndexingConfigEnableDefaultStarTreeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || enableDefaultStarTreeAdded + + err, enableDynamicStarTreeCreationAdded := retrieveIndexingConfigEnableDynamicStarTreeCreationFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || enableDynamicStarTreeCreationAdded + + err, fstindexTypeAdded := retrieveIndexingConfigFstindexTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fstindexTypeAdded + + err, invertedIndexColumnsAdded := retrieveIndexingConfigInvertedIndexColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || invertedIndexColumnsAdded + + err, jsonIndexColumnsAdded := retrieveIndexingConfigJSONIndexColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || jsonIndexColumnsAdded + + err, jsonIndexConfigsAdded := retrieveIndexingConfigJSONIndexConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || jsonIndexConfigsAdded + + err, loadModeAdded := retrieveIndexingConfigLoadModeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || loadModeAdded + + err, noDictionaryColumnsAdded := retrieveIndexingConfigNoDictionaryColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || noDictionaryColumnsAdded + + err, noDictionaryConfigAdded := retrieveIndexingConfigNoDictionaryConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || noDictionaryConfigAdded + + err, noDictionarySizeRatioThresholdAdded := retrieveIndexingConfigNoDictionarySizeRatioThresholdFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || noDictionarySizeRatioThresholdAdded + + err, nullHandlingEnabledAdded := retrieveIndexingConfigNullHandlingEnabledFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nullHandlingEnabledAdded + + err, onHeapDictionaryColumnsAdded := retrieveIndexingConfigOnHeapDictionaryColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || onHeapDictionaryColumnsAdded + + err, optimizeDictionaryAdded := retrieveIndexingConfigOptimizeDictionaryFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || optimizeDictionaryAdded + + err, optimizeDictionaryForMetricsAdded := retrieveIndexingConfigOptimizeDictionaryForMetricsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || optimizeDictionaryForMetricsAdded + + err, rangeIndexColumnsAdded := retrieveIndexingConfigRangeIndexColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || rangeIndexColumnsAdded + + err, rangeIndexVersionAdded := retrieveIndexingConfigRangeIndexVersionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || rangeIndexVersionAdded + + err, segmentFormatVersionAdded := retrieveIndexingConfigSegmentFormatVersionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentFormatVersionAdded + + err, segmentNameGeneratorTypeAdded := retrieveIndexingConfigSegmentNameGeneratorTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentNameGeneratorTypeAdded + + err, segmentPartitionConfigAdded := retrieveIndexingConfigSegmentPartitionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentPartitionConfigAdded + + err, sortedColumnAdded := retrieveIndexingConfigSortedColumnFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || sortedColumnAdded + + err, starTreeIndexConfigsAdded := retrieveIndexingConfigStarTreeIndexConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || starTreeIndexConfigsAdded + + err, streamConfigsAdded := retrieveIndexingConfigStreamConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || streamConfigsAdded + + err, varLengthDictionaryColumnsAdded := retrieveIndexingConfigVarLengthDictionaryColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || varLengthDictionaryColumnsAdded + + return nil, retAdded +} + +func retrieveIndexingConfigAggregateMetricsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + aggregateMetricsFlagName := fmt.Sprintf("%v.aggregateMetrics", cmdPrefix) + if cmd.Flags().Changed(aggregateMetricsFlagName) { + + var aggregateMetricsFlagName string + if cmdPrefix == "" { + aggregateMetricsFlagName = "aggregateMetrics" + } else { + aggregateMetricsFlagName = fmt.Sprintf("%v.aggregateMetrics", cmdPrefix) + } + + aggregateMetricsFlagValue, err := cmd.Flags().GetBool(aggregateMetricsFlagName) + if err != nil { + return err, false + } + m.AggregateMetrics = aggregateMetricsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigAutoGeneratedInvertedIndexFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + autoGeneratedInvertedIndexFlagName := fmt.Sprintf("%v.autoGeneratedInvertedIndex", cmdPrefix) + if cmd.Flags().Changed(autoGeneratedInvertedIndexFlagName) { + + var autoGeneratedInvertedIndexFlagName string + if cmdPrefix == "" { + autoGeneratedInvertedIndexFlagName = "autoGeneratedInvertedIndex" + } else { + autoGeneratedInvertedIndexFlagName = fmt.Sprintf("%v.autoGeneratedInvertedIndex", cmdPrefix) + } + + autoGeneratedInvertedIndexFlagValue, err := cmd.Flags().GetBool(autoGeneratedInvertedIndexFlagName) + if err != nil { + return err, false + } + m.AutoGeneratedInvertedIndex = autoGeneratedInvertedIndexFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigBloomFilterColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + bloomFilterColumnsFlagName := fmt.Sprintf("%v.bloomFilterColumns", cmdPrefix) + if cmd.Flags().Changed(bloomFilterColumnsFlagName) { + // warning: bloomFilterColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigBloomFilterConfigsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + bloomFilterConfigsFlagName := fmt.Sprintf("%v.bloomFilterConfigs", cmdPrefix) + if cmd.Flags().Changed(bloomFilterConfigsFlagName) { + // warning: bloomFilterConfigs map type map[string]BloomFilterConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigColumnMinMaxValueGeneratorModeFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + columnMinMaxValueGeneratorModeFlagName := fmt.Sprintf("%v.columnMinMaxValueGeneratorMode", cmdPrefix) + if cmd.Flags().Changed(columnMinMaxValueGeneratorModeFlagName) { + + var columnMinMaxValueGeneratorModeFlagName string + if cmdPrefix == "" { + columnMinMaxValueGeneratorModeFlagName = "columnMinMaxValueGeneratorMode" + } else { + columnMinMaxValueGeneratorModeFlagName = fmt.Sprintf("%v.columnMinMaxValueGeneratorMode", cmdPrefix) + } + + columnMinMaxValueGeneratorModeFlagValue, err := cmd.Flags().GetString(columnMinMaxValueGeneratorModeFlagName) + if err != nil { + return err, false + } + m.ColumnMinMaxValueGeneratorMode = columnMinMaxValueGeneratorModeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigCreateInvertedIndexDuringSegmentGenerationFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + createInvertedIndexDuringSegmentGenerationFlagName := fmt.Sprintf("%v.createInvertedIndexDuringSegmentGeneration", cmdPrefix) + if cmd.Flags().Changed(createInvertedIndexDuringSegmentGenerationFlagName) { + + var createInvertedIndexDuringSegmentGenerationFlagName string + if cmdPrefix == "" { + createInvertedIndexDuringSegmentGenerationFlagName = "createInvertedIndexDuringSegmentGeneration" + } else { + createInvertedIndexDuringSegmentGenerationFlagName = fmt.Sprintf("%v.createInvertedIndexDuringSegmentGeneration", cmdPrefix) + } + + createInvertedIndexDuringSegmentGenerationFlagValue, err := cmd.Flags().GetBool(createInvertedIndexDuringSegmentGenerationFlagName) + if err != nil { + return err, false + } + m.CreateInvertedIndexDuringSegmentGeneration = createInvertedIndexDuringSegmentGenerationFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigEnableDefaultStarTreeFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + enableDefaultStarTreeFlagName := fmt.Sprintf("%v.enableDefaultStarTree", cmdPrefix) + if cmd.Flags().Changed(enableDefaultStarTreeFlagName) { + + var enableDefaultStarTreeFlagName string + if cmdPrefix == "" { + enableDefaultStarTreeFlagName = "enableDefaultStarTree" + } else { + enableDefaultStarTreeFlagName = fmt.Sprintf("%v.enableDefaultStarTree", cmdPrefix) + } + + enableDefaultStarTreeFlagValue, err := cmd.Flags().GetBool(enableDefaultStarTreeFlagName) + if err != nil { + return err, false + } + m.EnableDefaultStarTree = enableDefaultStarTreeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigEnableDynamicStarTreeCreationFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + enableDynamicStarTreeCreationFlagName := fmt.Sprintf("%v.enableDynamicStarTreeCreation", cmdPrefix) + if cmd.Flags().Changed(enableDynamicStarTreeCreationFlagName) { + + var enableDynamicStarTreeCreationFlagName string + if cmdPrefix == "" { + enableDynamicStarTreeCreationFlagName = "enableDynamicStarTreeCreation" + } else { + enableDynamicStarTreeCreationFlagName = fmt.Sprintf("%v.enableDynamicStarTreeCreation", cmdPrefix) + } + + enableDynamicStarTreeCreationFlagValue, err := cmd.Flags().GetBool(enableDynamicStarTreeCreationFlagName) + if err != nil { + return err, false + } + m.EnableDynamicStarTreeCreation = enableDynamicStarTreeCreationFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigFstindexTypeFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fstindexTypeFlagName := fmt.Sprintf("%v.fstindexType", cmdPrefix) + if cmd.Flags().Changed(fstindexTypeFlagName) { + + var fstindexTypeFlagName string + if cmdPrefix == "" { + fstindexTypeFlagName = "fstindexType" + } else { + fstindexTypeFlagName = fmt.Sprintf("%v.fstindexType", cmdPrefix) + } + + fstindexTypeFlagValue, err := cmd.Flags().GetString(fstindexTypeFlagName) + if err != nil { + return err, false + } + m.FstindexType = fstindexTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigInvertedIndexColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + invertedIndexColumnsFlagName := fmt.Sprintf("%v.invertedIndexColumns", cmdPrefix) + if cmd.Flags().Changed(invertedIndexColumnsFlagName) { + // warning: invertedIndexColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigJSONIndexColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + jsonIndexColumnsFlagName := fmt.Sprintf("%v.jsonIndexColumns", cmdPrefix) + if cmd.Flags().Changed(jsonIndexColumnsFlagName) { + // warning: jsonIndexColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigJSONIndexConfigsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + jsonIndexConfigsFlagName := fmt.Sprintf("%v.jsonIndexConfigs", cmdPrefix) + if cmd.Flags().Changed(jsonIndexConfigsFlagName) { + // warning: jsonIndexConfigs map type map[string]JSONIndexConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigLoadModeFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + loadModeFlagName := fmt.Sprintf("%v.loadMode", cmdPrefix) + if cmd.Flags().Changed(loadModeFlagName) { + + var loadModeFlagName string + if cmdPrefix == "" { + loadModeFlagName = "loadMode" + } else { + loadModeFlagName = fmt.Sprintf("%v.loadMode", cmdPrefix) + } + + loadModeFlagValue, err := cmd.Flags().GetString(loadModeFlagName) + if err != nil { + return err, false + } + m.LoadMode = loadModeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigNoDictionaryColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + noDictionaryColumnsFlagName := fmt.Sprintf("%v.noDictionaryColumns", cmdPrefix) + if cmd.Flags().Changed(noDictionaryColumnsFlagName) { + // warning: noDictionaryColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigNoDictionaryConfigFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + noDictionaryConfigFlagName := fmt.Sprintf("%v.noDictionaryConfig", cmdPrefix) + if cmd.Flags().Changed(noDictionaryConfigFlagName) { + // warning: noDictionaryConfig map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigNoDictionarySizeRatioThresholdFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + noDictionarySizeRatioThresholdFlagName := fmt.Sprintf("%v.noDictionarySizeRatioThreshold", cmdPrefix) + if cmd.Flags().Changed(noDictionarySizeRatioThresholdFlagName) { + + var noDictionarySizeRatioThresholdFlagName string + if cmdPrefix == "" { + noDictionarySizeRatioThresholdFlagName = "noDictionarySizeRatioThreshold" + } else { + noDictionarySizeRatioThresholdFlagName = fmt.Sprintf("%v.noDictionarySizeRatioThreshold", cmdPrefix) + } + + noDictionarySizeRatioThresholdFlagValue, err := cmd.Flags().GetFloat64(noDictionarySizeRatioThresholdFlagName) + if err != nil { + return err, false + } + m.NoDictionarySizeRatioThreshold = noDictionarySizeRatioThresholdFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigNullHandlingEnabledFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nullHandlingEnabledFlagName := fmt.Sprintf("%v.nullHandlingEnabled", cmdPrefix) + if cmd.Flags().Changed(nullHandlingEnabledFlagName) { + + var nullHandlingEnabledFlagName string + if cmdPrefix == "" { + nullHandlingEnabledFlagName = "nullHandlingEnabled" + } else { + nullHandlingEnabledFlagName = fmt.Sprintf("%v.nullHandlingEnabled", cmdPrefix) + } + + nullHandlingEnabledFlagValue, err := cmd.Flags().GetBool(nullHandlingEnabledFlagName) + if err != nil { + return err, false + } + m.NullHandlingEnabled = nullHandlingEnabledFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigOnHeapDictionaryColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + onHeapDictionaryColumnsFlagName := fmt.Sprintf("%v.onHeapDictionaryColumns", cmdPrefix) + if cmd.Flags().Changed(onHeapDictionaryColumnsFlagName) { + // warning: onHeapDictionaryColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigOptimizeDictionaryFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + optimizeDictionaryFlagName := fmt.Sprintf("%v.optimizeDictionary", cmdPrefix) + if cmd.Flags().Changed(optimizeDictionaryFlagName) { + + var optimizeDictionaryFlagName string + if cmdPrefix == "" { + optimizeDictionaryFlagName = "optimizeDictionary" + } else { + optimizeDictionaryFlagName = fmt.Sprintf("%v.optimizeDictionary", cmdPrefix) + } + + optimizeDictionaryFlagValue, err := cmd.Flags().GetBool(optimizeDictionaryFlagName) + if err != nil { + return err, false + } + m.OptimizeDictionary = optimizeDictionaryFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigOptimizeDictionaryForMetricsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + optimizeDictionaryForMetricsFlagName := fmt.Sprintf("%v.optimizeDictionaryForMetrics", cmdPrefix) + if cmd.Flags().Changed(optimizeDictionaryForMetricsFlagName) { + + var optimizeDictionaryForMetricsFlagName string + if cmdPrefix == "" { + optimizeDictionaryForMetricsFlagName = "optimizeDictionaryForMetrics" + } else { + optimizeDictionaryForMetricsFlagName = fmt.Sprintf("%v.optimizeDictionaryForMetrics", cmdPrefix) + } + + optimizeDictionaryForMetricsFlagValue, err := cmd.Flags().GetBool(optimizeDictionaryForMetricsFlagName) + if err != nil { + return err, false + } + m.OptimizeDictionaryForMetrics = optimizeDictionaryForMetricsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigRangeIndexColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + rangeIndexColumnsFlagName := fmt.Sprintf("%v.rangeIndexColumns", cmdPrefix) + if cmd.Flags().Changed(rangeIndexColumnsFlagName) { + // warning: rangeIndexColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigRangeIndexVersionFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + rangeIndexVersionFlagName := fmt.Sprintf("%v.rangeIndexVersion", cmdPrefix) + if cmd.Flags().Changed(rangeIndexVersionFlagName) { + + var rangeIndexVersionFlagName string + if cmdPrefix == "" { + rangeIndexVersionFlagName = "rangeIndexVersion" + } else { + rangeIndexVersionFlagName = fmt.Sprintf("%v.rangeIndexVersion", cmdPrefix) + } + + rangeIndexVersionFlagValue, err := cmd.Flags().GetInt32(rangeIndexVersionFlagName) + if err != nil { + return err, false + } + m.RangeIndexVersion = rangeIndexVersionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigSegmentFormatVersionFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentFormatVersionFlagName := fmt.Sprintf("%v.segmentFormatVersion", cmdPrefix) + if cmd.Flags().Changed(segmentFormatVersionFlagName) { + + var segmentFormatVersionFlagName string + if cmdPrefix == "" { + segmentFormatVersionFlagName = "segmentFormatVersion" + } else { + segmentFormatVersionFlagName = fmt.Sprintf("%v.segmentFormatVersion", cmdPrefix) + } + + segmentFormatVersionFlagValue, err := cmd.Flags().GetString(segmentFormatVersionFlagName) + if err != nil { + return err, false + } + m.SegmentFormatVersion = segmentFormatVersionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigSegmentNameGeneratorTypeFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentNameGeneratorTypeFlagName := fmt.Sprintf("%v.segmentNameGeneratorType", cmdPrefix) + if cmd.Flags().Changed(segmentNameGeneratorTypeFlagName) { + + var segmentNameGeneratorTypeFlagName string + if cmdPrefix == "" { + segmentNameGeneratorTypeFlagName = "segmentNameGeneratorType" + } else { + segmentNameGeneratorTypeFlagName = fmt.Sprintf("%v.segmentNameGeneratorType", cmdPrefix) + } + + segmentNameGeneratorTypeFlagValue, err := cmd.Flags().GetString(segmentNameGeneratorTypeFlagName) + if err != nil { + return err, false + } + m.SegmentNameGeneratorType = segmentNameGeneratorTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIndexingConfigSegmentPartitionConfigFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentPartitionConfigFlagName := fmt.Sprintf("%v.segmentPartitionConfig", cmdPrefix) + if cmd.Flags().Changed(segmentPartitionConfigFlagName) { + // info: complex object segmentPartitionConfig SegmentPartitionConfig is retrieved outside this Changed() block + } + segmentPartitionConfigFlagValue := m.SegmentPartitionConfig + if swag.IsZero(segmentPartitionConfigFlagValue) { + segmentPartitionConfigFlagValue = &models.SegmentPartitionConfig{} + } + + err, segmentPartitionConfigAdded := retrieveModelSegmentPartitionConfigFlags(depth+1, segmentPartitionConfigFlagValue, segmentPartitionConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentPartitionConfigAdded + if segmentPartitionConfigAdded { + m.SegmentPartitionConfig = segmentPartitionConfigFlagValue + } + + return nil, retAdded +} + +func retrieveIndexingConfigSortedColumnFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + sortedColumnFlagName := fmt.Sprintf("%v.sortedColumn", cmdPrefix) + if cmd.Flags().Changed(sortedColumnFlagName) { + // warning: sortedColumn array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigStarTreeIndexConfigsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + starTreeIndexConfigsFlagName := fmt.Sprintf("%v.starTreeIndexConfigs", cmdPrefix) + if cmd.Flags().Changed(starTreeIndexConfigsFlagName) { + // warning: starTreeIndexConfigs array type []*StarTreeIndexConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigStreamConfigsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + streamConfigsFlagName := fmt.Sprintf("%v.streamConfigs", cmdPrefix) + if cmd.Flags().Changed(streamConfigsFlagName) { + // warning: streamConfigs map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIndexingConfigVarLengthDictionaryColumnsFlags(depth int, m *models.IndexingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + varLengthDictionaryColumnsFlagName := fmt.Sprintf("%v.varLengthDictionaryColumns", cmdPrefix) + if cmd.Flags().Changed(varLengthDictionaryColumnsFlagName) { + // warning: varLengthDictionaryColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/info_operation.go b/src/cli/info_operation.go new file mode 100644 index 0000000..b4a503e --- /dev/null +++ b/src/cli/info_operation.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/auth" + + "github.com/spf13/cobra" +) + +// makeOperationAuthInfoCmd returns a cmd to handle operation info +func makeOperationAuthInfoCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "info", + Short: ``, + RunE: runOperationAuthInfo, + } + + if err := registerOperationAuthInfoParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationAuthInfo uses cmd flags to call endpoint api +func runOperationAuthInfo(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := auth.NewInfoParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationAuthInfoResult(appCli.Auth.Info(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationAuthInfoParamFlags registers all flags needed to fill params +func registerOperationAuthInfoParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationAuthInfoResult parses request result and return the string content +func parseOperationAuthInfoResult(resp0 *auth.InfoOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning infoOK is not supported + + return "", respErr + } + + // warning: non schema response infoOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/ingest_from_file_operation.go b/src/cli/ingest_from_file_operation.go new file mode 100644 index 0000000..f3c528a --- /dev/null +++ b/src/cli/ingest_from_file_operation.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableIngestFromFileCmd returns a cmd to handle operation ingestFromFile +func makeOperationTableIngestFromFileCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "ingestFromFile", + Short: `Creates a segment using given file and pushes it to Pinot. + All steps happen on the controller. This API is NOT meant for production environments/large input files. + Example usage (query params need encoding): +` + "`" + `` + "`" + `` + "`" + ` +curl -X POST -F file=@data.json -H "Content-Type: multipart/form-data" "http://localhost:9000/ingestFromFile?tableNameWithType=foo_OFFLINE& +batchConfigMapStr={ + "inputFormat":"csv", + "recordReader.prop.delimiter":"|" +}" +` + "`" + `` + "`" + `` + "`" + ``, + RunE: runOperationTableIngestFromFile, + } + + if err := registerOperationTableIngestFromFileParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableIngestFromFile uses cmd flags to call endpoint api +func runOperationTableIngestFromFile(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewIngestFromFileParams() + if err, _ := retrieveOperationTableIngestFromFileBatchConfigMapStrFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableIngestFromFileBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableIngestFromFileTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableIngestFromFileResult(appCli.Table.IngestFromFile(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableIngestFromFileParamFlags registers all flags needed to fill params +func registerOperationTableIngestFromFileParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableIngestFromFileBatchConfigMapStrParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableIngestFromFileBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableIngestFromFileTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableIngestFromFileBatchConfigMapStrParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + batchConfigMapStrDescription := `Required. Batch config Map as json string. Must pass inputFormat, and optionally record reader properties. e.g. {"inputFormat":"json"}` + + var batchConfigMapStrFlagName string + if cmdPrefix == "" { + batchConfigMapStrFlagName = "batchConfigMapStr" + } else { + batchConfigMapStrFlagName = fmt.Sprintf("%v.batchConfigMapStr", cmdPrefix) + } + + var batchConfigMapStrFlagDefault string + + _ = cmd.PersistentFlags().String(batchConfigMapStrFlagName, batchConfigMapStrFlagDefault, batchConfigMapStrDescription) + + return nil +} +func registerOperationTableIngestFromFileBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelFormDataMultiPartFlags(0, "formDataMultiPart", cmd); err != nil { + return err + } + + return nil +} +func registerOperationTableIngestFromFileTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Name of the table to upload the file to` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} + +func retrieveOperationTableIngestFromFileBatchConfigMapStrFlag(m *table.IngestFromFileParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("batchConfigMapStr") { + + var batchConfigMapStrFlagName string + if cmdPrefix == "" { + batchConfigMapStrFlagName = "batchConfigMapStr" + } else { + batchConfigMapStrFlagName = fmt.Sprintf("%v.batchConfigMapStr", cmdPrefix) + } + + batchConfigMapStrFlagValue, err := cmd.Flags().GetString(batchConfigMapStrFlagName) + if err != nil { + return err, false + } + m.BatchConfigMapStr = batchConfigMapStrFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableIngestFromFileBodyFlag(m *table.IngestFromFileParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.FormDataMultiPart{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.FormDataMultiPart: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.FormDataMultiPart{} + } + err, added := retrieveModelFormDataMultiPartFlags(0, bodyValueModel, "formDataMultiPart", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationTableIngestFromFileTableNameWithTypeFlag(m *table.IngestFromFileParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableIngestFromFileResult parses request result and return the string content +func parseOperationTableIngestFromFileResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning ingestFromFile default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/ingest_from_uri_operation.go b/src/cli/ingest_from_uri_operation.go new file mode 100644 index 0000000..50734b3 --- /dev/null +++ b/src/cli/ingest_from_uri_operation.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableIngestFromURICmd returns a cmd to handle operation ingestFromUri +func makeOperationTableIngestFromURICmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "ingestFromURI", + Short: `Creates a segment using file at the given URI and pushes it to Pinot. + All steps happen on the controller. This API is NOT meant for production environments/large input files. +Example usage (query params need encoding): +` + "`" + `` + "`" + `` + "`" + ` +curl -X POST "http://localhost:9000/ingestFromURI?tableNameWithType=foo_OFFLINE +&batchConfigMapStr={ + "inputFormat":"json", + "input.fs.className":"org.apache.pinot.plugin.filesystem.S3PinotFS", + "input.fs.prop.region":"us-central", + "input.fs.prop.accessKey":"foo", + "input.fs.prop.secretKey":"bar" +} +&sourceURIStr=s3://test.bucket/path/to/json/data/data.json" +` + "`" + `` + "`" + `` + "`" + ``, + RunE: runOperationTableIngestFromURI, + } + + if err := registerOperationTableIngestFromURIParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableIngestFromURI uses cmd flags to call endpoint api +func runOperationTableIngestFromURI(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewIngestFromURIParams() + if err, _ := retrieveOperationTableIngestFromURIBatchConfigMapStrFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableIngestFromURISourceURIStrFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableIngestFromURITableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableIngestFromURIResult(appCli.Table.IngestFromURI(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableIngestFromURIParamFlags registers all flags needed to fill params +func registerOperationTableIngestFromURIParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableIngestFromURIBatchConfigMapStrParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableIngestFromURISourceURIStrParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableIngestFromURITableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableIngestFromURIBatchConfigMapStrParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + batchConfigMapStrDescription := `Required. Batch config Map as json string. Must pass inputFormat, and optionally input FS properties. e.g. {"inputFormat":"json"}` + + var batchConfigMapStrFlagName string + if cmdPrefix == "" { + batchConfigMapStrFlagName = "batchConfigMapStr" + } else { + batchConfigMapStrFlagName = fmt.Sprintf("%v.batchConfigMapStr", cmdPrefix) + } + + var batchConfigMapStrFlagDefault string + + _ = cmd.PersistentFlags().String(batchConfigMapStrFlagName, batchConfigMapStrFlagDefault, batchConfigMapStrDescription) + + return nil +} +func registerOperationTableIngestFromURISourceURIStrParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + sourceUriStrDescription := `Required. URI of file to upload` + + var sourceUriStrFlagName string + if cmdPrefix == "" { + sourceUriStrFlagName = "sourceURIStr" + } else { + sourceUriStrFlagName = fmt.Sprintf("%v.sourceURIStr", cmdPrefix) + } + + var sourceUriStrFlagDefault string + + _ = cmd.PersistentFlags().String(sourceUriStrFlagName, sourceUriStrFlagDefault, sourceUriStrDescription) + + return nil +} +func registerOperationTableIngestFromURITableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Name of the table to upload the file to` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} + +func retrieveOperationTableIngestFromURIBatchConfigMapStrFlag(m *table.IngestFromURIParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("batchConfigMapStr") { + + var batchConfigMapStrFlagName string + if cmdPrefix == "" { + batchConfigMapStrFlagName = "batchConfigMapStr" + } else { + batchConfigMapStrFlagName = fmt.Sprintf("%v.batchConfigMapStr", cmdPrefix) + } + + batchConfigMapStrFlagValue, err := cmd.Flags().GetString(batchConfigMapStrFlagName) + if err != nil { + return err, false + } + m.BatchConfigMapStr = batchConfigMapStrFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableIngestFromURISourceURIStrFlag(m *table.IngestFromURIParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("sourceURIStr") { + + var sourceUriStrFlagName string + if cmdPrefix == "" { + sourceUriStrFlagName = "sourceURIStr" + } else { + sourceUriStrFlagName = fmt.Sprintf("%v.sourceURIStr", cmdPrefix) + } + + sourceUriStrFlagValue, err := cmd.Flags().GetString(sourceUriStrFlagName) + if err != nil { + return err, false + } + m.SourceURIStr = sourceUriStrFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableIngestFromURITableNameWithTypeFlag(m *table.IngestFromURIParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableIngestFromURIResult parses request result and return the string content +func parseOperationTableIngestFromURIResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning ingestFromURI default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/ingestion_config_model.go b/src/cli/ingestion_config_model.go new file mode 100644 index 0000000..b906e7d --- /dev/null +++ b/src/cli/ingestion_config_model.go @@ -0,0 +1,499 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for IngestionConfig + +// register flags to command +func registerModelIngestionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerIngestionConfigAggregationConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigBatchIngestionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigComplexTypeConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigContinueOnError(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigFilterConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigRowTimeValueCheck(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigSegmentTimeValueCheck(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigStreamIngestionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerIngestionConfigTransformConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerIngestionConfigAggregationConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: aggregationConfigs []*AggregationConfig array type is not supported by go-swagger cli yet + + return nil +} + +func registerIngestionConfigBatchIngestionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var batchIngestionConfigFlagName string + if cmdPrefix == "" { + batchIngestionConfigFlagName = "batchIngestionConfig" + } else { + batchIngestionConfigFlagName = fmt.Sprintf("%v.batchIngestionConfig", cmdPrefix) + } + + if err := registerModelBatchIngestionConfigFlags(depth+1, batchIngestionConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerIngestionConfigComplexTypeConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var complexTypeConfigFlagName string + if cmdPrefix == "" { + complexTypeConfigFlagName = "complexTypeConfig" + } else { + complexTypeConfigFlagName = fmt.Sprintf("%v.complexTypeConfig", cmdPrefix) + } + + if err := registerModelComplexTypeConfigFlags(depth+1, complexTypeConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerIngestionConfigContinueOnError(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + continueOnErrorDescription := `` + + var continueOnErrorFlagName string + if cmdPrefix == "" { + continueOnErrorFlagName = "continueOnError" + } else { + continueOnErrorFlagName = fmt.Sprintf("%v.continueOnError", cmdPrefix) + } + + var continueOnErrorFlagDefault bool + + _ = cmd.PersistentFlags().Bool(continueOnErrorFlagName, continueOnErrorFlagDefault, continueOnErrorDescription) + + return nil +} + +func registerIngestionConfigFilterConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var filterConfigFlagName string + if cmdPrefix == "" { + filterConfigFlagName = "filterConfig" + } else { + filterConfigFlagName = fmt.Sprintf("%v.filterConfig", cmdPrefix) + } + + if err := registerModelFilterConfigFlags(depth+1, filterConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerIngestionConfigRowTimeValueCheck(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + rowTimeValueCheckDescription := `` + + var rowTimeValueCheckFlagName string + if cmdPrefix == "" { + rowTimeValueCheckFlagName = "rowTimeValueCheck" + } else { + rowTimeValueCheckFlagName = fmt.Sprintf("%v.rowTimeValueCheck", cmdPrefix) + } + + var rowTimeValueCheckFlagDefault bool + + _ = cmd.PersistentFlags().Bool(rowTimeValueCheckFlagName, rowTimeValueCheckFlagDefault, rowTimeValueCheckDescription) + + return nil +} + +func registerIngestionConfigSegmentTimeValueCheck(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentTimeValueCheckDescription := `` + + var segmentTimeValueCheckFlagName string + if cmdPrefix == "" { + segmentTimeValueCheckFlagName = "segmentTimeValueCheck" + } else { + segmentTimeValueCheckFlagName = fmt.Sprintf("%v.segmentTimeValueCheck", cmdPrefix) + } + + var segmentTimeValueCheckFlagDefault bool + + _ = cmd.PersistentFlags().Bool(segmentTimeValueCheckFlagName, segmentTimeValueCheckFlagDefault, segmentTimeValueCheckDescription) + + return nil +} + +func registerIngestionConfigStreamIngestionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var streamIngestionConfigFlagName string + if cmdPrefix == "" { + streamIngestionConfigFlagName = "streamIngestionConfig" + } else { + streamIngestionConfigFlagName = fmt.Sprintf("%v.streamIngestionConfig", cmdPrefix) + } + + if err := registerModelStreamIngestionConfigFlags(depth+1, streamIngestionConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerIngestionConfigTransformConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: transformConfigs []*TransformConfig array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelIngestionConfigFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, aggregationConfigsAdded := retrieveIngestionConfigAggregationConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || aggregationConfigsAdded + + err, batchIngestionConfigAdded := retrieveIngestionConfigBatchIngestionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || batchIngestionConfigAdded + + err, complexTypeConfigAdded := retrieveIngestionConfigComplexTypeConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || complexTypeConfigAdded + + err, continueOnErrorAdded := retrieveIngestionConfigContinueOnErrorFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || continueOnErrorAdded + + err, filterConfigAdded := retrieveIngestionConfigFilterConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || filterConfigAdded + + err, rowTimeValueCheckAdded := retrieveIngestionConfigRowTimeValueCheckFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || rowTimeValueCheckAdded + + err, segmentTimeValueCheckAdded := retrieveIngestionConfigSegmentTimeValueCheckFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentTimeValueCheckAdded + + err, streamIngestionConfigAdded := retrieveIngestionConfigStreamIngestionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || streamIngestionConfigAdded + + err, transformConfigsAdded := retrieveIngestionConfigTransformConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || transformConfigsAdded + + return nil, retAdded +} + +func retrieveIngestionConfigAggregationConfigsFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + aggregationConfigsFlagName := fmt.Sprintf("%v.aggregationConfigs", cmdPrefix) + if cmd.Flags().Changed(aggregationConfigsFlagName) { + // warning: aggregationConfigs array type []*AggregationConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveIngestionConfigBatchIngestionConfigFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + batchIngestionConfigFlagName := fmt.Sprintf("%v.batchIngestionConfig", cmdPrefix) + if cmd.Flags().Changed(batchIngestionConfigFlagName) { + // info: complex object batchIngestionConfig BatchIngestionConfig is retrieved outside this Changed() block + } + batchIngestionConfigFlagValue := m.BatchIngestionConfig + if swag.IsZero(batchIngestionConfigFlagValue) { + batchIngestionConfigFlagValue = &models.BatchIngestionConfig{} + } + + err, batchIngestionConfigAdded := retrieveModelBatchIngestionConfigFlags(depth+1, batchIngestionConfigFlagValue, batchIngestionConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || batchIngestionConfigAdded + if batchIngestionConfigAdded { + m.BatchIngestionConfig = batchIngestionConfigFlagValue + } + + return nil, retAdded +} + +func retrieveIngestionConfigComplexTypeConfigFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + complexTypeConfigFlagName := fmt.Sprintf("%v.complexTypeConfig", cmdPrefix) + if cmd.Flags().Changed(complexTypeConfigFlagName) { + // info: complex object complexTypeConfig ComplexTypeConfig is retrieved outside this Changed() block + } + complexTypeConfigFlagValue := m.ComplexTypeConfig + if swag.IsZero(complexTypeConfigFlagValue) { + complexTypeConfigFlagValue = &models.ComplexTypeConfig{} + } + + err, complexTypeConfigAdded := retrieveModelComplexTypeConfigFlags(depth+1, complexTypeConfigFlagValue, complexTypeConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || complexTypeConfigAdded + if complexTypeConfigAdded { + m.ComplexTypeConfig = complexTypeConfigFlagValue + } + + return nil, retAdded +} + +func retrieveIngestionConfigContinueOnErrorFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + continueOnErrorFlagName := fmt.Sprintf("%v.continueOnError", cmdPrefix) + if cmd.Flags().Changed(continueOnErrorFlagName) { + + var continueOnErrorFlagName string + if cmdPrefix == "" { + continueOnErrorFlagName = "continueOnError" + } else { + continueOnErrorFlagName = fmt.Sprintf("%v.continueOnError", cmdPrefix) + } + + continueOnErrorFlagValue, err := cmd.Flags().GetBool(continueOnErrorFlagName) + if err != nil { + return err, false + } + m.ContinueOnError = continueOnErrorFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIngestionConfigFilterConfigFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + filterConfigFlagName := fmt.Sprintf("%v.filterConfig", cmdPrefix) + if cmd.Flags().Changed(filterConfigFlagName) { + // info: complex object filterConfig FilterConfig is retrieved outside this Changed() block + } + filterConfigFlagValue := m.FilterConfig + if swag.IsZero(filterConfigFlagValue) { + filterConfigFlagValue = &models.FilterConfig{} + } + + err, filterConfigAdded := retrieveModelFilterConfigFlags(depth+1, filterConfigFlagValue, filterConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || filterConfigAdded + if filterConfigAdded { + m.FilterConfig = filterConfigFlagValue + } + + return nil, retAdded +} + +func retrieveIngestionConfigRowTimeValueCheckFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + rowTimeValueCheckFlagName := fmt.Sprintf("%v.rowTimeValueCheck", cmdPrefix) + if cmd.Flags().Changed(rowTimeValueCheckFlagName) { + + var rowTimeValueCheckFlagName string + if cmdPrefix == "" { + rowTimeValueCheckFlagName = "rowTimeValueCheck" + } else { + rowTimeValueCheckFlagName = fmt.Sprintf("%v.rowTimeValueCheck", cmdPrefix) + } + + rowTimeValueCheckFlagValue, err := cmd.Flags().GetBool(rowTimeValueCheckFlagName) + if err != nil { + return err, false + } + m.RowTimeValueCheck = rowTimeValueCheckFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIngestionConfigSegmentTimeValueCheckFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentTimeValueCheckFlagName := fmt.Sprintf("%v.segmentTimeValueCheck", cmdPrefix) + if cmd.Flags().Changed(segmentTimeValueCheckFlagName) { + + var segmentTimeValueCheckFlagName string + if cmdPrefix == "" { + segmentTimeValueCheckFlagName = "segmentTimeValueCheck" + } else { + segmentTimeValueCheckFlagName = fmt.Sprintf("%v.segmentTimeValueCheck", cmdPrefix) + } + + segmentTimeValueCheckFlagValue, err := cmd.Flags().GetBool(segmentTimeValueCheckFlagName) + if err != nil { + return err, false + } + m.SegmentTimeValueCheck = segmentTimeValueCheckFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveIngestionConfigStreamIngestionConfigFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + streamIngestionConfigFlagName := fmt.Sprintf("%v.streamIngestionConfig", cmdPrefix) + if cmd.Flags().Changed(streamIngestionConfigFlagName) { + // info: complex object streamIngestionConfig StreamIngestionConfig is retrieved outside this Changed() block + } + streamIngestionConfigFlagValue := m.StreamIngestionConfig + if swag.IsZero(streamIngestionConfigFlagValue) { + streamIngestionConfigFlagValue = &models.StreamIngestionConfig{} + } + + err, streamIngestionConfigAdded := retrieveModelStreamIngestionConfigFlags(depth+1, streamIngestionConfigFlagValue, streamIngestionConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || streamIngestionConfigAdded + if streamIngestionConfigAdded { + m.StreamIngestionConfig = streamIngestionConfigFlagValue + } + + return nil, retAdded +} + +func retrieveIngestionConfigTransformConfigsFlags(depth int, m *models.IngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + transformConfigsFlagName := fmt.Sprintf("%v.transformConfigs", cmdPrefix) + if cmd.Flags().Changed(transformConfigsFlagName) { + // warning: transformConfigs array type []*TransformConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/insert_operation.go b/src/cli/insert_operation.go new file mode 100644 index 0000000..730c501 --- /dev/null +++ b/src/cli/insert_operation.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/write_api" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationWriteAPIInsertCmd returns a cmd to handle operation insert +func makeOperationWriteAPIInsertCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "insert", + Short: `Insert records into a table`, + RunE: runOperationWriteAPIInsert, + } + + if err := registerOperationWriteAPIInsertParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationWriteAPIInsert uses cmd flags to call endpoint api +func runOperationWriteAPIInsert(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := write_api.NewInsertParams() + if err, _ := retrieveOperationWriteAPIInsertBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationWriteAPIInsertTableFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationWriteAPIInsertResult(appCli.WriteAPI.Insert(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationWriteAPIInsertParamFlags registers all flags needed to fill params +func registerOperationWriteAPIInsertParamFlags(cmd *cobra.Command) error { + if err := registerOperationWriteAPIInsertBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationWriteAPIInsertTableParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationWriteAPIInsertBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelWritePayloadFlags(0, "writePayload", cmd); err != nil { + return err + } + + return nil +} +func registerOperationWriteAPIInsertTableParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableDescription := `Required. ` + + var tableFlagName string + if cmdPrefix == "" { + tableFlagName = "table" + } else { + tableFlagName = fmt.Sprintf("%v.table", cmdPrefix) + } + + var tableFlagDefault string + + _ = cmd.PersistentFlags().String(tableFlagName, tableFlagDefault, tableDescription) + + return nil +} + +func retrieveOperationWriteAPIInsertBodyFlag(m *write_api.InsertParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.WritePayload{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.WritePayload: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.WritePayload{} + } + err, added := retrieveModelWritePayloadFlags(0, bodyValueModel, "writePayload", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationWriteAPIInsertTableFlag(m *write_api.InsertParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("table") { + + var tableFlagName string + if cmdPrefix == "" { + tableFlagName = "table" + } else { + tableFlagName = fmt.Sprintf("%v.table", cmdPrefix) + } + + tableFlagValue, err := cmd.Flags().GetString(tableFlagName) + if err != nil { + return err, false + } + m.Table = tableFlagValue + + } + return nil, retAdded +} + +// parseOperationWriteAPIInsertResult parses request result and return the string content +func parseOperationWriteAPIInsertResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning insert default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/instance_assignment_config_model.go b/src/cli/instance_assignment_config_model.go new file mode 100644 index 0000000..2756795 --- /dev/null +++ b/src/cli/instance_assignment_config_model.go @@ -0,0 +1,269 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for InstanceAssignmentConfig + +// register flags to command +func registerModelInstanceAssignmentConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstanceAssignmentConfigConstraintConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceAssignmentConfigPartitionSelector(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceAssignmentConfigReplicaGroupPartitionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceAssignmentConfigTagPoolConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceAssignmentConfigConstraintConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var constraintConfigFlagName string + if cmdPrefix == "" { + constraintConfigFlagName = "constraintConfig" + } else { + constraintConfigFlagName = fmt.Sprintf("%v.constraintConfig", cmdPrefix) + } + + if err := registerModelInstanceConstraintConfigFlags(depth+1, constraintConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceAssignmentConfigPartitionSelector(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + partitionSelectorDescription := `Enum: ["FD_AWARE_INSTANCE_PARTITION_SELECTOR","INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR"]. ` + + var partitionSelectorFlagName string + if cmdPrefix == "" { + partitionSelectorFlagName = "partitionSelector" + } else { + partitionSelectorFlagName = fmt.Sprintf("%v.partitionSelector", cmdPrefix) + } + + var partitionSelectorFlagDefault string + + _ = cmd.PersistentFlags().String(partitionSelectorFlagName, partitionSelectorFlagDefault, partitionSelectorDescription) + + if err := cmd.RegisterFlagCompletionFunc(partitionSelectorFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["FD_AWARE_INSTANCE_PARTITION_SELECTOR","INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerInstanceAssignmentConfigReplicaGroupPartitionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var replicaGroupPartitionConfigFlagName string + if cmdPrefix == "" { + replicaGroupPartitionConfigFlagName = "replicaGroupPartitionConfig" + } else { + replicaGroupPartitionConfigFlagName = fmt.Sprintf("%v.replicaGroupPartitionConfig", cmdPrefix) + } + + if err := registerModelInstanceReplicaGroupPartitionConfigFlags(depth+1, replicaGroupPartitionConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceAssignmentConfigTagPoolConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var tagPoolConfigFlagName string + if cmdPrefix == "" { + tagPoolConfigFlagName = "tagPoolConfig" + } else { + tagPoolConfigFlagName = fmt.Sprintf("%v.tagPoolConfig", cmdPrefix) + } + + if err := registerModelInstanceTagPoolConfigFlags(depth+1, tagPoolConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstanceAssignmentConfigFlags(depth int, m *models.InstanceAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, constraintConfigAdded := retrieveInstanceAssignmentConfigConstraintConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || constraintConfigAdded + + err, partitionSelectorAdded := retrieveInstanceAssignmentConfigPartitionSelectorFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionSelectorAdded + + err, replicaGroupPartitionConfigAdded := retrieveInstanceAssignmentConfigReplicaGroupPartitionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicaGroupPartitionConfigAdded + + err, tagPoolConfigAdded := retrieveInstanceAssignmentConfigTagPoolConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tagPoolConfigAdded + + return nil, retAdded +} + +func retrieveInstanceAssignmentConfigConstraintConfigFlags(depth int, m *models.InstanceAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + constraintConfigFlagName := fmt.Sprintf("%v.constraintConfig", cmdPrefix) + if cmd.Flags().Changed(constraintConfigFlagName) { + // info: complex object constraintConfig InstanceConstraintConfig is retrieved outside this Changed() block + } + constraintConfigFlagValue := m.ConstraintConfig + if swag.IsZero(constraintConfigFlagValue) { + constraintConfigFlagValue = &models.InstanceConstraintConfig{} + } + + err, constraintConfigAdded := retrieveModelInstanceConstraintConfigFlags(depth+1, constraintConfigFlagValue, constraintConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || constraintConfigAdded + if constraintConfigAdded { + m.ConstraintConfig = constraintConfigFlagValue + } + + return nil, retAdded +} + +func retrieveInstanceAssignmentConfigPartitionSelectorFlags(depth int, m *models.InstanceAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionSelectorFlagName := fmt.Sprintf("%v.partitionSelector", cmdPrefix) + if cmd.Flags().Changed(partitionSelectorFlagName) { + + var partitionSelectorFlagName string + if cmdPrefix == "" { + partitionSelectorFlagName = "partitionSelector" + } else { + partitionSelectorFlagName = fmt.Sprintf("%v.partitionSelector", cmdPrefix) + } + + partitionSelectorFlagValue, err := cmd.Flags().GetString(partitionSelectorFlagName) + if err != nil { + return err, false + } + m.PartitionSelector = partitionSelectorFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceAssignmentConfigReplicaGroupPartitionConfigFlags(depth int, m *models.InstanceAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + replicaGroupPartitionConfigFlagName := fmt.Sprintf("%v.replicaGroupPartitionConfig", cmdPrefix) + if cmd.Flags().Changed(replicaGroupPartitionConfigFlagName) { + // info: complex object replicaGroupPartitionConfig InstanceReplicaGroupPartitionConfig is retrieved outside this Changed() block + } + replicaGroupPartitionConfigFlagValue := m.ReplicaGroupPartitionConfig + if swag.IsZero(replicaGroupPartitionConfigFlagValue) { + replicaGroupPartitionConfigFlagValue = &models.InstanceReplicaGroupPartitionConfig{} + } + + err, replicaGroupPartitionConfigAdded := retrieveModelInstanceReplicaGroupPartitionConfigFlags(depth+1, replicaGroupPartitionConfigFlagValue, replicaGroupPartitionConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicaGroupPartitionConfigAdded + if replicaGroupPartitionConfigAdded { + m.ReplicaGroupPartitionConfig = replicaGroupPartitionConfigFlagValue + } + + return nil, retAdded +} + +func retrieveInstanceAssignmentConfigTagPoolConfigFlags(depth int, m *models.InstanceAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tagPoolConfigFlagName := fmt.Sprintf("%v.tagPoolConfig", cmdPrefix) + if cmd.Flags().Changed(tagPoolConfigFlagName) { + // info: complex object tagPoolConfig InstanceTagPoolConfig is retrieved outside this Changed() block + } + tagPoolConfigFlagValue := m.TagPoolConfig + if swag.IsZero(tagPoolConfigFlagValue) { + tagPoolConfigFlagValue = &models.InstanceTagPoolConfig{} + } + + err, tagPoolConfigAdded := retrieveModelInstanceTagPoolConfigFlags(depth+1, tagPoolConfigFlagValue, tagPoolConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tagPoolConfigAdded + if tagPoolConfigAdded { + m.TagPoolConfig = tagPoolConfigFlagValue + } + + return nil, retAdded +} diff --git a/src/cli/instance_constraint_config_model.go b/src/cli/instance_constraint_config_model.go new file mode 100644 index 0000000..a8f337a --- /dev/null +++ b/src/cli/instance_constraint_config_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for InstanceConstraintConfig + +// register flags to command +func registerModelInstanceConstraintConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstanceConstraintConfigConstraints(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceConstraintConfigConstraints(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: constraints []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstanceConstraintConfigFlags(depth int, m *models.InstanceConstraintConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, constraintsAdded := retrieveInstanceConstraintConfigConstraintsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || constraintsAdded + + return nil, retAdded +} + +func retrieveInstanceConstraintConfigConstraintsFlags(depth int, m *models.InstanceConstraintConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + constraintsFlagName := fmt.Sprintf("%v.constraints", cmdPrefix) + if cmd.Flags().Changed(constraintsFlagName) { + // warning: constraints array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/instance_info_model.go b/src/cli/instance_info_model.go new file mode 100644 index 0000000..df959b6 --- /dev/null +++ b/src/cli/instance_info_model.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for InstanceInfo + +// register flags to command +func registerModelInstanceInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstanceInfoHost(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceInfoInstanceName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceInfoPort(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceInfoHost(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + hostDescription := `` + + var hostFlagName string + if cmdPrefix == "" { + hostFlagName = "host" + } else { + hostFlagName = fmt.Sprintf("%v.host", cmdPrefix) + } + + var hostFlagDefault string + + _ = cmd.PersistentFlags().String(hostFlagName, hostFlagDefault, hostDescription) + + return nil +} + +func registerInstanceInfoInstanceName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + instanceNameDescription := `` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func registerInstanceInfoPort(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + portDescription := `` + + var portFlagName string + if cmdPrefix == "" { + portFlagName = "port" + } else { + portFlagName = fmt.Sprintf("%v.port", cmdPrefix) + } + + var portFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(portFlagName, portFlagDefault, portDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstanceInfoFlags(depth int, m *models.InstanceInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, hostAdded := retrieveInstanceInfoHostFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || hostAdded + + err, instanceNameAdded := retrieveInstanceInfoInstanceNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instanceNameAdded + + err, portAdded := retrieveInstanceInfoPortFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || portAdded + + return nil, retAdded +} + +func retrieveInstanceInfoHostFlags(depth int, m *models.InstanceInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + hostFlagName := fmt.Sprintf("%v.host", cmdPrefix) + if cmd.Flags().Changed(hostFlagName) { + + var hostFlagName string + if cmdPrefix == "" { + hostFlagName = "host" + } else { + hostFlagName = fmt.Sprintf("%v.host", cmdPrefix) + } + + hostFlagValue, err := cmd.Flags().GetString(hostFlagName) + if err != nil { + return err, false + } + m.Host = hostFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceInfoInstanceNameFlags(depth int, m *models.InstanceInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instanceNameFlagName := fmt.Sprintf("%v.instanceName", cmdPrefix) + if cmd.Flags().Changed(instanceNameFlagName) { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceInfoPortFlags(depth int, m *models.InstanceInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + portFlagName := fmt.Sprintf("%v.port", cmdPrefix) + if cmd.Flags().Changed(portFlagName) { + + var portFlagName string + if cmdPrefix == "" { + portFlagName = "port" + } else { + portFlagName = fmt.Sprintf("%v.port", cmdPrefix) + } + + portFlagValue, err := cmd.Flags().GetInt32(portFlagName) + if err != nil { + return err, false + } + m.Port = portFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/instance_model.go b/src/cli/instance_model.go new file mode 100644 index 0000000..4d337a9 --- /dev/null +++ b/src/cli/instance_model.go @@ -0,0 +1,580 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for Instance + +// register flags to command +func registerModelInstanceFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstanceAdminPort(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceGrpcPort(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceHost(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstancePools(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstancePort(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceQueriesDisabled(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceQueryMailboxPort(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceQueryServicePort(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceTags(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceAdminPort(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + adminPortDescription := `` + + var adminPortFlagName string + if cmdPrefix == "" { + adminPortFlagName = "adminPort" + } else { + adminPortFlagName = fmt.Sprintf("%v.adminPort", cmdPrefix) + } + + var adminPortFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(adminPortFlagName, adminPortFlagDefault, adminPortDescription) + + return nil +} + +func registerInstanceGrpcPort(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + grpcPortDescription := `` + + var grpcPortFlagName string + if cmdPrefix == "" { + grpcPortFlagName = "grpcPort" + } else { + grpcPortFlagName = fmt.Sprintf("%v.grpcPort", cmdPrefix) + } + + var grpcPortFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(grpcPortFlagName, grpcPortFlagDefault, grpcPortDescription) + + return nil +} + +func registerInstanceHost(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + hostDescription := `Required. ` + + var hostFlagName string + if cmdPrefix == "" { + hostFlagName = "host" + } else { + hostFlagName = fmt.Sprintf("%v.host", cmdPrefix) + } + + var hostFlagDefault string + + _ = cmd.PersistentFlags().String(hostFlagName, hostFlagDefault, hostDescription) + + return nil +} + +func registerInstancePools(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: pools map[string]int32 map type is not supported by go-swagger cli yet + + return nil +} + +func registerInstancePort(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + portDescription := `Required. ` + + var portFlagName string + if cmdPrefix == "" { + portFlagName = "port" + } else { + portFlagName = fmt.Sprintf("%v.port", cmdPrefix) + } + + var portFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(portFlagName, portFlagDefault, portDescription) + + return nil +} + +func registerInstanceQueriesDisabled(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + queriesDisabledDescription := `` + + var queriesDisabledFlagName string + if cmdPrefix == "" { + queriesDisabledFlagName = "queriesDisabled" + } else { + queriesDisabledFlagName = fmt.Sprintf("%v.queriesDisabled", cmdPrefix) + } + + var queriesDisabledFlagDefault bool + + _ = cmd.PersistentFlags().Bool(queriesDisabledFlagName, queriesDisabledFlagDefault, queriesDisabledDescription) + + return nil +} + +func registerInstanceQueryMailboxPort(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + queryMailboxPortDescription := `` + + var queryMailboxPortFlagName string + if cmdPrefix == "" { + queryMailboxPortFlagName = "queryMailboxPort" + } else { + queryMailboxPortFlagName = fmt.Sprintf("%v.queryMailboxPort", cmdPrefix) + } + + var queryMailboxPortFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(queryMailboxPortFlagName, queryMailboxPortFlagDefault, queryMailboxPortDescription) + + return nil +} + +func registerInstanceQueryServicePort(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + queryServicePortDescription := `` + + var queryServicePortFlagName string + if cmdPrefix == "" { + queryServicePortFlagName = "queryServicePort" + } else { + queryServicePortFlagName = fmt.Sprintf("%v.queryServicePort", cmdPrefix) + } + + var queryServicePortFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(queryServicePortFlagName, queryServicePortFlagDefault, queryServicePortDescription) + + return nil +} + +func registerInstanceTags(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tags []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerInstanceType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + typeDescription := `Enum: ["CONTROLLER","BROKER","SERVER","MINION"]. Required. ` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["CONTROLLER","BROKER","SERVER","MINION"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstanceFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, adminPortAdded := retrieveInstanceAdminPortFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || adminPortAdded + + err, grpcPortAdded := retrieveInstanceGrpcPortFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || grpcPortAdded + + err, hostAdded := retrieveInstanceHostFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || hostAdded + + err, poolsAdded := retrieveInstancePoolsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || poolsAdded + + err, portAdded := retrieveInstancePortFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || portAdded + + err, queriesDisabledAdded := retrieveInstanceQueriesDisabledFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || queriesDisabledAdded + + err, queryMailboxPortAdded := retrieveInstanceQueryMailboxPortFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || queryMailboxPortAdded + + err, queryServicePortAdded := retrieveInstanceQueryServicePortFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || queryServicePortAdded + + err, tagsAdded := retrieveInstanceTagsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tagsAdded + + err, typeAdded := retrieveInstanceTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || typeAdded + + return nil, retAdded +} + +func retrieveInstanceAdminPortFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + adminPortFlagName := fmt.Sprintf("%v.adminPort", cmdPrefix) + if cmd.Flags().Changed(adminPortFlagName) { + + var adminPortFlagName string + if cmdPrefix == "" { + adminPortFlagName = "adminPort" + } else { + adminPortFlagName = fmt.Sprintf("%v.adminPort", cmdPrefix) + } + + adminPortFlagValue, err := cmd.Flags().GetInt32(adminPortFlagName) + if err != nil { + return err, false + } + m.AdminPort = adminPortFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceGrpcPortFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + grpcPortFlagName := fmt.Sprintf("%v.grpcPort", cmdPrefix) + if cmd.Flags().Changed(grpcPortFlagName) { + + var grpcPortFlagName string + if cmdPrefix == "" { + grpcPortFlagName = "grpcPort" + } else { + grpcPortFlagName = fmt.Sprintf("%v.grpcPort", cmdPrefix) + } + + grpcPortFlagValue, err := cmd.Flags().GetInt32(grpcPortFlagName) + if err != nil { + return err, false + } + m.GrpcPort = grpcPortFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceHostFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + hostFlagName := fmt.Sprintf("%v.host", cmdPrefix) + if cmd.Flags().Changed(hostFlagName) { + + var hostFlagName string + if cmdPrefix == "" { + hostFlagName = "host" + } else { + hostFlagName = fmt.Sprintf("%v.host", cmdPrefix) + } + + hostFlagValue, err := cmd.Flags().GetString(hostFlagName) + if err != nil { + return err, false + } + m.Host = hostFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstancePoolsFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + poolsFlagName := fmt.Sprintf("%v.pools", cmdPrefix) + if cmd.Flags().Changed(poolsFlagName) { + // warning: pools map type map[string]int32 is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveInstancePortFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + portFlagName := fmt.Sprintf("%v.port", cmdPrefix) + if cmd.Flags().Changed(portFlagName) { + + var portFlagName string + if cmdPrefix == "" { + portFlagName = "port" + } else { + portFlagName = fmt.Sprintf("%v.port", cmdPrefix) + } + + portFlagValue, err := cmd.Flags().GetInt32(portFlagName) + if err != nil { + return err, false + } + m.Port = portFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceQueriesDisabledFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + queriesDisabledFlagName := fmt.Sprintf("%v.queriesDisabled", cmdPrefix) + if cmd.Flags().Changed(queriesDisabledFlagName) { + + var queriesDisabledFlagName string + if cmdPrefix == "" { + queriesDisabledFlagName = "queriesDisabled" + } else { + queriesDisabledFlagName = fmt.Sprintf("%v.queriesDisabled", cmdPrefix) + } + + queriesDisabledFlagValue, err := cmd.Flags().GetBool(queriesDisabledFlagName) + if err != nil { + return err, false + } + m.QueriesDisabled = &queriesDisabledFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceQueryMailboxPortFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + queryMailboxPortFlagName := fmt.Sprintf("%v.queryMailboxPort", cmdPrefix) + if cmd.Flags().Changed(queryMailboxPortFlagName) { + + var queryMailboxPortFlagName string + if cmdPrefix == "" { + queryMailboxPortFlagName = "queryMailboxPort" + } else { + queryMailboxPortFlagName = fmt.Sprintf("%v.queryMailboxPort", cmdPrefix) + } + + queryMailboxPortFlagValue, err := cmd.Flags().GetInt32(queryMailboxPortFlagName) + if err != nil { + return err, false + } + m.QueryMailboxPort = queryMailboxPortFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceQueryServicePortFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + queryServicePortFlagName := fmt.Sprintf("%v.queryServicePort", cmdPrefix) + if cmd.Flags().Changed(queryServicePortFlagName) { + + var queryServicePortFlagName string + if cmdPrefix == "" { + queryServicePortFlagName = "queryServicePort" + } else { + queryServicePortFlagName = fmt.Sprintf("%v.queryServicePort", cmdPrefix) + } + + queryServicePortFlagValue, err := cmd.Flags().GetInt32(queryServicePortFlagName) + if err != nil { + return err, false + } + m.QueryServicePort = queryServicePortFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceTagsFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tagsFlagName := fmt.Sprintf("%v.tags", cmdPrefix) + if cmd.Flags().Changed(tagsFlagName) { + // warning: tags array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveInstanceTypeFlags(depth int, m *models.Instance, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + typeFlagName := fmt.Sprintf("%v.type", cmdPrefix) + if cmd.Flags().Changed(typeFlagName) { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/instance_partitions_model.go b/src/cli/instance_partitions_model.go new file mode 100644 index 0000000..9215281 --- /dev/null +++ b/src/cli/instance_partitions_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for InstancePartitions + +// register flags to command +func registerModelInstancePartitionsFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstancePartitionsInstancePartitionsName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstancePartitionsPartitionToInstancesMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstancePartitionsInstancePartitionsName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + instancePartitionsNameDescription := `` + + var instancePartitionsNameFlagName string + if cmdPrefix == "" { + instancePartitionsNameFlagName = "instancePartitionsName" + } else { + instancePartitionsNameFlagName = fmt.Sprintf("%v.instancePartitionsName", cmdPrefix) + } + + var instancePartitionsNameFlagDefault string + + _ = cmd.PersistentFlags().String(instancePartitionsNameFlagName, instancePartitionsNameFlagDefault, instancePartitionsNameDescription) + + return nil +} + +func registerInstancePartitionsPartitionToInstancesMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: partitionToInstancesMap map[string][]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstancePartitionsFlags(depth int, m *models.InstancePartitions, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, instancePartitionsNameAdded := retrieveInstancePartitionsInstancePartitionsNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instancePartitionsNameAdded + + err, partitionToInstancesMapAdded := retrieveInstancePartitionsPartitionToInstancesMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionToInstancesMapAdded + + return nil, retAdded +} + +func retrieveInstancePartitionsInstancePartitionsNameFlags(depth int, m *models.InstancePartitions, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instancePartitionsNameFlagName := fmt.Sprintf("%v.instancePartitionsName", cmdPrefix) + if cmd.Flags().Changed(instancePartitionsNameFlagName) { + + var instancePartitionsNameFlagName string + if cmdPrefix == "" { + instancePartitionsNameFlagName = "instancePartitionsName" + } else { + instancePartitionsNameFlagName = fmt.Sprintf("%v.instancePartitionsName", cmdPrefix) + } + + instancePartitionsNameFlagValue, err := cmd.Flags().GetString(instancePartitionsNameFlagName) + if err != nil { + return err, false + } + m.InstancePartitionsName = instancePartitionsNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstancePartitionsPartitionToInstancesMapFlags(depth int, m *models.InstancePartitions, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionToInstancesMapFlagName := fmt.Sprintf("%v.partitionToInstancesMap", cmdPrefix) + if cmd.Flags().Changed(partitionToInstancesMapFlagName) { + // warning: partitionToInstancesMap map type map[string][]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/instance_replica_group_partition_config_model.go b/src/cli/instance_replica_group_partition_config_model.go new file mode 100644 index 0000000..760c914 --- /dev/null +++ b/src/cli/instance_replica_group_partition_config_model.go @@ -0,0 +1,441 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for InstanceReplicaGroupPartitionConfig + +// register flags to command +func registerModelInstanceReplicaGroupPartitionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstanceReplicaGroupPartitionConfigMinimizeDataMovement(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceReplicaGroupPartitionConfigNumInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceReplicaGroupPartitionConfigNumInstancesPerPartition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceReplicaGroupPartitionConfigNumInstancesPerReplicaGroup(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceReplicaGroupPartitionConfigNumPartitions(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceReplicaGroupPartitionConfigNumReplicaGroups(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceReplicaGroupPartitionConfigReplicaGroupBased(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigMinimizeDataMovement(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + minimizeDataMovementDescription := `` + + var minimizeDataMovementFlagName string + if cmdPrefix == "" { + minimizeDataMovementFlagName = "minimizeDataMovement" + } else { + minimizeDataMovementFlagName = fmt.Sprintf("%v.minimizeDataMovement", cmdPrefix) + } + + var minimizeDataMovementFlagDefault bool + + _ = cmd.PersistentFlags().Bool(minimizeDataMovementFlagName, minimizeDataMovementFlagDefault, minimizeDataMovementDescription) + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigNumInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numInstancesDescription := `` + + var numInstancesFlagName string + if cmdPrefix == "" { + numInstancesFlagName = "numInstances" + } else { + numInstancesFlagName = fmt.Sprintf("%v.numInstances", cmdPrefix) + } + + var numInstancesFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numInstancesFlagName, numInstancesFlagDefault, numInstancesDescription) + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigNumInstancesPerPartition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numInstancesPerPartitionDescription := `` + + var numInstancesPerPartitionFlagName string + if cmdPrefix == "" { + numInstancesPerPartitionFlagName = "numInstancesPerPartition" + } else { + numInstancesPerPartitionFlagName = fmt.Sprintf("%v.numInstancesPerPartition", cmdPrefix) + } + + var numInstancesPerPartitionFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numInstancesPerPartitionFlagName, numInstancesPerPartitionFlagDefault, numInstancesPerPartitionDescription) + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigNumInstancesPerReplicaGroup(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numInstancesPerReplicaGroupDescription := `` + + var numInstancesPerReplicaGroupFlagName string + if cmdPrefix == "" { + numInstancesPerReplicaGroupFlagName = "numInstancesPerReplicaGroup" + } else { + numInstancesPerReplicaGroupFlagName = fmt.Sprintf("%v.numInstancesPerReplicaGroup", cmdPrefix) + } + + var numInstancesPerReplicaGroupFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numInstancesPerReplicaGroupFlagName, numInstancesPerReplicaGroupFlagDefault, numInstancesPerReplicaGroupDescription) + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigNumPartitions(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numPartitionsDescription := `` + + var numPartitionsFlagName string + if cmdPrefix == "" { + numPartitionsFlagName = "numPartitions" + } else { + numPartitionsFlagName = fmt.Sprintf("%v.numPartitions", cmdPrefix) + } + + var numPartitionsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numPartitionsFlagName, numPartitionsFlagDefault, numPartitionsDescription) + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigNumReplicaGroups(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numReplicaGroupsDescription := `` + + var numReplicaGroupsFlagName string + if cmdPrefix == "" { + numReplicaGroupsFlagName = "numReplicaGroups" + } else { + numReplicaGroupsFlagName = fmt.Sprintf("%v.numReplicaGroups", cmdPrefix) + } + + var numReplicaGroupsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numReplicaGroupsFlagName, numReplicaGroupsFlagDefault, numReplicaGroupsDescription) + + return nil +} + +func registerInstanceReplicaGroupPartitionConfigReplicaGroupBased(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + replicaGroupBasedDescription := `` + + var replicaGroupBasedFlagName string + if cmdPrefix == "" { + replicaGroupBasedFlagName = "replicaGroupBased" + } else { + replicaGroupBasedFlagName = fmt.Sprintf("%v.replicaGroupBased", cmdPrefix) + } + + var replicaGroupBasedFlagDefault bool + + _ = cmd.PersistentFlags().Bool(replicaGroupBasedFlagName, replicaGroupBasedFlagDefault, replicaGroupBasedDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstanceReplicaGroupPartitionConfigFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, minimizeDataMovementAdded := retrieveInstanceReplicaGroupPartitionConfigMinimizeDataMovementFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || minimizeDataMovementAdded + + err, numInstancesAdded := retrieveInstanceReplicaGroupPartitionConfigNumInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numInstancesAdded + + err, numInstancesPerPartitionAdded := retrieveInstanceReplicaGroupPartitionConfigNumInstancesPerPartitionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numInstancesPerPartitionAdded + + err, numInstancesPerReplicaGroupAdded := retrieveInstanceReplicaGroupPartitionConfigNumInstancesPerReplicaGroupFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numInstancesPerReplicaGroupAdded + + err, numPartitionsAdded := retrieveInstanceReplicaGroupPartitionConfigNumPartitionsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numPartitionsAdded + + err, numReplicaGroupsAdded := retrieveInstanceReplicaGroupPartitionConfigNumReplicaGroupsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numReplicaGroupsAdded + + err, replicaGroupBasedAdded := retrieveInstanceReplicaGroupPartitionConfigReplicaGroupBasedFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicaGroupBasedAdded + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigMinimizeDataMovementFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + minimizeDataMovementFlagName := fmt.Sprintf("%v.minimizeDataMovement", cmdPrefix) + if cmd.Flags().Changed(minimizeDataMovementFlagName) { + + var minimizeDataMovementFlagName string + if cmdPrefix == "" { + minimizeDataMovementFlagName = "minimizeDataMovement" + } else { + minimizeDataMovementFlagName = fmt.Sprintf("%v.minimizeDataMovement", cmdPrefix) + } + + minimizeDataMovementFlagValue, err := cmd.Flags().GetBool(minimizeDataMovementFlagName) + if err != nil { + return err, false + } + m.MinimizeDataMovement = &minimizeDataMovementFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigNumInstancesFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numInstancesFlagName := fmt.Sprintf("%v.numInstances", cmdPrefix) + if cmd.Flags().Changed(numInstancesFlagName) { + + var numInstancesFlagName string + if cmdPrefix == "" { + numInstancesFlagName = "numInstances" + } else { + numInstancesFlagName = fmt.Sprintf("%v.numInstances", cmdPrefix) + } + + numInstancesFlagValue, err := cmd.Flags().GetInt32(numInstancesFlagName) + if err != nil { + return err, false + } + m.NumInstances = numInstancesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigNumInstancesPerPartitionFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numInstancesPerPartitionFlagName := fmt.Sprintf("%v.numInstancesPerPartition", cmdPrefix) + if cmd.Flags().Changed(numInstancesPerPartitionFlagName) { + + var numInstancesPerPartitionFlagName string + if cmdPrefix == "" { + numInstancesPerPartitionFlagName = "numInstancesPerPartition" + } else { + numInstancesPerPartitionFlagName = fmt.Sprintf("%v.numInstancesPerPartition", cmdPrefix) + } + + numInstancesPerPartitionFlagValue, err := cmd.Flags().GetInt32(numInstancesPerPartitionFlagName) + if err != nil { + return err, false + } + m.NumInstancesPerPartition = numInstancesPerPartitionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigNumInstancesPerReplicaGroupFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numInstancesPerReplicaGroupFlagName := fmt.Sprintf("%v.numInstancesPerReplicaGroup", cmdPrefix) + if cmd.Flags().Changed(numInstancesPerReplicaGroupFlagName) { + + var numInstancesPerReplicaGroupFlagName string + if cmdPrefix == "" { + numInstancesPerReplicaGroupFlagName = "numInstancesPerReplicaGroup" + } else { + numInstancesPerReplicaGroupFlagName = fmt.Sprintf("%v.numInstancesPerReplicaGroup", cmdPrefix) + } + + numInstancesPerReplicaGroupFlagValue, err := cmd.Flags().GetInt32(numInstancesPerReplicaGroupFlagName) + if err != nil { + return err, false + } + m.NumInstancesPerReplicaGroup = numInstancesPerReplicaGroupFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigNumPartitionsFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numPartitionsFlagName := fmt.Sprintf("%v.numPartitions", cmdPrefix) + if cmd.Flags().Changed(numPartitionsFlagName) { + + var numPartitionsFlagName string + if cmdPrefix == "" { + numPartitionsFlagName = "numPartitions" + } else { + numPartitionsFlagName = fmt.Sprintf("%v.numPartitions", cmdPrefix) + } + + numPartitionsFlagValue, err := cmd.Flags().GetInt32(numPartitionsFlagName) + if err != nil { + return err, false + } + m.NumPartitions = numPartitionsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigNumReplicaGroupsFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numReplicaGroupsFlagName := fmt.Sprintf("%v.numReplicaGroups", cmdPrefix) + if cmd.Flags().Changed(numReplicaGroupsFlagName) { + + var numReplicaGroupsFlagName string + if cmdPrefix == "" { + numReplicaGroupsFlagName = "numReplicaGroups" + } else { + numReplicaGroupsFlagName = fmt.Sprintf("%v.numReplicaGroups", cmdPrefix) + } + + numReplicaGroupsFlagValue, err := cmd.Flags().GetInt32(numReplicaGroupsFlagName) + if err != nil { + return err, false + } + m.NumReplicaGroups = numReplicaGroupsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceReplicaGroupPartitionConfigReplicaGroupBasedFlags(depth int, m *models.InstanceReplicaGroupPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + replicaGroupBasedFlagName := fmt.Sprintf("%v.replicaGroupBased", cmdPrefix) + if cmd.Flags().Changed(replicaGroupBasedFlagName) { + + var replicaGroupBasedFlagName string + if cmdPrefix == "" { + replicaGroupBasedFlagName = "replicaGroupBased" + } else { + replicaGroupBasedFlagName = fmt.Sprintf("%v.replicaGroupBased", cmdPrefix) + } + + replicaGroupBasedFlagValue, err := cmd.Flags().GetBool(replicaGroupBasedFlagName) + if err != nil { + return err, false + } + m.ReplicaGroupBased = &replicaGroupBasedFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/instance_tag_pool_config_model.go b/src/cli/instance_tag_pool_config_model.go new file mode 100644 index 0000000..af1b266 --- /dev/null +++ b/src/cli/instance_tag_pool_config_model.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for InstanceTagPoolConfig + +// register flags to command +func registerModelInstanceTagPoolConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstanceTagPoolConfigNumPools(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceTagPoolConfigPoolBased(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceTagPoolConfigPools(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerInstanceTagPoolConfigTag(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstanceTagPoolConfigNumPools(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numPoolsDescription := `` + + var numPoolsFlagName string + if cmdPrefix == "" { + numPoolsFlagName = "numPools" + } else { + numPoolsFlagName = fmt.Sprintf("%v.numPools", cmdPrefix) + } + + var numPoolsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numPoolsFlagName, numPoolsFlagDefault, numPoolsDescription) + + return nil +} + +func registerInstanceTagPoolConfigPoolBased(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + poolBasedDescription := `` + + var poolBasedFlagName string + if cmdPrefix == "" { + poolBasedFlagName = "poolBased" + } else { + poolBasedFlagName = fmt.Sprintf("%v.poolBased", cmdPrefix) + } + + var poolBasedFlagDefault bool + + _ = cmd.PersistentFlags().Bool(poolBasedFlagName, poolBasedFlagDefault, poolBasedDescription) + + return nil +} + +func registerInstanceTagPoolConfigPools(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: pools []int32 array type is not supported by go-swagger cli yet + + return nil +} + +func registerInstanceTagPoolConfigTag(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tagDescription := `Required. ` + + var tagFlagName string + if cmdPrefix == "" { + tagFlagName = "tag" + } else { + tagFlagName = fmt.Sprintf("%v.tag", cmdPrefix) + } + + var tagFlagDefault string + + _ = cmd.PersistentFlags().String(tagFlagName, tagFlagDefault, tagDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstanceTagPoolConfigFlags(depth int, m *models.InstanceTagPoolConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, numPoolsAdded := retrieveInstanceTagPoolConfigNumPoolsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numPoolsAdded + + err, poolBasedAdded := retrieveInstanceTagPoolConfigPoolBasedFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || poolBasedAdded + + err, poolsAdded := retrieveInstanceTagPoolConfigPoolsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || poolsAdded + + err, tagAdded := retrieveInstanceTagPoolConfigTagFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tagAdded + + return nil, retAdded +} + +func retrieveInstanceTagPoolConfigNumPoolsFlags(depth int, m *models.InstanceTagPoolConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numPoolsFlagName := fmt.Sprintf("%v.numPools", cmdPrefix) + if cmd.Flags().Changed(numPoolsFlagName) { + + var numPoolsFlagName string + if cmdPrefix == "" { + numPoolsFlagName = "numPools" + } else { + numPoolsFlagName = fmt.Sprintf("%v.numPools", cmdPrefix) + } + + numPoolsFlagValue, err := cmd.Flags().GetInt32(numPoolsFlagName) + if err != nil { + return err, false + } + m.NumPools = numPoolsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceTagPoolConfigPoolBasedFlags(depth int, m *models.InstanceTagPoolConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + poolBasedFlagName := fmt.Sprintf("%v.poolBased", cmdPrefix) + if cmd.Flags().Changed(poolBasedFlagName) { + + var poolBasedFlagName string + if cmdPrefix == "" { + poolBasedFlagName = "poolBased" + } else { + poolBasedFlagName = fmt.Sprintf("%v.poolBased", cmdPrefix) + } + + poolBasedFlagValue, err := cmd.Flags().GetBool(poolBasedFlagName) + if err != nil { + return err, false + } + m.PoolBased = &poolBasedFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveInstanceTagPoolConfigPoolsFlags(depth int, m *models.InstanceTagPoolConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + poolsFlagName := fmt.Sprintf("%v.pools", cmdPrefix) + if cmd.Flags().Changed(poolsFlagName) { + // warning: pools array type []int32 is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveInstanceTagPoolConfigTagFlags(depth int, m *models.InstanceTagPoolConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tagFlagName := fmt.Sprintf("%v.tag", cmdPrefix) + if cmd.Flags().Changed(tagFlagName) { + + var tagFlagName string + if cmdPrefix == "" { + tagFlagName = "tag" + } else { + tagFlagName = fmt.Sprintf("%v.tag", cmdPrefix) + } + + tagFlagValue, err := cmd.Flags().GetString(tagFlagName) + if err != nil { + return err, false + } + m.Tag = tagFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/instances_model.go b/src/cli/instances_model.go new file mode 100644 index 0000000..80677ba --- /dev/null +++ b/src/cli/instances_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for Instances + +// register flags to command +func registerModelInstancesFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerInstancesInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerInstancesInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: instances []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelInstancesFlags(depth int, m *models.Instances, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, instancesAdded := retrieveInstancesInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instancesAdded + + return nil, retAdded +} + +func retrieveInstancesInstancesFlags(depth int, m *models.Instances, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instancesFlagName := fmt.Sprintf("%v.instances", cmdPrefix) + if cmd.Flags().Changed(instancesFlagName) { + // warning: instances array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/job_key_model.go b/src/cli/job_key_model.go new file mode 100644 index 0000000..599bbb2 --- /dev/null +++ b/src/cli/job_key_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for JobKey + +// register flags to command +func registerModelJobKeyFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerJobKeyGroup(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerJobKeyName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerJobKeyGroup(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + groupDescription := `` + + var groupFlagName string + if cmdPrefix == "" { + groupFlagName = "group" + } else { + groupFlagName = fmt.Sprintf("%v.group", cmdPrefix) + } + + var groupFlagDefault string + + _ = cmd.PersistentFlags().String(groupFlagName, groupFlagDefault, groupDescription) + + return nil +} + +func registerJobKeyName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelJobKeyFlags(depth int, m *models.JobKey, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, groupAdded := retrieveJobKeyGroupFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || groupAdded + + err, nameAdded := retrieveJobKeyNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + return nil, retAdded +} + +func retrieveJobKeyGroupFlags(depth int, m *models.JobKey, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + groupFlagName := fmt.Sprintf("%v.group", cmdPrefix) + if cmd.Flags().Changed(groupFlagName) { + + var groupFlagName string + if cmdPrefix == "" { + groupFlagName = "group" + } else { + groupFlagName = fmt.Sprintf("%v.group", cmdPrefix) + } + + groupFlagValue, err := cmd.Flags().GetString(groupFlagName) + if err != nil { + return err, false + } + m.Group = groupFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveJobKeyNameFlags(depth int, m *models.JobKey, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/json_index_config_model.go b/src/cli/json_index_config_model.go new file mode 100644 index 0000000..f24fb67 --- /dev/null +++ b/src/cli/json_index_config_model.go @@ -0,0 +1,307 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for JSONIndexConfig + +// register flags to command +func registerModelJSONIndexConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerJSONIndexConfigDisableCrossArrayUnnest(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerJSONIndexConfigExcludeArray(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerJSONIndexConfigExcludeFields(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerJSONIndexConfigExcludePaths(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerJSONIndexConfigIncludePaths(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerJSONIndexConfigMaxLevels(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerJSONIndexConfigDisableCrossArrayUnnest(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + disableCrossArrayUnnestDescription := `` + + var disableCrossArrayUnnestFlagName string + if cmdPrefix == "" { + disableCrossArrayUnnestFlagName = "disableCrossArrayUnnest" + } else { + disableCrossArrayUnnestFlagName = fmt.Sprintf("%v.disableCrossArrayUnnest", cmdPrefix) + } + + var disableCrossArrayUnnestFlagDefault bool + + _ = cmd.PersistentFlags().Bool(disableCrossArrayUnnestFlagName, disableCrossArrayUnnestFlagDefault, disableCrossArrayUnnestDescription) + + return nil +} + +func registerJSONIndexConfigExcludeArray(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + excludeArrayDescription := `` + + var excludeArrayFlagName string + if cmdPrefix == "" { + excludeArrayFlagName = "excludeArray" + } else { + excludeArrayFlagName = fmt.Sprintf("%v.excludeArray", cmdPrefix) + } + + var excludeArrayFlagDefault bool + + _ = cmd.PersistentFlags().Bool(excludeArrayFlagName, excludeArrayFlagDefault, excludeArrayDescription) + + return nil +} + +func registerJSONIndexConfigExcludeFields(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: excludeFields []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerJSONIndexConfigExcludePaths(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: excludePaths []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerJSONIndexConfigIncludePaths(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: includePaths []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerJSONIndexConfigMaxLevels(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxLevelsDescription := `` + + var maxLevelsFlagName string + if cmdPrefix == "" { + maxLevelsFlagName = "maxLevels" + } else { + maxLevelsFlagName = fmt.Sprintf("%v.maxLevels", cmdPrefix) + } + + var maxLevelsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxLevelsFlagName, maxLevelsFlagDefault, maxLevelsDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelJSONIndexConfigFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, disableCrossArrayUnnestAdded := retrieveJSONIndexConfigDisableCrossArrayUnnestFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || disableCrossArrayUnnestAdded + + err, excludeArrayAdded := retrieveJSONIndexConfigExcludeArrayFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || excludeArrayAdded + + err, excludeFieldsAdded := retrieveJSONIndexConfigExcludeFieldsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || excludeFieldsAdded + + err, excludePathsAdded := retrieveJSONIndexConfigExcludePathsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || excludePathsAdded + + err, includePathsAdded := retrieveJSONIndexConfigIncludePathsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || includePathsAdded + + err, maxLevelsAdded := retrieveJSONIndexConfigMaxLevelsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxLevelsAdded + + return nil, retAdded +} + +func retrieveJSONIndexConfigDisableCrossArrayUnnestFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + disableCrossArrayUnnestFlagName := fmt.Sprintf("%v.disableCrossArrayUnnest", cmdPrefix) + if cmd.Flags().Changed(disableCrossArrayUnnestFlagName) { + + var disableCrossArrayUnnestFlagName string + if cmdPrefix == "" { + disableCrossArrayUnnestFlagName = "disableCrossArrayUnnest" + } else { + disableCrossArrayUnnestFlagName = fmt.Sprintf("%v.disableCrossArrayUnnest", cmdPrefix) + } + + disableCrossArrayUnnestFlagValue, err := cmd.Flags().GetBool(disableCrossArrayUnnestFlagName) + if err != nil { + return err, false + } + m.DisableCrossArrayUnnest = disableCrossArrayUnnestFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveJSONIndexConfigExcludeArrayFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + excludeArrayFlagName := fmt.Sprintf("%v.excludeArray", cmdPrefix) + if cmd.Flags().Changed(excludeArrayFlagName) { + + var excludeArrayFlagName string + if cmdPrefix == "" { + excludeArrayFlagName = "excludeArray" + } else { + excludeArrayFlagName = fmt.Sprintf("%v.excludeArray", cmdPrefix) + } + + excludeArrayFlagValue, err := cmd.Flags().GetBool(excludeArrayFlagName) + if err != nil { + return err, false + } + m.ExcludeArray = excludeArrayFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveJSONIndexConfigExcludeFieldsFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + excludeFieldsFlagName := fmt.Sprintf("%v.excludeFields", cmdPrefix) + if cmd.Flags().Changed(excludeFieldsFlagName) { + // warning: excludeFields array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveJSONIndexConfigExcludePathsFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + excludePathsFlagName := fmt.Sprintf("%v.excludePaths", cmdPrefix) + if cmd.Flags().Changed(excludePathsFlagName) { + // warning: excludePaths array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveJSONIndexConfigIncludePathsFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + includePathsFlagName := fmt.Sprintf("%v.includePaths", cmdPrefix) + if cmd.Flags().Changed(includePathsFlagName) { + // warning: includePaths array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveJSONIndexConfigMaxLevelsFlags(depth int, m *models.JSONIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxLevelsFlagName := fmt.Sprintf("%v.maxLevels", cmdPrefix) + if cmd.Flags().Changed(maxLevelsFlagName) { + + var maxLevelsFlagName string + if cmdPrefix == "" { + maxLevelsFlagName = "maxLevels" + } else { + maxLevelsFlagName = fmt.Sprintf("%v.maxLevels", cmdPrefix) + } + + maxLevelsFlagValue, err := cmd.Flags().GetInt32(maxLevelsFlagName) + if err != nil { + return err, false + } + m.MaxLevels = maxLevelsFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/json_node_model.go b/src/cli/json_node_model.go new file mode 100644 index 0000000..23c5354 --- /dev/null +++ b/src/cli/json_node_model.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Schema cli for interface{} + +// Name: [JsonNode], Type:[interface{}], register and retrieve functions are not rendered by go-swagger cli diff --git a/src/cli/lead_controller_entry_model.go b/src/cli/lead_controller_entry_model.go new file mode 100644 index 0000000..5075464 --- /dev/null +++ b/src/cli/lead_controller_entry_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for LeadControllerEntry + +// register flags to command +func registerModelLeadControllerEntryFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerLeadControllerEntryLeadControllerID(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerLeadControllerEntryTableNames(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerLeadControllerEntryLeadControllerID(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + leadControllerIdDescription := `` + + var leadControllerIdFlagName string + if cmdPrefix == "" { + leadControllerIdFlagName = "leadControllerId" + } else { + leadControllerIdFlagName = fmt.Sprintf("%v.leadControllerId", cmdPrefix) + } + + var leadControllerIdFlagDefault string + + _ = cmd.PersistentFlags().String(leadControllerIdFlagName, leadControllerIdFlagDefault, leadControllerIdDescription) + + return nil +} + +func registerLeadControllerEntryTableNames(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tableNames []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelLeadControllerEntryFlags(depth int, m *models.LeadControllerEntry, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, leadControllerIdAdded := retrieveLeadControllerEntryLeadControllerIDFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || leadControllerIdAdded + + err, tableNamesAdded := retrieveLeadControllerEntryTableNamesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableNamesAdded + + return nil, retAdded +} + +func retrieveLeadControllerEntryLeadControllerIDFlags(depth int, m *models.LeadControllerEntry, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + leadControllerIdFlagName := fmt.Sprintf("%v.leadControllerId", cmdPrefix) + if cmd.Flags().Changed(leadControllerIdFlagName) { + + var leadControllerIdFlagName string + if cmdPrefix == "" { + leadControllerIdFlagName = "leadControllerId" + } else { + leadControllerIdFlagName = fmt.Sprintf("%v.leadControllerId", cmdPrefix) + } + + leadControllerIdFlagValue, err := cmd.Flags().GetString(leadControllerIdFlagName) + if err != nil { + return err, false + } + m.LeadControllerID = leadControllerIdFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveLeadControllerEntryTableNamesFlags(depth int, m *models.LeadControllerEntry, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableNamesFlagName := fmt.Sprintf("%v.tableNames", cmdPrefix) + if cmd.Flags().Changed(tableNamesFlagName) { + // warning: tableNames array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/lead_controller_response_model.go b/src/cli/lead_controller_response_model.go new file mode 100644 index 0000000..409d1dc --- /dev/null +++ b/src/cli/lead_controller_response_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for LeadControllerResponse + +// register flags to command +func registerModelLeadControllerResponseFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerLeadControllerResponseLeadControllerEntryMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerLeadControllerResponseLeadControllerResourceEnabled(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerLeadControllerResponseLeadControllerEntryMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: leadControllerEntryMap map[string]LeadControllerEntry map type is not supported by go-swagger cli yet + + return nil +} + +func registerLeadControllerResponseLeadControllerResourceEnabled(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + leadControllerResourceEnabledDescription := `` + + var leadControllerResourceEnabledFlagName string + if cmdPrefix == "" { + leadControllerResourceEnabledFlagName = "leadControllerResourceEnabled" + } else { + leadControllerResourceEnabledFlagName = fmt.Sprintf("%v.leadControllerResourceEnabled", cmdPrefix) + } + + var leadControllerResourceEnabledFlagDefault bool + + _ = cmd.PersistentFlags().Bool(leadControllerResourceEnabledFlagName, leadControllerResourceEnabledFlagDefault, leadControllerResourceEnabledDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelLeadControllerResponseFlags(depth int, m *models.LeadControllerResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, leadControllerEntryMapAdded := retrieveLeadControllerResponseLeadControllerEntryMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || leadControllerEntryMapAdded + + err, leadControllerResourceEnabledAdded := retrieveLeadControllerResponseLeadControllerResourceEnabledFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || leadControllerResourceEnabledAdded + + return nil, retAdded +} + +func retrieveLeadControllerResponseLeadControllerEntryMapFlags(depth int, m *models.LeadControllerResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + leadControllerEntryMapFlagName := fmt.Sprintf("%v.leadControllerEntryMap", cmdPrefix) + if cmd.Flags().Changed(leadControllerEntryMapFlagName) { + // warning: leadControllerEntryMap map type map[string]LeadControllerEntry is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveLeadControllerResponseLeadControllerResourceEnabledFlags(depth int, m *models.LeadControllerResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + leadControllerResourceEnabledFlagName := fmt.Sprintf("%v.leadControllerResourceEnabled", cmdPrefix) + if cmd.Flags().Changed(leadControllerResourceEnabledFlagName) { + + var leadControllerResourceEnabledFlagName string + if cmdPrefix == "" { + leadControllerResourceEnabledFlagName = "leadControllerResourceEnabled" + } else { + leadControllerResourceEnabledFlagName = fmt.Sprintf("%v.leadControllerResourceEnabled", cmdPrefix) + } + + leadControllerResourceEnabledFlagValue, err := cmd.Flags().GetBool(leadControllerResourceEnabledFlagName) + if err != nil { + return err, false + } + m.LeadControllerResourceEnabled = leadControllerResourceEnabledFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/list_brokers_mapping_operation.go b/src/cli/list_brokers_mapping_operation.go new file mode 100644 index 0000000..49c96f4 --- /dev/null +++ b/src/cli/list_brokers_mapping_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerListBrokersMappingCmd returns a cmd to handle operation listBrokersMapping +func makeOperationBrokerListBrokersMappingCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listBrokersMapping", + Short: `List tenants and tables to brokers mappings`, + RunE: runOperationBrokerListBrokersMapping, + } + + if err := registerOperationBrokerListBrokersMappingParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerListBrokersMapping uses cmd flags to call endpoint api +func runOperationBrokerListBrokersMapping(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewListBrokersMappingParams() + if err, _ := retrieveOperationBrokerListBrokersMappingStateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerListBrokersMappingResult(appCli.Broker.ListBrokersMapping(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerListBrokersMappingParamFlags registers all flags needed to fill params +func registerOperationBrokerListBrokersMappingParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerListBrokersMappingStateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerListBrokersMappingStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} + +func retrieveOperationBrokerListBrokersMappingStateFlag(m *broker.ListBrokersMappingParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerListBrokersMappingResult parses request result and return the string content +func parseOperationBrokerListBrokersMappingResult(resp0 *broker.ListBrokersMappingOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.ListBrokersMappingOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/list_brokers_mapping_v2_operation.go b/src/cli/list_brokers_mapping_v2_operation.go new file mode 100644 index 0000000..646ccac --- /dev/null +++ b/src/cli/list_brokers_mapping_v2_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationBrokerListBrokersMappingV2Cmd returns a cmd to handle operation listBrokersMappingV2 +func makeOperationBrokerListBrokersMappingV2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listBrokersMappingV2", + Short: `List tenants and tables to brokers mappings`, + RunE: runOperationBrokerListBrokersMappingV2, + } + + if err := registerOperationBrokerListBrokersMappingV2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerListBrokersMappingV2 uses cmd flags to call endpoint api +func runOperationBrokerListBrokersMappingV2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewListBrokersMappingV2Params() + if err, _ := retrieveOperationBrokerListBrokersMappingV2StateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerListBrokersMappingV2Result(appCli.Broker.ListBrokersMappingV2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerListBrokersMappingV2ParamFlags registers all flags needed to fill params +func registerOperationBrokerListBrokersMappingV2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerListBrokersMappingV2StateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerListBrokersMappingV2StateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `ONLINE|OFFLINE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} + +func retrieveOperationBrokerListBrokersMappingV2StateFlag(m *broker.ListBrokersMappingV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerListBrokersMappingV2Result parses request result and return the string content +func parseOperationBrokerListBrokersMappingV2Result(resp0 *broker.ListBrokersMappingV2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*broker.ListBrokersMappingV2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/list_cluster_configs_operation.go b/src/cli/list_cluster_configs_operation.go new file mode 100644 index 0000000..bec6d76 --- /dev/null +++ b/src/cli/list_cluster_configs_operation.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/cluster" + + "github.com/spf13/cobra" +) + +// makeOperationClusterListClusterConfigsCmd returns a cmd to handle operation listClusterConfigs +func makeOperationClusterListClusterConfigsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listClusterConfigs", + Short: `List cluster level configurations`, + RunE: runOperationClusterListClusterConfigs, + } + + if err := registerOperationClusterListClusterConfigsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterListClusterConfigs uses cmd flags to call endpoint api +func runOperationClusterListClusterConfigs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster.NewListClusterConfigsParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterListClusterConfigsResult(appCli.Cluster.ListClusterConfigs(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterListClusterConfigsParamFlags registers all flags needed to fill params +func registerOperationClusterListClusterConfigsParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationClusterListClusterConfigsResult parses request result and return the string content +func parseOperationClusterListClusterConfigsResult(resp0 *cluster.ListClusterConfigsOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning listClusterConfigsOK is not supported + + // Non schema case: warning listClusterConfigsInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response listClusterConfigsOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/list_configs_operation.go b/src/cli/list_configs_operation.go new file mode 100644 index 0000000..50ed88a --- /dev/null +++ b/src/cli/list_configs_operation.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableListConfigsCmd returns a cmd to handle operation listConfigs +func makeOperationTableListConfigsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listConfigs", + Short: `Lists all TableConfigs in cluster`, + RunE: runOperationTableListConfigs, + } + + if err := registerOperationTableListConfigsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableListConfigs uses cmd flags to call endpoint api +func runOperationTableListConfigs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewListConfigsParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableListConfigsResult(appCli.Table.ListConfigs(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableListConfigsParamFlags registers all flags needed to fill params +func registerOperationTableListConfigsParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTableListConfigsResult parses request result and return the string content +func parseOperationTableListConfigsResult(resp0 *table.ListConfigsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.ListConfigsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/list_instance_or_toggle_tenant_state_operation.go b/src/cli/list_instance_or_toggle_tenant_state_operation.go new file mode 100644 index 0000000..aa9b3c5 --- /dev/null +++ b/src/cli/list_instance_or_toggle_tenant_state_operation.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/tenant" + + "github.com/spf13/cobra" +) + +// makeOperationTenantListInstanceOrToggleTenantStateCmd returns a cmd to handle operation listInstanceOrToggleTenantState +func makeOperationTenantListInstanceOrToggleTenantStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listInstanceOrToggleTenantState", + Short: ``, + RunE: runOperationTenantListInstanceOrToggleTenantState, + } + + if err := registerOperationTenantListInstanceOrToggleTenantStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantListInstanceOrToggleTenantState uses cmd flags to call endpoint api +func runOperationTenantListInstanceOrToggleTenantState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewListInstanceOrToggleTenantStateParams() + if err, _ := retrieveOperationTenantListInstanceOrToggleTenantStateStateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantListInstanceOrToggleTenantStateTableTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantListInstanceOrToggleTenantStateTenantNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTenantListInstanceOrToggleTenantStateTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantListInstanceOrToggleTenantStateResult(appCli.Tenant.ListInstanceOrToggleTenantState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantListInstanceOrToggleTenantStateParamFlags registers all flags needed to fill params +func registerOperationTenantListInstanceOrToggleTenantStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantListInstanceOrToggleTenantStateStateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantListInstanceOrToggleTenantStateTableTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantListInstanceOrToggleTenantStateTenantNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTenantListInstanceOrToggleTenantStateTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantListInstanceOrToggleTenantStateStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `state` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationTenantListInstanceOrToggleTenantStateTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `Table type (offline|realtime)` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} +func registerOperationTenantListInstanceOrToggleTenantStateTenantNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tenantNameDescription := `Required. Tenant name` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} +func registerOperationTenantListInstanceOrToggleTenantStateTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Tenant type (server|broker)` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTenantListInstanceOrToggleTenantStateStateFlag(m *tenant.ListInstanceOrToggleTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = &stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantListInstanceOrToggleTenantStateTableTypeFlag(m *tenant.ListInstanceOrToggleTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = &tableTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantListInstanceOrToggleTenantStateTenantNameFlag(m *tenant.ListInstanceOrToggleTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tenantName") { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTenantListInstanceOrToggleTenantStateTypeFlag(m *tenant.ListInstanceOrToggleTenantStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTenantListInstanceOrToggleTenantStateResult parses request result and return the string content +func parseOperationTenantListInstanceOrToggleTenantStateResult(resp0 *tenant.ListInstanceOrToggleTenantStateOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning listInstanceOrToggleTenantStateOK is not supported + + // Non schema case: warning listInstanceOrToggleTenantStateInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response listInstanceOrToggleTenantStateOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/list_schema_names_operation.go b/src/cli/list_schema_names_operation.go new file mode 100644 index 0000000..cda2aea --- /dev/null +++ b/src/cli/list_schema_names_operation.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/schema" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSchemaListSchemaNamesCmd returns a cmd to handle operation listSchemaNames +func makeOperationSchemaListSchemaNamesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listSchemaNames", + Short: `Lists all schema names`, + RunE: runOperationSchemaListSchemaNames, + } + + if err := registerOperationSchemaListSchemaNamesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaListSchemaNames uses cmd flags to call endpoint api +func runOperationSchemaListSchemaNames(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewListSchemaNamesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaListSchemaNamesResult(appCli.Schema.ListSchemaNames(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaListSchemaNamesParamFlags registers all flags needed to fill params +func registerOperationSchemaListSchemaNamesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationSchemaListSchemaNamesResult parses request result and return the string content +func parseOperationSchemaListSchemaNamesResult(resp0 *schema.ListSchemaNamesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*schema.ListSchemaNamesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/list_segment_lineage_operation.go b/src/cli/list_segment_lineage_operation.go new file mode 100644 index 0000000..67d492b --- /dev/null +++ b/src/cli/list_segment_lineage_operation.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentListSegmentLineageCmd returns a cmd to handle operation listSegmentLineage +func makeOperationSegmentListSegmentLineageCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listSegmentLineage", + Short: `List segment lineage in chronologically sorted order`, + RunE: runOperationSegmentListSegmentLineage, + } + + if err := registerOperationSegmentListSegmentLineageParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentListSegmentLineage uses cmd flags to call endpoint api +func runOperationSegmentListSegmentLineage(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewListSegmentLineageParams() + if err, _ := retrieveOperationSegmentListSegmentLineageTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentListSegmentLineageTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentListSegmentLineageResult(appCli.Segment.ListSegmentLineage(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentListSegmentLineageParamFlags registers all flags needed to fill params +func registerOperationSegmentListSegmentLineageParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentListSegmentLineageTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentListSegmentLineageTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentListSegmentLineageTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentListSegmentLineageTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentListSegmentLineageTableNameFlag(m *segment.ListSegmentLineageParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentListSegmentLineageTypeFlag(m *segment.ListSegmentLineageParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentListSegmentLineageResult parses request result and return the string content +func parseOperationSegmentListSegmentLineageResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning listSegmentLineage default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/list_tables_operation.go b/src/cli/list_tables_operation.go new file mode 100644 index 0000000..6e7b9f7 --- /dev/null +++ b/src/cli/list_tables_operation.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableListTablesCmd returns a cmd to handle operation listTables +func makeOperationTableListTablesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listTables", + Short: `Lists all tables in cluster`, + RunE: runOperationTableListTables, + } + + if err := registerOperationTableListTablesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableListTables uses cmd flags to call endpoint api +func runOperationTableListTables(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewListTablesParams() + if err, _ := retrieveOperationTableListTablesSortAscFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableListTablesSortTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableListTablesTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableListTablesTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableListTablesResult(appCli.Table.ListTables(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableListTablesParamFlags registers all flags needed to fill params +func registerOperationTableListTablesParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableListTablesSortAscParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableListTablesSortTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableListTablesTaskTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableListTablesTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableListTablesSortAscParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + sortAscDescription := `true|false` + + var sortAscFlagName string + if cmdPrefix == "" { + sortAscFlagName = "sortAsc" + } else { + sortAscFlagName = fmt.Sprintf("%v.sortAsc", cmdPrefix) + } + + var sortAscFlagDefault bool = true + + _ = cmd.PersistentFlags().Bool(sortAscFlagName, sortAscFlagDefault, sortAscDescription) + + return nil +} +func registerOperationTableListTablesSortTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + sortTypeDescription := `name|creationTime|lastModifiedTime` + + var sortTypeFlagName string + if cmdPrefix == "" { + sortTypeFlagName = "sortType" + } else { + sortTypeFlagName = fmt.Sprintf("%v.sortType", cmdPrefix) + } + + var sortTypeFlagDefault string + + _ = cmd.PersistentFlags().String(sortTypeFlagName, sortTypeFlagDefault, sortTypeDescription) + + return nil +} +func registerOperationTableListTablesTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} +func registerOperationTableListTablesTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `realtime|offline` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableListTablesSortAscFlag(m *table.ListTablesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("sortAsc") { + + var sortAscFlagName string + if cmdPrefix == "" { + sortAscFlagName = "sortAsc" + } else { + sortAscFlagName = fmt.Sprintf("%v.sortAsc", cmdPrefix) + } + + sortAscFlagValue, err := cmd.Flags().GetBool(sortAscFlagName) + if err != nil { + return err, false + } + m.SortAsc = &sortAscFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableListTablesSortTypeFlag(m *table.ListTablesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("sortType") { + + var sortTypeFlagName string + if cmdPrefix == "" { + sortTypeFlagName = "sortType" + } else { + sortTypeFlagName = fmt.Sprintf("%v.sortType", cmdPrefix) + } + + sortTypeFlagValue, err := cmd.Flags().GetString(sortTypeFlagName) + if err != nil { + return err, false + } + m.SortType = &sortTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableListTablesTaskTypeFlag(m *table.ListTablesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = &taskTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableListTablesTypeFlag(m *table.ListTablesParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableListTablesResult parses request result and return the string content +func parseOperationTableListTablesResult(resp0 *table.ListTablesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.ListTablesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/list_task_types_operation.go b/src/cli/list_task_types_operation.go new file mode 100644 index 0000000..3e60d63 --- /dev/null +++ b/src/cli/list_task_types_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskListTaskTypesCmd returns a cmd to handle operation listTaskTypes +func makeOperationTaskListTaskTypesCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listTaskTypes", + Short: ``, + RunE: runOperationTaskListTaskTypes, + } + + if err := registerOperationTaskListTaskTypesParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskListTaskTypes uses cmd flags to call endpoint api +func runOperationTaskListTaskTypes(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewListTaskTypesParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskListTaskTypesResult(appCli.Task.ListTaskTypes(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskListTaskTypesParamFlags registers all flags needed to fill params +func registerOperationTaskListTaskTypesParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTaskListTaskTypesResult parses request result and return the string content +func parseOperationTaskListTaskTypesResult(resp0 *task.ListTaskTypesOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.ListTaskTypesOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/list_uers_operation.go b/src/cli/list_uers_operation.go new file mode 100644 index 0000000..c52db3f --- /dev/null +++ b/src/cli/list_uers_operation.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/user" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationUserListUersCmd returns a cmd to handle operation listUers +func makeOperationUserListUersCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "listUers", + Short: `List all users in cluster`, + RunE: runOperationUserListUers, + } + + if err := registerOperationUserListUersParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationUserListUers uses cmd flags to call endpoint api +func runOperationUserListUers(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := user.NewListUersParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationUserListUersResult(appCli.User.ListUers(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationUserListUersParamFlags registers all flags needed to fill params +func registerOperationUserListUersParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationUserListUersResult parses request result and return the string content +func parseOperationUserListUersResult(resp0 *user.ListUersOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*user.ListUersOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/ls_operation.go b/src/cli/ls_operation.go new file mode 100644 index 0000000..fac25b5 --- /dev/null +++ b/src/cli/ls_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperLsCmd returns a cmd to handle operation ls +func makeOperationZookeeperLsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "ls", + Short: ``, + RunE: runOperationZookeeperLs, + } + + if err := registerOperationZookeeperLsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperLs uses cmd flags to call endpoint api +func runOperationZookeeperLs(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewLsParams() + if err, _ := retrieveOperationZookeeperLsPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperLsResult(appCli.Zookeeper.Ls(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperLsParamFlags registers all flags needed to fill params +func registerOperationZookeeperLsParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperLsPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperLsPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperLsPathFlag(m *zookeeper.LsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperLsResult parses request result and return the string content +func parseOperationZookeeperLsResult(resp0 *zookeeper.LsOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning lsOK is not supported + + // Non schema case: warning lsNotFound is not supported + + // Non schema case: warning lsInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response lsOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/lsl_operation.go b/src/cli/lsl_operation.go new file mode 100644 index 0000000..2a752ab --- /dev/null +++ b/src/cli/lsl_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperLslCmd returns a cmd to handle operation lsl +func makeOperationZookeeperLslCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "lsl", + Short: ``, + RunE: runOperationZookeeperLsl, + } + + if err := registerOperationZookeeperLslParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperLsl uses cmd flags to call endpoint api +func runOperationZookeeperLsl(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewLslParams() + if err, _ := retrieveOperationZookeeperLslPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperLslResult(appCli.Zookeeper.Lsl(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperLslParamFlags registers all flags needed to fill params +func registerOperationZookeeperLslParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperLslPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperLslPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperLslPathFlag(m *zookeeper.LslParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperLslResult parses request result and return the string content +func parseOperationZookeeperLslResult(resp0 *zookeeper.LslOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning lslOK is not supported + + // Non schema case: warning lslNotFound is not supported + + // Non schema case: warning lslInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response lslOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/media_type_model.go b/src/cli/media_type_model.go new file mode 100644 index 0000000..8789719 --- /dev/null +++ b/src/cli/media_type_model.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for MediaType + +// register flags to command +func registerModelMediaTypeFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerMediaTypeParameters(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMediaTypeSubtype(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMediaTypeType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMediaTypeWildcardSubtype(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMediaTypeWildcardType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerMediaTypeParameters(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameters map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerMediaTypeSubtype(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + subtypeDescription := `` + + var subtypeFlagName string + if cmdPrefix == "" { + subtypeFlagName = "subtype" + } else { + subtypeFlagName = fmt.Sprintf("%v.subtype", cmdPrefix) + } + + var subtypeFlagDefault string + + _ = cmd.PersistentFlags().String(subtypeFlagName, subtypeFlagDefault, subtypeDescription) + + return nil +} + +func registerMediaTypeType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + typeDescription := `` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func registerMediaTypeWildcardSubtype(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + wildcardSubtypeDescription := `` + + var wildcardSubtypeFlagName string + if cmdPrefix == "" { + wildcardSubtypeFlagName = "wildcardSubtype" + } else { + wildcardSubtypeFlagName = fmt.Sprintf("%v.wildcardSubtype", cmdPrefix) + } + + var wildcardSubtypeFlagDefault bool + + _ = cmd.PersistentFlags().Bool(wildcardSubtypeFlagName, wildcardSubtypeFlagDefault, wildcardSubtypeDescription) + + return nil +} + +func registerMediaTypeWildcardType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + wildcardTypeDescription := `` + + var wildcardTypeFlagName string + if cmdPrefix == "" { + wildcardTypeFlagName = "wildcardType" + } else { + wildcardTypeFlagName = fmt.Sprintf("%v.wildcardType", cmdPrefix) + } + + var wildcardTypeFlagDefault bool + + _ = cmd.PersistentFlags().Bool(wildcardTypeFlagName, wildcardTypeFlagDefault, wildcardTypeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelMediaTypeFlags(depth int, m *models.MediaType, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, parametersAdded := retrieveMediaTypeParametersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parametersAdded + + err, subtypeAdded := retrieveMediaTypeSubtypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || subtypeAdded + + err, typeAdded := retrieveMediaTypeTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || typeAdded + + err, wildcardSubtypeAdded := retrieveMediaTypeWildcardSubtypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || wildcardSubtypeAdded + + err, wildcardTypeAdded := retrieveMediaTypeWildcardTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || wildcardTypeAdded + + return nil, retAdded +} + +func retrieveMediaTypeParametersFlags(depth int, m *models.MediaType, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parametersFlagName := fmt.Sprintf("%v.parameters", cmdPrefix) + if cmd.Flags().Changed(parametersFlagName) { + // warning: parameters map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMediaTypeSubtypeFlags(depth int, m *models.MediaType, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + subtypeFlagName := fmt.Sprintf("%v.subtype", cmdPrefix) + if cmd.Flags().Changed(subtypeFlagName) { + + var subtypeFlagName string + if cmdPrefix == "" { + subtypeFlagName = "subtype" + } else { + subtypeFlagName = fmt.Sprintf("%v.subtype", cmdPrefix) + } + + subtypeFlagValue, err := cmd.Flags().GetString(subtypeFlagName) + if err != nil { + return err, false + } + m.Subtype = subtypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMediaTypeTypeFlags(depth int, m *models.MediaType, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + typeFlagName := fmt.Sprintf("%v.type", cmdPrefix) + if cmd.Flags().Changed(typeFlagName) { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMediaTypeWildcardSubtypeFlags(depth int, m *models.MediaType, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + wildcardSubtypeFlagName := fmt.Sprintf("%v.wildcardSubtype", cmdPrefix) + if cmd.Flags().Changed(wildcardSubtypeFlagName) { + + var wildcardSubtypeFlagName string + if cmdPrefix == "" { + wildcardSubtypeFlagName = "wildcardSubtype" + } else { + wildcardSubtypeFlagName = fmt.Sprintf("%v.wildcardSubtype", cmdPrefix) + } + + wildcardSubtypeFlagValue, err := cmd.Flags().GetBool(wildcardSubtypeFlagName) + if err != nil { + return err, false + } + m.WildcardSubtype = wildcardSubtypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMediaTypeWildcardTypeFlags(depth int, m *models.MediaType, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + wildcardTypeFlagName := fmt.Sprintf("%v.wildcardType", cmdPrefix) + if cmd.Flags().Changed(wildcardTypeFlagName) { + + var wildcardTypeFlagName string + if cmdPrefix == "" { + wildcardTypeFlagName = "wildcardType" + } else { + wildcardTypeFlagName = fmt.Sprintf("%v.wildcardType", cmdPrefix) + } + + wildcardTypeFlagValue, err := cmd.Flags().GetBool(wildcardTypeFlagName) + if err != nil { + return err, false + } + m.WildcardType = wildcardTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/message_body_workers_model.go b/src/cli/message_body_workers_model.go new file mode 100644 index 0000000..d7a606c --- /dev/null +++ b/src/cli/message_body_workers_model.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Schema cli for interface{} + +// Name: [MessageBodyWorkers], Type:[interface{}], register and retrieve functions are not rendered by go-swagger cli diff --git a/src/cli/metric_field_spec_model.go b/src/cli/metric_field_spec_model.go new file mode 100644 index 0000000..9586c28 --- /dev/null +++ b/src/cli/metric_field_spec_model.go @@ -0,0 +1,487 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for MetricFieldSpec + +// register flags to command +func registerModelMetricFieldSpecFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerMetricFieldSpecDataType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecDefaultNullValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecDefaultNullValueString(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecMaxLength(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecSingleValueField(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecTransformFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMetricFieldSpecVirtualColumnProvider(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerMetricFieldSpecDataType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + dataTypeDescription := `Enum: ["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]. ` + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + var dataTypeFlagDefault string + + _ = cmd.PersistentFlags().String(dataTypeFlagName, dataTypeFlagDefault, dataTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(dataTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerMetricFieldSpecDefaultNullValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: defaultNullValue interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerMetricFieldSpecDefaultNullValueString(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + defaultNullValueStringDescription := `` + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + var defaultNullValueStringFlagDefault string + + _ = cmd.PersistentFlags().String(defaultNullValueStringFlagName, defaultNullValueStringFlagDefault, defaultNullValueStringDescription) + + return nil +} + +func registerMetricFieldSpecMaxLength(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxLengthDescription := `` + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + var maxLengthFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxLengthFlagName, maxLengthFlagDefault, maxLengthDescription) + + return nil +} + +func registerMetricFieldSpecName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerMetricFieldSpecSingleValueField(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + singleValueFieldDescription := `` + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + var singleValueFieldFlagDefault bool + + _ = cmd.PersistentFlags().Bool(singleValueFieldFlagName, singleValueFieldFlagDefault, singleValueFieldDescription) + + return nil +} + +func registerMetricFieldSpecTransformFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + transformFunctionDescription := `` + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + var transformFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(transformFunctionFlagName, transformFunctionFlagDefault, transformFunctionDescription) + + return nil +} + +func registerMetricFieldSpecVirtualColumnProvider(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + virtualColumnProviderDescription := `` + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + var virtualColumnProviderFlagDefault string + + _ = cmd.PersistentFlags().String(virtualColumnProviderFlagName, virtualColumnProviderFlagDefault, virtualColumnProviderDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelMetricFieldSpecFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dataTypeAdded := retrieveMetricFieldSpecDataTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dataTypeAdded + + err, defaultNullValueAdded := retrieveMetricFieldSpecDefaultNullValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueAdded + + err, defaultNullValueStringAdded := retrieveMetricFieldSpecDefaultNullValueStringFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueStringAdded + + err, maxLengthAdded := retrieveMetricFieldSpecMaxLengthFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxLengthAdded + + err, nameAdded := retrieveMetricFieldSpecNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, singleValueFieldAdded := retrieveMetricFieldSpecSingleValueFieldFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || singleValueFieldAdded + + err, transformFunctionAdded := retrieveMetricFieldSpecTransformFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || transformFunctionAdded + + err, virtualColumnProviderAdded := retrieveMetricFieldSpecVirtualColumnProviderFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || virtualColumnProviderAdded + + return nil, retAdded +} + +func retrieveMetricFieldSpecDataTypeFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dataTypeFlagName := fmt.Sprintf("%v.dataType", cmdPrefix) + if cmd.Flags().Changed(dataTypeFlagName) { + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + dataTypeFlagValue, err := cmd.Flags().GetString(dataTypeFlagName) + if err != nil { + return err, false + } + m.DataType = dataTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecDefaultNullValueFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueFlagName := fmt.Sprintf("%v.defaultNullValue", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueFlagName) { + // warning: defaultNullValue map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecDefaultNullValueStringFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueStringFlagName := fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueStringFlagName) { + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + defaultNullValueStringFlagValue, err := cmd.Flags().GetString(defaultNullValueStringFlagName) + if err != nil { + return err, false + } + m.DefaultNullValueString = defaultNullValueStringFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecMaxLengthFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxLengthFlagName := fmt.Sprintf("%v.maxLength", cmdPrefix) + if cmd.Flags().Changed(maxLengthFlagName) { + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + maxLengthFlagValue, err := cmd.Flags().GetInt32(maxLengthFlagName) + if err != nil { + return err, false + } + m.MaxLength = maxLengthFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecNameFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecSingleValueFieldFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + singleValueFieldFlagName := fmt.Sprintf("%v.singleValueField", cmdPrefix) + if cmd.Flags().Changed(singleValueFieldFlagName) { + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + singleValueFieldFlagValue, err := cmd.Flags().GetBool(singleValueFieldFlagName) + if err != nil { + return err, false + } + m.SingleValueField = singleValueFieldFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecTransformFunctionFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + transformFunctionFlagName := fmt.Sprintf("%v.transformFunction", cmdPrefix) + if cmd.Flags().Changed(transformFunctionFlagName) { + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + transformFunctionFlagValue, err := cmd.Flags().GetString(transformFunctionFlagName) + if err != nil { + return err, false + } + m.TransformFunction = transformFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveMetricFieldSpecVirtualColumnProviderFlags(depth int, m *models.MetricFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + virtualColumnProviderFlagName := fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + if cmd.Flags().Changed(virtualColumnProviderFlagName) { + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + virtualColumnProviderFlagValue, err := cmd.Flags().GetString(virtualColumnProviderFlagName) + if err != nil { + return err, false + } + m.VirtualColumnProvider = virtualColumnProviderFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/multi_part_model.go b/src/cli/multi_part_model.go new file mode 100644 index 0000000..a4125ca --- /dev/null +++ b/src/cli/multi_part_model.go @@ -0,0 +1,402 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for MultiPart + +// register flags to command +func registerModelMultiPartFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerMultiPartBodyParts(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartContentDisposition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartEntity(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartMediaType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartMessageBodyWorkers(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartParameterizedHeaders(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartParent(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerMultiPartProviders(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerMultiPartBodyParts(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: bodyParts []*BodyPart array type is not supported by go-swagger cli yet + + return nil +} + +func registerMultiPartContentDisposition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var contentDispositionFlagName string + if cmdPrefix == "" { + contentDispositionFlagName = "contentDisposition" + } else { + contentDispositionFlagName = fmt.Sprintf("%v.contentDisposition", cmdPrefix) + } + + if err := registerModelContentDispositionFlags(depth+1, contentDispositionFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerMultiPartEntity(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: entity interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerMultiPartHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: headers map[string][]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerMultiPartMediaType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var mediaTypeFlagName string + if cmdPrefix == "" { + mediaTypeFlagName = "mediaType" + } else { + mediaTypeFlagName = fmt.Sprintf("%v.mediaType", cmdPrefix) + } + + if err := registerModelMediaTypeFlags(depth+1, mediaTypeFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerMultiPartMessageBodyWorkers(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: messageBodyWorkers MessageBodyWorkers map type is not supported by go-swagger cli yet + + return nil +} + +func registerMultiPartParameterizedHeaders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameterizedHeaders map[string][]ParameterizedHeader map type is not supported by go-swagger cli yet + + return nil +} + +func registerMultiPartParent(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var parentFlagName string + if cmdPrefix == "" { + parentFlagName = "parent" + } else { + parentFlagName = fmt.Sprintf("%v.parent", cmdPrefix) + } + + if err := registerModelMultiPartFlags(depth+1, parentFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerMultiPartProviders(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: providers Providers map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelMultiPartFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, bodyPartsAdded := retrieveMultiPartBodyPartsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || bodyPartsAdded + + err, contentDispositionAdded := retrieveMultiPartContentDispositionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + + err, entityAdded := retrieveMultiPartEntityFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || entityAdded + + err, headersAdded := retrieveMultiPartHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || headersAdded + + err, mediaTypeAdded := retrieveMultiPartMediaTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + + err, messageBodyWorkersAdded := retrieveMultiPartMessageBodyWorkersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || messageBodyWorkersAdded + + err, parameterizedHeadersAdded := retrieveMultiPartParameterizedHeadersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parameterizedHeadersAdded + + err, parentAdded := retrieveMultiPartParentFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + + err, providersAdded := retrieveMultiPartProvidersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || providersAdded + + return nil, retAdded +} + +func retrieveMultiPartBodyPartsFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + bodyPartsFlagName := fmt.Sprintf("%v.bodyParts", cmdPrefix) + if cmd.Flags().Changed(bodyPartsFlagName) { + // warning: bodyParts array type []*BodyPart is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMultiPartContentDispositionFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + contentDispositionFlagName := fmt.Sprintf("%v.contentDisposition", cmdPrefix) + if cmd.Flags().Changed(contentDispositionFlagName) { + // info: complex object contentDisposition ContentDisposition is retrieved outside this Changed() block + } + contentDispositionFlagValue := m.ContentDisposition + if swag.IsZero(contentDispositionFlagValue) { + contentDispositionFlagValue = &models.ContentDisposition{} + } + + err, contentDispositionAdded := retrieveModelContentDispositionFlags(depth+1, contentDispositionFlagValue, contentDispositionFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || contentDispositionAdded + if contentDispositionAdded { + m.ContentDisposition = contentDispositionFlagValue + } + + return nil, retAdded +} + +func retrieveMultiPartEntityFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + entityFlagName := fmt.Sprintf("%v.entity", cmdPrefix) + if cmd.Flags().Changed(entityFlagName) { + // warning: entity map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMultiPartHeadersFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + headersFlagName := fmt.Sprintf("%v.headers", cmdPrefix) + if cmd.Flags().Changed(headersFlagName) { + // warning: headers map type map[string][]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMultiPartMediaTypeFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + mediaTypeFlagName := fmt.Sprintf("%v.mediaType", cmdPrefix) + if cmd.Flags().Changed(mediaTypeFlagName) { + // info: complex object mediaType MediaType is retrieved outside this Changed() block + } + mediaTypeFlagValue := m.MediaType + if swag.IsZero(mediaTypeFlagValue) { + mediaTypeFlagValue = &models.MediaType{} + } + + err, mediaTypeAdded := retrieveModelMediaTypeFlags(depth+1, mediaTypeFlagValue, mediaTypeFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || mediaTypeAdded + if mediaTypeAdded { + m.MediaType = mediaTypeFlagValue + } + + return nil, retAdded +} + +func retrieveMultiPartMessageBodyWorkersFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + messageBodyWorkersFlagName := fmt.Sprintf("%v.messageBodyWorkers", cmdPrefix) + if cmd.Flags().Changed(messageBodyWorkersFlagName) { + // warning: messageBodyWorkers map type MessageBodyWorkers is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMultiPartParameterizedHeadersFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parameterizedHeadersFlagName := fmt.Sprintf("%v.parameterizedHeaders", cmdPrefix) + if cmd.Flags().Changed(parameterizedHeadersFlagName) { + // warning: parameterizedHeaders map type map[string][]ParameterizedHeader is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveMultiPartParentFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parentFlagName := fmt.Sprintf("%v.parent", cmdPrefix) + if cmd.Flags().Changed(parentFlagName) { + // info: complex object parent MultiPart is retrieved outside this Changed() block + } + parentFlagValue := m.Parent + if swag.IsZero(parentFlagValue) { + parentFlagValue = &models.MultiPart{} + } + + err, parentAdded := retrieveModelMultiPartFlags(depth+1, parentFlagValue, parentFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parentAdded + if parentAdded { + m.Parent = parentFlagValue + } + + return nil, retAdded +} + +func retrieveMultiPartProvidersFlags(depth int, m *models.MultiPart, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + providersFlagName := fmt.Sprintf("%v.providers", cmdPrefix) + if cmd.Flags().Changed(providersFlagName) { + // warning: providers map type Providers is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/object_node_model.go b/src/cli/object_node_model.go new file mode 100644 index 0000000..9f92a08 --- /dev/null +++ b/src/cli/object_node_model.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Schema cli for interface{} + +// Name: [ObjectNode], Type:[interface{}], register and retrieve functions are not rendered by go-swagger cli diff --git a/src/cli/parameterized_header_model.go b/src/cli/parameterized_header_model.go new file mode 100644 index 0000000..0217cf9 --- /dev/null +++ b/src/cli/parameterized_header_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ParameterizedHeader + +// register flags to command +func registerModelParameterizedHeaderFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerParameterizedHeaderParameters(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerParameterizedHeaderValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerParameterizedHeaderParameters(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: parameters map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerParameterizedHeaderValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + valueDescription := `` + + var valueFlagName string + if cmdPrefix == "" { + valueFlagName = "value" + } else { + valueFlagName = fmt.Sprintf("%v.value", cmdPrefix) + } + + var valueFlagDefault string + + _ = cmd.PersistentFlags().String(valueFlagName, valueFlagDefault, valueDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelParameterizedHeaderFlags(depth int, m *models.ParameterizedHeader, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, parametersAdded := retrieveParameterizedHeaderParametersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || parametersAdded + + err, valueAdded := retrieveParameterizedHeaderValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || valueAdded + + return nil, retAdded +} + +func retrieveParameterizedHeaderParametersFlags(depth int, m *models.ParameterizedHeader, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + parametersFlagName := fmt.Sprintf("%v.parameters", cmdPrefix) + if cmd.Flags().Changed(parametersFlagName) { + // warning: parameters map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveParameterizedHeaderValueFlags(depth int, m *models.ParameterizedHeader, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + valueFlagName := fmt.Sprintf("%v.value", cmdPrefix) + if cmd.Flags().Changed(valueFlagName) { + + var valueFlagName string + if cmdPrefix == "" { + valueFlagName = "value" + } else { + valueFlagName = fmt.Sprintf("%v.value", cmdPrefix) + } + + valueFlagValue, err := cmd.Flags().GetString(valueFlagName) + if err != nil { + return err, false + } + m.Value = valueFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/partition_offset_info_model.go b/src/cli/partition_offset_info_model.go new file mode 100644 index 0000000..9030d6f --- /dev/null +++ b/src/cli/partition_offset_info_model.go @@ -0,0 +1,164 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for PartitionOffsetInfo + +// register flags to command +func registerModelPartitionOffsetInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerPartitionOffsetInfoAvailabilityLagMsMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerPartitionOffsetInfoCurrentOffsetsMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerPartitionOffsetInfoLatestUpstreamOffsetMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerPartitionOffsetInfoRecordsLagMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerPartitionOffsetInfoAvailabilityLagMsMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: availabilityLagMsMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerPartitionOffsetInfoCurrentOffsetsMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: currentOffsetsMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerPartitionOffsetInfoLatestUpstreamOffsetMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: latestUpstreamOffsetMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerPartitionOffsetInfoRecordsLagMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: recordsLagMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelPartitionOffsetInfoFlags(depth int, m *models.PartitionOffsetInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, availabilityLagMsMapAdded := retrievePartitionOffsetInfoAvailabilityLagMsMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || availabilityLagMsMapAdded + + err, currentOffsetsMapAdded := retrievePartitionOffsetInfoCurrentOffsetsMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || currentOffsetsMapAdded + + err, latestUpstreamOffsetMapAdded := retrievePartitionOffsetInfoLatestUpstreamOffsetMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || latestUpstreamOffsetMapAdded + + err, recordsLagMapAdded := retrievePartitionOffsetInfoRecordsLagMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || recordsLagMapAdded + + return nil, retAdded +} + +func retrievePartitionOffsetInfoAvailabilityLagMsMapFlags(depth int, m *models.PartitionOffsetInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + availabilityLagMsMapFlagName := fmt.Sprintf("%v.availabilityLagMsMap", cmdPrefix) + if cmd.Flags().Changed(availabilityLagMsMapFlagName) { + // warning: availabilityLagMsMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrievePartitionOffsetInfoCurrentOffsetsMapFlags(depth int, m *models.PartitionOffsetInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + currentOffsetsMapFlagName := fmt.Sprintf("%v.currentOffsetsMap", cmdPrefix) + if cmd.Flags().Changed(currentOffsetsMapFlagName) { + // warning: currentOffsetsMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrievePartitionOffsetInfoLatestUpstreamOffsetMapFlags(depth int, m *models.PartitionOffsetInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + latestUpstreamOffsetMapFlagName := fmt.Sprintf("%v.latestUpstreamOffsetMap", cmdPrefix) + if cmd.Flags().Changed(latestUpstreamOffsetMapFlagName) { + // warning: latestUpstreamOffsetMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrievePartitionOffsetInfoRecordsLagMapFlags(depth int, m *models.PartitionOffsetInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + recordsLagMapFlagName := fmt.Sprintf("%v.recordsLagMap", cmdPrefix) + if cmd.Flags().Changed(recordsLagMapFlagName) { + // warning: recordsLagMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/pause_consumption_operation.go b/src/cli/pause_consumption_operation.go new file mode 100644 index 0000000..e578d81 --- /dev/null +++ b/src/cli/pause_consumption_operation.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTablePauseConsumptionCmd returns a cmd to handle operation pauseConsumption +func makeOperationTablePauseConsumptionCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "pauseConsumption", + Short: `Pause the consumption of a realtime table`, + RunE: runOperationTablePauseConsumption, + } + + if err := registerOperationTablePauseConsumptionParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTablePauseConsumption uses cmd flags to call endpoint api +func runOperationTablePauseConsumption(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewPauseConsumptionParams() + if err, _ := retrieveOperationTablePauseConsumptionTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTablePauseConsumptionResult(appCli.Table.PauseConsumption(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTablePauseConsumptionParamFlags registers all flags needed to fill params +func registerOperationTablePauseConsumptionParamFlags(cmd *cobra.Command) error { + if err := registerOperationTablePauseConsumptionTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTablePauseConsumptionTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTablePauseConsumptionTableNameFlag(m *table.PauseConsumptionParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTablePauseConsumptionResult parses request result and return the string content +func parseOperationTablePauseConsumptionResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning pauseConsumption default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/pinot_task_config_model.go b/src/cli/pinot_task_config_model.go new file mode 100644 index 0000000..fd30a91 --- /dev/null +++ b/src/cli/pinot_task_config_model.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for PinotTaskConfig + +// register flags to command +func registerModelPinotTaskConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerPinotTaskConfigConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerPinotTaskConfigTableName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerPinotTaskConfigTaskID(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerPinotTaskConfigTaskType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerPinotTaskConfigConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: configs map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerPinotTaskConfigTableName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tableNameDescription := `` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func registerPinotTaskConfigTaskID(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + taskIdDescription := `` + + var taskIdFlagName string + if cmdPrefix == "" { + taskIdFlagName = "taskId" + } else { + taskIdFlagName = fmt.Sprintf("%v.taskId", cmdPrefix) + } + + var taskIdFlagDefault string + + _ = cmd.PersistentFlags().String(taskIdFlagName, taskIdFlagDefault, taskIdDescription) + + return nil +} + +func registerPinotTaskConfigTaskType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + taskTypeDescription := `` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelPinotTaskConfigFlags(depth int, m *models.PinotTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, configsAdded := retrievePinotTaskConfigConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || configsAdded + + err, tableNameAdded := retrievePinotTaskConfigTableNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableNameAdded + + err, taskIdAdded := retrievePinotTaskConfigTaskIDFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskIdAdded + + err, taskTypeAdded := retrievePinotTaskConfigTaskTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskTypeAdded + + return nil, retAdded +} + +func retrievePinotTaskConfigConfigsFlags(depth int, m *models.PinotTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + configsFlagName := fmt.Sprintf("%v.configs", cmdPrefix) + if cmd.Flags().Changed(configsFlagName) { + // warning: configs map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrievePinotTaskConfigTableNameFlags(depth int, m *models.PinotTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableNameFlagName := fmt.Sprintf("%v.tableName", cmdPrefix) + if cmd.Flags().Changed(tableNameFlagName) { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrievePinotTaskConfigTaskIDFlags(depth int, m *models.PinotTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskIdFlagName := fmt.Sprintf("%v.taskId", cmdPrefix) + if cmd.Flags().Changed(taskIdFlagName) { + + var taskIdFlagName string + if cmdPrefix == "" { + taskIdFlagName = "taskId" + } else { + taskIdFlagName = fmt.Sprintf("%v.taskId", cmdPrefix) + } + + taskIdFlagValue, err := cmd.Flags().GetString(taskIdFlagName) + if err != nil { + return err, false + } + m.TaskID = taskIdFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrievePinotTaskConfigTaskTypeFlags(depth int, m *models.PinotTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskTypeFlagName := fmt.Sprintf("%v.taskType", cmdPrefix) + if cmd.Flags().Changed(taskTypeFlagName) { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/providers_model.go b/src/cli/providers_model.go new file mode 100644 index 0000000..f4a7fd1 --- /dev/null +++ b/src/cli/providers_model.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Schema cli for interface{} + +// Name: [Providers], Type:[interface{}], register and retrieve functions are not rendered by go-swagger cli diff --git a/src/cli/put_children_operation.go b/src/cli/put_children_operation.go new file mode 100644 index 0000000..f93a4b4 --- /dev/null +++ b/src/cli/put_children_operation.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperPutChildrenCmd returns a cmd to handle operation putChildren +func makeOperationZookeeperPutChildrenCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "putChildren", + Short: ``, + RunE: runOperationZookeeperPutChildren, + } + + if err := registerOperationZookeeperPutChildrenParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperPutChildren uses cmd flags to call endpoint api +func runOperationZookeeperPutChildren(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewPutChildrenParams() + if err, _ := retrieveOperationZookeeperPutChildrenAccessOptionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutChildrenBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutChildrenDataFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutChildrenExpectedVersionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutChildrenPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperPutChildrenResult(appCli.Zookeeper.PutChildren(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperPutChildrenParamFlags registers all flags needed to fill params +func registerOperationZookeeperPutChildrenParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperPutChildrenAccessOptionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutChildrenBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutChildrenDataParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutChildrenExpectedVersionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutChildrenPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperPutChildrenAccessOptionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + accessOptionDescription := `accessOption` + + var accessOptionFlagName string + if cmdPrefix == "" { + accessOptionFlagName = "accessOption" + } else { + accessOptionFlagName = fmt.Sprintf("%v.accessOption", cmdPrefix) + } + + var accessOptionFlagDefault int32 = 1 + + _ = cmd.PersistentFlags().Int32(accessOptionFlagName, accessOptionFlagDefault, accessOptionDescription) + + return nil +} +func registerOperationZookeeperPutChildrenBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationZookeeperPutChildrenDataParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + dataDescription := `Content` + + var dataFlagName string + if cmdPrefix == "" { + dataFlagName = "data" + } else { + dataFlagName = fmt.Sprintf("%v.data", cmdPrefix) + } + + var dataFlagDefault string + + _ = cmd.PersistentFlags().String(dataFlagName, dataFlagDefault, dataDescription) + + return nil +} +func registerOperationZookeeperPutChildrenExpectedVersionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + expectedVersionDescription := `expectedVersion` + + var expectedVersionFlagName string + if cmdPrefix == "" { + expectedVersionFlagName = "expectedVersion" + } else { + expectedVersionFlagName = fmt.Sprintf("%v.expectedVersion", cmdPrefix) + } + + var expectedVersionFlagDefault int32 = -1 + + _ = cmd.PersistentFlags().Int32(expectedVersionFlagName, expectedVersionFlagDefault, expectedVersionDescription) + + return nil +} +func registerOperationZookeeperPutChildrenPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper path of parent, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperPutChildrenAccessOptionFlag(m *zookeeper.PutChildrenParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("accessOption") { + + var accessOptionFlagName string + if cmdPrefix == "" { + accessOptionFlagName = "accessOption" + } else { + accessOptionFlagName = fmt.Sprintf("%v.accessOption", cmdPrefix) + } + + accessOptionFlagValue, err := cmd.Flags().GetInt32(accessOptionFlagName) + if err != nil { + return err, false + } + m.AccessOption = &accessOptionFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutChildrenBodyFlag(m *zookeeper.PutChildrenParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutChildrenDataFlag(m *zookeeper.PutChildrenParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("data") { + + var dataFlagName string + if cmdPrefix == "" { + dataFlagName = "data" + } else { + dataFlagName = fmt.Sprintf("%v.data", cmdPrefix) + } + + dataFlagValue, err := cmd.Flags().GetString(dataFlagName) + if err != nil { + return err, false + } + m.Data = &dataFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutChildrenExpectedVersionFlag(m *zookeeper.PutChildrenParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("expectedVersion") { + + var expectedVersionFlagName string + if cmdPrefix == "" { + expectedVersionFlagName = "expectedVersion" + } else { + expectedVersionFlagName = fmt.Sprintf("%v.expectedVersion", cmdPrefix) + } + + expectedVersionFlagValue, err := cmd.Flags().GetInt32(expectedVersionFlagName) + if err != nil { + return err, false + } + m.ExpectedVersion = &expectedVersionFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutChildrenPathFlag(m *zookeeper.PutChildrenParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperPutChildrenResult parses request result and return the string content +func parseOperationZookeeperPutChildrenResult(resp0 *zookeeper.PutChildrenOK, resp1 *zookeeper.PutChildrenNoContent, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning putChildrenOK is not supported + + // Non schema case: warning putChildrenNoContent is not supported + + // Non schema case: warning putChildrenNotFound is not supported + + // Non schema case: warning putChildrenInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response putChildrenOK is not supported by go-swagger cli yet. + + // warning: non schema response putChildrenNoContent is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/put_data_operation.go b/src/cli/put_data_operation.go new file mode 100644 index 0000000..ecf75a5 --- /dev/null +++ b/src/cli/put_data_operation.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperPutDataCmd returns a cmd to handle operation putData +func makeOperationZookeeperPutDataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "putData", + Short: ``, + RunE: runOperationZookeeperPutData, + } + + if err := registerOperationZookeeperPutDataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperPutData uses cmd flags to call endpoint api +func runOperationZookeeperPutData(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewPutDataParams() + if err, _ := retrieveOperationZookeeperPutDataAccessOptionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutDataBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutDataDataFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutDataExpectedVersionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationZookeeperPutDataPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperPutDataResult(appCli.Zookeeper.PutData(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperPutDataParamFlags registers all flags needed to fill params +func registerOperationZookeeperPutDataParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperPutDataAccessOptionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutDataBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutDataDataParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutDataExpectedVersionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationZookeeperPutDataPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperPutDataAccessOptionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + accessOptionDescription := `accessOption` + + var accessOptionFlagName string + if cmdPrefix == "" { + accessOptionFlagName = "accessOption" + } else { + accessOptionFlagName = fmt.Sprintf("%v.accessOption", cmdPrefix) + } + + var accessOptionFlagDefault int32 = 1 + + _ = cmd.PersistentFlags().Int32(accessOptionFlagName, accessOptionFlagDefault, accessOptionDescription) + + return nil +} +func registerOperationZookeeperPutDataBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationZookeeperPutDataDataParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + dataDescription := `Content` + + var dataFlagName string + if cmdPrefix == "" { + dataFlagName = "data" + } else { + dataFlagName = fmt.Sprintf("%v.data", cmdPrefix) + } + + var dataFlagDefault string + + _ = cmd.PersistentFlags().String(dataFlagName, dataFlagDefault, dataDescription) + + return nil +} +func registerOperationZookeeperPutDataExpectedVersionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + expectedVersionDescription := `expectedVersion` + + var expectedVersionFlagName string + if cmdPrefix == "" { + expectedVersionFlagName = "expectedVersion" + } else { + expectedVersionFlagName = fmt.Sprintf("%v.expectedVersion", cmdPrefix) + } + + var expectedVersionFlagDefault int32 = -1 + + _ = cmd.PersistentFlags().Int32(expectedVersionFlagName, expectedVersionFlagDefault, expectedVersionDescription) + + return nil +} +func registerOperationZookeeperPutDataPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperPutDataAccessOptionFlag(m *zookeeper.PutDataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("accessOption") { + + var accessOptionFlagName string + if cmdPrefix == "" { + accessOptionFlagName = "accessOption" + } else { + accessOptionFlagName = fmt.Sprintf("%v.accessOption", cmdPrefix) + } + + accessOptionFlagValue, err := cmd.Flags().GetInt32(accessOptionFlagName) + if err != nil { + return err, false + } + m.AccessOption = &accessOptionFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutDataBodyFlag(m *zookeeper.PutDataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutDataDataFlag(m *zookeeper.PutDataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("data") { + + var dataFlagName string + if cmdPrefix == "" { + dataFlagName = "data" + } else { + dataFlagName = fmt.Sprintf("%v.data", cmdPrefix) + } + + dataFlagValue, err := cmd.Flags().GetString(dataFlagName) + if err != nil { + return err, false + } + m.Data = &dataFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutDataExpectedVersionFlag(m *zookeeper.PutDataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("expectedVersion") { + + var expectedVersionFlagName string + if cmdPrefix == "" { + expectedVersionFlagName = "expectedVersion" + } else { + expectedVersionFlagName = fmt.Sprintf("%v.expectedVersion", cmdPrefix) + } + + expectedVersionFlagValue, err := cmd.Flags().GetInt32(expectedVersionFlagName) + if err != nil { + return err, false + } + m.ExpectedVersion = &expectedVersionFlagValue + + } + return nil, retAdded +} +func retrieveOperationZookeeperPutDataPathFlag(m *zookeeper.PutDataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperPutDataResult parses request result and return the string content +func parseOperationZookeeperPutDataResult(resp0 *zookeeper.PutDataOK, resp1 *zookeeper.PutDataNoContent, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning putDataOK is not supported + + // Non schema case: warning putDataNoContent is not supported + + // Non schema case: warning putDataNotFound is not supported + + // Non schema case: warning putDataInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response putDataOK is not supported by go-swagger cli yet. + + // warning: non schema response putDataNoContent is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/put_operation.go b/src/cli/put_operation.go new file mode 100644 index 0000000..d138566 --- /dev/null +++ b/src/cli/put_operation.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTablePutCmd returns a cmd to handle operation put +func makeOperationTablePutCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "put", + Short: `Updates segmentsConfig section (validation and retention) of a table`, + RunE: runOperationTablePut, + } + + if err := registerOperationTablePutParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTablePut uses cmd flags to call endpoint api +func runOperationTablePut(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewPutParams() + if err, _ := retrieveOperationTablePutBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTablePutTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTablePutResult(appCli.Table.Put(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTablePutParamFlags registers all flags needed to fill params +func registerOperationTablePutParamFlags(cmd *cobra.Command) error { + if err := registerOperationTablePutBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTablePutTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTablePutBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTablePutTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTablePutBodyFlag(m *table.PutParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTablePutTableNameFlag(m *table.PutParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTablePutResult parses request result and return the string content +func parseOperationTablePutResult(resp0 *table.PutOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning putOK is not supported + + // Non schema case: warning putNotFound is not supported + + // Non schema case: warning putInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response putOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/query_config_model.go b/src/cli/query_config_model.go new file mode 100644 index 0000000..8b1f2eb --- /dev/null +++ b/src/cli/query_config_model.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for QueryConfig + +// register flags to command +func registerModelQueryConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerQueryConfigDisableGroovy(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerQueryConfigExpressionOverrideMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerQueryConfigTimeoutMs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerQueryConfigUseApproximateFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerQueryConfigDisableGroovy(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + disableGroovyDescription := `` + + var disableGroovyFlagName string + if cmdPrefix == "" { + disableGroovyFlagName = "disableGroovy" + } else { + disableGroovyFlagName = fmt.Sprintf("%v.disableGroovy", cmdPrefix) + } + + var disableGroovyFlagDefault bool + + _ = cmd.PersistentFlags().Bool(disableGroovyFlagName, disableGroovyFlagDefault, disableGroovyDescription) + + return nil +} + +func registerQueryConfigExpressionOverrideMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: expressionOverrideMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerQueryConfigTimeoutMs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeoutMsDescription := `` + + var timeoutMsFlagName string + if cmdPrefix == "" { + timeoutMsFlagName = "timeoutMs" + } else { + timeoutMsFlagName = fmt.Sprintf("%v.timeoutMs", cmdPrefix) + } + + var timeoutMsFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(timeoutMsFlagName, timeoutMsFlagDefault, timeoutMsDescription) + + return nil +} + +func registerQueryConfigUseApproximateFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + useApproximateFunctionDescription := `` + + var useApproximateFunctionFlagName string + if cmdPrefix == "" { + useApproximateFunctionFlagName = "useApproximateFunction" + } else { + useApproximateFunctionFlagName = fmt.Sprintf("%v.useApproximateFunction", cmdPrefix) + } + + var useApproximateFunctionFlagDefault bool + + _ = cmd.PersistentFlags().Bool(useApproximateFunctionFlagName, useApproximateFunctionFlagDefault, useApproximateFunctionDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelQueryConfigFlags(depth int, m *models.QueryConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, disableGroovyAdded := retrieveQueryConfigDisableGroovyFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || disableGroovyAdded + + err, expressionOverrideMapAdded := retrieveQueryConfigExpressionOverrideMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || expressionOverrideMapAdded + + err, timeoutMsAdded := retrieveQueryConfigTimeoutMsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeoutMsAdded + + err, useApproximateFunctionAdded := retrieveQueryConfigUseApproximateFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || useApproximateFunctionAdded + + return nil, retAdded +} + +func retrieveQueryConfigDisableGroovyFlags(depth int, m *models.QueryConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + disableGroovyFlagName := fmt.Sprintf("%v.disableGroovy", cmdPrefix) + if cmd.Flags().Changed(disableGroovyFlagName) { + + var disableGroovyFlagName string + if cmdPrefix == "" { + disableGroovyFlagName = "disableGroovy" + } else { + disableGroovyFlagName = fmt.Sprintf("%v.disableGroovy", cmdPrefix) + } + + disableGroovyFlagValue, err := cmd.Flags().GetBool(disableGroovyFlagName) + if err != nil { + return err, false + } + m.DisableGroovy = &disableGroovyFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveQueryConfigExpressionOverrideMapFlags(depth int, m *models.QueryConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + expressionOverrideMapFlagName := fmt.Sprintf("%v.expressionOverrideMap", cmdPrefix) + if cmd.Flags().Changed(expressionOverrideMapFlagName) { + // warning: expressionOverrideMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveQueryConfigTimeoutMsFlags(depth int, m *models.QueryConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeoutMsFlagName := fmt.Sprintf("%v.timeoutMs", cmdPrefix) + if cmd.Flags().Changed(timeoutMsFlagName) { + + var timeoutMsFlagName string + if cmdPrefix == "" { + timeoutMsFlagName = "timeoutMs" + } else { + timeoutMsFlagName = fmt.Sprintf("%v.timeoutMs", cmdPrefix) + } + + timeoutMsFlagValue, err := cmd.Flags().GetInt64(timeoutMsFlagName) + if err != nil { + return err, false + } + m.TimeoutMs = timeoutMsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveQueryConfigUseApproximateFunctionFlags(depth int, m *models.QueryConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + useApproximateFunctionFlagName := fmt.Sprintf("%v.useApproximateFunction", cmdPrefix) + if cmd.Flags().Changed(useApproximateFunctionFlagName) { + + var useApproximateFunctionFlagName string + if cmdPrefix == "" { + useApproximateFunctionFlagName = "useApproximateFunction" + } else { + useApproximateFunctionFlagName = fmt.Sprintf("%v.useApproximateFunction", cmdPrefix) + } + + useApproximateFunctionFlagValue, err := cmd.Flags().GetBool(useApproximateFunctionFlagName) + if err != nil { + return err, false + } + m.UseApproximateFunction = &useApproximateFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/quota_config_model.go b/src/cli/quota_config_model.go new file mode 100644 index 0000000..8dc3b32 --- /dev/null +++ b/src/cli/quota_config_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for QuotaConfig + +// register flags to command +func registerModelQuotaConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerQuotaConfigMaxQueriesPerSecond(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerQuotaConfigStorage(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerQuotaConfigMaxQueriesPerSecond(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxQueriesPerSecondDescription := `` + + var maxQueriesPerSecondFlagName string + if cmdPrefix == "" { + maxQueriesPerSecondFlagName = "maxQueriesPerSecond" + } else { + maxQueriesPerSecondFlagName = fmt.Sprintf("%v.maxQueriesPerSecond", cmdPrefix) + } + + var maxQueriesPerSecondFlagDefault string + + _ = cmd.PersistentFlags().String(maxQueriesPerSecondFlagName, maxQueriesPerSecondFlagDefault, maxQueriesPerSecondDescription) + + return nil +} + +func registerQuotaConfigStorage(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + storageDescription := `` + + var storageFlagName string + if cmdPrefix == "" { + storageFlagName = "storage" + } else { + storageFlagName = fmt.Sprintf("%v.storage", cmdPrefix) + } + + var storageFlagDefault string + + _ = cmd.PersistentFlags().String(storageFlagName, storageFlagDefault, storageDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelQuotaConfigFlags(depth int, m *models.QuotaConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, maxQueriesPerSecondAdded := retrieveQuotaConfigMaxQueriesPerSecondFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxQueriesPerSecondAdded + + err, storageAdded := retrieveQuotaConfigStorageFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || storageAdded + + return nil, retAdded +} + +func retrieveQuotaConfigMaxQueriesPerSecondFlags(depth int, m *models.QuotaConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxQueriesPerSecondFlagName := fmt.Sprintf("%v.maxQueriesPerSecond", cmdPrefix) + if cmd.Flags().Changed(maxQueriesPerSecondFlagName) { + + var maxQueriesPerSecondFlagName string + if cmdPrefix == "" { + maxQueriesPerSecondFlagName = "maxQueriesPerSecond" + } else { + maxQueriesPerSecondFlagName = fmt.Sprintf("%v.maxQueriesPerSecond", cmdPrefix) + } + + maxQueriesPerSecondFlagValue, err := cmd.Flags().GetString(maxQueriesPerSecondFlagName) + if err != nil { + return err, false + } + m.MaxQueriesPerSecond = maxQueriesPerSecondFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveQuotaConfigStorageFlags(depth int, m *models.QuotaConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + storageFlagName := fmt.Sprintf("%v.storage", cmdPrefix) + if cmd.Flags().Changed(storageFlagName) { + + var storageFlagName string + if cmdPrefix == "" { + storageFlagName = "storage" + } else { + storageFlagName = fmt.Sprintf("%v.storage", cmdPrefix) + } + + storageFlagValue, err := cmd.Flags().GetString(storageFlagName) + if err != nil { + return err, false + } + m.Storage = storageFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/rebalance_operation.go b/src/cli/rebalance_operation.go new file mode 100644 index 0000000..aaf8bf1 --- /dev/null +++ b/src/cli/rebalance_operation.go @@ -0,0 +1,566 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableRebalanceCmd returns a cmd to handle operation rebalance +func makeOperationTableRebalanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "rebalance", + Short: `Rebalances a table (reassign instances and segments for a table)`, + RunE: runOperationTableRebalance, + } + + if err := registerOperationTableRebalanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableRebalance uses cmd flags to call endpoint api +func runOperationTableRebalance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewRebalanceParams() + if err, _ := retrieveOperationTableRebalanceBestEffortsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceBootstrapFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceDowntimeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceDryRunFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceExternalViewCheckIntervalInMsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceExternalViewStabilizationTimeoutInMsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceIncludeConsumingFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceMinAvailableReplicasFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceReassignInstancesFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRebalanceTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableRebalanceResult(appCli.Table.Rebalance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableRebalanceParamFlags registers all flags needed to fill params +func registerOperationTableRebalanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableRebalanceBestEffortsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceBootstrapParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceDowntimeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceDryRunParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceExternalViewCheckIntervalInMsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceExternalViewStabilizationTimeoutInMsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceIncludeConsumingParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceMinAvailableReplicasParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceReassignInstancesParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRebalanceTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableRebalanceBestEffortsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bestEffortsDescription := `Whether to use best-efforts to rebalance (not fail the rebalance when the no-downtime contract cannot be achieved)` + + var bestEffortsFlagName string + if cmdPrefix == "" { + bestEffortsFlagName = "bestEfforts" + } else { + bestEffortsFlagName = fmt.Sprintf("%v.bestEfforts", cmdPrefix) + } + + var bestEffortsFlagDefault bool + + _ = cmd.PersistentFlags().Bool(bestEffortsFlagName, bestEffortsFlagDefault, bestEffortsDescription) + + return nil +} +func registerOperationTableRebalanceBootstrapParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bootstrapDescription := `Whether to rebalance table in bootstrap mode (regardless of minimum segment movement, reassign all segments in a round-robin fashion as if adding new segments to an empty table)` + + var bootstrapFlagName string + if cmdPrefix == "" { + bootstrapFlagName = "bootstrap" + } else { + bootstrapFlagName = fmt.Sprintf("%v.bootstrap", cmdPrefix) + } + + var bootstrapFlagDefault bool + + _ = cmd.PersistentFlags().Bool(bootstrapFlagName, bootstrapFlagDefault, bootstrapDescription) + + return nil +} +func registerOperationTableRebalanceDowntimeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + downtimeDescription := `Whether to allow downtime for the rebalance` + + var downtimeFlagName string + if cmdPrefix == "" { + downtimeFlagName = "downtime" + } else { + downtimeFlagName = fmt.Sprintf("%v.downtime", cmdPrefix) + } + + var downtimeFlagDefault bool + + _ = cmd.PersistentFlags().Bool(downtimeFlagName, downtimeFlagDefault, downtimeDescription) + + return nil +} +func registerOperationTableRebalanceDryRunParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + dryRunDescription := `Whether to rebalance table in dry-run mode` + + var dryRunFlagName string + if cmdPrefix == "" { + dryRunFlagName = "dryRun" + } else { + dryRunFlagName = fmt.Sprintf("%v.dryRun", cmdPrefix) + } + + var dryRunFlagDefault bool + + _ = cmd.PersistentFlags().Bool(dryRunFlagName, dryRunFlagDefault, dryRunDescription) + + return nil +} +func registerOperationTableRebalanceExternalViewCheckIntervalInMsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + externalViewCheckIntervalInMsDescription := `How often to check if external view converges with ideal states` + + var externalViewCheckIntervalInMsFlagName string + if cmdPrefix == "" { + externalViewCheckIntervalInMsFlagName = "externalViewCheckIntervalInMs" + } else { + externalViewCheckIntervalInMsFlagName = fmt.Sprintf("%v.externalViewCheckIntervalInMs", cmdPrefix) + } + + var externalViewCheckIntervalInMsFlagDefault int64 = 1000 + + _ = cmd.PersistentFlags().Int64(externalViewCheckIntervalInMsFlagName, externalViewCheckIntervalInMsFlagDefault, externalViewCheckIntervalInMsDescription) + + return nil +} +func registerOperationTableRebalanceExternalViewStabilizationTimeoutInMsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + externalViewStabilizationTimeoutInMsDescription := `How long to wait till external view converges with ideal states` + + var externalViewStabilizationTimeoutInMsFlagName string + if cmdPrefix == "" { + externalViewStabilizationTimeoutInMsFlagName = "externalViewStabilizationTimeoutInMs" + } else { + externalViewStabilizationTimeoutInMsFlagName = fmt.Sprintf("%v.externalViewStabilizationTimeoutInMs", cmdPrefix) + } + + var externalViewStabilizationTimeoutInMsFlagDefault int64 = 3.6e+06 + + _ = cmd.PersistentFlags().Int64(externalViewStabilizationTimeoutInMsFlagName, externalViewStabilizationTimeoutInMsFlagDefault, externalViewStabilizationTimeoutInMsDescription) + + return nil +} +func registerOperationTableRebalanceIncludeConsumingParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + includeConsumingDescription := `Whether to reassign CONSUMING segments for real-time table` + + var includeConsumingFlagName string + if cmdPrefix == "" { + includeConsumingFlagName = "includeConsuming" + } else { + includeConsumingFlagName = fmt.Sprintf("%v.includeConsuming", cmdPrefix) + } + + var includeConsumingFlagDefault bool + + _ = cmd.PersistentFlags().Bool(includeConsumingFlagName, includeConsumingFlagDefault, includeConsumingDescription) + + return nil +} +func registerOperationTableRebalanceMinAvailableReplicasParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + minAvailableReplicasDescription := `For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of replicas allowed to be unavailable if value is negative` + + var minAvailableReplicasFlagName string + if cmdPrefix == "" { + minAvailableReplicasFlagName = "minAvailableReplicas" + } else { + minAvailableReplicasFlagName = fmt.Sprintf("%v.minAvailableReplicas", cmdPrefix) + } + + var minAvailableReplicasFlagDefault int32 = 1 + + _ = cmd.PersistentFlags().Int32(minAvailableReplicasFlagName, minAvailableReplicasFlagDefault, minAvailableReplicasDescription) + + return nil +} +func registerOperationTableRebalanceReassignInstancesParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + reassignInstancesDescription := `Whether to reassign instances before reassigning segments` + + var reassignInstancesFlagName string + if cmdPrefix == "" { + reassignInstancesFlagName = "reassignInstances" + } else { + reassignInstancesFlagName = fmt.Sprintf("%v.reassignInstances", cmdPrefix) + } + + var reassignInstancesFlagDefault bool + + _ = cmd.PersistentFlags().Bool(reassignInstancesFlagName, reassignInstancesFlagDefault, reassignInstancesDescription) + + return nil +} +func registerOperationTableRebalanceTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table to rebalance` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableRebalanceTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationTableRebalanceBestEffortsFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("bestEfforts") { + + var bestEffortsFlagName string + if cmdPrefix == "" { + bestEffortsFlagName = "bestEfforts" + } else { + bestEffortsFlagName = fmt.Sprintf("%v.bestEfforts", cmdPrefix) + } + + bestEffortsFlagValue, err := cmd.Flags().GetBool(bestEffortsFlagName) + if err != nil { + return err, false + } + m.BestEfforts = &bestEffortsFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceBootstrapFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("bootstrap") { + + var bootstrapFlagName string + if cmdPrefix == "" { + bootstrapFlagName = "bootstrap" + } else { + bootstrapFlagName = fmt.Sprintf("%v.bootstrap", cmdPrefix) + } + + bootstrapFlagValue, err := cmd.Flags().GetBool(bootstrapFlagName) + if err != nil { + return err, false + } + m.Bootstrap = &bootstrapFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceDowntimeFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("downtime") { + + var downtimeFlagName string + if cmdPrefix == "" { + downtimeFlagName = "downtime" + } else { + downtimeFlagName = fmt.Sprintf("%v.downtime", cmdPrefix) + } + + downtimeFlagValue, err := cmd.Flags().GetBool(downtimeFlagName) + if err != nil { + return err, false + } + m.Downtime = &downtimeFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceDryRunFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("dryRun") { + + var dryRunFlagName string + if cmdPrefix == "" { + dryRunFlagName = "dryRun" + } else { + dryRunFlagName = fmt.Sprintf("%v.dryRun", cmdPrefix) + } + + dryRunFlagValue, err := cmd.Flags().GetBool(dryRunFlagName) + if err != nil { + return err, false + } + m.DryRun = &dryRunFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceExternalViewCheckIntervalInMsFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("externalViewCheckIntervalInMs") { + + var externalViewCheckIntervalInMsFlagName string + if cmdPrefix == "" { + externalViewCheckIntervalInMsFlagName = "externalViewCheckIntervalInMs" + } else { + externalViewCheckIntervalInMsFlagName = fmt.Sprintf("%v.externalViewCheckIntervalInMs", cmdPrefix) + } + + externalViewCheckIntervalInMsFlagValue, err := cmd.Flags().GetInt64(externalViewCheckIntervalInMsFlagName) + if err != nil { + return err, false + } + m.ExternalViewCheckIntervalInMs = &externalViewCheckIntervalInMsFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceExternalViewStabilizationTimeoutInMsFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("externalViewStabilizationTimeoutInMs") { + + var externalViewStabilizationTimeoutInMsFlagName string + if cmdPrefix == "" { + externalViewStabilizationTimeoutInMsFlagName = "externalViewStabilizationTimeoutInMs" + } else { + externalViewStabilizationTimeoutInMsFlagName = fmt.Sprintf("%v.externalViewStabilizationTimeoutInMs", cmdPrefix) + } + + externalViewStabilizationTimeoutInMsFlagValue, err := cmd.Flags().GetInt64(externalViewStabilizationTimeoutInMsFlagName) + if err != nil { + return err, false + } + m.ExternalViewStabilizationTimeoutInMs = &externalViewStabilizationTimeoutInMsFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceIncludeConsumingFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("includeConsuming") { + + var includeConsumingFlagName string + if cmdPrefix == "" { + includeConsumingFlagName = "includeConsuming" + } else { + includeConsumingFlagName = fmt.Sprintf("%v.includeConsuming", cmdPrefix) + } + + includeConsumingFlagValue, err := cmd.Flags().GetBool(includeConsumingFlagName) + if err != nil { + return err, false + } + m.IncludeConsuming = &includeConsumingFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceMinAvailableReplicasFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("minAvailableReplicas") { + + var minAvailableReplicasFlagName string + if cmdPrefix == "" { + minAvailableReplicasFlagName = "minAvailableReplicas" + } else { + minAvailableReplicasFlagName = fmt.Sprintf("%v.minAvailableReplicas", cmdPrefix) + } + + minAvailableReplicasFlagValue, err := cmd.Flags().GetInt32(minAvailableReplicasFlagName) + if err != nil { + return err, false + } + m.MinAvailableReplicas = &minAvailableReplicasFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceReassignInstancesFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("reassignInstances") { + + var reassignInstancesFlagName string + if cmdPrefix == "" { + reassignInstancesFlagName = "reassignInstances" + } else { + reassignInstancesFlagName = fmt.Sprintf("%v.reassignInstances", cmdPrefix) + } + + reassignInstancesFlagValue, err := cmd.Flags().GetBool(reassignInstancesFlagName) + if err != nil { + return err, false + } + m.ReassignInstances = &reassignInstancesFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceTableNameFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRebalanceTypeFlag(m *table.RebalanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableRebalanceResult parses request result and return the string content +func parseOperationTableRebalanceResult(resp0 *table.RebalanceOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.RebalanceOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/rebalance_result_model.go b/src/cli/rebalance_result_model.go new file mode 100644 index 0000000..369a97b --- /dev/null +++ b/src/cli/rebalance_result_model.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for RebalanceResult + +// register flags to command +func registerModelRebalanceResultFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerRebalanceResultDescription(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerRebalanceResultInstanceAssignment(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerRebalanceResultSegmentAssignment(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerRebalanceResultStatus(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerRebalanceResultDescription(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + descriptionDescription := `` + + var descriptionFlagName string + if cmdPrefix == "" { + descriptionFlagName = "description" + } else { + descriptionFlagName = fmt.Sprintf("%v.description", cmdPrefix) + } + + var descriptionFlagDefault string + + _ = cmd.PersistentFlags().String(descriptionFlagName, descriptionFlagDefault, descriptionDescription) + + return nil +} + +func registerRebalanceResultInstanceAssignment(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: instanceAssignment map[string]InstancePartitions map type is not supported by go-swagger cli yet + + return nil +} + +func registerRebalanceResultSegmentAssignment(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentAssignment map[string]map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerRebalanceResultStatus(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + statusDescription := `Enum: ["NO_OP","DONE","FAILED","IN_PROGRESS"]. ` + + var statusFlagName string + if cmdPrefix == "" { + statusFlagName = "status" + } else { + statusFlagName = fmt.Sprintf("%v.status", cmdPrefix) + } + + var statusFlagDefault string + + _ = cmd.PersistentFlags().String(statusFlagName, statusFlagDefault, statusDescription) + + if err := cmd.RegisterFlagCompletionFunc(statusFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NO_OP","DONE","FAILED","IN_PROGRESS"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelRebalanceResultFlags(depth int, m *models.RebalanceResult, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, descriptionAdded := retrieveRebalanceResultDescriptionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || descriptionAdded + + err, instanceAssignmentAdded := retrieveRebalanceResultInstanceAssignmentFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instanceAssignmentAdded + + err, segmentAssignmentAdded := retrieveRebalanceResultSegmentAssignmentFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentAssignmentAdded + + err, statusAdded := retrieveRebalanceResultStatusFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || statusAdded + + return nil, retAdded +} + +func retrieveRebalanceResultDescriptionFlags(depth int, m *models.RebalanceResult, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + descriptionFlagName := fmt.Sprintf("%v.description", cmdPrefix) + if cmd.Flags().Changed(descriptionFlagName) { + + var descriptionFlagName string + if cmdPrefix == "" { + descriptionFlagName = "description" + } else { + descriptionFlagName = fmt.Sprintf("%v.description", cmdPrefix) + } + + descriptionFlagValue, err := cmd.Flags().GetString(descriptionFlagName) + if err != nil { + return err, false + } + m.Description = descriptionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveRebalanceResultInstanceAssignmentFlags(depth int, m *models.RebalanceResult, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instanceAssignmentFlagName := fmt.Sprintf("%v.instanceAssignment", cmdPrefix) + if cmd.Flags().Changed(instanceAssignmentFlagName) { + // warning: instanceAssignment map type map[string]InstancePartitions is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveRebalanceResultSegmentAssignmentFlags(depth int, m *models.RebalanceResult, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentAssignmentFlagName := fmt.Sprintf("%v.segmentAssignment", cmdPrefix) + if cmd.Flags().Changed(segmentAssignmentFlagName) { + // warning: segmentAssignment map type map[string]map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveRebalanceResultStatusFlags(depth int, m *models.RebalanceResult, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + statusFlagName := fmt.Sprintf("%v.status", cmdPrefix) + if cmd.Flags().Changed(statusFlagName) { + + var statusFlagName string + if cmdPrefix == "" { + statusFlagName = "status" + } else { + statusFlagName = fmt.Sprintf("%v.status", cmdPrefix) + } + + statusFlagValue, err := cmd.Flags().GetString(statusFlagName) + if err != nil { + return err, false + } + m.Status = statusFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/rebuild_broker_resource_operation.go b/src/cli/rebuild_broker_resource_operation.go new file mode 100644 index 0000000..2ae7c76 --- /dev/null +++ b/src/cli/rebuild_broker_resource_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableRebuildBrokerResourceCmd returns a cmd to handle operation rebuildBrokerResource +func makeOperationTableRebuildBrokerResourceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "rebuildBrokerResource", + Short: `when new brokers are added`, + RunE: runOperationTableRebuildBrokerResource, + } + + if err := registerOperationTableRebuildBrokerResourceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableRebuildBrokerResource uses cmd flags to call endpoint api +func runOperationTableRebuildBrokerResource(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewRebuildBrokerResourceParams() + if err, _ := retrieveOperationTableRebuildBrokerResourceTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableRebuildBrokerResourceResult(appCli.Table.RebuildBrokerResource(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableRebuildBrokerResourceParamFlags registers all flags needed to fill params +func registerOperationTableRebuildBrokerResourceParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableRebuildBrokerResourceTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableRebuildBrokerResourceTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name (with type)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableRebuildBrokerResourceTableNameFlag(m *table.RebuildBrokerResourceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableRebuildBrokerResourceResult parses request result and return the string content +func parseOperationTableRebuildBrokerResourceResult(resp0 *table.RebuildBrokerResourceOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning rebuildBrokerResourceOK is not supported + + // Non schema case: warning rebuildBrokerResourceBadRequest is not supported + + // Non schema case: warning rebuildBrokerResourceInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response rebuildBrokerResourceOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/recommend_config_operation.go b/src/cli/recommend_config_operation.go new file mode 100644 index 0000000..a7e6cdf --- /dev/null +++ b/src/cli/recommend_config_operation.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableRecommendConfigCmd returns a cmd to handle operation recommendConfig +func makeOperationTableRecommendConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "recommendConfig", + Short: `Recommend a config with input json`, + RunE: runOperationTableRecommendConfig, + } + + if err := registerOperationTableRecommendConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableRecommendConfig uses cmd flags to call endpoint api +func runOperationTableRecommendConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewRecommendConfigParams() + if err, _ := retrieveOperationTableRecommendConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableRecommendConfigResult(appCli.Table.RecommendConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableRecommendConfigParamFlags registers all flags needed to fill params +func registerOperationTableRecommendConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableRecommendConfigBodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableRecommendConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} + +func retrieveOperationTableRecommendConfigBodyFlag(m *table.RecommendConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} + +// parseOperationTableRecommendConfigResult parses request result and return the string content +func parseOperationTableRecommendConfigResult(resp0 *table.RecommendConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.RecommendConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reload_all_segments_deprecated1_operation.go b/src/cli/reload_all_segments_deprecated1_operation.go new file mode 100644 index 0000000..2f73f84 --- /dev/null +++ b/src/cli/reload_all_segments_deprecated1_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentReloadAllSegmentsDeprecated1Cmd returns a cmd to handle operation reloadAllSegmentsDeprecated1 +func makeOperationSegmentReloadAllSegmentsDeprecated1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "reloadAllSegmentsDeprecated1", + Short: `Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead)`, + RunE: runOperationSegmentReloadAllSegmentsDeprecated1, + } + + if err := registerOperationSegmentReloadAllSegmentsDeprecated1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentReloadAllSegmentsDeprecated1 uses cmd flags to call endpoint api +func runOperationSegmentReloadAllSegmentsDeprecated1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewReloadAllSegmentsDeprecated1Params() + if err, _ := retrieveOperationSegmentReloadAllSegmentsDeprecated1TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadAllSegmentsDeprecated1TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentReloadAllSegmentsDeprecated1Result(appCli.Segment.ReloadAllSegmentsDeprecated1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentReloadAllSegmentsDeprecated1ParamFlags registers all flags needed to fill params +func registerOperationSegmentReloadAllSegmentsDeprecated1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentReloadAllSegmentsDeprecated1TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadAllSegmentsDeprecated1TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentReloadAllSegmentsDeprecated1TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentReloadAllSegmentsDeprecated1TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentReloadAllSegmentsDeprecated1TableNameFlag(m *segment.ReloadAllSegmentsDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadAllSegmentsDeprecated1TypeFlag(m *segment.ReloadAllSegmentsDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentReloadAllSegmentsDeprecated1Result parses request result and return the string content +func parseOperationSegmentReloadAllSegmentsDeprecated1Result(resp0 *segment.ReloadAllSegmentsDeprecated1OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ReloadAllSegmentsDeprecated1OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reload_all_segments_deprecated2_operation.go b/src/cli/reload_all_segments_deprecated2_operation.go new file mode 100644 index 0000000..859fd96 --- /dev/null +++ b/src/cli/reload_all_segments_deprecated2_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentReloadAllSegmentsDeprecated2Cmd returns a cmd to handle operation reloadAllSegmentsDeprecated2 +func makeOperationSegmentReloadAllSegmentsDeprecated2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "reloadAllSegmentsDeprecated2", + Short: `Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead)`, + RunE: runOperationSegmentReloadAllSegmentsDeprecated2, + } + + if err := registerOperationSegmentReloadAllSegmentsDeprecated2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentReloadAllSegmentsDeprecated2 uses cmd flags to call endpoint api +func runOperationSegmentReloadAllSegmentsDeprecated2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewReloadAllSegmentsDeprecated2Params() + if err, _ := retrieveOperationSegmentReloadAllSegmentsDeprecated2TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadAllSegmentsDeprecated2TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentReloadAllSegmentsDeprecated2Result(appCli.Segment.ReloadAllSegmentsDeprecated2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentReloadAllSegmentsDeprecated2ParamFlags registers all flags needed to fill params +func registerOperationSegmentReloadAllSegmentsDeprecated2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentReloadAllSegmentsDeprecated2TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadAllSegmentsDeprecated2TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentReloadAllSegmentsDeprecated2TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentReloadAllSegmentsDeprecated2TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentReloadAllSegmentsDeprecated2TableNameFlag(m *segment.ReloadAllSegmentsDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadAllSegmentsDeprecated2TypeFlag(m *segment.ReloadAllSegmentsDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentReloadAllSegmentsDeprecated2Result parses request result and return the string content +func parseOperationSegmentReloadAllSegmentsDeprecated2Result(resp0 *segment.ReloadAllSegmentsDeprecated2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ReloadAllSegmentsDeprecated2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reload_all_segments_operation.go b/src/cli/reload_all_segments_operation.go new file mode 100644 index 0000000..1e1351e --- /dev/null +++ b/src/cli/reload_all_segments_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentReloadAllSegmentsCmd returns a cmd to handle operation reloadAllSegments +func makeOperationSegmentReloadAllSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "reloadAllSegments", + Short: `Reload all segments`, + RunE: runOperationSegmentReloadAllSegments, + } + + if err := registerOperationSegmentReloadAllSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentReloadAllSegments uses cmd flags to call endpoint api +func runOperationSegmentReloadAllSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewReloadAllSegmentsParams() + if err, _ := retrieveOperationSegmentReloadAllSegmentsForceDownloadFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadAllSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadAllSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentReloadAllSegmentsResult(appCli.Segment.ReloadAllSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentReloadAllSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentReloadAllSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentReloadAllSegmentsForceDownloadParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadAllSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadAllSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentReloadAllSegmentsForceDownloadParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceDownloadDescription := `Whether to force server to download segment` + + var forceDownloadFlagName string + if cmdPrefix == "" { + forceDownloadFlagName = "forceDownload" + } else { + forceDownloadFlagName = fmt.Sprintf("%v.forceDownload", cmdPrefix) + } + + var forceDownloadFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceDownloadFlagName, forceDownloadFlagDefault, forceDownloadDescription) + + return nil +} +func registerOperationSegmentReloadAllSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentReloadAllSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentReloadAllSegmentsForceDownloadFlag(m *segment.ReloadAllSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceDownload") { + + var forceDownloadFlagName string + if cmdPrefix == "" { + forceDownloadFlagName = "forceDownload" + } else { + forceDownloadFlagName = fmt.Sprintf("%v.forceDownload", cmdPrefix) + } + + forceDownloadFlagValue, err := cmd.Flags().GetBool(forceDownloadFlagName) + if err != nil { + return err, false + } + m.ForceDownload = &forceDownloadFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadAllSegmentsTableNameFlag(m *segment.ReloadAllSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadAllSegmentsTypeFlag(m *segment.ReloadAllSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentReloadAllSegmentsResult parses request result and return the string content +func parseOperationSegmentReloadAllSegmentsResult(resp0 *segment.ReloadAllSegmentsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ReloadAllSegmentsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reload_segment_deprecated1_operation.go b/src/cli/reload_segment_deprecated1_operation.go new file mode 100644 index 0000000..857b56a --- /dev/null +++ b/src/cli/reload_segment_deprecated1_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentReloadSegmentDeprecated1Cmd returns a cmd to handle operation reloadSegmentDeprecated1 +func makeOperationSegmentReloadSegmentDeprecated1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "reloadSegmentDeprecated1", + Short: `Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead)`, + RunE: runOperationSegmentReloadSegmentDeprecated1, + } + + if err := registerOperationSegmentReloadSegmentDeprecated1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentReloadSegmentDeprecated1 uses cmd flags to call endpoint api +func runOperationSegmentReloadSegmentDeprecated1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewReloadSegmentDeprecated1Params() + if err, _ := retrieveOperationSegmentReloadSegmentDeprecated1SegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadSegmentDeprecated1TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadSegmentDeprecated1TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentReloadSegmentDeprecated1Result(appCli.Segment.ReloadSegmentDeprecated1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentReloadSegmentDeprecated1ParamFlags registers all flags needed to fill params +func registerOperationSegmentReloadSegmentDeprecated1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentReloadSegmentDeprecated1SegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadSegmentDeprecated1TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadSegmentDeprecated1TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentReloadSegmentDeprecated1SegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentReloadSegmentDeprecated1TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentReloadSegmentDeprecated1TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentReloadSegmentDeprecated1SegmentNameFlag(m *segment.ReloadSegmentDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadSegmentDeprecated1TableNameFlag(m *segment.ReloadSegmentDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadSegmentDeprecated1TypeFlag(m *segment.ReloadSegmentDeprecated1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentReloadSegmentDeprecated1Result parses request result and return the string content +func parseOperationSegmentReloadSegmentDeprecated1Result(resp0 *segment.ReloadSegmentDeprecated1OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ReloadSegmentDeprecated1OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reload_segment_deprecated2_operation.go b/src/cli/reload_segment_deprecated2_operation.go new file mode 100644 index 0000000..923d47a --- /dev/null +++ b/src/cli/reload_segment_deprecated2_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentReloadSegmentDeprecated2Cmd returns a cmd to handle operation reloadSegmentDeprecated2 +func makeOperationSegmentReloadSegmentDeprecated2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "reloadSegmentDeprecated2", + Short: `Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead)`, + RunE: runOperationSegmentReloadSegmentDeprecated2, + } + + if err := registerOperationSegmentReloadSegmentDeprecated2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentReloadSegmentDeprecated2 uses cmd flags to call endpoint api +func runOperationSegmentReloadSegmentDeprecated2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewReloadSegmentDeprecated2Params() + if err, _ := retrieveOperationSegmentReloadSegmentDeprecated2SegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadSegmentDeprecated2TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadSegmentDeprecated2TypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentReloadSegmentDeprecated2Result(appCli.Segment.ReloadSegmentDeprecated2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentReloadSegmentDeprecated2ParamFlags registers all flags needed to fill params +func registerOperationSegmentReloadSegmentDeprecated2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentReloadSegmentDeprecated2SegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadSegmentDeprecated2TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadSegmentDeprecated2TypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentReloadSegmentDeprecated2SegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentReloadSegmentDeprecated2TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentReloadSegmentDeprecated2TypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentReloadSegmentDeprecated2SegmentNameFlag(m *segment.ReloadSegmentDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadSegmentDeprecated2TableNameFlag(m *segment.ReloadSegmentDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadSegmentDeprecated2TypeFlag(m *segment.ReloadSegmentDeprecated2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentReloadSegmentDeprecated2Result parses request result and return the string content +func parseOperationSegmentReloadSegmentDeprecated2Result(resp0 *segment.ReloadSegmentDeprecated2OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ReloadSegmentDeprecated2OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reload_segment_operation.go b/src/cli/reload_segment_operation.go new file mode 100644 index 0000000..046de3e --- /dev/null +++ b/src/cli/reload_segment_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentReloadSegmentCmd returns a cmd to handle operation reloadSegment +func makeOperationSegmentReloadSegmentCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "reloadSegment", + Short: `Reload a segment`, + RunE: runOperationSegmentReloadSegment, + } + + if err := registerOperationSegmentReloadSegmentParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentReloadSegment uses cmd flags to call endpoint api +func runOperationSegmentReloadSegment(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewReloadSegmentParams() + if err, _ := retrieveOperationSegmentReloadSegmentForceDownloadFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadSegmentSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentReloadSegmentTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentReloadSegmentResult(appCli.Segment.ReloadSegment(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentReloadSegmentParamFlags registers all flags needed to fill params +func registerOperationSegmentReloadSegmentParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentReloadSegmentForceDownloadParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadSegmentSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentReloadSegmentTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentReloadSegmentForceDownloadParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceDownloadDescription := `Whether to force server to download segment` + + var forceDownloadFlagName string + if cmdPrefix == "" { + forceDownloadFlagName = "forceDownload" + } else { + forceDownloadFlagName = fmt.Sprintf("%v.forceDownload", cmdPrefix) + } + + var forceDownloadFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceDownloadFlagName, forceDownloadFlagDefault, forceDownloadDescription) + + return nil +} +func registerOperationSegmentReloadSegmentSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentReloadSegmentTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationSegmentReloadSegmentForceDownloadFlag(m *segment.ReloadSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceDownload") { + + var forceDownloadFlagName string + if cmdPrefix == "" { + forceDownloadFlagName = "forceDownload" + } else { + forceDownloadFlagName = fmt.Sprintf("%v.forceDownload", cmdPrefix) + } + + forceDownloadFlagValue, err := cmd.Flags().GetBool(forceDownloadFlagName) + if err != nil { + return err, false + } + m.ForceDownload = &forceDownloadFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadSegmentSegmentNameFlag(m *segment.ReloadSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentReloadSegmentTableNameFlag(m *segment.ReloadSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentReloadSegmentResult parses request result and return the string content +func parseOperationSegmentReloadSegmentResult(resp0 *segment.ReloadSegmentOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ReloadSegmentOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/remove_instance_partitions_operation.go b/src/cli/remove_instance_partitions_operation.go new file mode 100644 index 0000000..a91232f --- /dev/null +++ b/src/cli/remove_instance_partitions_operation.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableRemoveInstancePartitionsCmd returns a cmd to handle operation removeInstancePartitions +func makeOperationTableRemoveInstancePartitionsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "removeInstancePartitions", + Short: ``, + RunE: runOperationTableRemoveInstancePartitions, + } + + if err := registerOperationTableRemoveInstancePartitionsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableRemoveInstancePartitions uses cmd flags to call endpoint api +func runOperationTableRemoveInstancePartitions(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewRemoveInstancePartitionsParams() + if err, _ := retrieveOperationTableRemoveInstancePartitionsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableRemoveInstancePartitionsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableRemoveInstancePartitionsResult(appCli.Table.RemoveInstancePartitions(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableRemoveInstancePartitionsParamFlags registers all flags needed to fill params +func registerOperationTableRemoveInstancePartitionsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableRemoveInstancePartitionsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableRemoveInstancePartitionsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableRemoveInstancePartitionsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableRemoveInstancePartitionsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["OFFLINE","CONSUMING","COMPLETED"]. OFFLINE|CONSUMING|COMPLETED` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["OFFLINE","CONSUMING","COMPLETED"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTableRemoveInstancePartitionsTableNameFlag(m *table.RemoveInstancePartitionsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableRemoveInstancePartitionsTypeFlag(m *table.RemoveInstancePartitionsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableRemoveInstancePartitionsResult parses request result and return the string content +func parseOperationTableRemoveInstancePartitionsResult(resp0 *table.RemoveInstancePartitionsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.RemoveInstancePartitionsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/replace_instance_operation.go b/src/cli/replace_instance_operation.go new file mode 100644 index 0000000..483c977 --- /dev/null +++ b/src/cli/replace_instance_operation.go @@ -0,0 +1,276 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableReplaceInstanceCmd returns a cmd to handle operation replaceInstance +func makeOperationTableReplaceInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "replaceInstance", + Short: ``, + RunE: runOperationTableReplaceInstance, + } + + if err := registerOperationTableReplaceInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableReplaceInstance uses cmd flags to call endpoint api +func runOperationTableReplaceInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewReplaceInstanceParams() + if err, _ := retrieveOperationTableReplaceInstanceNewInstanceIDFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableReplaceInstanceOldInstanceIDFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableReplaceInstanceTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableReplaceInstanceTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableReplaceInstanceResult(appCli.Table.ReplaceInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableReplaceInstanceParamFlags registers all flags needed to fill params +func registerOperationTableReplaceInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableReplaceInstanceNewInstanceIDParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableReplaceInstanceOldInstanceIDParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableReplaceInstanceTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableReplaceInstanceTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableReplaceInstanceNewInstanceIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + newInstanceIdDescription := `Required. New instance to replace with` + + var newInstanceIdFlagName string + if cmdPrefix == "" { + newInstanceIdFlagName = "newInstanceId" + } else { + newInstanceIdFlagName = fmt.Sprintf("%v.newInstanceId", cmdPrefix) + } + + var newInstanceIdFlagDefault string + + _ = cmd.PersistentFlags().String(newInstanceIdFlagName, newInstanceIdFlagDefault, newInstanceIdDescription) + + return nil +} +func registerOperationTableReplaceInstanceOldInstanceIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + oldInstanceIdDescription := `Required. Old instance to be replaced` + + var oldInstanceIdFlagName string + if cmdPrefix == "" { + oldInstanceIdFlagName = "oldInstanceId" + } else { + oldInstanceIdFlagName = fmt.Sprintf("%v.oldInstanceId", cmdPrefix) + } + + var oldInstanceIdFlagDefault string + + _ = cmd.PersistentFlags().String(oldInstanceIdFlagName, oldInstanceIdFlagDefault, oldInstanceIdDescription) + + return nil +} +func registerOperationTableReplaceInstanceTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableReplaceInstanceTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Enum: ["OFFLINE","CONSUMING","COMPLETED"]. OFFLINE|CONSUMING|COMPLETED` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + if err := cmd.RegisterFlagCompletionFunc(typeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["OFFLINE","CONSUMING","COMPLETED"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationTableReplaceInstanceNewInstanceIDFlag(m *table.ReplaceInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("newInstanceId") { + + var newInstanceIdFlagName string + if cmdPrefix == "" { + newInstanceIdFlagName = "newInstanceId" + } else { + newInstanceIdFlagName = fmt.Sprintf("%v.newInstanceId", cmdPrefix) + } + + newInstanceIdFlagValue, err := cmd.Flags().GetString(newInstanceIdFlagName) + if err != nil { + return err, false + } + m.NewInstanceID = newInstanceIdFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableReplaceInstanceOldInstanceIDFlag(m *table.ReplaceInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("oldInstanceId") { + + var oldInstanceIdFlagName string + if cmdPrefix == "" { + oldInstanceIdFlagName = "oldInstanceId" + } else { + oldInstanceIdFlagName = fmt.Sprintf("%v.oldInstanceId", cmdPrefix) + } + + oldInstanceIdFlagValue, err := cmd.Flags().GetString(oldInstanceIdFlagName) + if err != nil { + return err, false + } + m.OldInstanceID = oldInstanceIdFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableReplaceInstanceTableNameFlag(m *table.ReplaceInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableReplaceInstanceTypeFlag(m *table.ReplaceInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationTableReplaceInstanceResult parses request result and return the string content +func parseOperationTableReplaceInstanceResult(resp0 *table.ReplaceInstanceOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.ReplaceInstanceOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/replica_group_strategy_config_model.go b/src/cli/replica_group_strategy_config_model.go new file mode 100644 index 0000000..4a5e4cb --- /dev/null +++ b/src/cli/replica_group_strategy_config_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ReplicaGroupStrategyConfig + +// register flags to command +func registerModelReplicaGroupStrategyConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerReplicaGroupStrategyConfigNumInstancesPerPartition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerReplicaGroupStrategyConfigPartitionColumn(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerReplicaGroupStrategyConfigNumInstancesPerPartition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numInstancesPerPartitionDescription := `Required. ` + + var numInstancesPerPartitionFlagName string + if cmdPrefix == "" { + numInstancesPerPartitionFlagName = "numInstancesPerPartition" + } else { + numInstancesPerPartitionFlagName = fmt.Sprintf("%v.numInstancesPerPartition", cmdPrefix) + } + + var numInstancesPerPartitionFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numInstancesPerPartitionFlagName, numInstancesPerPartitionFlagDefault, numInstancesPerPartitionDescription) + + return nil +} + +func registerReplicaGroupStrategyConfigPartitionColumn(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + partitionColumnDescription := `` + + var partitionColumnFlagName string + if cmdPrefix == "" { + partitionColumnFlagName = "partitionColumn" + } else { + partitionColumnFlagName = fmt.Sprintf("%v.partitionColumn", cmdPrefix) + } + + var partitionColumnFlagDefault string + + _ = cmd.PersistentFlags().String(partitionColumnFlagName, partitionColumnFlagDefault, partitionColumnDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelReplicaGroupStrategyConfigFlags(depth int, m *models.ReplicaGroupStrategyConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, numInstancesPerPartitionAdded := retrieveReplicaGroupStrategyConfigNumInstancesPerPartitionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numInstancesPerPartitionAdded + + err, partitionColumnAdded := retrieveReplicaGroupStrategyConfigPartitionColumnFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionColumnAdded + + return nil, retAdded +} + +func retrieveReplicaGroupStrategyConfigNumInstancesPerPartitionFlags(depth int, m *models.ReplicaGroupStrategyConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numInstancesPerPartitionFlagName := fmt.Sprintf("%v.numInstancesPerPartition", cmdPrefix) + if cmd.Flags().Changed(numInstancesPerPartitionFlagName) { + + var numInstancesPerPartitionFlagName string + if cmdPrefix == "" { + numInstancesPerPartitionFlagName = "numInstancesPerPartition" + } else { + numInstancesPerPartitionFlagName = fmt.Sprintf("%v.numInstancesPerPartition", cmdPrefix) + } + + numInstancesPerPartitionFlagValue, err := cmd.Flags().GetInt32(numInstancesPerPartitionFlagName) + if err != nil { + return err, false + } + m.NumInstancesPerPartition = numInstancesPerPartitionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveReplicaGroupStrategyConfigPartitionColumnFlags(depth int, m *models.ReplicaGroupStrategyConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionColumnFlagName := fmt.Sprintf("%v.partitionColumn", cmdPrefix) + if cmd.Flags().Changed(partitionColumnFlagName) { + + var partitionColumnFlagName string + if cmdPrefix == "" { + partitionColumnFlagName = "partitionColumn" + } else { + partitionColumnFlagName = fmt.Sprintf("%v.partitionColumn", cmdPrefix) + } + + partitionColumnFlagValue, err := cmd.Flags().GetString(partitionColumnFlagName) + if err != nil { + return err, false + } + m.PartitionColumn = partitionColumnFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/reset_segment_operation.go b/src/cli/reset_segment_operation.go new file mode 100644 index 0000000..d50203d --- /dev/null +++ b/src/cli/reset_segment_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentResetSegmentCmd returns a cmd to handle operation resetSegment +func makeOperationSegmentResetSegmentCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "resetSegment", + Short: `Resets a segment by disabling and then enabling it`, + RunE: runOperationSegmentResetSegment, + } + + if err := registerOperationSegmentResetSegmentParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentResetSegment uses cmd flags to call endpoint api +func runOperationSegmentResetSegment(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewResetSegmentParams() + if err, _ := retrieveOperationSegmentResetSegmentSegmentNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentResetSegmentTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentResetSegmentTargetInstanceFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentResetSegmentResult(appCli.Segment.ResetSegment(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentResetSegmentParamFlags registers all flags needed to fill params +func registerOperationSegmentResetSegmentParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentResetSegmentSegmentNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentResetSegmentTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentResetSegmentTargetInstanceParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentResetSegmentSegmentNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentNameDescription := `Required. Name of the segment` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} +func registerOperationSegmentResetSegmentTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Name of the table with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationSegmentResetSegmentTargetInstanceParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + targetInstanceDescription := `Name of the target instance to reset` + + var targetInstanceFlagName string + if cmdPrefix == "" { + targetInstanceFlagName = "targetInstance" + } else { + targetInstanceFlagName = fmt.Sprintf("%v.targetInstance", cmdPrefix) + } + + var targetInstanceFlagDefault string + + _ = cmd.PersistentFlags().String(targetInstanceFlagName, targetInstanceFlagDefault, targetInstanceDescription) + + return nil +} + +func retrieveOperationSegmentResetSegmentSegmentNameFlag(m *segment.ResetSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentName") { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentResetSegmentTableNameWithTypeFlag(m *segment.ResetSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentResetSegmentTargetInstanceFlag(m *segment.ResetSegmentParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("targetInstance") { + + var targetInstanceFlagName string + if cmdPrefix == "" { + targetInstanceFlagName = "targetInstance" + } else { + targetInstanceFlagName = fmt.Sprintf("%v.targetInstance", cmdPrefix) + } + + targetInstanceFlagValue, err := cmd.Flags().GetString(targetInstanceFlagName) + if err != nil { + return err, false + } + m.TargetInstance = &targetInstanceFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentResetSegmentResult parses request result and return the string content +func parseOperationSegmentResetSegmentResult(resp0 *segment.ResetSegmentOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ResetSegmentOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/reset_segments_operation.go b/src/cli/reset_segments_operation.go new file mode 100644 index 0000000..83e296a --- /dev/null +++ b/src/cli/reset_segments_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentResetSegmentsCmd returns a cmd to handle operation resetSegments +func makeOperationSegmentResetSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "resetSegments", + Short: `Resets segments by disabling and then enabling them`, + RunE: runOperationSegmentResetSegments, + } + + if err := registerOperationSegmentResetSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentResetSegments uses cmd flags to call endpoint api +func runOperationSegmentResetSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewResetSegmentsParams() + if err, _ := retrieveOperationSegmentResetSegmentsErrorSegmentsOnlyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentResetSegmentsTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentResetSegmentsTargetInstanceFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentResetSegmentsResult(appCli.Segment.ResetSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentResetSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentResetSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentResetSegmentsErrorSegmentsOnlyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentResetSegmentsTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentResetSegmentsTargetInstanceParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentResetSegmentsErrorSegmentsOnlyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + errorSegmentsOnlyDescription := `Whether to reset only segments with error state` + + var errorSegmentsOnlyFlagName string + if cmdPrefix == "" { + errorSegmentsOnlyFlagName = "errorSegmentsOnly" + } else { + errorSegmentsOnlyFlagName = fmt.Sprintf("%v.errorSegmentsOnly", cmdPrefix) + } + + var errorSegmentsOnlyFlagDefault bool + + _ = cmd.PersistentFlags().Bool(errorSegmentsOnlyFlagName, errorSegmentsOnlyFlagDefault, errorSegmentsOnlyDescription) + + return nil +} +func registerOperationSegmentResetSegmentsTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Name of the table with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} +func registerOperationSegmentResetSegmentsTargetInstanceParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + targetInstanceDescription := `Name of the target instance to reset` + + var targetInstanceFlagName string + if cmdPrefix == "" { + targetInstanceFlagName = "targetInstance" + } else { + targetInstanceFlagName = fmt.Sprintf("%v.targetInstance", cmdPrefix) + } + + var targetInstanceFlagDefault string + + _ = cmd.PersistentFlags().String(targetInstanceFlagName, targetInstanceFlagDefault, targetInstanceDescription) + + return nil +} + +func retrieveOperationSegmentResetSegmentsErrorSegmentsOnlyFlag(m *segment.ResetSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("errorSegmentsOnly") { + + var errorSegmentsOnlyFlagName string + if cmdPrefix == "" { + errorSegmentsOnlyFlagName = "errorSegmentsOnly" + } else { + errorSegmentsOnlyFlagName = fmt.Sprintf("%v.errorSegmentsOnly", cmdPrefix) + } + + errorSegmentsOnlyFlagValue, err := cmd.Flags().GetBool(errorSegmentsOnlyFlagName) + if err != nil { + return err, false + } + m.ErrorSegmentsOnly = &errorSegmentsOnlyFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentResetSegmentsTableNameWithTypeFlag(m *segment.ResetSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentResetSegmentsTargetInstanceFlag(m *segment.ResetSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("targetInstance") { + + var targetInstanceFlagName string + if cmdPrefix == "" { + targetInstanceFlagName = "targetInstance" + } else { + targetInstanceFlagName = fmt.Sprintf("%v.targetInstance", cmdPrefix) + } + + targetInstanceFlagValue, err := cmd.Flags().GetString(targetInstanceFlagName) + if err != nil { + return err, false + } + m.TargetInstance = &targetInstanceFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentResetSegmentsResult parses request result and return the string content +func parseOperationSegmentResetSegmentsResult(resp0 *segment.ResetSegmentsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*segment.ResetSegmentsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/resume_consumption_operation.go b/src/cli/resume_consumption_operation.go new file mode 100644 index 0000000..27a2c17 --- /dev/null +++ b/src/cli/resume_consumption_operation.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableResumeConsumptionCmd returns a cmd to handle operation resumeConsumption +func makeOperationTableResumeConsumptionCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "resumeConsumption", + Short: `Resume the consumption for a realtime table. ConsumeFrom parameter indicates from which offsets consumption should resume. If consumeFrom parameter is not provided, consumption continues based on the offsets in segment ZK metadata, and in case the offsets are already gone, the first available offsets are picked to minimize the data loss.`, + RunE: runOperationTableResumeConsumption, + } + + if err := registerOperationTableResumeConsumptionParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableResumeConsumption uses cmd flags to call endpoint api +func runOperationTableResumeConsumption(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewResumeConsumptionParams() + if err, _ := retrieveOperationTableResumeConsumptionConsumeFromFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableResumeConsumptionTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableResumeConsumptionResult(appCli.Table.ResumeConsumption(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableResumeConsumptionParamFlags registers all flags needed to fill params +func registerOperationTableResumeConsumptionParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableResumeConsumptionConsumeFromParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableResumeConsumptionTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableResumeConsumptionConsumeFromParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + consumeFromDescription := `smallest | largest` + + var consumeFromFlagName string + if cmdPrefix == "" { + consumeFromFlagName = "consumeFrom" + } else { + consumeFromFlagName = fmt.Sprintf("%v.consumeFrom", cmdPrefix) + } + + var consumeFromFlagDefault string + + _ = cmd.PersistentFlags().String(consumeFromFlagName, consumeFromFlagDefault, consumeFromDescription) + + return nil +} +func registerOperationTableResumeConsumptionTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableResumeConsumptionConsumeFromFlag(m *table.ResumeConsumptionParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("consumeFrom") { + + var consumeFromFlagName string + if cmdPrefix == "" { + consumeFromFlagName = "consumeFrom" + } else { + consumeFromFlagName = fmt.Sprintf("%v.consumeFrom", cmdPrefix) + } + + consumeFromFlagValue, err := cmd.Flags().GetString(consumeFromFlagName) + if err != nil { + return err, false + } + m.ConsumeFrom = &consumeFromFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableResumeConsumptionTableNameFlag(m *table.ResumeConsumptionParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableResumeConsumptionResult parses request result and return the string content +func parseOperationTableResumeConsumptionResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning resumeConsumption default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/resume_tasks_operation.go b/src/cli/resume_tasks_operation.go new file mode 100644 index 0000000..449033c --- /dev/null +++ b/src/cli/resume_tasks_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskResumeTasksCmd returns a cmd to handle operation resumeTasks +func makeOperationTaskResumeTasksCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "resumeTasks", + Short: ``, + RunE: runOperationTaskResumeTasks, + } + + if err := registerOperationTaskResumeTasksParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskResumeTasks uses cmd flags to call endpoint api +func runOperationTaskResumeTasks(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewResumeTasksParams() + if err, _ := retrieveOperationTaskResumeTasksTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskResumeTasksResult(appCli.Task.ResumeTasks(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskResumeTasksParamFlags registers all flags needed to fill params +func registerOperationTaskResumeTasksParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskResumeTasksTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskResumeTasksTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskResumeTasksTaskTypeFlag(m *task.ResumeTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskResumeTasksResult parses request result and return the string content +func parseOperationTaskResumeTasksResult(resp0 *task.ResumeTasksOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.ResumeTasksOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/revert_replace_segments_operation.go b/src/cli/revert_replace_segments_operation.go new file mode 100644 index 0000000..76ff199 --- /dev/null +++ b/src/cli/revert_replace_segments_operation.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentRevertReplaceSegmentsCmd returns a cmd to handle operation revertReplaceSegments +func makeOperationSegmentRevertReplaceSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "revertReplaceSegments", + Short: `Revert segments replacement`, + RunE: runOperationSegmentRevertReplaceSegments, + } + + if err := registerOperationSegmentRevertReplaceSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentRevertReplaceSegments uses cmd flags to call endpoint api +func runOperationSegmentRevertReplaceSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewRevertReplaceSegmentsParams() + if err, _ := retrieveOperationSegmentRevertReplaceSegmentsForceRevertFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentRevertReplaceSegmentsSegmentLineageEntryIDFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentRevertReplaceSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentRevertReplaceSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentRevertReplaceSegmentsResult(appCli.Segment.RevertReplaceSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentRevertReplaceSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentRevertReplaceSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentRevertReplaceSegmentsForceRevertParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentRevertReplaceSegmentsSegmentLineageEntryIDParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentRevertReplaceSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentRevertReplaceSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentRevertReplaceSegmentsForceRevertParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceRevertDescription := `Force revert in case the user knows that the lineage entry is interrupted` + + var forceRevertFlagName string + if cmdPrefix == "" { + forceRevertFlagName = "forceRevert" + } else { + forceRevertFlagName = fmt.Sprintf("%v.forceRevert", cmdPrefix) + } + + var forceRevertFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceRevertFlagName, forceRevertFlagDefault, forceRevertDescription) + + return nil +} +func registerOperationSegmentRevertReplaceSegmentsSegmentLineageEntryIDParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + segmentLineageEntryIdDescription := `Required. Segment lineage entry id to revert` + + var segmentLineageEntryIdFlagName string + if cmdPrefix == "" { + segmentLineageEntryIdFlagName = "segmentLineageEntryId" + } else { + segmentLineageEntryIdFlagName = fmt.Sprintf("%v.segmentLineageEntryId", cmdPrefix) + } + + var segmentLineageEntryIdFlagDefault string + + _ = cmd.PersistentFlags().String(segmentLineageEntryIdFlagName, segmentLineageEntryIdFlagDefault, segmentLineageEntryIdDescription) + + return nil +} +func registerOperationSegmentRevertReplaceSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentRevertReplaceSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentRevertReplaceSegmentsForceRevertFlag(m *segment.RevertReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceRevert") { + + var forceRevertFlagName string + if cmdPrefix == "" { + forceRevertFlagName = "forceRevert" + } else { + forceRevertFlagName = fmt.Sprintf("%v.forceRevert", cmdPrefix) + } + + forceRevertFlagValue, err := cmd.Flags().GetBool(forceRevertFlagName) + if err != nil { + return err, false + } + m.ForceRevert = &forceRevertFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentRevertReplaceSegmentsSegmentLineageEntryIDFlag(m *segment.RevertReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("segmentLineageEntryId") { + + var segmentLineageEntryIdFlagName string + if cmdPrefix == "" { + segmentLineageEntryIdFlagName = "segmentLineageEntryId" + } else { + segmentLineageEntryIdFlagName = fmt.Sprintf("%v.segmentLineageEntryId", cmdPrefix) + } + + segmentLineageEntryIdFlagValue, err := cmd.Flags().GetString(segmentLineageEntryIdFlagName) + if err != nil { + return err, false + } + m.SegmentLineageEntryID = segmentLineageEntryIdFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentRevertReplaceSegmentsTableNameFlag(m *segment.RevertReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentRevertReplaceSegmentsTypeFlag(m *segment.RevertReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentRevertReplaceSegmentsResult parses request result and return the string content +func parseOperationSegmentRevertReplaceSegmentsResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning revertReplaceSegments default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/routing_config_model.go b/src/cli/routing_config_model.go new file mode 100644 index 0000000..c582f5d --- /dev/null +++ b/src/cli/routing_config_model.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for RoutingConfig + +// register flags to command +func registerModelRoutingConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerRoutingConfigInstanceSelectorType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerRoutingConfigRoutingTableBuilderName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerRoutingConfigSegmentPrunerTypes(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerRoutingConfigInstanceSelectorType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + instanceSelectorTypeDescription := `` + + var instanceSelectorTypeFlagName string + if cmdPrefix == "" { + instanceSelectorTypeFlagName = "instanceSelectorType" + } else { + instanceSelectorTypeFlagName = fmt.Sprintf("%v.instanceSelectorType", cmdPrefix) + } + + var instanceSelectorTypeFlagDefault string + + _ = cmd.PersistentFlags().String(instanceSelectorTypeFlagName, instanceSelectorTypeFlagDefault, instanceSelectorTypeDescription) + + return nil +} + +func registerRoutingConfigRoutingTableBuilderName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + routingTableBuilderNameDescription := `` + + var routingTableBuilderNameFlagName string + if cmdPrefix == "" { + routingTableBuilderNameFlagName = "routingTableBuilderName" + } else { + routingTableBuilderNameFlagName = fmt.Sprintf("%v.routingTableBuilderName", cmdPrefix) + } + + var routingTableBuilderNameFlagDefault string + + _ = cmd.PersistentFlags().String(routingTableBuilderNameFlagName, routingTableBuilderNameFlagDefault, routingTableBuilderNameDescription) + + return nil +} + +func registerRoutingConfigSegmentPrunerTypes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentPrunerTypes []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelRoutingConfigFlags(depth int, m *models.RoutingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, instanceSelectorTypeAdded := retrieveRoutingConfigInstanceSelectorTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instanceSelectorTypeAdded + + err, routingTableBuilderNameAdded := retrieveRoutingConfigRoutingTableBuilderNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || routingTableBuilderNameAdded + + err, segmentPrunerTypesAdded := retrieveRoutingConfigSegmentPrunerTypesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentPrunerTypesAdded + + return nil, retAdded +} + +func retrieveRoutingConfigInstanceSelectorTypeFlags(depth int, m *models.RoutingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instanceSelectorTypeFlagName := fmt.Sprintf("%v.instanceSelectorType", cmdPrefix) + if cmd.Flags().Changed(instanceSelectorTypeFlagName) { + + var instanceSelectorTypeFlagName string + if cmdPrefix == "" { + instanceSelectorTypeFlagName = "instanceSelectorType" + } else { + instanceSelectorTypeFlagName = fmt.Sprintf("%v.instanceSelectorType", cmdPrefix) + } + + instanceSelectorTypeFlagValue, err := cmd.Flags().GetString(instanceSelectorTypeFlagName) + if err != nil { + return err, false + } + m.InstanceSelectorType = instanceSelectorTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveRoutingConfigRoutingTableBuilderNameFlags(depth int, m *models.RoutingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + routingTableBuilderNameFlagName := fmt.Sprintf("%v.routingTableBuilderName", cmdPrefix) + if cmd.Flags().Changed(routingTableBuilderNameFlagName) { + + var routingTableBuilderNameFlagName string + if cmdPrefix == "" { + routingTableBuilderNameFlagName = "routingTableBuilderName" + } else { + routingTableBuilderNameFlagName = fmt.Sprintf("%v.routingTableBuilderName", cmdPrefix) + } + + routingTableBuilderNameFlagValue, err := cmd.Flags().GetString(routingTableBuilderNameFlagName) + if err != nil { + return err, false + } + m.RoutingTableBuilderName = routingTableBuilderNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveRoutingConfigSegmentPrunerTypesFlags(depth int, m *models.RoutingConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentPrunerTypesFlagName := fmt.Sprintf("%v.segmentPrunerTypes", cmdPrefix) + if cmd.Flags().Changed(segmentPrunerTypesFlagName) { + // warning: segmentPrunerTypes array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/run_periodic_task_operation.go b/src/cli/run_periodic_task_operation.go new file mode 100644 index 0000000..79105a2 --- /dev/null +++ b/src/cli/run_periodic_task_operation.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/periodic_task" + + "github.com/spf13/cobra" +) + +// makeOperationPeriodicTaskRunPeriodicTaskCmd returns a cmd to handle operation runPeriodicTask +func makeOperationPeriodicTaskRunPeriodicTaskCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "runPeriodicTask", + Short: ``, + RunE: runOperationPeriodicTaskRunPeriodicTask, + } + + if err := registerOperationPeriodicTaskRunPeriodicTaskParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationPeriodicTaskRunPeriodicTask uses cmd flags to call endpoint api +func runOperationPeriodicTaskRunPeriodicTask(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := periodic_task.NewRunPeriodicTaskParams() + if err, _ := retrieveOperationPeriodicTaskRunPeriodicTaskTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationPeriodicTaskRunPeriodicTaskTasknameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationPeriodicTaskRunPeriodicTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationPeriodicTaskRunPeriodicTaskResult(appCli.PeriodicTask.RunPeriodicTask(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationPeriodicTaskRunPeriodicTaskParamFlags registers all flags needed to fill params +func registerOperationPeriodicTaskRunPeriodicTaskParamFlags(cmd *cobra.Command) error { + if err := registerOperationPeriodicTaskRunPeriodicTaskTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationPeriodicTaskRunPeriodicTaskTasknameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationPeriodicTaskRunPeriodicTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationPeriodicTaskRunPeriodicTaskTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationPeriodicTaskRunPeriodicTaskTasknameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tasknameDescription := `Required. Periodic task name` + + var tasknameFlagName string + if cmdPrefix == "" { + tasknameFlagName = "taskname" + } else { + tasknameFlagName = fmt.Sprintf("%v.taskname", cmdPrefix) + } + + var tasknameFlagDefault string + + _ = cmd.PersistentFlags().String(tasknameFlagName, tasknameFlagDefault, tasknameDescription) + + return nil +} +func registerOperationPeriodicTaskRunPeriodicTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `OFFLINE | REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationPeriodicTaskRunPeriodicTaskTableNameFlag(m *periodic_task.RunPeriodicTaskParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = &tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationPeriodicTaskRunPeriodicTaskTasknameFlag(m *periodic_task.RunPeriodicTaskParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskname") { + + var tasknameFlagName string + if cmdPrefix == "" { + tasknameFlagName = "taskname" + } else { + tasknameFlagName = fmt.Sprintf("%v.taskname", cmdPrefix) + } + + tasknameFlagValue, err := cmd.Flags().GetString(tasknameFlagName) + if err != nil { + return err, false + } + m.Taskname = tasknameFlagValue + + } + return nil, retAdded +} +func retrieveOperationPeriodicTaskRunPeriodicTaskTypeFlag(m *periodic_task.RunPeriodicTaskParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = &typeFlagValue + + } + return nil, retAdded +} + +// parseOperationPeriodicTaskRunPeriodicTaskResult parses request result and return the string content +func parseOperationPeriodicTaskRunPeriodicTaskResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning runPeriodicTask default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/schedule_tasks_deprecated_operation.go b/src/cli/schedule_tasks_deprecated_operation.go new file mode 100644 index 0000000..adb85cc --- /dev/null +++ b/src/cli/schedule_tasks_deprecated_operation.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskScheduleTasksDeprecatedCmd returns a cmd to handle operation scheduleTasksDeprecated +func makeOperationTaskScheduleTasksDeprecatedCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "scheduleTasksDeprecated", + Short: ``, + RunE: runOperationTaskScheduleTasksDeprecated, + } + + if err := registerOperationTaskScheduleTasksDeprecatedParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskScheduleTasksDeprecated uses cmd flags to call endpoint api +func runOperationTaskScheduleTasksDeprecated(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewScheduleTasksDeprecatedParams() + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskScheduleTasksDeprecatedResult(appCli.Task.ScheduleTasksDeprecated(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskScheduleTasksDeprecatedParamFlags registers all flags needed to fill params +func registerOperationTaskScheduleTasksDeprecatedParamFlags(cmd *cobra.Command) error { + return nil +} + +// parseOperationTaskScheduleTasksDeprecatedResult parses request result and return the string content +func parseOperationTaskScheduleTasksDeprecatedResult(resp0 *task.ScheduleTasksDeprecatedOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.ScheduleTasksDeprecatedOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/schedule_tasks_operation.go b/src/cli/schedule_tasks_operation.go new file mode 100644 index 0000000..3135657 --- /dev/null +++ b/src/cli/schedule_tasks_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskScheduleTasksCmd returns a cmd to handle operation scheduleTasks +func makeOperationTaskScheduleTasksCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "scheduleTasks", + Short: ``, + RunE: runOperationTaskScheduleTasks, + } + + if err := registerOperationTaskScheduleTasksParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskScheduleTasks uses cmd flags to call endpoint api +func runOperationTaskScheduleTasks(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewScheduleTasksParams() + if err, _ := retrieveOperationTaskScheduleTasksTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskScheduleTasksTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskScheduleTasksResult(appCli.Task.ScheduleTasks(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskScheduleTasksParamFlags registers all flags needed to fill params +func registerOperationTaskScheduleTasksParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskScheduleTasksTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskScheduleTasksTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskScheduleTasksTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Table name (with type suffix)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTaskScheduleTasksTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskScheduleTasksTableNameFlag(m *task.ScheduleTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = &tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskScheduleTasksTaskTypeFlag(m *task.ScheduleTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = &taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskScheduleTasksResult parses request result and return the string content +func parseOperationTaskScheduleTasksResult(resp0 *task.ScheduleTasksOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.ScheduleTasksOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/schema_model.go b/src/cli/schema_model.go new file mode 100644 index 0000000..f49ce15 --- /dev/null +++ b/src/cli/schema_model.go @@ -0,0 +1,281 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for Schema + +// register flags to command +func registerModelSchemaFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSchemaDateTimeFieldSpecs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSchemaDimensionFieldSpecs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSchemaMetricFieldSpecs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSchemaPrimaryKeyColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSchemaSchemaName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSchemaTimeFieldSpec(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSchemaDateTimeFieldSpecs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: dateTimeFieldSpecs []*DateTimeFieldSpec array type is not supported by go-swagger cli yet + + return nil +} + +func registerSchemaDimensionFieldSpecs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: dimensionFieldSpecs []*DimensionFieldSpec array type is not supported by go-swagger cli yet + + return nil +} + +func registerSchemaMetricFieldSpecs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: metricFieldSpecs []*MetricFieldSpec array type is not supported by go-swagger cli yet + + return nil +} + +func registerSchemaPrimaryKeyColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: primaryKeyColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerSchemaSchemaName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + schemaNameDescription := `` + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + var schemaNameFlagDefault string + + _ = cmd.PersistentFlags().String(schemaNameFlagName, schemaNameFlagDefault, schemaNameDescription) + + return nil +} + +func registerSchemaTimeFieldSpec(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var timeFieldSpecFlagName string + if cmdPrefix == "" { + timeFieldSpecFlagName = "timeFieldSpec" + } else { + timeFieldSpecFlagName = fmt.Sprintf("%v.timeFieldSpec", cmdPrefix) + } + + if err := registerModelTimeFieldSpecFlags(depth+1, timeFieldSpecFlagName, cmd); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSchemaFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dateTimeFieldSpecsAdded := retrieveSchemaDateTimeFieldSpecsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dateTimeFieldSpecsAdded + + err, dimensionFieldSpecsAdded := retrieveSchemaDimensionFieldSpecsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dimensionFieldSpecsAdded + + err, metricFieldSpecsAdded := retrieveSchemaMetricFieldSpecsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || metricFieldSpecsAdded + + err, primaryKeyColumnsAdded := retrieveSchemaPrimaryKeyColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || primaryKeyColumnsAdded + + err, schemaNameAdded := retrieveSchemaSchemaNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || schemaNameAdded + + err, timeFieldSpecAdded := retrieveSchemaTimeFieldSpecFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeFieldSpecAdded + + return nil, retAdded +} + +func retrieveSchemaDateTimeFieldSpecsFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dateTimeFieldSpecsFlagName := fmt.Sprintf("%v.dateTimeFieldSpecs", cmdPrefix) + if cmd.Flags().Changed(dateTimeFieldSpecsFlagName) { + // warning: dateTimeFieldSpecs array type []*DateTimeFieldSpec is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveSchemaDimensionFieldSpecsFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dimensionFieldSpecsFlagName := fmt.Sprintf("%v.dimensionFieldSpecs", cmdPrefix) + if cmd.Flags().Changed(dimensionFieldSpecsFlagName) { + // warning: dimensionFieldSpecs array type []*DimensionFieldSpec is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveSchemaMetricFieldSpecsFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + metricFieldSpecsFlagName := fmt.Sprintf("%v.metricFieldSpecs", cmdPrefix) + if cmd.Flags().Changed(metricFieldSpecsFlagName) { + // warning: metricFieldSpecs array type []*MetricFieldSpec is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveSchemaPrimaryKeyColumnsFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + primaryKeyColumnsFlagName := fmt.Sprintf("%v.primaryKeyColumns", cmdPrefix) + if cmd.Flags().Changed(primaryKeyColumnsFlagName) { + // warning: primaryKeyColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveSchemaSchemaNameFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + schemaNameFlagName := fmt.Sprintf("%v.schemaName", cmdPrefix) + if cmd.Flags().Changed(schemaNameFlagName) { + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + schemaNameFlagValue, err := cmd.Flags().GetString(schemaNameFlagName) + if err != nil { + return err, false + } + m.SchemaName = schemaNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSchemaTimeFieldSpecFlags(depth int, m *models.Schema, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeFieldSpecFlagName := fmt.Sprintf("%v.timeFieldSpec", cmdPrefix) + if cmd.Flags().Changed(timeFieldSpecFlagName) { + // info: complex object timeFieldSpec TimeFieldSpec is retrieved outside this Changed() block + } + timeFieldSpecFlagValue := m.TimeFieldSpec + if swag.IsZero(timeFieldSpecFlagValue) { + timeFieldSpecFlagValue = &models.TimeFieldSpec{} + } + + err, timeFieldSpecAdded := retrieveModelTimeFieldSpecFlags(depth+1, timeFieldSpecFlagValue, timeFieldSpecFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeFieldSpecAdded + if timeFieldSpecAdded { + m.TimeFieldSpec = timeFieldSpecFlagValue + } + + return nil, retAdded +} diff --git a/src/cli/segment_assignment_config_model.go b/src/cli/segment_assignment_config_model.go new file mode 100644 index 0000000..19b6e8b --- /dev/null +++ b/src/cli/segment_assignment_config_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SegmentAssignmentConfig + +// register flags to command +func registerModelSegmentAssignmentConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentAssignmentConfigAssignmentStrategy(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentAssignmentConfigAssignmentStrategy(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + assignmentStrategyDescription := `` + + var assignmentStrategyFlagName string + if cmdPrefix == "" { + assignmentStrategyFlagName = "assignmentStrategy" + } else { + assignmentStrategyFlagName = fmt.Sprintf("%v.assignmentStrategy", cmdPrefix) + } + + var assignmentStrategyFlagDefault string + + _ = cmd.PersistentFlags().String(assignmentStrategyFlagName, assignmentStrategyFlagDefault, assignmentStrategyDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentAssignmentConfigFlags(depth int, m *models.SegmentAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, assignmentStrategyAdded := retrieveSegmentAssignmentConfigAssignmentStrategyFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || assignmentStrategyAdded + + return nil, retAdded +} + +func retrieveSegmentAssignmentConfigAssignmentStrategyFlags(depth int, m *models.SegmentAssignmentConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + assignmentStrategyFlagName := fmt.Sprintf("%v.assignmentStrategy", cmdPrefix) + if cmd.Flags().Changed(assignmentStrategyFlagName) { + + var assignmentStrategyFlagName string + if cmdPrefix == "" { + assignmentStrategyFlagName = "assignmentStrategy" + } else { + assignmentStrategyFlagName = fmt.Sprintf("%v.assignmentStrategy", cmdPrefix) + } + + assignmentStrategyFlagValue, err := cmd.Flags().GetString(assignmentStrategyFlagName) + if err != nil { + return err, false + } + m.AssignmentStrategy = assignmentStrategyFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/segment_consumer_info_model.go b/src/cli/segment_consumer_info_model.go new file mode 100644 index 0000000..85f04b0 --- /dev/null +++ b/src/cli/segment_consumer_info_model.go @@ -0,0 +1,297 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for SegmentConsumerInfo + +// register flags to command +func registerModelSegmentConsumerInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentConsumerInfoConsumerState(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentConsumerInfoLastConsumedTimestamp(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentConsumerInfoPartitionOffsetInfo(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentConsumerInfoPartitionToOffsetMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentConsumerInfoSegmentName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentConsumerInfoConsumerState(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + consumerStateDescription := `` + + var consumerStateFlagName string + if cmdPrefix == "" { + consumerStateFlagName = "consumerState" + } else { + consumerStateFlagName = fmt.Sprintf("%v.consumerState", cmdPrefix) + } + + var consumerStateFlagDefault string + + _ = cmd.PersistentFlags().String(consumerStateFlagName, consumerStateFlagDefault, consumerStateDescription) + + return nil +} + +func registerSegmentConsumerInfoLastConsumedTimestamp(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + lastConsumedTimestampDescription := `` + + var lastConsumedTimestampFlagName string + if cmdPrefix == "" { + lastConsumedTimestampFlagName = "lastConsumedTimestamp" + } else { + lastConsumedTimestampFlagName = fmt.Sprintf("%v.lastConsumedTimestamp", cmdPrefix) + } + + var lastConsumedTimestampFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(lastConsumedTimestampFlagName, lastConsumedTimestampFlagDefault, lastConsumedTimestampDescription) + + return nil +} + +func registerSegmentConsumerInfoPartitionOffsetInfo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var partitionOffsetInfoFlagName string + if cmdPrefix == "" { + partitionOffsetInfoFlagName = "partitionOffsetInfo" + } else { + partitionOffsetInfoFlagName = fmt.Sprintf("%v.partitionOffsetInfo", cmdPrefix) + } + + if err := registerModelPartitionOffsetInfoFlags(depth+1, partitionOffsetInfoFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentConsumerInfoPartitionToOffsetMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: partitionToOffsetMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerSegmentConsumerInfoSegmentName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentNameDescription := `` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentConsumerInfoFlags(depth int, m *models.SegmentConsumerInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, consumerStateAdded := retrieveSegmentConsumerInfoConsumerStateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || consumerStateAdded + + err, lastConsumedTimestampAdded := retrieveSegmentConsumerInfoLastConsumedTimestampFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || lastConsumedTimestampAdded + + err, partitionOffsetInfoAdded := retrieveSegmentConsumerInfoPartitionOffsetInfoFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionOffsetInfoAdded + + err, partitionToOffsetMapAdded := retrieveSegmentConsumerInfoPartitionToOffsetMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionToOffsetMapAdded + + err, segmentNameAdded := retrieveSegmentConsumerInfoSegmentNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentNameAdded + + return nil, retAdded +} + +func retrieveSegmentConsumerInfoConsumerStateFlags(depth int, m *models.SegmentConsumerInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + consumerStateFlagName := fmt.Sprintf("%v.consumerState", cmdPrefix) + if cmd.Flags().Changed(consumerStateFlagName) { + + var consumerStateFlagName string + if cmdPrefix == "" { + consumerStateFlagName = "consumerState" + } else { + consumerStateFlagName = fmt.Sprintf("%v.consumerState", cmdPrefix) + } + + consumerStateFlagValue, err := cmd.Flags().GetString(consumerStateFlagName) + if err != nil { + return err, false + } + m.ConsumerState = consumerStateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentConsumerInfoLastConsumedTimestampFlags(depth int, m *models.SegmentConsumerInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + lastConsumedTimestampFlagName := fmt.Sprintf("%v.lastConsumedTimestamp", cmdPrefix) + if cmd.Flags().Changed(lastConsumedTimestampFlagName) { + + var lastConsumedTimestampFlagName string + if cmdPrefix == "" { + lastConsumedTimestampFlagName = "lastConsumedTimestamp" + } else { + lastConsumedTimestampFlagName = fmt.Sprintf("%v.lastConsumedTimestamp", cmdPrefix) + } + + lastConsumedTimestampFlagValue, err := cmd.Flags().GetInt64(lastConsumedTimestampFlagName) + if err != nil { + return err, false + } + m.LastConsumedTimestamp = lastConsumedTimestampFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentConsumerInfoPartitionOffsetInfoFlags(depth int, m *models.SegmentConsumerInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionOffsetInfoFlagName := fmt.Sprintf("%v.partitionOffsetInfo", cmdPrefix) + if cmd.Flags().Changed(partitionOffsetInfoFlagName) { + // info: complex object partitionOffsetInfo PartitionOffsetInfo is retrieved outside this Changed() block + } + partitionOffsetInfoFlagValue := m.PartitionOffsetInfo + if swag.IsZero(partitionOffsetInfoFlagValue) { + partitionOffsetInfoFlagValue = &models.PartitionOffsetInfo{} + } + + err, partitionOffsetInfoAdded := retrieveModelPartitionOffsetInfoFlags(depth+1, partitionOffsetInfoFlagValue, partitionOffsetInfoFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionOffsetInfoAdded + if partitionOffsetInfoAdded { + m.PartitionOffsetInfo = partitionOffsetInfoFlagValue + } + + return nil, retAdded +} + +func retrieveSegmentConsumerInfoPartitionToOffsetMapFlags(depth int, m *models.SegmentConsumerInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionToOffsetMapFlagName := fmt.Sprintf("%v.partitionToOffsetMap", cmdPrefix) + if cmd.Flags().Changed(partitionToOffsetMapFlagName) { + // warning: partitionToOffsetMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveSegmentConsumerInfoSegmentNameFlags(depth int, m *models.SegmentConsumerInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentNameFlagName := fmt.Sprintf("%v.segmentName", cmdPrefix) + if cmd.Flags().Changed(segmentNameFlagName) { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/segment_debug_info_model.go b/src/cli/segment_debug_info_model.go new file mode 100644 index 0000000..f0ffa25 --- /dev/null +++ b/src/cli/segment_debug_info_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SegmentDebugInfo + +// register flags to command +func registerModelSegmentDebugInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentDebugInfoSegmentName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentDebugInfoServerState(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentDebugInfoSegmentName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentNameDescription := `` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} + +func registerSegmentDebugInfoServerState(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: serverState map[string]SegmentState map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentDebugInfoFlags(depth int, m *models.SegmentDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, segmentNameAdded := retrieveSegmentDebugInfoSegmentNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentNameAdded + + err, serverStateAdded := retrieveSegmentDebugInfoServerStateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || serverStateAdded + + return nil, retAdded +} + +func retrieveSegmentDebugInfoSegmentNameFlags(depth int, m *models.SegmentDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentNameFlagName := fmt.Sprintf("%v.segmentName", cmdPrefix) + if cmd.Flags().Changed(segmentNameFlagName) { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentDebugInfoServerStateFlags(depth int, m *models.SegmentDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + serverStateFlagName := fmt.Sprintf("%v.serverState", cmdPrefix) + if cmd.Flags().Changed(serverStateFlagName) { + // warning: serverState map type map[string]SegmentState is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/segment_error_info_model.go b/src/cli/segment_error_info_model.go new file mode 100644 index 0000000..da130a0 --- /dev/null +++ b/src/cli/segment_error_info_model.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SegmentErrorInfo + +// register flags to command +func registerModelSegmentErrorInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentErrorInfoErrorMessage(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentErrorInfoStackTrace(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentErrorInfoTimestamp(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentErrorInfoErrorMessage(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + errorMessageDescription := `` + + var errorMessageFlagName string + if cmdPrefix == "" { + errorMessageFlagName = "errorMessage" + } else { + errorMessageFlagName = fmt.Sprintf("%v.errorMessage", cmdPrefix) + } + + var errorMessageFlagDefault string + + _ = cmd.PersistentFlags().String(errorMessageFlagName, errorMessageFlagDefault, errorMessageDescription) + + return nil +} + +func registerSegmentErrorInfoStackTrace(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + stackTraceDescription := `` + + var stackTraceFlagName string + if cmdPrefix == "" { + stackTraceFlagName = "stackTrace" + } else { + stackTraceFlagName = fmt.Sprintf("%v.stackTrace", cmdPrefix) + } + + var stackTraceFlagDefault string + + _ = cmd.PersistentFlags().String(stackTraceFlagName, stackTraceFlagDefault, stackTraceDescription) + + return nil +} + +func registerSegmentErrorInfoTimestamp(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timestampDescription := `` + + var timestampFlagName string + if cmdPrefix == "" { + timestampFlagName = "timestamp" + } else { + timestampFlagName = fmt.Sprintf("%v.timestamp", cmdPrefix) + } + + var timestampFlagDefault string + + _ = cmd.PersistentFlags().String(timestampFlagName, timestampFlagDefault, timestampDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentErrorInfoFlags(depth int, m *models.SegmentErrorInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, errorMessageAdded := retrieveSegmentErrorInfoErrorMessageFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || errorMessageAdded + + err, stackTraceAdded := retrieveSegmentErrorInfoStackTraceFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || stackTraceAdded + + err, timestampAdded := retrieveSegmentErrorInfoTimestampFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timestampAdded + + return nil, retAdded +} + +func retrieveSegmentErrorInfoErrorMessageFlags(depth int, m *models.SegmentErrorInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + errorMessageFlagName := fmt.Sprintf("%v.errorMessage", cmdPrefix) + if cmd.Flags().Changed(errorMessageFlagName) { + + var errorMessageFlagName string + if cmdPrefix == "" { + errorMessageFlagName = "errorMessage" + } else { + errorMessageFlagName = fmt.Sprintf("%v.errorMessage", cmdPrefix) + } + + errorMessageFlagValue, err := cmd.Flags().GetString(errorMessageFlagName) + if err != nil { + return err, false + } + m.ErrorMessage = errorMessageFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentErrorInfoStackTraceFlags(depth int, m *models.SegmentErrorInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + stackTraceFlagName := fmt.Sprintf("%v.stackTrace", cmdPrefix) + if cmd.Flags().Changed(stackTraceFlagName) { + + var stackTraceFlagName string + if cmdPrefix == "" { + stackTraceFlagName = "stackTrace" + } else { + stackTraceFlagName = fmt.Sprintf("%v.stackTrace", cmdPrefix) + } + + stackTraceFlagValue, err := cmd.Flags().GetString(stackTraceFlagName) + if err != nil { + return err, false + } + m.StackTrace = stackTraceFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentErrorInfoTimestampFlags(depth int, m *models.SegmentErrorInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timestampFlagName := fmt.Sprintf("%v.timestamp", cmdPrefix) + if cmd.Flags().Changed(timestampFlagName) { + + var timestampFlagName string + if cmdPrefix == "" { + timestampFlagName = "timestamp" + } else { + timestampFlagName = fmt.Sprintf("%v.timestamp", cmdPrefix) + } + + timestampFlagValue, err := cmd.Flags().GetString(timestampFlagName) + if err != nil { + return err, false + } + m.Timestamp = timestampFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/segment_partition_config_model.go b/src/cli/segment_partition_config_model.go new file mode 100644 index 0000000..05e909f --- /dev/null +++ b/src/cli/segment_partition_config_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SegmentPartitionConfig + +// register flags to command +func registerModelSegmentPartitionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentPartitionConfigColumnPartitionMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentPartitionConfigColumnPartitionMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: columnPartitionMap map[string]ColumnPartitionConfig map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentPartitionConfigFlags(depth int, m *models.SegmentPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, columnPartitionMapAdded := retrieveSegmentPartitionConfigColumnPartitionMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || columnPartitionMapAdded + + return nil, retAdded +} + +func retrieveSegmentPartitionConfigColumnPartitionMapFlags(depth int, m *models.SegmentPartitionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + columnPartitionMapFlagName := fmt.Sprintf("%v.columnPartitionMap", cmdPrefix) + if cmd.Flags().Changed(columnPartitionMapFlagName) { + // warning: columnPartitionMap map type map[string]ColumnPartitionConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/segment_size_details_model.go b/src/cli/segment_size_details_model.go new file mode 100644 index 0000000..5ef0ba1 --- /dev/null +++ b/src/cli/segment_size_details_model.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SegmentSizeDetails + +// register flags to command +func registerModelSegmentSizeDetailsFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentSizeDetailsEstimatedSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentSizeDetailsReportedSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentSizeDetailsServerInfo(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentSizeDetailsEstimatedSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + estimatedSizeInBytesDescription := `` + + var estimatedSizeInBytesFlagName string + if cmdPrefix == "" { + estimatedSizeInBytesFlagName = "estimatedSizeInBytes" + } else { + estimatedSizeInBytesFlagName = fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + } + + var estimatedSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(estimatedSizeInBytesFlagName, estimatedSizeInBytesFlagDefault, estimatedSizeInBytesDescription) + + return nil +} + +func registerSegmentSizeDetailsReportedSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + reportedSizeInBytesDescription := `` + + var reportedSizeInBytesFlagName string + if cmdPrefix == "" { + reportedSizeInBytesFlagName = "reportedSizeInBytes" + } else { + reportedSizeInBytesFlagName = fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + } + + var reportedSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(reportedSizeInBytesFlagName, reportedSizeInBytesFlagDefault, reportedSizeInBytesDescription) + + return nil +} + +func registerSegmentSizeDetailsServerInfo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: serverInfo map[string]SegmentSizeInfo map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentSizeDetailsFlags(depth int, m *models.SegmentSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, estimatedSizeInBytesAdded := retrieveSegmentSizeDetailsEstimatedSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || estimatedSizeInBytesAdded + + err, reportedSizeInBytesAdded := retrieveSegmentSizeDetailsReportedSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || reportedSizeInBytesAdded + + err, serverInfoAdded := retrieveSegmentSizeDetailsServerInfoFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || serverInfoAdded + + return nil, retAdded +} + +func retrieveSegmentSizeDetailsEstimatedSizeInBytesFlags(depth int, m *models.SegmentSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + estimatedSizeInBytesFlagName := fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(estimatedSizeInBytesFlagName) { + + var estimatedSizeInBytesFlagName string + if cmdPrefix == "" { + estimatedSizeInBytesFlagName = "estimatedSizeInBytes" + } else { + estimatedSizeInBytesFlagName = fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + } + + estimatedSizeInBytesFlagValue, err := cmd.Flags().GetInt64(estimatedSizeInBytesFlagName) + if err != nil { + return err, false + } + m.EstimatedSizeInBytes = estimatedSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentSizeDetailsReportedSizeInBytesFlags(depth int, m *models.SegmentSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + reportedSizeInBytesFlagName := fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(reportedSizeInBytesFlagName) { + + var reportedSizeInBytesFlagName string + if cmdPrefix == "" { + reportedSizeInBytesFlagName = "reportedSizeInBytes" + } else { + reportedSizeInBytesFlagName = fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + } + + reportedSizeInBytesFlagValue, err := cmd.Flags().GetInt64(reportedSizeInBytesFlagName) + if err != nil { + return err, false + } + m.ReportedSizeInBytes = reportedSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentSizeDetailsServerInfoFlags(depth int, m *models.SegmentSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + serverInfoFlagName := fmt.Sprintf("%v.serverInfo", cmdPrefix) + if cmd.Flags().Changed(serverInfoFlagName) { + // warning: serverInfo map type map[string]SegmentSizeInfo is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/segment_size_info_model.go b/src/cli/segment_size_info_model.go new file mode 100644 index 0000000..0b30016 --- /dev/null +++ b/src/cli/segment_size_info_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SegmentSizeInfo + +// register flags to command +func registerModelSegmentSizeInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentSizeInfoDiskSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentSizeInfoSegmentName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentSizeInfoDiskSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + diskSizeInBytesDescription := `` + + var diskSizeInBytesFlagName string + if cmdPrefix == "" { + diskSizeInBytesFlagName = "diskSizeInBytes" + } else { + diskSizeInBytesFlagName = fmt.Sprintf("%v.diskSizeInBytes", cmdPrefix) + } + + var diskSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(diskSizeInBytesFlagName, diskSizeInBytesFlagDefault, diskSizeInBytesDescription) + + return nil +} + +func registerSegmentSizeInfoSegmentName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentNameDescription := `` + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + var segmentNameFlagDefault string + + _ = cmd.PersistentFlags().String(segmentNameFlagName, segmentNameFlagDefault, segmentNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentSizeInfoFlags(depth int, m *models.SegmentSizeInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, diskSizeInBytesAdded := retrieveSegmentSizeInfoDiskSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || diskSizeInBytesAdded + + err, segmentNameAdded := retrieveSegmentSizeInfoSegmentNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentNameAdded + + return nil, retAdded +} + +func retrieveSegmentSizeInfoDiskSizeInBytesFlags(depth int, m *models.SegmentSizeInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + diskSizeInBytesFlagName := fmt.Sprintf("%v.diskSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(diskSizeInBytesFlagName) { + + var diskSizeInBytesFlagName string + if cmdPrefix == "" { + diskSizeInBytesFlagName = "diskSizeInBytes" + } else { + diskSizeInBytesFlagName = fmt.Sprintf("%v.diskSizeInBytes", cmdPrefix) + } + + diskSizeInBytesFlagValue, err := cmd.Flags().GetInt64(diskSizeInBytesFlagName) + if err != nil { + return err, false + } + m.DiskSizeInBytes = diskSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentSizeInfoSegmentNameFlags(depth int, m *models.SegmentSizeInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentNameFlagName := fmt.Sprintf("%v.segmentName", cmdPrefix) + if cmd.Flags().Changed(segmentNameFlagName) { + + var segmentNameFlagName string + if cmdPrefix == "" { + segmentNameFlagName = "segmentName" + } else { + segmentNameFlagName = fmt.Sprintf("%v.segmentName", cmdPrefix) + } + + segmentNameFlagValue, err := cmd.Flags().GetString(segmentNameFlagName) + if err != nil { + return err, false + } + m.SegmentName = segmentNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/segment_state_model.go b/src/cli/segment_state_model.go new file mode 100644 index 0000000..6ba8a55 --- /dev/null +++ b/src/cli/segment_state_model.go @@ -0,0 +1,319 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for SegmentState + +// register flags to command +func registerModelSegmentStateFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentStateConsumerInfo(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentStateErrorInfo(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentStateExternalView(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentStateIdealState(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentStateSegmentSize(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentStateConsumerInfo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var consumerInfoFlagName string + if cmdPrefix == "" { + consumerInfoFlagName = "consumerInfo" + } else { + consumerInfoFlagName = fmt.Sprintf("%v.consumerInfo", cmdPrefix) + } + + if err := registerModelSegmentConsumerInfoFlags(depth+1, consumerInfoFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentStateErrorInfo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var errorInfoFlagName string + if cmdPrefix == "" { + errorInfoFlagName = "errorInfo" + } else { + errorInfoFlagName = fmt.Sprintf("%v.errorInfo", cmdPrefix) + } + + if err := registerModelSegmentErrorInfoFlags(depth+1, errorInfoFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentStateExternalView(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + externalViewDescription := `` + + var externalViewFlagName string + if cmdPrefix == "" { + externalViewFlagName = "externalView" + } else { + externalViewFlagName = fmt.Sprintf("%v.externalView", cmdPrefix) + } + + var externalViewFlagDefault string + + _ = cmd.PersistentFlags().String(externalViewFlagName, externalViewFlagDefault, externalViewDescription) + + return nil +} + +func registerSegmentStateIdealState(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + idealStateDescription := `` + + var idealStateFlagName string + if cmdPrefix == "" { + idealStateFlagName = "idealState" + } else { + idealStateFlagName = fmt.Sprintf("%v.idealState", cmdPrefix) + } + + var idealStateFlagDefault string + + _ = cmd.PersistentFlags().String(idealStateFlagName, idealStateFlagDefault, idealStateDescription) + + return nil +} + +func registerSegmentStateSegmentSize(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentSizeDescription := `` + + var segmentSizeFlagName string + if cmdPrefix == "" { + segmentSizeFlagName = "segmentSize" + } else { + segmentSizeFlagName = fmt.Sprintf("%v.segmentSize", cmdPrefix) + } + + var segmentSizeFlagDefault string + + _ = cmd.PersistentFlags().String(segmentSizeFlagName, segmentSizeFlagDefault, segmentSizeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentStateFlags(depth int, m *models.SegmentState, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, consumerInfoAdded := retrieveSegmentStateConsumerInfoFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || consumerInfoAdded + + err, errorInfoAdded := retrieveSegmentStateErrorInfoFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || errorInfoAdded + + err, externalViewAdded := retrieveSegmentStateExternalViewFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || externalViewAdded + + err, idealStateAdded := retrieveSegmentStateIdealStateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || idealStateAdded + + err, segmentSizeAdded := retrieveSegmentStateSegmentSizeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentSizeAdded + + return nil, retAdded +} + +func retrieveSegmentStateConsumerInfoFlags(depth int, m *models.SegmentState, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + consumerInfoFlagName := fmt.Sprintf("%v.consumerInfo", cmdPrefix) + if cmd.Flags().Changed(consumerInfoFlagName) { + // info: complex object consumerInfo SegmentConsumerInfo is retrieved outside this Changed() block + } + consumerInfoFlagValue := m.ConsumerInfo + if swag.IsZero(consumerInfoFlagValue) { + consumerInfoFlagValue = &models.SegmentConsumerInfo{} + } + + err, consumerInfoAdded := retrieveModelSegmentConsumerInfoFlags(depth+1, consumerInfoFlagValue, consumerInfoFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || consumerInfoAdded + if consumerInfoAdded { + m.ConsumerInfo = consumerInfoFlagValue + } + + return nil, retAdded +} + +func retrieveSegmentStateErrorInfoFlags(depth int, m *models.SegmentState, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + errorInfoFlagName := fmt.Sprintf("%v.errorInfo", cmdPrefix) + if cmd.Flags().Changed(errorInfoFlagName) { + // info: complex object errorInfo SegmentErrorInfo is retrieved outside this Changed() block + } + errorInfoFlagValue := m.ErrorInfo + if swag.IsZero(errorInfoFlagValue) { + errorInfoFlagValue = &models.SegmentErrorInfo{} + } + + err, errorInfoAdded := retrieveModelSegmentErrorInfoFlags(depth+1, errorInfoFlagValue, errorInfoFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || errorInfoAdded + if errorInfoAdded { + m.ErrorInfo = errorInfoFlagValue + } + + return nil, retAdded +} + +func retrieveSegmentStateExternalViewFlags(depth int, m *models.SegmentState, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + externalViewFlagName := fmt.Sprintf("%v.externalView", cmdPrefix) + if cmd.Flags().Changed(externalViewFlagName) { + + var externalViewFlagName string + if cmdPrefix == "" { + externalViewFlagName = "externalView" + } else { + externalViewFlagName = fmt.Sprintf("%v.externalView", cmdPrefix) + } + + externalViewFlagValue, err := cmd.Flags().GetString(externalViewFlagName) + if err != nil { + return err, false + } + m.ExternalView = externalViewFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentStateIdealStateFlags(depth int, m *models.SegmentState, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + idealStateFlagName := fmt.Sprintf("%v.idealState", cmdPrefix) + if cmd.Flags().Changed(idealStateFlagName) { + + var idealStateFlagName string + if cmdPrefix == "" { + idealStateFlagName = "idealState" + } else { + idealStateFlagName = fmt.Sprintf("%v.idealState", cmdPrefix) + } + + idealStateFlagValue, err := cmd.Flags().GetString(idealStateFlagName) + if err != nil { + return err, false + } + m.IdealState = idealStateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentStateSegmentSizeFlags(depth int, m *models.SegmentState, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentSizeFlagName := fmt.Sprintf("%v.segmentSize", cmdPrefix) + if cmd.Flags().Changed(segmentSizeFlagName) { + + var segmentSizeFlagName string + if cmdPrefix == "" { + segmentSizeFlagName = "segmentSize" + } else { + segmentSizeFlagName = fmt.Sprintf("%v.segmentSize", cmdPrefix) + } + + segmentSizeFlagValue, err := cmd.Flags().GetString(segmentSizeFlagName) + if err != nil { + return err, false + } + m.SegmentSize = segmentSizeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/segments_validation_and_retention_config_model.go b/src/cli/segments_validation_and_retention_config_model.go new file mode 100644 index 0000000..2fad140 --- /dev/null +++ b/src/cli/segments_validation_and_retention_config_model.go @@ -0,0 +1,980 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for SegmentsValidationAndRetentionConfig + +// register flags to command +func registerModelSegmentsValidationAndRetentionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSegmentsValidationAndRetentionConfigCompletionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigCrypterClassName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigDeletedSegmentsRetentionPeriod(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigMinimizeDataMovement(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigPeerSegmentDownloadScheme(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigReplicaGroupStrategyConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigReplicasPerPartition(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigReplication(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigRetentionTimeUnit(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigRetentionTimeValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigSchemaName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigSegmentAssignmentStrategy(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigSegmentPushFrequency(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigSegmentPushType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigTimeColumnName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSegmentsValidationAndRetentionConfigTimeType(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentsValidationAndRetentionConfigCompletionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var completionConfigFlagName string + if cmdPrefix == "" { + completionConfigFlagName = "completionConfig" + } else { + completionConfigFlagName = fmt.Sprintf("%v.completionConfig", cmdPrefix) + } + + if err := registerModelCompletionConfigFlags(depth+1, completionConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentsValidationAndRetentionConfigCrypterClassName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + crypterClassNameDescription := `` + + var crypterClassNameFlagName string + if cmdPrefix == "" { + crypterClassNameFlagName = "crypterClassName" + } else { + crypterClassNameFlagName = fmt.Sprintf("%v.crypterClassName", cmdPrefix) + } + + var crypterClassNameFlagDefault string + + _ = cmd.PersistentFlags().String(crypterClassNameFlagName, crypterClassNameFlagDefault, crypterClassNameDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigDeletedSegmentsRetentionPeriod(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + deletedSegmentsRetentionPeriodDescription := `` + + var deletedSegmentsRetentionPeriodFlagName string + if cmdPrefix == "" { + deletedSegmentsRetentionPeriodFlagName = "deletedSegmentsRetentionPeriod" + } else { + deletedSegmentsRetentionPeriodFlagName = fmt.Sprintf("%v.deletedSegmentsRetentionPeriod", cmdPrefix) + } + + var deletedSegmentsRetentionPeriodFlagDefault string + + _ = cmd.PersistentFlags().String(deletedSegmentsRetentionPeriodFlagName, deletedSegmentsRetentionPeriodFlagDefault, deletedSegmentsRetentionPeriodDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigMinimizeDataMovement(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + minimizeDataMovementDescription := `` + + var minimizeDataMovementFlagName string + if cmdPrefix == "" { + minimizeDataMovementFlagName = "minimizeDataMovement" + } else { + minimizeDataMovementFlagName = fmt.Sprintf("%v.minimizeDataMovement", cmdPrefix) + } + + var minimizeDataMovementFlagDefault bool + + _ = cmd.PersistentFlags().Bool(minimizeDataMovementFlagName, minimizeDataMovementFlagDefault, minimizeDataMovementDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigPeerSegmentDownloadScheme(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + peerSegmentDownloadSchemeDescription := `` + + var peerSegmentDownloadSchemeFlagName string + if cmdPrefix == "" { + peerSegmentDownloadSchemeFlagName = "peerSegmentDownloadScheme" + } else { + peerSegmentDownloadSchemeFlagName = fmt.Sprintf("%v.peerSegmentDownloadScheme", cmdPrefix) + } + + var peerSegmentDownloadSchemeFlagDefault string + + _ = cmd.PersistentFlags().String(peerSegmentDownloadSchemeFlagName, peerSegmentDownloadSchemeFlagDefault, peerSegmentDownloadSchemeDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigReplicaGroupStrategyConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var replicaGroupStrategyConfigFlagName string + if cmdPrefix == "" { + replicaGroupStrategyConfigFlagName = "replicaGroupStrategyConfig" + } else { + replicaGroupStrategyConfigFlagName = fmt.Sprintf("%v.replicaGroupStrategyConfig", cmdPrefix) + } + + if err := registerModelReplicaGroupStrategyConfigFlags(depth+1, replicaGroupStrategyConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerSegmentsValidationAndRetentionConfigReplicasPerPartition(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + replicasPerPartitionDescription := `` + + var replicasPerPartitionFlagName string + if cmdPrefix == "" { + replicasPerPartitionFlagName = "replicasPerPartition" + } else { + replicasPerPartitionFlagName = fmt.Sprintf("%v.replicasPerPartition", cmdPrefix) + } + + var replicasPerPartitionFlagDefault string + + _ = cmd.PersistentFlags().String(replicasPerPartitionFlagName, replicasPerPartitionFlagDefault, replicasPerPartitionDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigReplication(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + replicationDescription := `` + + var replicationFlagName string + if cmdPrefix == "" { + replicationFlagName = "replication" + } else { + replicationFlagName = fmt.Sprintf("%v.replication", cmdPrefix) + } + + var replicationFlagDefault string + + _ = cmd.PersistentFlags().String(replicationFlagName, replicationFlagDefault, replicationDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigRetentionTimeUnit(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + retentionTimeUnitDescription := `` + + var retentionTimeUnitFlagName string + if cmdPrefix == "" { + retentionTimeUnitFlagName = "retentionTimeUnit" + } else { + retentionTimeUnitFlagName = fmt.Sprintf("%v.retentionTimeUnit", cmdPrefix) + } + + var retentionTimeUnitFlagDefault string + + _ = cmd.PersistentFlags().String(retentionTimeUnitFlagName, retentionTimeUnitFlagDefault, retentionTimeUnitDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigRetentionTimeValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + retentionTimeValueDescription := `` + + var retentionTimeValueFlagName string + if cmdPrefix == "" { + retentionTimeValueFlagName = "retentionTimeValue" + } else { + retentionTimeValueFlagName = fmt.Sprintf("%v.retentionTimeValue", cmdPrefix) + } + + var retentionTimeValueFlagDefault string + + _ = cmd.PersistentFlags().String(retentionTimeValueFlagName, retentionTimeValueFlagDefault, retentionTimeValueDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigSchemaName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + schemaNameDescription := `` + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + var schemaNameFlagDefault string + + _ = cmd.PersistentFlags().String(schemaNameFlagName, schemaNameFlagDefault, schemaNameDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigSegmentAssignmentStrategy(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentAssignmentStrategyDescription := `` + + var segmentAssignmentStrategyFlagName string + if cmdPrefix == "" { + segmentAssignmentStrategyFlagName = "segmentAssignmentStrategy" + } else { + segmentAssignmentStrategyFlagName = fmt.Sprintf("%v.segmentAssignmentStrategy", cmdPrefix) + } + + var segmentAssignmentStrategyFlagDefault string + + _ = cmd.PersistentFlags().String(segmentAssignmentStrategyFlagName, segmentAssignmentStrategyFlagDefault, segmentAssignmentStrategyDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigSegmentPushFrequency(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentPushFrequencyDescription := `` + + var segmentPushFrequencyFlagName string + if cmdPrefix == "" { + segmentPushFrequencyFlagName = "segmentPushFrequency" + } else { + segmentPushFrequencyFlagName = fmt.Sprintf("%v.segmentPushFrequency", cmdPrefix) + } + + var segmentPushFrequencyFlagDefault string + + _ = cmd.PersistentFlags().String(segmentPushFrequencyFlagName, segmentPushFrequencyFlagDefault, segmentPushFrequencyDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigSegmentPushType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentPushTypeDescription := `` + + var segmentPushTypeFlagName string + if cmdPrefix == "" { + segmentPushTypeFlagName = "segmentPushType" + } else { + segmentPushTypeFlagName = fmt.Sprintf("%v.segmentPushType", cmdPrefix) + } + + var segmentPushTypeFlagDefault string + + _ = cmd.PersistentFlags().String(segmentPushTypeFlagName, segmentPushTypeFlagDefault, segmentPushTypeDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigTimeColumnName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeColumnNameDescription := `` + + var timeColumnNameFlagName string + if cmdPrefix == "" { + timeColumnNameFlagName = "timeColumnName" + } else { + timeColumnNameFlagName = fmt.Sprintf("%v.timeColumnName", cmdPrefix) + } + + var timeColumnNameFlagDefault string + + _ = cmd.PersistentFlags().String(timeColumnNameFlagName, timeColumnNameFlagDefault, timeColumnNameDescription) + + return nil +} + +func registerSegmentsValidationAndRetentionConfigTimeType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeTypeDescription := `Enum: ["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]. ` + + var timeTypeFlagName string + if cmdPrefix == "" { + timeTypeFlagName = "timeType" + } else { + timeTypeFlagName = fmt.Sprintf("%v.timeType", cmdPrefix) + } + + var timeTypeFlagDefault string + + _ = cmd.PersistentFlags().String(timeTypeFlagName, timeTypeFlagDefault, timeTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(timeTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSegmentsValidationAndRetentionConfigFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, completionConfigAdded := retrieveSegmentsValidationAndRetentionConfigCompletionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || completionConfigAdded + + err, crypterClassNameAdded := retrieveSegmentsValidationAndRetentionConfigCrypterClassNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || crypterClassNameAdded + + err, deletedSegmentsRetentionPeriodAdded := retrieveSegmentsValidationAndRetentionConfigDeletedSegmentsRetentionPeriodFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || deletedSegmentsRetentionPeriodAdded + + err, minimizeDataMovementAdded := retrieveSegmentsValidationAndRetentionConfigMinimizeDataMovementFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || minimizeDataMovementAdded + + err, peerSegmentDownloadSchemeAdded := retrieveSegmentsValidationAndRetentionConfigPeerSegmentDownloadSchemeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || peerSegmentDownloadSchemeAdded + + err, replicaGroupStrategyConfigAdded := retrieveSegmentsValidationAndRetentionConfigReplicaGroupStrategyConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicaGroupStrategyConfigAdded + + err, replicasPerPartitionAdded := retrieveSegmentsValidationAndRetentionConfigReplicasPerPartitionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicasPerPartitionAdded + + err, replicationAdded := retrieveSegmentsValidationAndRetentionConfigReplicationFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicationAdded + + err, retentionTimeUnitAdded := retrieveSegmentsValidationAndRetentionConfigRetentionTimeUnitFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || retentionTimeUnitAdded + + err, retentionTimeValueAdded := retrieveSegmentsValidationAndRetentionConfigRetentionTimeValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || retentionTimeValueAdded + + err, schemaNameAdded := retrieveSegmentsValidationAndRetentionConfigSchemaNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || schemaNameAdded + + err, segmentAssignmentStrategyAdded := retrieveSegmentsValidationAndRetentionConfigSegmentAssignmentStrategyFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentAssignmentStrategyAdded + + err, segmentPushFrequencyAdded := retrieveSegmentsValidationAndRetentionConfigSegmentPushFrequencyFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentPushFrequencyAdded + + err, segmentPushTypeAdded := retrieveSegmentsValidationAndRetentionConfigSegmentPushTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentPushTypeAdded + + err, timeColumnNameAdded := retrieveSegmentsValidationAndRetentionConfigTimeColumnNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeColumnNameAdded + + err, timeTypeAdded := retrieveSegmentsValidationAndRetentionConfigTimeTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeTypeAdded + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigCompletionConfigFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + completionConfigFlagName := fmt.Sprintf("%v.completionConfig", cmdPrefix) + if cmd.Flags().Changed(completionConfigFlagName) { + // info: complex object completionConfig CompletionConfig is retrieved outside this Changed() block + } + completionConfigFlagValue := m.CompletionConfig + if swag.IsZero(completionConfigFlagValue) { + completionConfigFlagValue = &models.CompletionConfig{} + } + + err, completionConfigAdded := retrieveModelCompletionConfigFlags(depth+1, completionConfigFlagValue, completionConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || completionConfigAdded + if completionConfigAdded { + m.CompletionConfig = completionConfigFlagValue + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigCrypterClassNameFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + crypterClassNameFlagName := fmt.Sprintf("%v.crypterClassName", cmdPrefix) + if cmd.Flags().Changed(crypterClassNameFlagName) { + + var crypterClassNameFlagName string + if cmdPrefix == "" { + crypterClassNameFlagName = "crypterClassName" + } else { + crypterClassNameFlagName = fmt.Sprintf("%v.crypterClassName", cmdPrefix) + } + + crypterClassNameFlagValue, err := cmd.Flags().GetString(crypterClassNameFlagName) + if err != nil { + return err, false + } + m.CrypterClassName = crypterClassNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigDeletedSegmentsRetentionPeriodFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + deletedSegmentsRetentionPeriodFlagName := fmt.Sprintf("%v.deletedSegmentsRetentionPeriod", cmdPrefix) + if cmd.Flags().Changed(deletedSegmentsRetentionPeriodFlagName) { + + var deletedSegmentsRetentionPeriodFlagName string + if cmdPrefix == "" { + deletedSegmentsRetentionPeriodFlagName = "deletedSegmentsRetentionPeriod" + } else { + deletedSegmentsRetentionPeriodFlagName = fmt.Sprintf("%v.deletedSegmentsRetentionPeriod", cmdPrefix) + } + + deletedSegmentsRetentionPeriodFlagValue, err := cmd.Flags().GetString(deletedSegmentsRetentionPeriodFlagName) + if err != nil { + return err, false + } + m.DeletedSegmentsRetentionPeriod = deletedSegmentsRetentionPeriodFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigMinimizeDataMovementFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + minimizeDataMovementFlagName := fmt.Sprintf("%v.minimizeDataMovement", cmdPrefix) + if cmd.Flags().Changed(minimizeDataMovementFlagName) { + + var minimizeDataMovementFlagName string + if cmdPrefix == "" { + minimizeDataMovementFlagName = "minimizeDataMovement" + } else { + minimizeDataMovementFlagName = fmt.Sprintf("%v.minimizeDataMovement", cmdPrefix) + } + + minimizeDataMovementFlagValue, err := cmd.Flags().GetBool(minimizeDataMovementFlagName) + if err != nil { + return err, false + } + m.MinimizeDataMovement = minimizeDataMovementFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigPeerSegmentDownloadSchemeFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + peerSegmentDownloadSchemeFlagName := fmt.Sprintf("%v.peerSegmentDownloadScheme", cmdPrefix) + if cmd.Flags().Changed(peerSegmentDownloadSchemeFlagName) { + + var peerSegmentDownloadSchemeFlagName string + if cmdPrefix == "" { + peerSegmentDownloadSchemeFlagName = "peerSegmentDownloadScheme" + } else { + peerSegmentDownloadSchemeFlagName = fmt.Sprintf("%v.peerSegmentDownloadScheme", cmdPrefix) + } + + peerSegmentDownloadSchemeFlagValue, err := cmd.Flags().GetString(peerSegmentDownloadSchemeFlagName) + if err != nil { + return err, false + } + m.PeerSegmentDownloadScheme = peerSegmentDownloadSchemeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigReplicaGroupStrategyConfigFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + replicaGroupStrategyConfigFlagName := fmt.Sprintf("%v.replicaGroupStrategyConfig", cmdPrefix) + if cmd.Flags().Changed(replicaGroupStrategyConfigFlagName) { + // info: complex object replicaGroupStrategyConfig ReplicaGroupStrategyConfig is retrieved outside this Changed() block + } + replicaGroupStrategyConfigFlagValue := m.ReplicaGroupStrategyConfig + if swag.IsZero(replicaGroupStrategyConfigFlagValue) { + replicaGroupStrategyConfigFlagValue = &models.ReplicaGroupStrategyConfig{} + } + + err, replicaGroupStrategyConfigAdded := retrieveModelReplicaGroupStrategyConfigFlags(depth+1, replicaGroupStrategyConfigFlagValue, replicaGroupStrategyConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || replicaGroupStrategyConfigAdded + if replicaGroupStrategyConfigAdded { + m.ReplicaGroupStrategyConfig = replicaGroupStrategyConfigFlagValue + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigReplicasPerPartitionFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + replicasPerPartitionFlagName := fmt.Sprintf("%v.replicasPerPartition", cmdPrefix) + if cmd.Flags().Changed(replicasPerPartitionFlagName) { + + var replicasPerPartitionFlagName string + if cmdPrefix == "" { + replicasPerPartitionFlagName = "replicasPerPartition" + } else { + replicasPerPartitionFlagName = fmt.Sprintf("%v.replicasPerPartition", cmdPrefix) + } + + replicasPerPartitionFlagValue, err := cmd.Flags().GetString(replicasPerPartitionFlagName) + if err != nil { + return err, false + } + m.ReplicasPerPartition = replicasPerPartitionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigReplicationFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + replicationFlagName := fmt.Sprintf("%v.replication", cmdPrefix) + if cmd.Flags().Changed(replicationFlagName) { + + var replicationFlagName string + if cmdPrefix == "" { + replicationFlagName = "replication" + } else { + replicationFlagName = fmt.Sprintf("%v.replication", cmdPrefix) + } + + replicationFlagValue, err := cmd.Flags().GetString(replicationFlagName) + if err != nil { + return err, false + } + m.Replication = replicationFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigRetentionTimeUnitFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + retentionTimeUnitFlagName := fmt.Sprintf("%v.retentionTimeUnit", cmdPrefix) + if cmd.Flags().Changed(retentionTimeUnitFlagName) { + + var retentionTimeUnitFlagName string + if cmdPrefix == "" { + retentionTimeUnitFlagName = "retentionTimeUnit" + } else { + retentionTimeUnitFlagName = fmt.Sprintf("%v.retentionTimeUnit", cmdPrefix) + } + + retentionTimeUnitFlagValue, err := cmd.Flags().GetString(retentionTimeUnitFlagName) + if err != nil { + return err, false + } + m.RetentionTimeUnit = retentionTimeUnitFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigRetentionTimeValueFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + retentionTimeValueFlagName := fmt.Sprintf("%v.retentionTimeValue", cmdPrefix) + if cmd.Flags().Changed(retentionTimeValueFlagName) { + + var retentionTimeValueFlagName string + if cmdPrefix == "" { + retentionTimeValueFlagName = "retentionTimeValue" + } else { + retentionTimeValueFlagName = fmt.Sprintf("%v.retentionTimeValue", cmdPrefix) + } + + retentionTimeValueFlagValue, err := cmd.Flags().GetString(retentionTimeValueFlagName) + if err != nil { + return err, false + } + m.RetentionTimeValue = retentionTimeValueFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigSchemaNameFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + schemaNameFlagName := fmt.Sprintf("%v.schemaName", cmdPrefix) + if cmd.Flags().Changed(schemaNameFlagName) { + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + schemaNameFlagValue, err := cmd.Flags().GetString(schemaNameFlagName) + if err != nil { + return err, false + } + m.SchemaName = schemaNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigSegmentAssignmentStrategyFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentAssignmentStrategyFlagName := fmt.Sprintf("%v.segmentAssignmentStrategy", cmdPrefix) + if cmd.Flags().Changed(segmentAssignmentStrategyFlagName) { + + var segmentAssignmentStrategyFlagName string + if cmdPrefix == "" { + segmentAssignmentStrategyFlagName = "segmentAssignmentStrategy" + } else { + segmentAssignmentStrategyFlagName = fmt.Sprintf("%v.segmentAssignmentStrategy", cmdPrefix) + } + + segmentAssignmentStrategyFlagValue, err := cmd.Flags().GetString(segmentAssignmentStrategyFlagName) + if err != nil { + return err, false + } + m.SegmentAssignmentStrategy = segmentAssignmentStrategyFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigSegmentPushFrequencyFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentPushFrequencyFlagName := fmt.Sprintf("%v.segmentPushFrequency", cmdPrefix) + if cmd.Flags().Changed(segmentPushFrequencyFlagName) { + + var segmentPushFrequencyFlagName string + if cmdPrefix == "" { + segmentPushFrequencyFlagName = "segmentPushFrequency" + } else { + segmentPushFrequencyFlagName = fmt.Sprintf("%v.segmentPushFrequency", cmdPrefix) + } + + segmentPushFrequencyFlagValue, err := cmd.Flags().GetString(segmentPushFrequencyFlagName) + if err != nil { + return err, false + } + m.SegmentPushFrequency = segmentPushFrequencyFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigSegmentPushTypeFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentPushTypeFlagName := fmt.Sprintf("%v.segmentPushType", cmdPrefix) + if cmd.Flags().Changed(segmentPushTypeFlagName) { + + var segmentPushTypeFlagName string + if cmdPrefix == "" { + segmentPushTypeFlagName = "segmentPushType" + } else { + segmentPushTypeFlagName = fmt.Sprintf("%v.segmentPushType", cmdPrefix) + } + + segmentPushTypeFlagValue, err := cmd.Flags().GetString(segmentPushTypeFlagName) + if err != nil { + return err, false + } + m.SegmentPushType = segmentPushTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigTimeColumnNameFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeColumnNameFlagName := fmt.Sprintf("%v.timeColumnName", cmdPrefix) + if cmd.Flags().Changed(timeColumnNameFlagName) { + + var timeColumnNameFlagName string + if cmdPrefix == "" { + timeColumnNameFlagName = "timeColumnName" + } else { + timeColumnNameFlagName = fmt.Sprintf("%v.timeColumnName", cmdPrefix) + } + + timeColumnNameFlagValue, err := cmd.Flags().GetString(timeColumnNameFlagName) + if err != nil { + return err, false + } + m.TimeColumnName = timeColumnNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSegmentsValidationAndRetentionConfigTimeTypeFlags(depth int, m *models.SegmentsValidationAndRetentionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeTypeFlagName := fmt.Sprintf("%v.timeType", cmdPrefix) + if cmd.Flags().Changed(timeTypeFlagName) { + + var timeTypeFlagName string + if cmdPrefix == "" { + timeTypeFlagName = "timeType" + } else { + timeTypeFlagName = fmt.Sprintf("%v.timeType", cmdPrefix) + } + + timeTypeFlagValue, err := cmd.Flags().GetString(timeTypeFlagName) + if err != nil { + return err, false + } + m.TimeType = timeTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/server_reload_controller_job_status_response_model.go b/src/cli/server_reload_controller_job_status_response_model.go new file mode 100644 index 0000000..e3b0748 --- /dev/null +++ b/src/cli/server_reload_controller_job_status_response_model.go @@ -0,0 +1,416 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for ServerReloadControllerJobStatusResponse + +// register flags to command +func registerModelServerReloadControllerJobStatusResponseFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerServerReloadControllerJobStatusResponseEstimatedTimeRemainingInMinutes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerServerReloadControllerJobStatusResponseMetadata(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerServerReloadControllerJobStatusResponseSuccessCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerServerReloadControllerJobStatusResponseTimeElapsedInMinutes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerServerReloadControllerJobStatusResponseTotalSegmentCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerServerReloadControllerJobStatusResponseTotalServerCallsFailed(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerServerReloadControllerJobStatusResponseTotalServersQueried(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerServerReloadControllerJobStatusResponseEstimatedTimeRemainingInMinutes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + estimatedTimeRemainingInMinutesDescription := `` + + var estimatedTimeRemainingInMinutesFlagName string + if cmdPrefix == "" { + estimatedTimeRemainingInMinutesFlagName = "estimatedTimeRemainingInMinutes" + } else { + estimatedTimeRemainingInMinutesFlagName = fmt.Sprintf("%v.estimatedTimeRemainingInMinutes", cmdPrefix) + } + + var estimatedTimeRemainingInMinutesFlagDefault float64 + + _ = cmd.PersistentFlags().Float64(estimatedTimeRemainingInMinutesFlagName, estimatedTimeRemainingInMinutesFlagDefault, estimatedTimeRemainingInMinutesDescription) + + return nil +} + +func registerServerReloadControllerJobStatusResponseMetadata(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: metadata map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerServerReloadControllerJobStatusResponseSuccessCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + successCountDescription := `` + + var successCountFlagName string + if cmdPrefix == "" { + successCountFlagName = "successCount" + } else { + successCountFlagName = fmt.Sprintf("%v.successCount", cmdPrefix) + } + + var successCountFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(successCountFlagName, successCountFlagDefault, successCountDescription) + + return nil +} + +func registerServerReloadControllerJobStatusResponseTimeElapsedInMinutes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeElapsedInMinutesDescription := `` + + var timeElapsedInMinutesFlagName string + if cmdPrefix == "" { + timeElapsedInMinutesFlagName = "timeElapsedInMinutes" + } else { + timeElapsedInMinutesFlagName = fmt.Sprintf("%v.timeElapsedInMinutes", cmdPrefix) + } + + var timeElapsedInMinutesFlagDefault float64 + + _ = cmd.PersistentFlags().Float64(timeElapsedInMinutesFlagName, timeElapsedInMinutesFlagDefault, timeElapsedInMinutesDescription) + + return nil +} + +func registerServerReloadControllerJobStatusResponseTotalSegmentCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + totalSegmentCountDescription := `` + + var totalSegmentCountFlagName string + if cmdPrefix == "" { + totalSegmentCountFlagName = "totalSegmentCount" + } else { + totalSegmentCountFlagName = fmt.Sprintf("%v.totalSegmentCount", cmdPrefix) + } + + var totalSegmentCountFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(totalSegmentCountFlagName, totalSegmentCountFlagDefault, totalSegmentCountDescription) + + return nil +} + +func registerServerReloadControllerJobStatusResponseTotalServerCallsFailed(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + totalServerCallsFailedDescription := `` + + var totalServerCallsFailedFlagName string + if cmdPrefix == "" { + totalServerCallsFailedFlagName = "totalServerCallsFailed" + } else { + totalServerCallsFailedFlagName = fmt.Sprintf("%v.totalServerCallsFailed", cmdPrefix) + } + + var totalServerCallsFailedFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(totalServerCallsFailedFlagName, totalServerCallsFailedFlagDefault, totalServerCallsFailedDescription) + + return nil +} + +func registerServerReloadControllerJobStatusResponseTotalServersQueried(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + totalServersQueriedDescription := `` + + var totalServersQueriedFlagName string + if cmdPrefix == "" { + totalServersQueriedFlagName = "totalServersQueried" + } else { + totalServersQueriedFlagName = fmt.Sprintf("%v.totalServersQueried", cmdPrefix) + } + + var totalServersQueriedFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(totalServersQueriedFlagName, totalServersQueriedFlagDefault, totalServersQueriedDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelServerReloadControllerJobStatusResponseFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, estimatedTimeRemainingInMinutesAdded := retrieveServerReloadControllerJobStatusResponseEstimatedTimeRemainingInMinutesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || estimatedTimeRemainingInMinutesAdded + + err, metadataAdded := retrieveServerReloadControllerJobStatusResponseMetadataFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || metadataAdded + + err, successCountAdded := retrieveServerReloadControllerJobStatusResponseSuccessCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || successCountAdded + + err, timeElapsedInMinutesAdded := retrieveServerReloadControllerJobStatusResponseTimeElapsedInMinutesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeElapsedInMinutesAdded + + err, totalSegmentCountAdded := retrieveServerReloadControllerJobStatusResponseTotalSegmentCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || totalSegmentCountAdded + + err, totalServerCallsFailedAdded := retrieveServerReloadControllerJobStatusResponseTotalServerCallsFailedFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || totalServerCallsFailedAdded + + err, totalServersQueriedAdded := retrieveServerReloadControllerJobStatusResponseTotalServersQueriedFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || totalServersQueriedAdded + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseEstimatedTimeRemainingInMinutesFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + estimatedTimeRemainingInMinutesFlagName := fmt.Sprintf("%v.estimatedTimeRemainingInMinutes", cmdPrefix) + if cmd.Flags().Changed(estimatedTimeRemainingInMinutesFlagName) { + + var estimatedTimeRemainingInMinutesFlagName string + if cmdPrefix == "" { + estimatedTimeRemainingInMinutesFlagName = "estimatedTimeRemainingInMinutes" + } else { + estimatedTimeRemainingInMinutesFlagName = fmt.Sprintf("%v.estimatedTimeRemainingInMinutes", cmdPrefix) + } + + estimatedTimeRemainingInMinutesFlagValue, err := cmd.Flags().GetFloat64(estimatedTimeRemainingInMinutesFlagName) + if err != nil { + return err, false + } + m.EstimatedTimeRemainingInMinutes = estimatedTimeRemainingInMinutesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseMetadataFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + metadataFlagName := fmt.Sprintf("%v.metadata", cmdPrefix) + if cmd.Flags().Changed(metadataFlagName) { + // warning: metadata map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseSuccessCountFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + successCountFlagName := fmt.Sprintf("%v.successCount", cmdPrefix) + if cmd.Flags().Changed(successCountFlagName) { + + var successCountFlagName string + if cmdPrefix == "" { + successCountFlagName = "successCount" + } else { + successCountFlagName = fmt.Sprintf("%v.successCount", cmdPrefix) + } + + successCountFlagValue, err := cmd.Flags().GetInt32(successCountFlagName) + if err != nil { + return err, false + } + m.SuccessCount = successCountFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseTimeElapsedInMinutesFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeElapsedInMinutesFlagName := fmt.Sprintf("%v.timeElapsedInMinutes", cmdPrefix) + if cmd.Flags().Changed(timeElapsedInMinutesFlagName) { + + var timeElapsedInMinutesFlagName string + if cmdPrefix == "" { + timeElapsedInMinutesFlagName = "timeElapsedInMinutes" + } else { + timeElapsedInMinutesFlagName = fmt.Sprintf("%v.timeElapsedInMinutes", cmdPrefix) + } + + timeElapsedInMinutesFlagValue, err := cmd.Flags().GetFloat64(timeElapsedInMinutesFlagName) + if err != nil { + return err, false + } + m.TimeElapsedInMinutes = timeElapsedInMinutesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseTotalSegmentCountFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + totalSegmentCountFlagName := fmt.Sprintf("%v.totalSegmentCount", cmdPrefix) + if cmd.Flags().Changed(totalSegmentCountFlagName) { + + var totalSegmentCountFlagName string + if cmdPrefix == "" { + totalSegmentCountFlagName = "totalSegmentCount" + } else { + totalSegmentCountFlagName = fmt.Sprintf("%v.totalSegmentCount", cmdPrefix) + } + + totalSegmentCountFlagValue, err := cmd.Flags().GetInt32(totalSegmentCountFlagName) + if err != nil { + return err, false + } + m.TotalSegmentCount = totalSegmentCountFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseTotalServerCallsFailedFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + totalServerCallsFailedFlagName := fmt.Sprintf("%v.totalServerCallsFailed", cmdPrefix) + if cmd.Flags().Changed(totalServerCallsFailedFlagName) { + + var totalServerCallsFailedFlagName string + if cmdPrefix == "" { + totalServerCallsFailedFlagName = "totalServerCallsFailed" + } else { + totalServerCallsFailedFlagName = fmt.Sprintf("%v.totalServerCallsFailed", cmdPrefix) + } + + totalServerCallsFailedFlagValue, err := cmd.Flags().GetInt32(totalServerCallsFailedFlagName) + if err != nil { + return err, false + } + m.TotalServerCallsFailed = totalServerCallsFailedFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveServerReloadControllerJobStatusResponseTotalServersQueriedFlags(depth int, m *models.ServerReloadControllerJobStatusResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + totalServersQueriedFlagName := fmt.Sprintf("%v.totalServersQueried", cmdPrefix) + if cmd.Flags().Changed(totalServersQueriedFlagName) { + + var totalServersQueriedFlagName string + if cmdPrefix == "" { + totalServersQueriedFlagName = "totalServersQueried" + } else { + totalServersQueriedFlagName = fmt.Sprintf("%v.totalServersQueried", cmdPrefix) + } + + totalServersQueriedFlagValue, err := cmd.Flags().GetInt32(totalServersQueriedFlagName) + if err != nil { + return err, false + } + m.TotalServersQueried = totalServersQueriedFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/set_instance_partitions_operation.go b/src/cli/set_instance_partitions_operation.go new file mode 100644 index 0000000..8ada28b --- /dev/null +++ b/src/cli/set_instance_partitions_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableSetInstancePartitionsCmd returns a cmd to handle operation setInstancePartitions +func makeOperationTableSetInstancePartitionsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "setInstancePartitions", + Short: ``, + RunE: runOperationTableSetInstancePartitions, + } + + if err := registerOperationTableSetInstancePartitionsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableSetInstancePartitions uses cmd flags to call endpoint api +func runOperationTableSetInstancePartitions(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewSetInstancePartitionsParams() + if err, _ := retrieveOperationTableSetInstancePartitionsBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableSetInstancePartitionsTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableSetInstancePartitionsResult(appCli.Table.SetInstancePartitions(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableSetInstancePartitionsParamFlags registers all flags needed to fill params +func registerOperationTableSetInstancePartitionsParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableSetInstancePartitionsBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableSetInstancePartitionsTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableSetInstancePartitionsBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableSetInstancePartitionsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableSetInstancePartitionsBodyFlag(m *table.SetInstancePartitionsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableSetInstancePartitionsTableNameFlag(m *table.SetInstancePartitionsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableSetInstancePartitionsResult parses request result and return the string content +func parseOperationTableSetInstancePartitionsResult(resp0 *table.SetInstancePartitionsOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.SetInstancePartitionsOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/set_logger_level_operation.go b/src/cli/set_logger_level_operation.go new file mode 100644 index 0000000..389615b --- /dev/null +++ b/src/cli/set_logger_level_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/logger" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationLoggerSetLoggerLevelCmd returns a cmd to handle operation setLoggerLevel +func makeOperationLoggerSetLoggerLevelCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "setLoggerLevel", + Short: `Set logger level for a given logger`, + RunE: runOperationLoggerSetLoggerLevel, + } + + if err := registerOperationLoggerSetLoggerLevelParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationLoggerSetLoggerLevel uses cmd flags to call endpoint api +func runOperationLoggerSetLoggerLevel(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := logger.NewSetLoggerLevelParams() + if err, _ := retrieveOperationLoggerSetLoggerLevelLevelFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationLoggerSetLoggerLevelLoggerNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationLoggerSetLoggerLevelResult(appCli.Logger.SetLoggerLevel(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationLoggerSetLoggerLevelParamFlags registers all flags needed to fill params +func registerOperationLoggerSetLoggerLevelParamFlags(cmd *cobra.Command) error { + if err := registerOperationLoggerSetLoggerLevelLevelParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationLoggerSetLoggerLevelLoggerNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationLoggerSetLoggerLevelLevelParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + levelDescription := `Logger level` + + var levelFlagName string + if cmdPrefix == "" { + levelFlagName = "level" + } else { + levelFlagName = fmt.Sprintf("%v.level", cmdPrefix) + } + + var levelFlagDefault string + + _ = cmd.PersistentFlags().String(levelFlagName, levelFlagDefault, levelDescription) + + return nil +} +func registerOperationLoggerSetLoggerLevelLoggerNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + loggerNameDescription := `Required. Logger name` + + var loggerNameFlagName string + if cmdPrefix == "" { + loggerNameFlagName = "loggerName" + } else { + loggerNameFlagName = fmt.Sprintf("%v.loggerName", cmdPrefix) + } + + var loggerNameFlagDefault string + + _ = cmd.PersistentFlags().String(loggerNameFlagName, loggerNameFlagDefault, loggerNameDescription) + + return nil +} + +func retrieveOperationLoggerSetLoggerLevelLevelFlag(m *logger.SetLoggerLevelParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("level") { + + var levelFlagName string + if cmdPrefix == "" { + levelFlagName = "level" + } else { + levelFlagName = fmt.Sprintf("%v.level", cmdPrefix) + } + + levelFlagValue, err := cmd.Flags().GetString(levelFlagName) + if err != nil { + return err, false + } + m.Level = &levelFlagValue + + } + return nil, retAdded +} +func retrieveOperationLoggerSetLoggerLevelLoggerNameFlag(m *logger.SetLoggerLevelParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("loggerName") { + + var loggerNameFlagName string + if cmdPrefix == "" { + loggerNameFlagName = "loggerName" + } else { + loggerNameFlagName = fmt.Sprintf("%v.loggerName", cmdPrefix) + } + + loggerNameFlagValue, err := cmd.Flags().GetString(loggerNameFlagName) + if err != nil { + return err, false + } + m.LoggerName = loggerNameFlagValue + + } + return nil, retAdded +} + +// parseOperationLoggerSetLoggerLevelResult parses request result and return the string content +func parseOperationLoggerSetLoggerLevelResult(resp0 *logger.SetLoggerLevelOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*logger.SetLoggerLevelOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/set_time_boundary_operation.go b/src/cli/set_time_boundary_operation.go new file mode 100644 index 0000000..755a0bf --- /dev/null +++ b/src/cli/set_time_boundary_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableSetTimeBoundaryCmd returns a cmd to handle operation setTimeBoundary +func makeOperationTableSetTimeBoundaryCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "setTimeBoundary", + Short: `Set hybrid table query time boundary based on offline segments' metadata`, + RunE: runOperationTableSetTimeBoundary, + } + + if err := registerOperationTableSetTimeBoundaryParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableSetTimeBoundary uses cmd flags to call endpoint api +func runOperationTableSetTimeBoundary(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewSetTimeBoundaryParams() + if err, _ := retrieveOperationTableSetTimeBoundaryTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableSetTimeBoundaryResult(appCli.Table.SetTimeBoundary(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableSetTimeBoundaryParamFlags registers all flags needed to fill params +func registerOperationTableSetTimeBoundaryParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableSetTimeBoundaryTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableSetTimeBoundaryTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the hybrid table (without type suffix)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableSetTimeBoundaryTableNameFlag(m *table.SetTimeBoundaryParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableSetTimeBoundaryResult parses request result and return the string content +func parseOperationTableSetTimeBoundaryResult(resp0 *table.SetTimeBoundaryOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.SetTimeBoundaryOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/star_tree_index_config_model.go b/src/cli/star_tree_index_config_model.go new file mode 100644 index 0000000..02c1fff --- /dev/null +++ b/src/cli/star_tree_index_config_model.go @@ -0,0 +1,189 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for StarTreeIndexConfig + +// register flags to command +func registerModelStarTreeIndexConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerStarTreeIndexConfigDimensionsSplitOrder(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerStarTreeIndexConfigFunctionColumnPairs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerStarTreeIndexConfigMaxLeafRecords(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerStarTreeIndexConfigSkipStarNodeCreationForDimensions(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerStarTreeIndexConfigDimensionsSplitOrder(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: dimensionsSplitOrder []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerStarTreeIndexConfigFunctionColumnPairs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: functionColumnPairs []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerStarTreeIndexConfigMaxLeafRecords(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxLeafRecordsDescription := `` + + var maxLeafRecordsFlagName string + if cmdPrefix == "" { + maxLeafRecordsFlagName = "maxLeafRecords" + } else { + maxLeafRecordsFlagName = fmt.Sprintf("%v.maxLeafRecords", cmdPrefix) + } + + var maxLeafRecordsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxLeafRecordsFlagName, maxLeafRecordsFlagDefault, maxLeafRecordsDescription) + + return nil +} + +func registerStarTreeIndexConfigSkipStarNodeCreationForDimensions(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: skipStarNodeCreationForDimensions []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelStarTreeIndexConfigFlags(depth int, m *models.StarTreeIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dimensionsSplitOrderAdded := retrieveStarTreeIndexConfigDimensionsSplitOrderFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dimensionsSplitOrderAdded + + err, functionColumnPairsAdded := retrieveStarTreeIndexConfigFunctionColumnPairsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || functionColumnPairsAdded + + err, maxLeafRecordsAdded := retrieveStarTreeIndexConfigMaxLeafRecordsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxLeafRecordsAdded + + err, skipStarNodeCreationForDimensionsAdded := retrieveStarTreeIndexConfigSkipStarNodeCreationForDimensionsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || skipStarNodeCreationForDimensionsAdded + + return nil, retAdded +} + +func retrieveStarTreeIndexConfigDimensionsSplitOrderFlags(depth int, m *models.StarTreeIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dimensionsSplitOrderFlagName := fmt.Sprintf("%v.dimensionsSplitOrder", cmdPrefix) + if cmd.Flags().Changed(dimensionsSplitOrderFlagName) { + // warning: dimensionsSplitOrder array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveStarTreeIndexConfigFunctionColumnPairsFlags(depth int, m *models.StarTreeIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + functionColumnPairsFlagName := fmt.Sprintf("%v.functionColumnPairs", cmdPrefix) + if cmd.Flags().Changed(functionColumnPairsFlagName) { + // warning: functionColumnPairs array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveStarTreeIndexConfigMaxLeafRecordsFlags(depth int, m *models.StarTreeIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxLeafRecordsFlagName := fmt.Sprintf("%v.maxLeafRecords", cmdPrefix) + if cmd.Flags().Changed(maxLeafRecordsFlagName) { + + var maxLeafRecordsFlagName string + if cmdPrefix == "" { + maxLeafRecordsFlagName = "maxLeafRecords" + } else { + maxLeafRecordsFlagName = fmt.Sprintf("%v.maxLeafRecords", cmdPrefix) + } + + maxLeafRecordsFlagValue, err := cmd.Flags().GetInt32(maxLeafRecordsFlagName) + if err != nil { + return err, false + } + m.MaxLeafRecords = maxLeafRecordsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveStarTreeIndexConfigSkipStarNodeCreationForDimensionsFlags(depth int, m *models.StarTreeIndexConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + skipStarNodeCreationForDimensionsFlagName := fmt.Sprintf("%v.skipStarNodeCreationForDimensions", cmdPrefix) + if cmd.Flags().Changed(skipStarNodeCreationForDimensionsFlagName) { + // warning: skipStarNodeCreationForDimensions array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/start_data_ingest_request_operation.go b/src/cli/start_data_ingest_request_operation.go new file mode 100644 index 0000000..df5be0d --- /dev/null +++ b/src/cli/start_data_ingest_request_operation.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/atomic_ingestion" + + "github.com/spf13/cobra" +) + +// makeOperationAtomicIngestionStartDataIngestRequestCmd returns a cmd to handle operation startDataIngestRequest +func makeOperationAtomicIngestionStartDataIngestRequestCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "startDataIngestRequest", + Short: ``, + RunE: runOperationAtomicIngestionStartDataIngestRequest, + } + + if err := registerOperationAtomicIngestionStartDataIngestRequestParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationAtomicIngestionStartDataIngestRequest uses cmd flags to call endpoint api +func runOperationAtomicIngestionStartDataIngestRequest(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := atomic_ingestion.NewStartDataIngestRequestParams() + if err, _ := retrieveOperationAtomicIngestionStartDataIngestRequestBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAtomicIngestionStartDataIngestRequestTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAtomicIngestionStartDataIngestRequestTableTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAtomicIngestionStartDataIngestRequestTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationAtomicIngestionStartDataIngestRequestResult(appCli.AtomicIngestion.StartDataIngestRequest(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationAtomicIngestionStartDataIngestRequestParamFlags registers all flags needed to fill params +func registerOperationAtomicIngestionStartDataIngestRequestParamFlags(cmd *cobra.Command) error { + if err := registerOperationAtomicIngestionStartDataIngestRequestBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAtomicIngestionStartDataIngestRequestTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAtomicIngestionStartDataIngestRequestTableTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAtomicIngestionStartDataIngestRequestTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationAtomicIngestionStartDataIngestRequestBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationAtomicIngestionStartDataIngestRequestTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationAtomicIngestionStartDataIngestRequestTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `Required. OFFLINE|REALTIME` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} +func registerOperationAtomicIngestionStartDataIngestRequestTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationAtomicIngestionStartDataIngestRequestBodyFlag(m *atomic_ingestion.StartDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationAtomicIngestionStartDataIngestRequestTableNameFlag(m *atomic_ingestion.StartDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationAtomicIngestionStartDataIngestRequestTableTypeFlag(m *atomic_ingestion.StartDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = tableTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationAtomicIngestionStartDataIngestRequestTaskTypeFlag(m *atomic_ingestion.StartDataIngestRequestParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationAtomicIngestionStartDataIngestRequestResult parses request result and return the string content +func parseOperationAtomicIngestionStartDataIngestRequestResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning startDataIngestRequest default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/start_replace_segments_operation.go b/src/cli/start_replace_segments_operation.go new file mode 100644 index 0000000..eaf5d78 --- /dev/null +++ b/src/cli/start_replace_segments_operation.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentStartReplaceSegmentsCmd returns a cmd to handle operation startReplaceSegments +func makeOperationSegmentStartReplaceSegmentsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "startReplaceSegments", + Short: `Start to replace segments`, + RunE: runOperationSegmentStartReplaceSegments, + } + + if err := registerOperationSegmentStartReplaceSegmentsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentStartReplaceSegments uses cmd flags to call endpoint api +func runOperationSegmentStartReplaceSegments(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewStartReplaceSegmentsParams() + if err, _ := retrieveOperationSegmentStartReplaceSegmentsBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentStartReplaceSegmentsForceCleanupFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentStartReplaceSegmentsTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentStartReplaceSegmentsTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentStartReplaceSegmentsResult(appCli.Segment.StartReplaceSegments(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentStartReplaceSegmentsParamFlags registers all flags needed to fill params +func registerOperationSegmentStartReplaceSegmentsParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentStartReplaceSegmentsBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentStartReplaceSegmentsForceCleanupParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentStartReplaceSegmentsTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentStartReplaceSegmentsTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentStartReplaceSegmentsBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. Fields belonging to start replace segment request") + + // add flags for body + if err := registerModelStartReplaceSegmentsRequestFlags(0, "startReplaceSegmentsRequest", cmd); err != nil { + return err + } + + return nil +} +func registerOperationSegmentStartReplaceSegmentsForceCleanupParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + forceCleanupDescription := `Force cleanup` + + var forceCleanupFlagName string + if cmdPrefix == "" { + forceCleanupFlagName = "forceCleanup" + } else { + forceCleanupFlagName = fmt.Sprintf("%v.forceCleanup", cmdPrefix) + } + + var forceCleanupFlagDefault bool + + _ = cmd.PersistentFlags().Bool(forceCleanupFlagName, forceCleanupFlagDefault, forceCleanupDescription) + + return nil +} +func registerOperationSegmentStartReplaceSegmentsTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentStartReplaceSegmentsTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + typeDescription := `Required. OFFLINE|REALTIME` + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + var typeFlagDefault string + + _ = cmd.PersistentFlags().String(typeFlagName, typeFlagDefault, typeDescription) + + return nil +} + +func retrieveOperationSegmentStartReplaceSegmentsBodyFlag(m *segment.StartReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.StartReplaceSegmentsRequest{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.StartReplaceSegmentsRequest: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.StartReplaceSegmentsRequest{} + } + err, added := retrieveModelStartReplaceSegmentsRequestFlags(0, bodyValueModel, "startReplaceSegmentsRequest", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationSegmentStartReplaceSegmentsForceCleanupFlag(m *segment.StartReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("forceCleanup") { + + var forceCleanupFlagName string + if cmdPrefix == "" { + forceCleanupFlagName = "forceCleanup" + } else { + forceCleanupFlagName = fmt.Sprintf("%v.forceCleanup", cmdPrefix) + } + + forceCleanupFlagValue, err := cmd.Flags().GetBool(forceCleanupFlagName) + if err != nil { + return err, false + } + m.ForceCleanup = &forceCleanupFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentStartReplaceSegmentsTableNameFlag(m *segment.StartReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentStartReplaceSegmentsTypeFlag(m *segment.StartReplaceSegmentsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("type") { + + var typeFlagName string + if cmdPrefix == "" { + typeFlagName = "type" + } else { + typeFlagName = fmt.Sprintf("%v.type", cmdPrefix) + } + + typeFlagValue, err := cmd.Flags().GetString(typeFlagName) + if err != nil { + return err, false + } + m.Type = typeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentStartReplaceSegmentsResult parses request result and return the string content +func parseOperationSegmentStartReplaceSegmentsResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning startReplaceSegments default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/start_replace_segments_request_model.go b/src/cli/start_replace_segments_request_model.go new file mode 100644 index 0000000..f85b1ec --- /dev/null +++ b/src/cli/start_replace_segments_request_model.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for StartReplaceSegmentsRequest + +// register flags to command +func registerModelStartReplaceSegmentsRequestFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerStartReplaceSegmentsRequestSegmentsFrom(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerStartReplaceSegmentsRequestSegmentsTo(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerStartReplaceSegmentsRequestSegmentsFrom(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentsFrom []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerStartReplaceSegmentsRequestSegmentsTo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentsTo []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelStartReplaceSegmentsRequestFlags(depth int, m *models.StartReplaceSegmentsRequest, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, segmentsFromAdded := retrieveStartReplaceSegmentsRequestSegmentsFromFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentsFromAdded + + err, segmentsToAdded := retrieveStartReplaceSegmentsRequestSegmentsToFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentsToAdded + + return nil, retAdded +} + +func retrieveStartReplaceSegmentsRequestSegmentsFromFlags(depth int, m *models.StartReplaceSegmentsRequest, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentsFromFlagName := fmt.Sprintf("%v.segmentsFrom", cmdPrefix) + if cmd.Flags().Changed(segmentsFromFlagName) { + // warning: segmentsFrom array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveStartReplaceSegmentsRequestSegmentsToFlags(depth int, m *models.StartReplaceSegmentsRequest, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentsToFlagName := fmt.Sprintf("%v.segmentsTo", cmdPrefix) + if cmd.Flags().Changed(segmentsToFlagName) { + // warning: segmentsTo array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/stat_operation.go b/src/cli/stat_operation.go new file mode 100644 index 0000000..579faa5 --- /dev/null +++ b/src/cli/stat_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/zookeeper" + + "github.com/spf13/cobra" +) + +// makeOperationZookeeperStatCmd returns a cmd to handle operation stat +func makeOperationZookeeperStatCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "stat", + Short: ` Use this api to fetch additional details of a znode such as creation time, modified time, numChildren etc `, + RunE: runOperationZookeeperStat, + } + + if err := registerOperationZookeeperStatParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationZookeeperStat uses cmd flags to call endpoint api +func runOperationZookeeperStat(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := zookeeper.NewStatParams() + if err, _ := retrieveOperationZookeeperStatPathFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationZookeeperStatResult(appCli.Zookeeper.Stat(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationZookeeperStatParamFlags registers all flags needed to fill params +func registerOperationZookeeperStatParamFlags(cmd *cobra.Command) error { + if err := registerOperationZookeeperStatPathParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationZookeeperStatPathParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + pathDescription := `Required. Zookeeper Path, must start with /` + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + var pathFlagDefault string + + _ = cmd.PersistentFlags().String(pathFlagName, pathFlagDefault, pathDescription) + + return nil +} + +func retrieveOperationZookeeperStatPathFlag(m *zookeeper.StatParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("path") { + + var pathFlagName string + if cmdPrefix == "" { + pathFlagName = "path" + } else { + pathFlagName = fmt.Sprintf("%v.path", cmdPrefix) + } + + pathFlagValue, err := cmd.Flags().GetString(pathFlagName) + if err != nil { + return err, false + } + m.Path = pathFlagValue + + } + return nil, retAdded +} + +// parseOperationZookeeperStatResult parses request result and return the string content +func parseOperationZookeeperStatResult(resp0 *zookeeper.StatOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning statOK is not supported + + // Non schema case: warning statNotFound is not supported + + // Non schema case: warning statInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response statOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/stop_tasks_operation.go b/src/cli/stop_tasks_operation.go new file mode 100644 index 0000000..739f80c --- /dev/null +++ b/src/cli/stop_tasks_operation.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskStopTasksCmd returns a cmd to handle operation stopTasks +func makeOperationTaskStopTasksCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "stopTasks", + Short: ``, + RunE: runOperationTaskStopTasks, + } + + if err := registerOperationTaskStopTasksParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskStopTasks uses cmd flags to call endpoint api +func runOperationTaskStopTasks(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewStopTasksParams() + if err, _ := retrieveOperationTaskStopTasksTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskStopTasksResult(appCli.Task.StopTasks(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskStopTasksParamFlags registers all flags needed to fill params +func registerOperationTaskStopTasksParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskStopTasksTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskStopTasksTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskStopTasksTaskTypeFlag(m *task.StopTasksParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskStopTasksResult parses request result and return the string content +func parseOperationTaskStopTasksResult(resp0 *task.StopTasksOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.StopTasksOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/stream_ingestion_config_model.go b/src/cli/stream_ingestion_config_model.go new file mode 100644 index 0000000..200b4b4 --- /dev/null +++ b/src/cli/stream_ingestion_config_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for StreamIngestionConfig + +// register flags to command +func registerModelStreamIngestionConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerStreamIngestionConfigStreamConfigMaps(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerStreamIngestionConfigStreamConfigMaps(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: streamConfigMaps []map[string]string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelStreamIngestionConfigFlags(depth int, m *models.StreamIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, streamConfigMapsAdded := retrieveStreamIngestionConfigStreamConfigMapsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || streamConfigMapsAdded + + return nil, retAdded +} + +func retrieveStreamIngestionConfigStreamConfigMapsFlags(depth int, m *models.StreamIngestionConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + streamConfigMapsFlagName := fmt.Sprintf("%v.streamConfigMaps", cmdPrefix) + if cmd.Flags().Changed(streamConfigMapsFlagName) { + // warning: streamConfigMaps array type []map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/string_result_response_model.go b/src/cli/string_result_response_model.go new file mode 100644 index 0000000..4e7471a --- /dev/null +++ b/src/cli/string_result_response_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for StringResultResponse + +// register flags to command +func registerModelStringResultResponseFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerStringResultResponseResult(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerStringResultResponseResult(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + resultDescription := `` + + var resultFlagName string + if cmdPrefix == "" { + resultFlagName = "result" + } else { + resultFlagName = fmt.Sprintf("%v.result", cmdPrefix) + } + + var resultFlagDefault string + + _ = cmd.PersistentFlags().String(resultFlagName, resultFlagDefault, resultDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelStringResultResponseFlags(depth int, m *models.StringResultResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, resultAdded := retrieveStringResultResponseResultFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || resultAdded + + return nil, retAdded +} + +func retrieveStringResultResponseResultFlags(depth int, m *models.StringResultResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + resultFlagName := fmt.Sprintf("%v.result", cmdPrefix) + if cmd.Flags().Changed(resultFlagName) { + + var resultFlagName string + if cmdPrefix == "" { + resultFlagName = "result" + } else { + resultFlagName = fmt.Sprintf("%v.result", cmdPrefix) + } + + resultFlagValue, err := cmd.Flags().GetString(resultFlagName) + if err != nil { + return err, false + } + m.Result = resultFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/subtask_debug_info_model.go b/src/cli/subtask_debug_info_model.go new file mode 100644 index 0000000..b263c66 --- /dev/null +++ b/src/cli/subtask_debug_info_model.go @@ -0,0 +1,452 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for SubtaskDebugInfo + +// register flags to command +func registerModelSubtaskDebugInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSubtaskDebugInfoFinishTime(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSubtaskDebugInfoInfo(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSubtaskDebugInfoParticipant(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSubtaskDebugInfoStartTime(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSubtaskDebugInfoState(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSubtaskDebugInfoTaskConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerSubtaskDebugInfoTaskID(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSubtaskDebugInfoFinishTime(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + finishTimeDescription := `` + + var finishTimeFlagName string + if cmdPrefix == "" { + finishTimeFlagName = "finishTime" + } else { + finishTimeFlagName = fmt.Sprintf("%v.finishTime", cmdPrefix) + } + + var finishTimeFlagDefault string + + _ = cmd.PersistentFlags().String(finishTimeFlagName, finishTimeFlagDefault, finishTimeDescription) + + return nil +} + +func registerSubtaskDebugInfoInfo(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + infoDescription := `` + + var infoFlagName string + if cmdPrefix == "" { + infoFlagName = "info" + } else { + infoFlagName = fmt.Sprintf("%v.info", cmdPrefix) + } + + var infoFlagDefault string + + _ = cmd.PersistentFlags().String(infoFlagName, infoFlagDefault, infoDescription) + + return nil +} + +func registerSubtaskDebugInfoParticipant(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + participantDescription := `` + + var participantFlagName string + if cmdPrefix == "" { + participantFlagName = "participant" + } else { + participantFlagName = fmt.Sprintf("%v.participant", cmdPrefix) + } + + var participantFlagDefault string + + _ = cmd.PersistentFlags().String(participantFlagName, participantFlagDefault, participantDescription) + + return nil +} + +func registerSubtaskDebugInfoStartTime(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + startTimeDescription := `` + + var startTimeFlagName string + if cmdPrefix == "" { + startTimeFlagName = "startTime" + } else { + startTimeFlagName = fmt.Sprintf("%v.startTime", cmdPrefix) + } + + var startTimeFlagDefault string + + _ = cmd.PersistentFlags().String(startTimeFlagName, startTimeFlagDefault, startTimeDescription) + + return nil +} + +func registerSubtaskDebugInfoState(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + stateDescription := `Enum: ["INIT","RUNNING","STOPPED","COMPLETED","TIMED_OUT","TASK_ERROR","TASK_ABORTED","ERROR","DROPPED"]. ` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + if err := cmd.RegisterFlagCompletionFunc(stateFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INIT","RUNNING","STOPPED","COMPLETED","TIMED_OUT","TASK_ERROR","TASK_ABORTED","ERROR","DROPPED"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerSubtaskDebugInfoTaskConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var taskConfigFlagName string + if cmdPrefix == "" { + taskConfigFlagName = "taskConfig" + } else { + taskConfigFlagName = fmt.Sprintf("%v.taskConfig", cmdPrefix) + } + + if err := registerModelPinotTaskConfigFlags(depth+1, taskConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerSubtaskDebugInfoTaskID(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + taskIdDescription := `` + + var taskIdFlagName string + if cmdPrefix == "" { + taskIdFlagName = "taskId" + } else { + taskIdFlagName = fmt.Sprintf("%v.taskId", cmdPrefix) + } + + var taskIdFlagDefault string + + _ = cmd.PersistentFlags().String(taskIdFlagName, taskIdFlagDefault, taskIdDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSubtaskDebugInfoFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, finishTimeAdded := retrieveSubtaskDebugInfoFinishTimeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || finishTimeAdded + + err, infoAdded := retrieveSubtaskDebugInfoInfoFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || infoAdded + + err, participantAdded := retrieveSubtaskDebugInfoParticipantFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || participantAdded + + err, startTimeAdded := retrieveSubtaskDebugInfoStartTimeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || startTimeAdded + + err, stateAdded := retrieveSubtaskDebugInfoStateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || stateAdded + + err, taskConfigAdded := retrieveSubtaskDebugInfoTaskConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskConfigAdded + + err, taskIdAdded := retrieveSubtaskDebugInfoTaskIDFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskIdAdded + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoFinishTimeFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + finishTimeFlagName := fmt.Sprintf("%v.finishTime", cmdPrefix) + if cmd.Flags().Changed(finishTimeFlagName) { + + var finishTimeFlagName string + if cmdPrefix == "" { + finishTimeFlagName = "finishTime" + } else { + finishTimeFlagName = fmt.Sprintf("%v.finishTime", cmdPrefix) + } + + finishTimeFlagValue, err := cmd.Flags().GetString(finishTimeFlagName) + if err != nil { + return err, false + } + m.FinishTime = finishTimeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoInfoFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + infoFlagName := fmt.Sprintf("%v.info", cmdPrefix) + if cmd.Flags().Changed(infoFlagName) { + + var infoFlagName string + if cmdPrefix == "" { + infoFlagName = "info" + } else { + infoFlagName = fmt.Sprintf("%v.info", cmdPrefix) + } + + infoFlagValue, err := cmd.Flags().GetString(infoFlagName) + if err != nil { + return err, false + } + m.Info = infoFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoParticipantFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + participantFlagName := fmt.Sprintf("%v.participant", cmdPrefix) + if cmd.Flags().Changed(participantFlagName) { + + var participantFlagName string + if cmdPrefix == "" { + participantFlagName = "participant" + } else { + participantFlagName = fmt.Sprintf("%v.participant", cmdPrefix) + } + + participantFlagValue, err := cmd.Flags().GetString(participantFlagName) + if err != nil { + return err, false + } + m.Participant = participantFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoStartTimeFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + startTimeFlagName := fmt.Sprintf("%v.startTime", cmdPrefix) + if cmd.Flags().Changed(startTimeFlagName) { + + var startTimeFlagName string + if cmdPrefix == "" { + startTimeFlagName = "startTime" + } else { + startTimeFlagName = fmt.Sprintf("%v.startTime", cmdPrefix) + } + + startTimeFlagValue, err := cmd.Flags().GetString(startTimeFlagName) + if err != nil { + return err, false + } + m.StartTime = startTimeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoStateFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + stateFlagName := fmt.Sprintf("%v.state", cmdPrefix) + if cmd.Flags().Changed(stateFlagName) { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = stateFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoTaskConfigFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskConfigFlagName := fmt.Sprintf("%v.taskConfig", cmdPrefix) + if cmd.Flags().Changed(taskConfigFlagName) { + // info: complex object taskConfig PinotTaskConfig is retrieved outside this Changed() block + } + taskConfigFlagValue := m.TaskConfig + if swag.IsZero(taskConfigFlagValue) { + taskConfigFlagValue = &models.PinotTaskConfig{} + } + + err, taskConfigAdded := retrieveModelPinotTaskConfigFlags(depth+1, taskConfigFlagValue, taskConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskConfigAdded + if taskConfigAdded { + m.TaskConfig = taskConfigFlagValue + } + + return nil, retAdded +} + +func retrieveSubtaskDebugInfoTaskIDFlags(depth int, m *models.SubtaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskIdFlagName := fmt.Sprintf("%v.taskId", cmdPrefix) + if cmd.Flags().Changed(taskIdFlagName) { + + var taskIdFlagName string + if cmdPrefix == "" { + taskIdFlagName = "taskId" + } else { + taskIdFlagName = fmt.Sprintf("%v.taskId", cmdPrefix) + } + + taskIdFlagValue, err := cmd.Flags().GetString(taskIdFlagName) + if err != nil { + return err, false + } + m.TaskID = taskIdFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/success_response_model.go b/src/cli/success_response_model.go new file mode 100644 index 0000000..09ed09f --- /dev/null +++ b/src/cli/success_response_model.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for SuccessResponse + +// register flags to command +func registerModelSuccessResponseFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerSuccessResponseStatus(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerSuccessResponseStatus(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + statusDescription := `` + + var statusFlagName string + if cmdPrefix == "" { + statusFlagName = "status" + } else { + statusFlagName = fmt.Sprintf("%v.status", cmdPrefix) + } + + var statusFlagDefault string + + _ = cmd.PersistentFlags().String(statusFlagName, statusFlagDefault, statusDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelSuccessResponseFlags(depth int, m *models.SuccessResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, statusAdded := retrieveSuccessResponseStatusFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || statusAdded + + return nil, retAdded +} + +func retrieveSuccessResponseStatusFlags(depth int, m *models.SuccessResponse, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + statusFlagName := fmt.Sprintf("%v.status", cmdPrefix) + if cmd.Flags().Changed(statusFlagName) { + + var statusFlagName string + if cmdPrefix == "" { + statusFlagName = "status" + } else { + statusFlagName = fmt.Sprintf("%v.status", cmdPrefix) + } + + statusFlagValue, err := cmd.Flags().GetString(statusFlagName) + if err != nil { + return err, false + } + m.Status = statusFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/table_and_schema_config_model.go b/src/cli/table_and_schema_config_model.go new file mode 100644 index 0000000..87cd479 --- /dev/null +++ b/src/cli/table_and_schema_config_model.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for TableAndSchemaConfig + +// register flags to command +func registerModelTableAndSchemaConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableAndSchemaConfigSchema(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableAndSchemaConfigTableConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableAndSchemaConfigSchema(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var schemaFlagName string + if cmdPrefix == "" { + schemaFlagName = "schema" + } else { + schemaFlagName = fmt.Sprintf("%v.schema", cmdPrefix) + } + + if err := registerModelSchemaFlags(depth+1, schemaFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableAndSchemaConfigTableConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var tableConfigFlagName string + if cmdPrefix == "" { + tableConfigFlagName = "tableConfig" + } else { + tableConfigFlagName = fmt.Sprintf("%v.tableConfig", cmdPrefix) + } + + if err := registerModelTableConfigFlags(depth+1, tableConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableAndSchemaConfigFlags(depth int, m *models.TableAndSchemaConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, schemaAdded := retrieveTableAndSchemaConfigSchemaFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || schemaAdded + + err, tableConfigAdded := retrieveTableAndSchemaConfigTableConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableConfigAdded + + return nil, retAdded +} + +func retrieveTableAndSchemaConfigSchemaFlags(depth int, m *models.TableAndSchemaConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + schemaFlagName := fmt.Sprintf("%v.schema", cmdPrefix) + if cmd.Flags().Changed(schemaFlagName) { + // info: complex object schema Schema is retrieved outside this Changed() block + } + schemaFlagValue := m.Schema + if swag.IsZero(schemaFlagValue) { + schemaFlagValue = &models.Schema{} + } + + err, schemaAdded := retrieveModelSchemaFlags(depth+1, schemaFlagValue, schemaFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || schemaAdded + if schemaAdded { + m.Schema = schemaFlagValue + } + + return nil, retAdded +} + +func retrieveTableAndSchemaConfigTableConfigFlags(depth int, m *models.TableAndSchemaConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableConfigFlagName := fmt.Sprintf("%v.tableConfig", cmdPrefix) + if cmd.Flags().Changed(tableConfigFlagName) { + // info: complex object tableConfig TableConfig is retrieved outside this Changed() block + } + tableConfigFlagValue := m.TableConfig + if swag.IsZero(tableConfigFlagValue) { + tableConfigFlagValue = &models.TableConfig{} + } + + err, tableConfigAdded := retrieveModelTableConfigFlags(depth+1, tableConfigFlagValue, tableConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableConfigAdded + if tableConfigAdded { + m.TableConfig = tableConfigFlagValue + } + + return nil, retAdded +} diff --git a/src/cli/table_config_model.go b/src/cli/table_config_model.go new file mode 100644 index 0000000..a099dc5 --- /dev/null +++ b/src/cli/table_config_model.go @@ -0,0 +1,1095 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for TableConfig + +// register flags to command +func registerModelTableConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableConfigDedupConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigDimensionTableConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigFieldConfigList(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigIngestionConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigInstanceAssignmentConfigMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigInstancePartitionsMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigIsDimTable(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigMetadata(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigQuery(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigQuota(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigRouting(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigSegmentAssignmentConfigMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigSegmentsConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTableIndexConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTableName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTableType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTask(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTenants(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTierConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigTunerConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableConfigUpsertConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigDedupConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var dedupConfigFlagName string + if cmdPrefix == "" { + dedupConfigFlagName = "dedupConfig" + } else { + dedupConfigFlagName = fmt.Sprintf("%v.dedupConfig", cmdPrefix) + } + + if err := registerModelDedupConfigFlags(depth+1, dedupConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigDimensionTableConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var dimensionTableConfigFlagName string + if cmdPrefix == "" { + dimensionTableConfigFlagName = "dimensionTableConfig" + } else { + dimensionTableConfigFlagName = fmt.Sprintf("%v.dimensionTableConfig", cmdPrefix) + } + + if err := registerModelDimensionTableConfigFlags(depth+1, dimensionTableConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigFieldConfigList(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: fieldConfigList []*FieldConfig array type is not supported by go-swagger cli yet + + return nil +} + +func registerTableConfigIngestionConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var ingestionConfigFlagName string + if cmdPrefix == "" { + ingestionConfigFlagName = "ingestionConfig" + } else { + ingestionConfigFlagName = fmt.Sprintf("%v.ingestionConfig", cmdPrefix) + } + + if err := registerModelIngestionConfigFlags(depth+1, ingestionConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigInstanceAssignmentConfigMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: instanceAssignmentConfigMap map[string]InstanceAssignmentConfig map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableConfigInstancePartitionsMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: instancePartitionsMap map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableConfigIsDimTable(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + isDimTableDescription := `` + + var isDimTableFlagName string + if cmdPrefix == "" { + isDimTableFlagName = "isDimTable" + } else { + isDimTableFlagName = fmt.Sprintf("%v.isDimTable", cmdPrefix) + } + + var isDimTableFlagDefault bool + + _ = cmd.PersistentFlags().Bool(isDimTableFlagName, isDimTableFlagDefault, isDimTableDescription) + + return nil +} + +func registerTableConfigMetadata(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var metadataFlagName string + if cmdPrefix == "" { + metadataFlagName = "metadata" + } else { + metadataFlagName = fmt.Sprintf("%v.metadata", cmdPrefix) + } + + if err := registerModelTableCustomConfigFlags(depth+1, metadataFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigQuery(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var queryFlagName string + if cmdPrefix == "" { + queryFlagName = "query" + } else { + queryFlagName = fmt.Sprintf("%v.query", cmdPrefix) + } + + if err := registerModelQueryConfigFlags(depth+1, queryFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigQuota(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var quotaFlagName string + if cmdPrefix == "" { + quotaFlagName = "quota" + } else { + quotaFlagName = fmt.Sprintf("%v.quota", cmdPrefix) + } + + if err := registerModelQuotaConfigFlags(depth+1, quotaFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigRouting(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var routingFlagName string + if cmdPrefix == "" { + routingFlagName = "routing" + } else { + routingFlagName = fmt.Sprintf("%v.routing", cmdPrefix) + } + + if err := registerModelRoutingConfigFlags(depth+1, routingFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigSegmentAssignmentConfigMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentAssignmentConfigMap map[string]SegmentAssignmentConfig map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableConfigSegmentsConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var segmentsConfigFlagName string + if cmdPrefix == "" { + segmentsConfigFlagName = "segmentsConfig" + } else { + segmentsConfigFlagName = fmt.Sprintf("%v.segmentsConfig", cmdPrefix) + } + + if err := registerModelSegmentsValidationAndRetentionConfigFlags(depth+1, segmentsConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigTableIndexConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var tableIndexConfigFlagName string + if cmdPrefix == "" { + tableIndexConfigFlagName = "tableIndexConfig" + } else { + tableIndexConfigFlagName = fmt.Sprintf("%v.tableIndexConfig", cmdPrefix) + } + + if err := registerModelIndexingConfigFlags(depth+1, tableIndexConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigTableName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tableNameDescription := `` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func registerTableConfigTableType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tableTypeDescription := `Enum: ["OFFLINE","REALTIME"]. ` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(tableTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["OFFLINE","REALTIME"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerTableConfigTask(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var taskFlagName string + if cmdPrefix == "" { + taskFlagName = "task" + } else { + taskFlagName = fmt.Sprintf("%v.task", cmdPrefix) + } + + if err := registerModelTableTaskConfigFlags(depth+1, taskFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigTenants(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var tenantsFlagName string + if cmdPrefix == "" { + tenantsFlagName = "tenants" + } else { + tenantsFlagName = fmt.Sprintf("%v.tenants", cmdPrefix) + } + + if err := registerModelTenantConfigFlags(depth+1, tenantsFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableConfigTierConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tierConfigs []*TierConfig array type is not supported by go-swagger cli yet + + return nil +} + +func registerTableConfigTunerConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tunerConfigs []*TunerConfig array type is not supported by go-swagger cli yet + + return nil +} + +func registerTableConfigUpsertConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var upsertConfigFlagName string + if cmdPrefix == "" { + upsertConfigFlagName = "upsertConfig" + } else { + upsertConfigFlagName = fmt.Sprintf("%v.upsertConfig", cmdPrefix) + } + + if err := registerModelUpsertConfigFlags(depth+1, upsertConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dedupConfigAdded := retrieveTableConfigDedupConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dedupConfigAdded + + err, dimensionTableConfigAdded := retrieveTableConfigDimensionTableConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dimensionTableConfigAdded + + err, fieldConfigListAdded := retrieveTableConfigFieldConfigListFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || fieldConfigListAdded + + err, ingestionConfigAdded := retrieveTableConfigIngestionConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || ingestionConfigAdded + + err, instanceAssignmentConfigMapAdded := retrieveTableConfigInstanceAssignmentConfigMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instanceAssignmentConfigMapAdded + + err, instancePartitionsMapAdded := retrieveTableConfigInstancePartitionsMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || instancePartitionsMapAdded + + err, isDimTableAdded := retrieveTableConfigIsDimTableFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || isDimTableAdded + + err, metadataAdded := retrieveTableConfigMetadataFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || metadataAdded + + err, queryAdded := retrieveTableConfigQueryFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || queryAdded + + err, quotaAdded := retrieveTableConfigQuotaFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || quotaAdded + + err, routingAdded := retrieveTableConfigRoutingFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || routingAdded + + err, segmentAssignmentConfigMapAdded := retrieveTableConfigSegmentAssignmentConfigMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentAssignmentConfigMapAdded + + err, segmentsConfigAdded := retrieveTableConfigSegmentsConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentsConfigAdded + + err, tableIndexConfigAdded := retrieveTableConfigTableIndexConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableIndexConfigAdded + + err, tableNameAdded := retrieveTableConfigTableNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableNameAdded + + err, tableTypeAdded := retrieveTableConfigTableTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableTypeAdded + + err, taskAdded := retrieveTableConfigTaskFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskAdded + + err, tenantsAdded := retrieveTableConfigTenantsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tenantsAdded + + err, tierConfigsAdded := retrieveTableConfigTierConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tierConfigsAdded + + err, tunerConfigsAdded := retrieveTableConfigTunerConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tunerConfigsAdded + + err, upsertConfigAdded := retrieveTableConfigUpsertConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || upsertConfigAdded + + return nil, retAdded +} + +func retrieveTableConfigDedupConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dedupConfigFlagName := fmt.Sprintf("%v.dedupConfig", cmdPrefix) + if cmd.Flags().Changed(dedupConfigFlagName) { + // info: complex object dedupConfig DedupConfig is retrieved outside this Changed() block + } + dedupConfigFlagValue := m.DedupConfig + if swag.IsZero(dedupConfigFlagValue) { + dedupConfigFlagValue = &models.DedupConfig{} + } + + err, dedupConfigAdded := retrieveModelDedupConfigFlags(depth+1, dedupConfigFlagValue, dedupConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dedupConfigAdded + if dedupConfigAdded { + m.DedupConfig = dedupConfigFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigDimensionTableConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dimensionTableConfigFlagName := fmt.Sprintf("%v.dimensionTableConfig", cmdPrefix) + if cmd.Flags().Changed(dimensionTableConfigFlagName) { + // info: complex object dimensionTableConfig DimensionTableConfig is retrieved outside this Changed() block + } + dimensionTableConfigFlagValue := m.DimensionTableConfig + if swag.IsZero(dimensionTableConfigFlagValue) { + dimensionTableConfigFlagValue = &models.DimensionTableConfig{} + } + + err, dimensionTableConfigAdded := retrieveModelDimensionTableConfigFlags(depth+1, dimensionTableConfigFlagValue, dimensionTableConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dimensionTableConfigAdded + if dimensionTableConfigAdded { + m.DimensionTableConfig = dimensionTableConfigFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigFieldConfigListFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + fieldConfigListFlagName := fmt.Sprintf("%v.fieldConfigList", cmdPrefix) + if cmd.Flags().Changed(fieldConfigListFlagName) { + // warning: fieldConfigList array type []*FieldConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableConfigIngestionConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + ingestionConfigFlagName := fmt.Sprintf("%v.ingestionConfig", cmdPrefix) + if cmd.Flags().Changed(ingestionConfigFlagName) { + // info: complex object ingestionConfig IngestionConfig is retrieved outside this Changed() block + } + ingestionConfigFlagValue := m.IngestionConfig + if swag.IsZero(ingestionConfigFlagValue) { + ingestionConfigFlagValue = &models.IngestionConfig{} + } + + err, ingestionConfigAdded := retrieveModelIngestionConfigFlags(depth+1, ingestionConfigFlagValue, ingestionConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || ingestionConfigAdded + if ingestionConfigAdded { + m.IngestionConfig = ingestionConfigFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigInstanceAssignmentConfigMapFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instanceAssignmentConfigMapFlagName := fmt.Sprintf("%v.instanceAssignmentConfigMap", cmdPrefix) + if cmd.Flags().Changed(instanceAssignmentConfigMapFlagName) { + // warning: instanceAssignmentConfigMap map type map[string]InstanceAssignmentConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableConfigInstancePartitionsMapFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + instancePartitionsMapFlagName := fmt.Sprintf("%v.instancePartitionsMap", cmdPrefix) + if cmd.Flags().Changed(instancePartitionsMapFlagName) { + // warning: instancePartitionsMap map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableConfigIsDimTableFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + isDimTableFlagName := fmt.Sprintf("%v.isDimTable", cmdPrefix) + if cmd.Flags().Changed(isDimTableFlagName) { + + var isDimTableFlagName string + if cmdPrefix == "" { + isDimTableFlagName = "isDimTable" + } else { + isDimTableFlagName = fmt.Sprintf("%v.isDimTable", cmdPrefix) + } + + isDimTableFlagValue, err := cmd.Flags().GetBool(isDimTableFlagName) + if err != nil { + return err, false + } + m.IsDimTable = &isDimTableFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableConfigMetadataFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + metadataFlagName := fmt.Sprintf("%v.metadata", cmdPrefix) + if cmd.Flags().Changed(metadataFlagName) { + // info: complex object metadata TableCustomConfig is retrieved outside this Changed() block + } + metadataFlagValue := m.Metadata + if swag.IsZero(metadataFlagValue) { + metadataFlagValue = &models.TableCustomConfig{} + } + + err, metadataAdded := retrieveModelTableCustomConfigFlags(depth+1, metadataFlagValue, metadataFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || metadataAdded + if metadataAdded { + m.Metadata = metadataFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigQueryFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + queryFlagName := fmt.Sprintf("%v.query", cmdPrefix) + if cmd.Flags().Changed(queryFlagName) { + // info: complex object query QueryConfig is retrieved outside this Changed() block + } + queryFlagValue := m.Query + if swag.IsZero(queryFlagValue) { + queryFlagValue = &models.QueryConfig{} + } + + err, queryAdded := retrieveModelQueryConfigFlags(depth+1, queryFlagValue, queryFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || queryAdded + if queryAdded { + m.Query = queryFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigQuotaFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + quotaFlagName := fmt.Sprintf("%v.quota", cmdPrefix) + if cmd.Flags().Changed(quotaFlagName) { + // info: complex object quota QuotaConfig is retrieved outside this Changed() block + } + quotaFlagValue := m.Quota + if swag.IsZero(quotaFlagValue) { + quotaFlagValue = &models.QuotaConfig{} + } + + err, quotaAdded := retrieveModelQuotaConfigFlags(depth+1, quotaFlagValue, quotaFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || quotaAdded + if quotaAdded { + m.Quota = quotaFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigRoutingFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + routingFlagName := fmt.Sprintf("%v.routing", cmdPrefix) + if cmd.Flags().Changed(routingFlagName) { + // info: complex object routing RoutingConfig is retrieved outside this Changed() block + } + routingFlagValue := m.Routing + if swag.IsZero(routingFlagValue) { + routingFlagValue = &models.RoutingConfig{} + } + + err, routingAdded := retrieveModelRoutingConfigFlags(depth+1, routingFlagValue, routingFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || routingAdded + if routingAdded { + m.Routing = routingFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigSegmentAssignmentConfigMapFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentAssignmentConfigMapFlagName := fmt.Sprintf("%v.segmentAssignmentConfigMap", cmdPrefix) + if cmd.Flags().Changed(segmentAssignmentConfigMapFlagName) { + // warning: segmentAssignmentConfigMap map type map[string]SegmentAssignmentConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableConfigSegmentsConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentsConfigFlagName := fmt.Sprintf("%v.segmentsConfig", cmdPrefix) + if cmd.Flags().Changed(segmentsConfigFlagName) { + // info: complex object segmentsConfig SegmentsValidationAndRetentionConfig is retrieved outside this Changed() block + } + segmentsConfigFlagValue := m.SegmentsConfig + if swag.IsZero(segmentsConfigFlagValue) { + segmentsConfigFlagValue = &models.SegmentsValidationAndRetentionConfig{} + } + + err, segmentsConfigAdded := retrieveModelSegmentsValidationAndRetentionConfigFlags(depth+1, segmentsConfigFlagValue, segmentsConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentsConfigAdded + if segmentsConfigAdded { + m.SegmentsConfig = segmentsConfigFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigTableIndexConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableIndexConfigFlagName := fmt.Sprintf("%v.tableIndexConfig", cmdPrefix) + if cmd.Flags().Changed(tableIndexConfigFlagName) { + // info: complex object tableIndexConfig IndexingConfig is retrieved outside this Changed() block + } + tableIndexConfigFlagValue := m.TableIndexConfig + if swag.IsZero(tableIndexConfigFlagValue) { + tableIndexConfigFlagValue = &models.IndexingConfig{} + } + + err, tableIndexConfigAdded := retrieveModelIndexingConfigFlags(depth+1, tableIndexConfigFlagValue, tableIndexConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableIndexConfigAdded + if tableIndexConfigAdded { + m.TableIndexConfig = tableIndexConfigFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigTableNameFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableNameFlagName := fmt.Sprintf("%v.tableName", cmdPrefix) + if cmd.Flags().Changed(tableNameFlagName) { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableConfigTableTypeFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableTypeFlagName := fmt.Sprintf("%v.tableType", cmdPrefix) + if cmd.Flags().Changed(tableTypeFlagName) { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = tableTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableConfigTaskFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskFlagName := fmt.Sprintf("%v.task", cmdPrefix) + if cmd.Flags().Changed(taskFlagName) { + // info: complex object task TableTaskConfig is retrieved outside this Changed() block + } + taskFlagValue := m.Task + if swag.IsZero(taskFlagValue) { + taskFlagValue = &models.TableTaskConfig{} + } + + err, taskAdded := retrieveModelTableTaskConfigFlags(depth+1, taskFlagValue, taskFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskAdded + if taskAdded { + m.Task = taskFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigTenantsFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tenantsFlagName := fmt.Sprintf("%v.tenants", cmdPrefix) + if cmd.Flags().Changed(tenantsFlagName) { + // info: complex object tenants TenantConfig is retrieved outside this Changed() block + } + tenantsFlagValue := m.Tenants + if swag.IsZero(tenantsFlagValue) { + tenantsFlagValue = &models.TenantConfig{} + } + + err, tenantsAdded := retrieveModelTenantConfigFlags(depth+1, tenantsFlagValue, tenantsFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tenantsAdded + if tenantsAdded { + m.Tenants = tenantsFlagValue + } + + return nil, retAdded +} + +func retrieveTableConfigTierConfigsFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tierConfigsFlagName := fmt.Sprintf("%v.tierConfigs", cmdPrefix) + if cmd.Flags().Changed(tierConfigsFlagName) { + // warning: tierConfigs array type []*TierConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableConfigTunerConfigsFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tunerConfigsFlagName := fmt.Sprintf("%v.tunerConfigs", cmdPrefix) + if cmd.Flags().Changed(tunerConfigsFlagName) { + // warning: tunerConfigs array type []*TunerConfig is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableConfigUpsertConfigFlags(depth int, m *models.TableConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + upsertConfigFlagName := fmt.Sprintf("%v.upsertConfig", cmdPrefix) + if cmd.Flags().Changed(upsertConfigFlagName) { + // info: complex object upsertConfig UpsertConfig is retrieved outside this Changed() block + } + upsertConfigFlagValue := m.UpsertConfig + if swag.IsZero(upsertConfigFlagValue) { + upsertConfigFlagValue = &models.UpsertConfig{} + } + + err, upsertConfigAdded := retrieveModelUpsertConfigFlags(depth+1, upsertConfigFlagValue, upsertConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || upsertConfigAdded + if upsertConfigAdded { + m.UpsertConfig = upsertConfigFlagValue + } + + return nil, retAdded +} diff --git a/src/cli/table_custom_config_model.go b/src/cli/table_custom_config_model.go new file mode 100644 index 0000000..89d553a --- /dev/null +++ b/src/cli/table_custom_config_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TableCustomConfig + +// register flags to command +func registerModelTableCustomConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableCustomConfigCustomConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableCustomConfigCustomConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: customConfigs map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableCustomConfigFlags(depth int, m *models.TableCustomConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, customConfigsAdded := retrieveTableCustomConfigCustomConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || customConfigsAdded + + return nil, retAdded +} + +func retrieveTableCustomConfigCustomConfigsFlags(depth int, m *models.TableCustomConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + customConfigsFlagName := fmt.Sprintf("%v.customConfigs", cmdPrefix) + if cmd.Flags().Changed(customConfigsFlagName) { + // warning: customConfigs map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/table_size_details_model.go b/src/cli/table_size_details_model.go new file mode 100644 index 0000000..c989e64 --- /dev/null +++ b/src/cli/table_size_details_model.go @@ -0,0 +1,319 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for TableSizeDetails + +// register flags to command +func registerModelTableSizeDetailsFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableSizeDetailsEstimatedSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSizeDetailsOfflineSegments(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSizeDetailsRealtimeSegments(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSizeDetailsReportedSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSizeDetailsTableName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableSizeDetailsEstimatedSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + estimatedSizeInBytesDescription := `` + + var estimatedSizeInBytesFlagName string + if cmdPrefix == "" { + estimatedSizeInBytesFlagName = "estimatedSizeInBytes" + } else { + estimatedSizeInBytesFlagName = fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + } + + var estimatedSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(estimatedSizeInBytesFlagName, estimatedSizeInBytesFlagDefault, estimatedSizeInBytesDescription) + + return nil +} + +func registerTableSizeDetailsOfflineSegments(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var offlineSegmentsFlagName string + if cmdPrefix == "" { + offlineSegmentsFlagName = "offlineSegments" + } else { + offlineSegmentsFlagName = fmt.Sprintf("%v.offlineSegments", cmdPrefix) + } + + if err := registerModelTableSubTypeSizeDetailsFlags(depth+1, offlineSegmentsFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableSizeDetailsRealtimeSegments(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var realtimeSegmentsFlagName string + if cmdPrefix == "" { + realtimeSegmentsFlagName = "realtimeSegments" + } else { + realtimeSegmentsFlagName = fmt.Sprintf("%v.realtimeSegments", cmdPrefix) + } + + if err := registerModelTableSubTypeSizeDetailsFlags(depth+1, realtimeSegmentsFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTableSizeDetailsReportedSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + reportedSizeInBytesDescription := `` + + var reportedSizeInBytesFlagName string + if cmdPrefix == "" { + reportedSizeInBytesFlagName = "reportedSizeInBytes" + } else { + reportedSizeInBytesFlagName = fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + } + + var reportedSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(reportedSizeInBytesFlagName, reportedSizeInBytesFlagDefault, reportedSizeInBytesDescription) + + return nil +} + +func registerTableSizeDetailsTableName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tableNameDescription := `` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableSizeDetailsFlags(depth int, m *models.TableSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, estimatedSizeInBytesAdded := retrieveTableSizeDetailsEstimatedSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || estimatedSizeInBytesAdded + + err, offlineSegmentsAdded := retrieveTableSizeDetailsOfflineSegmentsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || offlineSegmentsAdded + + err, realtimeSegmentsAdded := retrieveTableSizeDetailsRealtimeSegmentsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || realtimeSegmentsAdded + + err, reportedSizeInBytesAdded := retrieveTableSizeDetailsReportedSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || reportedSizeInBytesAdded + + err, tableNameAdded := retrieveTableSizeDetailsTableNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableNameAdded + + return nil, retAdded +} + +func retrieveTableSizeDetailsEstimatedSizeInBytesFlags(depth int, m *models.TableSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + estimatedSizeInBytesFlagName := fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(estimatedSizeInBytesFlagName) { + + var estimatedSizeInBytesFlagName string + if cmdPrefix == "" { + estimatedSizeInBytesFlagName = "estimatedSizeInBytes" + } else { + estimatedSizeInBytesFlagName = fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + } + + estimatedSizeInBytesFlagValue, err := cmd.Flags().GetInt64(estimatedSizeInBytesFlagName) + if err != nil { + return err, false + } + m.EstimatedSizeInBytes = estimatedSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableSizeDetailsOfflineSegmentsFlags(depth int, m *models.TableSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + offlineSegmentsFlagName := fmt.Sprintf("%v.offlineSegments", cmdPrefix) + if cmd.Flags().Changed(offlineSegmentsFlagName) { + // info: complex object offlineSegments TableSubTypeSizeDetails is retrieved outside this Changed() block + } + offlineSegmentsFlagValue := m.OfflineSegments + if swag.IsZero(offlineSegmentsFlagValue) { + offlineSegmentsFlagValue = &models.TableSubTypeSizeDetails{} + } + + err, offlineSegmentsAdded := retrieveModelTableSubTypeSizeDetailsFlags(depth+1, offlineSegmentsFlagValue, offlineSegmentsFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || offlineSegmentsAdded + if offlineSegmentsAdded { + m.OfflineSegments = offlineSegmentsFlagValue + } + + return nil, retAdded +} + +func retrieveTableSizeDetailsRealtimeSegmentsFlags(depth int, m *models.TableSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + realtimeSegmentsFlagName := fmt.Sprintf("%v.realtimeSegments", cmdPrefix) + if cmd.Flags().Changed(realtimeSegmentsFlagName) { + // info: complex object realtimeSegments TableSubTypeSizeDetails is retrieved outside this Changed() block + } + realtimeSegmentsFlagValue := m.RealtimeSegments + if swag.IsZero(realtimeSegmentsFlagValue) { + realtimeSegmentsFlagValue = &models.TableSubTypeSizeDetails{} + } + + err, realtimeSegmentsAdded := retrieveModelTableSubTypeSizeDetailsFlags(depth+1, realtimeSegmentsFlagValue, realtimeSegmentsFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || realtimeSegmentsAdded + if realtimeSegmentsAdded { + m.RealtimeSegments = realtimeSegmentsFlagValue + } + + return nil, retAdded +} + +func retrieveTableSizeDetailsReportedSizeInBytesFlags(depth int, m *models.TableSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + reportedSizeInBytesFlagName := fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(reportedSizeInBytesFlagName) { + + var reportedSizeInBytesFlagName string + if cmdPrefix == "" { + reportedSizeInBytesFlagName = "reportedSizeInBytes" + } else { + reportedSizeInBytesFlagName = fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + } + + reportedSizeInBytesFlagValue, err := cmd.Flags().GetInt64(reportedSizeInBytesFlagName) + if err != nil { + return err, false + } + m.ReportedSizeInBytes = reportedSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableSizeDetailsTableNameFlags(depth int, m *models.TableSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableNameFlagName := fmt.Sprintf("%v.tableName", cmdPrefix) + if cmd.Flags().Changed(tableNameFlagName) { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/table_sub_type_size_details_model.go b/src/cli/table_sub_type_size_details_model.go new file mode 100644 index 0000000..5c7dee2 --- /dev/null +++ b/src/cli/table_sub_type_size_details_model.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TableSubTypeSizeDetails + +// register flags to command +func registerModelTableSubTypeSizeDetailsFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableSubTypeSizeDetailsEstimatedSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSubTypeSizeDetailsMissingSegments(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSubTypeSizeDetailsReportedSizeInBytes(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableSubTypeSizeDetailsSegments(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableSubTypeSizeDetailsEstimatedSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + estimatedSizeInBytesDescription := `` + + var estimatedSizeInBytesFlagName string + if cmdPrefix == "" { + estimatedSizeInBytesFlagName = "estimatedSizeInBytes" + } else { + estimatedSizeInBytesFlagName = fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + } + + var estimatedSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(estimatedSizeInBytesFlagName, estimatedSizeInBytesFlagDefault, estimatedSizeInBytesDescription) + + return nil +} + +func registerTableSubTypeSizeDetailsMissingSegments(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + missingSegmentsDescription := `` + + var missingSegmentsFlagName string + if cmdPrefix == "" { + missingSegmentsFlagName = "missingSegments" + } else { + missingSegmentsFlagName = fmt.Sprintf("%v.missingSegments", cmdPrefix) + } + + var missingSegmentsFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(missingSegmentsFlagName, missingSegmentsFlagDefault, missingSegmentsDescription) + + return nil +} + +func registerTableSubTypeSizeDetailsReportedSizeInBytes(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + reportedSizeInBytesDescription := `` + + var reportedSizeInBytesFlagName string + if cmdPrefix == "" { + reportedSizeInBytesFlagName = "reportedSizeInBytes" + } else { + reportedSizeInBytesFlagName = fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + } + + var reportedSizeInBytesFlagDefault int64 + + _ = cmd.PersistentFlags().Int64(reportedSizeInBytesFlagName, reportedSizeInBytesFlagDefault, reportedSizeInBytesDescription) + + return nil +} + +func registerTableSubTypeSizeDetailsSegments(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segments map[string]SegmentSizeDetails map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableSubTypeSizeDetailsFlags(depth int, m *models.TableSubTypeSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, estimatedSizeInBytesAdded := retrieveTableSubTypeSizeDetailsEstimatedSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || estimatedSizeInBytesAdded + + err, missingSegmentsAdded := retrieveTableSubTypeSizeDetailsMissingSegmentsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || missingSegmentsAdded + + err, reportedSizeInBytesAdded := retrieveTableSubTypeSizeDetailsReportedSizeInBytesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || reportedSizeInBytesAdded + + err, segmentsAdded := retrieveTableSubTypeSizeDetailsSegmentsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentsAdded + + return nil, retAdded +} + +func retrieveTableSubTypeSizeDetailsEstimatedSizeInBytesFlags(depth int, m *models.TableSubTypeSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + estimatedSizeInBytesFlagName := fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(estimatedSizeInBytesFlagName) { + + var estimatedSizeInBytesFlagName string + if cmdPrefix == "" { + estimatedSizeInBytesFlagName = "estimatedSizeInBytes" + } else { + estimatedSizeInBytesFlagName = fmt.Sprintf("%v.estimatedSizeInBytes", cmdPrefix) + } + + estimatedSizeInBytesFlagValue, err := cmd.Flags().GetInt64(estimatedSizeInBytesFlagName) + if err != nil { + return err, false + } + m.EstimatedSizeInBytes = estimatedSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableSubTypeSizeDetailsMissingSegmentsFlags(depth int, m *models.TableSubTypeSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + missingSegmentsFlagName := fmt.Sprintf("%v.missingSegments", cmdPrefix) + if cmd.Flags().Changed(missingSegmentsFlagName) { + + var missingSegmentsFlagName string + if cmdPrefix == "" { + missingSegmentsFlagName = "missingSegments" + } else { + missingSegmentsFlagName = fmt.Sprintf("%v.missingSegments", cmdPrefix) + } + + missingSegmentsFlagValue, err := cmd.Flags().GetInt32(missingSegmentsFlagName) + if err != nil { + return err, false + } + m.MissingSegments = missingSegmentsFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableSubTypeSizeDetailsReportedSizeInBytesFlags(depth int, m *models.TableSubTypeSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + reportedSizeInBytesFlagName := fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + if cmd.Flags().Changed(reportedSizeInBytesFlagName) { + + var reportedSizeInBytesFlagName string + if cmdPrefix == "" { + reportedSizeInBytesFlagName = "reportedSizeInBytes" + } else { + reportedSizeInBytesFlagName = fmt.Sprintf("%v.reportedSizeInBytes", cmdPrefix) + } + + reportedSizeInBytesFlagValue, err := cmd.Flags().GetInt64(reportedSizeInBytesFlagName) + if err != nil { + return err, false + } + m.ReportedSizeInBytes = reportedSizeInBytesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableSubTypeSizeDetailsSegmentsFlags(depth int, m *models.TableSubTypeSizeDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentsFlagName := fmt.Sprintf("%v.segments", cmdPrefix) + if cmd.Flags().Changed(segmentsFlagName) { + // warning: segments map type map[string]SegmentSizeDetails is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/table_task_config_model.go b/src/cli/table_task_config_model.go new file mode 100644 index 0000000..f4fa6e2 --- /dev/null +++ b/src/cli/table_task_config_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TableTaskConfig + +// register flags to command +func registerModelTableTaskConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableTaskConfigTaskTypeConfigsMap(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableTaskConfigTaskTypeConfigsMap(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: taskTypeConfigsMap map[string]map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableTaskConfigFlags(depth int, m *models.TableTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, taskTypeConfigsMapAdded := retrieveTableTaskConfigTaskTypeConfigsMapFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskTypeConfigsMapAdded + + return nil, retAdded +} + +func retrieveTableTaskConfigTaskTypeConfigsMapFlags(depth int, m *models.TableTaskConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskTypeConfigsMapFlagName := fmt.Sprintf("%v.taskTypeConfigsMap", cmdPrefix) + if cmd.Flags().Changed(taskTypeConfigsMapFlagName) { + // warning: taskTypeConfigsMap map type map[string]map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/table_tier_details_model.go b/src/cli/table_tier_details_model.go new file mode 100644 index 0000000..b67dfba --- /dev/null +++ b/src/cli/table_tier_details_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TableTierDetails + +// register flags to command +func registerModelTableTierDetailsFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableTierDetailsSegmentTiers(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableTierDetailsTableName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableTierDetailsSegmentTiers(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentTiers map[string]map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableTierDetailsTableName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tableNameDescription := `Name of table to look for segment storage tiers` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableTierDetailsFlags(depth int, m *models.TableTierDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, segmentTiersAdded := retrieveTableTierDetailsSegmentTiersFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentTiersAdded + + err, tableNameAdded := retrieveTableTierDetailsTableNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tableNameAdded + + return nil, retAdded +} + +func retrieveTableTierDetailsSegmentTiersFlags(depth int, m *models.TableTierDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentTiersFlagName := fmt.Sprintf("%v.segmentTiers", cmdPrefix) + if cmd.Flags().Changed(segmentTiersFlagName) { + // warning: segmentTiers map type map[string]map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableTierDetailsTableNameFlags(depth int, m *models.TableTierDetails, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tableNameFlagName := fmt.Sprintf("%v.tableName", cmdPrefix) + if cmd.Flags().Changed(tableNameFlagName) { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/table_view_model.go b/src/cli/table_view_model.go new file mode 100644 index 0000000..1a79312 --- /dev/null +++ b/src/cli/table_view_model.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TableView + +// register flags to command +func registerModelTableViewFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableViewOFFLINE(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableViewREALTIME(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableViewOFFLINE(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: OFFLINE map[string]map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableViewREALTIME(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: REALTIME map[string]map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableViewFlags(depth int, m *models.TableView, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, oFFLINEAdded := retrieveTableViewOFFLINEFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || oFFLINEAdded + + err, rEALTIMEAdded := retrieveTableViewREALTIMEFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || rEALTIMEAdded + + return nil, retAdded +} + +func retrieveTableViewOFFLINEFlags(depth int, m *models.TableView, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + oFFLINEFlagName := fmt.Sprintf("%v.OFFLINE", cmdPrefix) + if cmd.Flags().Changed(oFFLINEFlagName) { + // warning: OFFLINE map type map[string]map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableViewREALTIMEFlags(depth int, m *models.TableView, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + rEALTIMEFlagName := fmt.Sprintf("%v.REALTIME", cmdPrefix) + if cmd.Flags().Changed(rEALTIMEFlagName) { + // warning: REALTIME map type map[string]map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/table_write_config_model.go b/src/cli/table_write_config_model.go new file mode 100644 index 0000000..dc6bd7a --- /dev/null +++ b/src/cli/table_write_config_model.go @@ -0,0 +1,307 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TableWriteConfig + +// register flags to command +func registerModelTableWriteConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTableWriteConfigEncoderClass(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableWriteConfigEncoderConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableWriteConfigPartitionColumns(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableWriteConfigProducerConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableWriteConfigProducerType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTableWriteConfigTopic(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTableWriteConfigEncoderClass(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + encoderClassDescription := `` + + var encoderClassFlagName string + if cmdPrefix == "" { + encoderClassFlagName = "encoderClass" + } else { + encoderClassFlagName = fmt.Sprintf("%v.encoderClass", cmdPrefix) + } + + var encoderClassFlagDefault string + + _ = cmd.PersistentFlags().String(encoderClassFlagName, encoderClassFlagDefault, encoderClassDescription) + + return nil +} + +func registerTableWriteConfigEncoderConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: encoderConfig map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableWriteConfigPartitionColumns(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: partitionColumns []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTableWriteConfigProducerConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: producerConfig map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerTableWriteConfigProducerType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + producerTypeDescription := `` + + var producerTypeFlagName string + if cmdPrefix == "" { + producerTypeFlagName = "producerType" + } else { + producerTypeFlagName = fmt.Sprintf("%v.producerType", cmdPrefix) + } + + var producerTypeFlagDefault string + + _ = cmd.PersistentFlags().String(producerTypeFlagName, producerTypeFlagDefault, producerTypeDescription) + + return nil +} + +func registerTableWriteConfigTopic(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + topicDescription := `` + + var topicFlagName string + if cmdPrefix == "" { + topicFlagName = "topic" + } else { + topicFlagName = fmt.Sprintf("%v.topic", cmdPrefix) + } + + var topicFlagDefault string + + _ = cmd.PersistentFlags().String(topicFlagName, topicFlagDefault, topicDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTableWriteConfigFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, encoderClassAdded := retrieveTableWriteConfigEncoderClassFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || encoderClassAdded + + err, encoderConfigAdded := retrieveTableWriteConfigEncoderConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || encoderConfigAdded + + err, partitionColumnsAdded := retrieveTableWriteConfigPartitionColumnsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partitionColumnsAdded + + err, producerConfigAdded := retrieveTableWriteConfigProducerConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || producerConfigAdded + + err, producerTypeAdded := retrieveTableWriteConfigProducerTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || producerTypeAdded + + err, topicAdded := retrieveTableWriteConfigTopicFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || topicAdded + + return nil, retAdded +} + +func retrieveTableWriteConfigEncoderClassFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + encoderClassFlagName := fmt.Sprintf("%v.encoderClass", cmdPrefix) + if cmd.Flags().Changed(encoderClassFlagName) { + + var encoderClassFlagName string + if cmdPrefix == "" { + encoderClassFlagName = "encoderClass" + } else { + encoderClassFlagName = fmt.Sprintf("%v.encoderClass", cmdPrefix) + } + + encoderClassFlagValue, err := cmd.Flags().GetString(encoderClassFlagName) + if err != nil { + return err, false + } + m.EncoderClass = encoderClassFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableWriteConfigEncoderConfigFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + encoderConfigFlagName := fmt.Sprintf("%v.encoderConfig", cmdPrefix) + if cmd.Flags().Changed(encoderConfigFlagName) { + // warning: encoderConfig map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableWriteConfigPartitionColumnsFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partitionColumnsFlagName := fmt.Sprintf("%v.partitionColumns", cmdPrefix) + if cmd.Flags().Changed(partitionColumnsFlagName) { + // warning: partitionColumns array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableWriteConfigProducerConfigFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + producerConfigFlagName := fmt.Sprintf("%v.producerConfig", cmdPrefix) + if cmd.Flags().Changed(producerConfigFlagName) { + // warning: producerConfig map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTableWriteConfigProducerTypeFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + producerTypeFlagName := fmt.Sprintf("%v.producerType", cmdPrefix) + if cmd.Flags().Changed(producerTypeFlagName) { + + var producerTypeFlagName string + if cmdPrefix == "" { + producerTypeFlagName = "producerType" + } else { + producerTypeFlagName = fmt.Sprintf("%v.producerType", cmdPrefix) + } + + producerTypeFlagValue, err := cmd.Flags().GetString(producerTypeFlagName) + if err != nil { + return err, false + } + m.ProducerType = producerTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTableWriteConfigTopicFlags(depth int, m *models.TableWriteConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + topicFlagName := fmt.Sprintf("%v.topic", cmdPrefix) + if cmd.Flags().Changed(topicFlagName) { + + var topicFlagName string + if cmdPrefix == "" { + topicFlagName = "topic" + } else { + topicFlagName = fmt.Sprintf("%v.topic", cmdPrefix) + } + + topicFlagValue, err := cmd.Flags().GetString(topicFlagName) + if err != nil { + return err, false + } + m.Topic = topicFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/tag_override_config_model.go b/src/cli/tag_override_config_model.go new file mode 100644 index 0000000..9148d16 --- /dev/null +++ b/src/cli/tag_override_config_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TagOverrideConfig + +// register flags to command +func registerModelTagOverrideConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTagOverrideConfigRealtimeCompleted(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTagOverrideConfigRealtimeConsuming(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTagOverrideConfigRealtimeCompleted(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + realtimeCompletedDescription := `` + + var realtimeCompletedFlagName string + if cmdPrefix == "" { + realtimeCompletedFlagName = "realtimeCompleted" + } else { + realtimeCompletedFlagName = fmt.Sprintf("%v.realtimeCompleted", cmdPrefix) + } + + var realtimeCompletedFlagDefault string + + _ = cmd.PersistentFlags().String(realtimeCompletedFlagName, realtimeCompletedFlagDefault, realtimeCompletedDescription) + + return nil +} + +func registerTagOverrideConfigRealtimeConsuming(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + realtimeConsumingDescription := `` + + var realtimeConsumingFlagName string + if cmdPrefix == "" { + realtimeConsumingFlagName = "realtimeConsuming" + } else { + realtimeConsumingFlagName = fmt.Sprintf("%v.realtimeConsuming", cmdPrefix) + } + + var realtimeConsumingFlagDefault string + + _ = cmd.PersistentFlags().String(realtimeConsumingFlagName, realtimeConsumingFlagDefault, realtimeConsumingDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTagOverrideConfigFlags(depth int, m *models.TagOverrideConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, realtimeCompletedAdded := retrieveTagOverrideConfigRealtimeCompletedFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || realtimeCompletedAdded + + err, realtimeConsumingAdded := retrieveTagOverrideConfigRealtimeConsumingFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || realtimeConsumingAdded + + return nil, retAdded +} + +func retrieveTagOverrideConfigRealtimeCompletedFlags(depth int, m *models.TagOverrideConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + realtimeCompletedFlagName := fmt.Sprintf("%v.realtimeCompleted", cmdPrefix) + if cmd.Flags().Changed(realtimeCompletedFlagName) { + + var realtimeCompletedFlagName string + if cmdPrefix == "" { + realtimeCompletedFlagName = "realtimeCompleted" + } else { + realtimeCompletedFlagName = fmt.Sprintf("%v.realtimeCompleted", cmdPrefix) + } + + realtimeCompletedFlagValue, err := cmd.Flags().GetString(realtimeCompletedFlagName) + if err != nil { + return err, false + } + m.RealtimeCompleted = realtimeCompletedFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTagOverrideConfigRealtimeConsumingFlags(depth int, m *models.TagOverrideConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + realtimeConsumingFlagName := fmt.Sprintf("%v.realtimeConsuming", cmdPrefix) + if cmd.Flags().Changed(realtimeConsumingFlagName) { + + var realtimeConsumingFlagName string + if cmdPrefix == "" { + realtimeConsumingFlagName = "realtimeConsuming" + } else { + realtimeConsumingFlagName = fmt.Sprintf("%v.realtimeConsuming", cmdPrefix) + } + + realtimeConsumingFlagValue, err := cmd.Flags().GetString(realtimeConsumingFlagName) + if err != nil { + return err, false + } + m.RealtimeConsuming = realtimeConsumingFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/task_count_model.go b/src/cli/task_count_model.go new file mode 100644 index 0000000..09ccfbf --- /dev/null +++ b/src/cli/task_count_model.go @@ -0,0 +1,382 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TaskCount + +// register flags to command +func registerModelTaskCountFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTaskCountCompleted(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskCountError(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskCountRunning(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskCountTotal(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskCountUnknown(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskCountWaiting(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTaskCountCompleted(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + completedDescription := `` + + var completedFlagName string + if cmdPrefix == "" { + completedFlagName = "completed" + } else { + completedFlagName = fmt.Sprintf("%v.completed", cmdPrefix) + } + + var completedFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(completedFlagName, completedFlagDefault, completedDescription) + + return nil +} + +func registerTaskCountError(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + errorDescription := `` + + var errorFlagName string + if cmdPrefix == "" { + errorFlagName = "error" + } else { + errorFlagName = fmt.Sprintf("%v.error", cmdPrefix) + } + + var errorFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(errorFlagName, errorFlagDefault, errorDescription) + + return nil +} + +func registerTaskCountRunning(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + runningDescription := `` + + var runningFlagName string + if cmdPrefix == "" { + runningFlagName = "running" + } else { + runningFlagName = fmt.Sprintf("%v.running", cmdPrefix) + } + + var runningFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(runningFlagName, runningFlagDefault, runningDescription) + + return nil +} + +func registerTaskCountTotal(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + totalDescription := `` + + var totalFlagName string + if cmdPrefix == "" { + totalFlagName = "total" + } else { + totalFlagName = fmt.Sprintf("%v.total", cmdPrefix) + } + + var totalFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(totalFlagName, totalFlagDefault, totalDescription) + + return nil +} + +func registerTaskCountUnknown(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + unknownDescription := `` + + var unknownFlagName string + if cmdPrefix == "" { + unknownFlagName = "unknown" + } else { + unknownFlagName = fmt.Sprintf("%v.unknown", cmdPrefix) + } + + var unknownFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(unknownFlagName, unknownFlagDefault, unknownDescription) + + return nil +} + +func registerTaskCountWaiting(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + waitingDescription := `` + + var waitingFlagName string + if cmdPrefix == "" { + waitingFlagName = "waiting" + } else { + waitingFlagName = fmt.Sprintf("%v.waiting", cmdPrefix) + } + + var waitingFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(waitingFlagName, waitingFlagDefault, waitingDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTaskCountFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, completedAdded := retrieveTaskCountCompletedFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || completedAdded + + err, errorAdded := retrieveTaskCountErrorFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || errorAdded + + err, runningAdded := retrieveTaskCountRunningFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || runningAdded + + err, totalAdded := retrieveTaskCountTotalFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || totalAdded + + err, unknownAdded := retrieveTaskCountUnknownFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || unknownAdded + + err, waitingAdded := retrieveTaskCountWaitingFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || waitingAdded + + return nil, retAdded +} + +func retrieveTaskCountCompletedFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + completedFlagName := fmt.Sprintf("%v.completed", cmdPrefix) + if cmd.Flags().Changed(completedFlagName) { + + var completedFlagName string + if cmdPrefix == "" { + completedFlagName = "completed" + } else { + completedFlagName = fmt.Sprintf("%v.completed", cmdPrefix) + } + + completedFlagValue, err := cmd.Flags().GetInt32(completedFlagName) + if err != nil { + return err, false + } + m.Completed = completedFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskCountErrorFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + errorFlagName := fmt.Sprintf("%v.error", cmdPrefix) + if cmd.Flags().Changed(errorFlagName) { + + var errorFlagName string + if cmdPrefix == "" { + errorFlagName = "error" + } else { + errorFlagName = fmt.Sprintf("%v.error", cmdPrefix) + } + + errorFlagValue, err := cmd.Flags().GetInt32(errorFlagName) + if err != nil { + return err, false + } + m.Error = errorFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskCountRunningFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + runningFlagName := fmt.Sprintf("%v.running", cmdPrefix) + if cmd.Flags().Changed(runningFlagName) { + + var runningFlagName string + if cmdPrefix == "" { + runningFlagName = "running" + } else { + runningFlagName = fmt.Sprintf("%v.running", cmdPrefix) + } + + runningFlagValue, err := cmd.Flags().GetInt32(runningFlagName) + if err != nil { + return err, false + } + m.Running = runningFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskCountTotalFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + totalFlagName := fmt.Sprintf("%v.total", cmdPrefix) + if cmd.Flags().Changed(totalFlagName) { + + var totalFlagName string + if cmdPrefix == "" { + totalFlagName = "total" + } else { + totalFlagName = fmt.Sprintf("%v.total", cmdPrefix) + } + + totalFlagValue, err := cmd.Flags().GetInt32(totalFlagName) + if err != nil { + return err, false + } + m.Total = totalFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskCountUnknownFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + unknownFlagName := fmt.Sprintf("%v.unknown", cmdPrefix) + if cmd.Flags().Changed(unknownFlagName) { + + var unknownFlagName string + if cmdPrefix == "" { + unknownFlagName = "unknown" + } else { + unknownFlagName = fmt.Sprintf("%v.unknown", cmdPrefix) + } + + unknownFlagValue, err := cmd.Flags().GetInt32(unknownFlagName) + if err != nil { + return err, false + } + m.Unknown = unknownFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskCountWaitingFlags(depth int, m *models.TaskCount, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + waitingFlagName := fmt.Sprintf("%v.waiting", cmdPrefix) + if cmd.Flags().Changed(waitingFlagName) { + + var waitingFlagName string + if cmdPrefix == "" { + waitingFlagName = "waiting" + } else { + waitingFlagName = fmt.Sprintf("%v.waiting", cmdPrefix) + } + + waitingFlagValue, err := cmd.Flags().GetInt32(waitingFlagName) + if err != nil { + return err, false + } + m.Waiting = waitingFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/task_debug_info_model.go b/src/cli/task_debug_info_model.go new file mode 100644 index 0000000..99c7c1f --- /dev/null +++ b/src/cli/task_debug_info_model.go @@ -0,0 +1,368 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for TaskDebugInfo + +// register flags to command +func registerModelTaskDebugInfoFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTaskDebugInfoExecutionStartTime(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskDebugInfoFinishTime(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskDebugInfoStartTime(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskDebugInfoSubtaskCount(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskDebugInfoSubtaskInfos(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTaskDebugInfoTaskState(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTaskDebugInfoExecutionStartTime(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + executionStartTimeDescription := `` + + var executionStartTimeFlagName string + if cmdPrefix == "" { + executionStartTimeFlagName = "executionStartTime" + } else { + executionStartTimeFlagName = fmt.Sprintf("%v.executionStartTime", cmdPrefix) + } + + var executionStartTimeFlagDefault string + + _ = cmd.PersistentFlags().String(executionStartTimeFlagName, executionStartTimeFlagDefault, executionStartTimeDescription) + + return nil +} + +func registerTaskDebugInfoFinishTime(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + finishTimeDescription := `` + + var finishTimeFlagName string + if cmdPrefix == "" { + finishTimeFlagName = "finishTime" + } else { + finishTimeFlagName = fmt.Sprintf("%v.finishTime", cmdPrefix) + } + + var finishTimeFlagDefault string + + _ = cmd.PersistentFlags().String(finishTimeFlagName, finishTimeFlagDefault, finishTimeDescription) + + return nil +} + +func registerTaskDebugInfoStartTime(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + startTimeDescription := `` + + var startTimeFlagName string + if cmdPrefix == "" { + startTimeFlagName = "startTime" + } else { + startTimeFlagName = fmt.Sprintf("%v.startTime", cmdPrefix) + } + + var startTimeFlagDefault string + + _ = cmd.PersistentFlags().String(startTimeFlagName, startTimeFlagDefault, startTimeDescription) + + return nil +} + +func registerTaskDebugInfoSubtaskCount(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var subtaskCountFlagName string + if cmdPrefix == "" { + subtaskCountFlagName = "subtaskCount" + } else { + subtaskCountFlagName = fmt.Sprintf("%v.subtaskCount", cmdPrefix) + } + + if err := registerModelTaskCountFlags(depth+1, subtaskCountFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTaskDebugInfoSubtaskInfos(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: subtaskInfos []*SubtaskDebugInfo array type is not supported by go-swagger cli yet + + return nil +} + +func registerTaskDebugInfoTaskState(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + taskStateDescription := `Enum: ["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]. ` + + var taskStateFlagName string + if cmdPrefix == "" { + taskStateFlagName = "taskState" + } else { + taskStateFlagName = fmt.Sprintf("%v.taskState", cmdPrefix) + } + + var taskStateFlagDefault string + + _ = cmd.PersistentFlags().String(taskStateFlagName, taskStateFlagDefault, taskStateDescription) + + if err := cmd.RegisterFlagCompletionFunc(taskStateFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTaskDebugInfoFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, executionStartTimeAdded := retrieveTaskDebugInfoExecutionStartTimeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || executionStartTimeAdded + + err, finishTimeAdded := retrieveTaskDebugInfoFinishTimeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || finishTimeAdded + + err, startTimeAdded := retrieveTaskDebugInfoStartTimeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || startTimeAdded + + err, subtaskCountAdded := retrieveTaskDebugInfoSubtaskCountFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || subtaskCountAdded + + err, subtaskInfosAdded := retrieveTaskDebugInfoSubtaskInfosFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || subtaskInfosAdded + + err, taskStateAdded := retrieveTaskDebugInfoTaskStateFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || taskStateAdded + + return nil, retAdded +} + +func retrieveTaskDebugInfoExecutionStartTimeFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + executionStartTimeFlagName := fmt.Sprintf("%v.executionStartTime", cmdPrefix) + if cmd.Flags().Changed(executionStartTimeFlagName) { + + var executionStartTimeFlagName string + if cmdPrefix == "" { + executionStartTimeFlagName = "executionStartTime" + } else { + executionStartTimeFlagName = fmt.Sprintf("%v.executionStartTime", cmdPrefix) + } + + executionStartTimeFlagValue, err := cmd.Flags().GetString(executionStartTimeFlagName) + if err != nil { + return err, false + } + m.ExecutionStartTime = executionStartTimeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskDebugInfoFinishTimeFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + finishTimeFlagName := fmt.Sprintf("%v.finishTime", cmdPrefix) + if cmd.Flags().Changed(finishTimeFlagName) { + + var finishTimeFlagName string + if cmdPrefix == "" { + finishTimeFlagName = "finishTime" + } else { + finishTimeFlagName = fmt.Sprintf("%v.finishTime", cmdPrefix) + } + + finishTimeFlagValue, err := cmd.Flags().GetString(finishTimeFlagName) + if err != nil { + return err, false + } + m.FinishTime = finishTimeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskDebugInfoStartTimeFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + startTimeFlagName := fmt.Sprintf("%v.startTime", cmdPrefix) + if cmd.Flags().Changed(startTimeFlagName) { + + var startTimeFlagName string + if cmdPrefix == "" { + startTimeFlagName = "startTime" + } else { + startTimeFlagName = fmt.Sprintf("%v.startTime", cmdPrefix) + } + + startTimeFlagValue, err := cmd.Flags().GetString(startTimeFlagName) + if err != nil { + return err, false + } + m.StartTime = startTimeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTaskDebugInfoSubtaskCountFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + subtaskCountFlagName := fmt.Sprintf("%v.subtaskCount", cmdPrefix) + if cmd.Flags().Changed(subtaskCountFlagName) { + // info: complex object subtaskCount TaskCount is retrieved outside this Changed() block + } + subtaskCountFlagValue := m.SubtaskCount + if swag.IsZero(subtaskCountFlagValue) { + subtaskCountFlagValue = &models.TaskCount{} + } + + err, subtaskCountAdded := retrieveModelTaskCountFlags(depth+1, subtaskCountFlagValue, subtaskCountFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || subtaskCountAdded + if subtaskCountAdded { + m.SubtaskCount = subtaskCountFlagValue + } + + return nil, retAdded +} + +func retrieveTaskDebugInfoSubtaskInfosFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + subtaskInfosFlagName := fmt.Sprintf("%v.subtaskInfos", cmdPrefix) + if cmd.Flags().Changed(subtaskInfosFlagName) { + // warning: subtaskInfos array type []*SubtaskDebugInfo is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTaskDebugInfoTaskStateFlags(depth int, m *models.TaskDebugInfo, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + taskStateFlagName := fmt.Sprintf("%v.taskState", cmdPrefix) + if cmd.Flags().Changed(taskStateFlagName) { + + var taskStateFlagName string + if cmdPrefix == "" { + taskStateFlagName = "taskState" + } else { + taskStateFlagName = fmt.Sprintf("%v.taskState", cmdPrefix) + } + + taskStateFlagValue, err := cmd.Flags().GetString(taskStateFlagName) + if err != nil { + return err, false + } + m.TaskState = taskStateFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/tenant_config_model.go b/src/cli/tenant_config_model.go new file mode 100644 index 0000000..5e50d98 --- /dev/null +++ b/src/cli/tenant_config_model.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for TenantConfig + +// register flags to command +func registerModelTenantConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTenantConfigBroker(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantConfigServer(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantConfigTagOverrideConfig(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTenantConfigBroker(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + brokerDescription := `` + + var brokerFlagName string + if cmdPrefix == "" { + brokerFlagName = "broker" + } else { + brokerFlagName = fmt.Sprintf("%v.broker", cmdPrefix) + } + + var brokerFlagDefault string + + _ = cmd.PersistentFlags().String(brokerFlagName, brokerFlagDefault, brokerDescription) + + return nil +} + +func registerTenantConfigServer(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + serverDescription := `` + + var serverFlagName string + if cmdPrefix == "" { + serverFlagName = "server" + } else { + serverFlagName = fmt.Sprintf("%v.server", cmdPrefix) + } + + var serverFlagDefault string + + _ = cmd.PersistentFlags().String(serverFlagName, serverFlagDefault, serverDescription) + + return nil +} + +func registerTenantConfigTagOverrideConfig(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var tagOverrideConfigFlagName string + if cmdPrefix == "" { + tagOverrideConfigFlagName = "tagOverrideConfig" + } else { + tagOverrideConfigFlagName = fmt.Sprintf("%v.tagOverrideConfig", cmdPrefix) + } + + if err := registerModelTagOverrideConfigFlags(depth+1, tagOverrideConfigFlagName, cmd); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTenantConfigFlags(depth int, m *models.TenantConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, brokerAdded := retrieveTenantConfigBrokerFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || brokerAdded + + err, serverAdded := retrieveTenantConfigServerFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || serverAdded + + err, tagOverrideConfigAdded := retrieveTenantConfigTagOverrideConfigFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tagOverrideConfigAdded + + return nil, retAdded +} + +func retrieveTenantConfigBrokerFlags(depth int, m *models.TenantConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + brokerFlagName := fmt.Sprintf("%v.broker", cmdPrefix) + if cmd.Flags().Changed(brokerFlagName) { + + var brokerFlagName string + if cmdPrefix == "" { + brokerFlagName = "broker" + } else { + brokerFlagName = fmt.Sprintf("%v.broker", cmdPrefix) + } + + brokerFlagValue, err := cmd.Flags().GetString(brokerFlagName) + if err != nil { + return err, false + } + m.Broker = brokerFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTenantConfigServerFlags(depth int, m *models.TenantConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + serverFlagName := fmt.Sprintf("%v.server", cmdPrefix) + if cmd.Flags().Changed(serverFlagName) { + + var serverFlagName string + if cmdPrefix == "" { + serverFlagName = "server" + } else { + serverFlagName = fmt.Sprintf("%v.server", cmdPrefix) + } + + serverFlagValue, err := cmd.Flags().GetString(serverFlagName) + if err != nil { + return err, false + } + m.Server = serverFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTenantConfigTagOverrideConfigFlags(depth int, m *models.TenantConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tagOverrideConfigFlagName := fmt.Sprintf("%v.tagOverrideConfig", cmdPrefix) + if cmd.Flags().Changed(tagOverrideConfigFlagName) { + // info: complex object tagOverrideConfig TagOverrideConfig is retrieved outside this Changed() block + } + tagOverrideConfigFlagValue := m.TagOverrideConfig + if swag.IsZero(tagOverrideConfigFlagValue) { + tagOverrideConfigFlagValue = &models.TagOverrideConfig{} + } + + err, tagOverrideConfigAdded := retrieveModelTagOverrideConfigFlags(depth+1, tagOverrideConfigFlagValue, tagOverrideConfigFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tagOverrideConfigAdded + if tagOverrideConfigAdded { + m.TagOverrideConfig = tagOverrideConfigFlagValue + } + + return nil, retAdded +} diff --git a/src/cli/tenant_metadata_model.go b/src/cli/tenant_metadata_model.go new file mode 100644 index 0000000..cf56be4 --- /dev/null +++ b/src/cli/tenant_metadata_model.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TenantMetadata + +// register flags to command +func registerModelTenantMetadataFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTenantMetadataBrokerInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantMetadataOfflineServerInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantMetadataRealtimeServerInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantMetadataServerInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantMetadataTenantName(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTenantMetadataBrokerInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: BrokerInstances []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTenantMetadataOfflineServerInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: OfflineServerInstances []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTenantMetadataRealtimeServerInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: RealtimeServerInstances []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTenantMetadataServerInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: ServerInstances []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTenantMetadataTenantName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tenantNameDescription := `` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTenantMetadataFlags(depth int, m *models.TenantMetadata, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, brokerInstancesAdded := retrieveTenantMetadataBrokerInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || brokerInstancesAdded + + err, offlineServerInstancesAdded := retrieveTenantMetadataOfflineServerInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || offlineServerInstancesAdded + + err, realtimeServerInstancesAdded := retrieveTenantMetadataRealtimeServerInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || realtimeServerInstancesAdded + + err, serverInstancesAdded := retrieveTenantMetadataServerInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || serverInstancesAdded + + err, tenantNameAdded := retrieveTenantMetadataTenantNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tenantNameAdded + + return nil, retAdded +} + +func retrieveTenantMetadataBrokerInstancesFlags(depth int, m *models.TenantMetadata, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + brokerInstancesFlagName := fmt.Sprintf("%v.BrokerInstances", cmdPrefix) + if cmd.Flags().Changed(brokerInstancesFlagName) { + // warning: BrokerInstances array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTenantMetadataOfflineServerInstancesFlags(depth int, m *models.TenantMetadata, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + offlineServerInstancesFlagName := fmt.Sprintf("%v.OfflineServerInstances", cmdPrefix) + if cmd.Flags().Changed(offlineServerInstancesFlagName) { + // warning: OfflineServerInstances array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTenantMetadataRealtimeServerInstancesFlags(depth int, m *models.TenantMetadata, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + realtimeServerInstancesFlagName := fmt.Sprintf("%v.RealtimeServerInstances", cmdPrefix) + if cmd.Flags().Changed(realtimeServerInstancesFlagName) { + // warning: RealtimeServerInstances array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTenantMetadataServerInstancesFlags(depth int, m *models.TenantMetadata, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + serverInstancesFlagName := fmt.Sprintf("%v.ServerInstances", cmdPrefix) + if cmd.Flags().Changed(serverInstancesFlagName) { + // warning: ServerInstances array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTenantMetadataTenantNameFlags(depth int, m *models.TenantMetadata, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tenantNameFlagName := fmt.Sprintf("%v.tenantName", cmdPrefix) + if cmd.Flags().Changed(tenantNameFlagName) { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/tenant_model.go b/src/cli/tenant_model.go new file mode 100644 index 0000000..dcee7f3 --- /dev/null +++ b/src/cli/tenant_model.go @@ -0,0 +1,335 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for Tenant + +// register flags to command +func registerModelTenantFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTenantNumberOfInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantOfflineInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantRealtimeInstances(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantTenantName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantTenantRole(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTenantNumberOfInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + numberOfInstancesDescription := `` + + var numberOfInstancesFlagName string + if cmdPrefix == "" { + numberOfInstancesFlagName = "numberOfInstances" + } else { + numberOfInstancesFlagName = fmt.Sprintf("%v.numberOfInstances", cmdPrefix) + } + + var numberOfInstancesFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(numberOfInstancesFlagName, numberOfInstancesFlagDefault, numberOfInstancesDescription) + + return nil +} + +func registerTenantOfflineInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + offlineInstancesDescription := `` + + var offlineInstancesFlagName string + if cmdPrefix == "" { + offlineInstancesFlagName = "offlineInstances" + } else { + offlineInstancesFlagName = fmt.Sprintf("%v.offlineInstances", cmdPrefix) + } + + var offlineInstancesFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(offlineInstancesFlagName, offlineInstancesFlagDefault, offlineInstancesDescription) + + return nil +} + +func registerTenantRealtimeInstances(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + realtimeInstancesDescription := `` + + var realtimeInstancesFlagName string + if cmdPrefix == "" { + realtimeInstancesFlagName = "realtimeInstances" + } else { + realtimeInstancesFlagName = fmt.Sprintf("%v.realtimeInstances", cmdPrefix) + } + + var realtimeInstancesFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(realtimeInstancesFlagName, realtimeInstancesFlagDefault, realtimeInstancesDescription) + + return nil +} + +func registerTenantTenantName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tenantNameDescription := `Required. ` + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + var tenantNameFlagDefault string + + _ = cmd.PersistentFlags().String(tenantNameFlagName, tenantNameFlagDefault, tenantNameDescription) + + return nil +} + +func registerTenantTenantRole(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tenantRoleDescription := `Enum: ["SERVER","BROKER","MINION"]. Required. ` + + var tenantRoleFlagName string + if cmdPrefix == "" { + tenantRoleFlagName = "tenantRole" + } else { + tenantRoleFlagName = fmt.Sprintf("%v.tenantRole", cmdPrefix) + } + + var tenantRoleFlagDefault string + + _ = cmd.PersistentFlags().String(tenantRoleFlagName, tenantRoleFlagDefault, tenantRoleDescription) + + if err := cmd.RegisterFlagCompletionFunc(tenantRoleFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["SERVER","BROKER","MINION"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTenantFlags(depth int, m *models.Tenant, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, numberOfInstancesAdded := retrieveTenantNumberOfInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || numberOfInstancesAdded + + err, offlineInstancesAdded := retrieveTenantOfflineInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || offlineInstancesAdded + + err, realtimeInstancesAdded := retrieveTenantRealtimeInstancesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || realtimeInstancesAdded + + err, tenantNameAdded := retrieveTenantTenantNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tenantNameAdded + + err, tenantRoleAdded := retrieveTenantTenantRoleFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tenantRoleAdded + + return nil, retAdded +} + +func retrieveTenantNumberOfInstancesFlags(depth int, m *models.Tenant, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + numberOfInstancesFlagName := fmt.Sprintf("%v.numberOfInstances", cmdPrefix) + if cmd.Flags().Changed(numberOfInstancesFlagName) { + + var numberOfInstancesFlagName string + if cmdPrefix == "" { + numberOfInstancesFlagName = "numberOfInstances" + } else { + numberOfInstancesFlagName = fmt.Sprintf("%v.numberOfInstances", cmdPrefix) + } + + numberOfInstancesFlagValue, err := cmd.Flags().GetInt32(numberOfInstancesFlagName) + if err != nil { + return err, false + } + m.NumberOfInstances = numberOfInstancesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTenantOfflineInstancesFlags(depth int, m *models.Tenant, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + offlineInstancesFlagName := fmt.Sprintf("%v.offlineInstances", cmdPrefix) + if cmd.Flags().Changed(offlineInstancesFlagName) { + + var offlineInstancesFlagName string + if cmdPrefix == "" { + offlineInstancesFlagName = "offlineInstances" + } else { + offlineInstancesFlagName = fmt.Sprintf("%v.offlineInstances", cmdPrefix) + } + + offlineInstancesFlagValue, err := cmd.Flags().GetInt32(offlineInstancesFlagName) + if err != nil { + return err, false + } + m.OfflineInstances = offlineInstancesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTenantRealtimeInstancesFlags(depth int, m *models.Tenant, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + realtimeInstancesFlagName := fmt.Sprintf("%v.realtimeInstances", cmdPrefix) + if cmd.Flags().Changed(realtimeInstancesFlagName) { + + var realtimeInstancesFlagName string + if cmdPrefix == "" { + realtimeInstancesFlagName = "realtimeInstances" + } else { + realtimeInstancesFlagName = fmt.Sprintf("%v.realtimeInstances", cmdPrefix) + } + + realtimeInstancesFlagValue, err := cmd.Flags().GetInt32(realtimeInstancesFlagName) + if err != nil { + return err, false + } + m.RealtimeInstances = realtimeInstancesFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTenantTenantNameFlags(depth int, m *models.Tenant, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tenantNameFlagName := fmt.Sprintf("%v.tenantName", cmdPrefix) + if cmd.Flags().Changed(tenantNameFlagName) { + + var tenantNameFlagName string + if cmdPrefix == "" { + tenantNameFlagName = "tenantName" + } else { + tenantNameFlagName = fmt.Sprintf("%v.tenantName", cmdPrefix) + } + + tenantNameFlagValue, err := cmd.Flags().GetString(tenantNameFlagName) + if err != nil { + return err, false + } + m.TenantName = tenantNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTenantTenantRoleFlags(depth int, m *models.Tenant, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tenantRoleFlagName := fmt.Sprintf("%v.tenantRole", cmdPrefix) + if cmd.Flags().Changed(tenantRoleFlagName) { + + var tenantRoleFlagName string + if cmdPrefix == "" { + tenantRoleFlagName = "tenantRole" + } else { + tenantRoleFlagName = fmt.Sprintf("%v.tenantRole", cmdPrefix) + } + + tenantRoleFlagValue, err := cmd.Flags().GetString(tenantRoleFlagName) + if err != nil { + return err, false + } + m.TenantRole = tenantRoleFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/tenants_list_model.go b/src/cli/tenants_list_model.go new file mode 100644 index 0000000..e1b339b --- /dev/null +++ b/src/cli/tenants_list_model.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TenantsList + +// register flags to command +func registerModelTenantsListFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTenantsListBROKERTENANTS(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTenantsListSERVERTENANTS(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTenantsListBROKERTENANTS(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: BROKER_TENANTS []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTenantsListSERVERTENANTS(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: SERVER_TENANTS []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTenantsListFlags(depth int, m *models.TenantsList, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, bROKERTENANTSAdded := retrieveTenantsListBROKERTENANTSFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || bROKERTENANTSAdded + + err, sERVERTENANTSAdded := retrieveTenantsListSERVERTENANTSFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || sERVERTENANTSAdded + + return nil, retAdded +} + +func retrieveTenantsListBROKERTENANTSFlags(depth int, m *models.TenantsList, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + bROKERTENANTSFlagName := fmt.Sprintf("%v.BROKER_TENANTS", cmdPrefix) + if cmd.Flags().Changed(bROKERTENANTSFlagName) { + // warning: BROKER_TENANTS array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTenantsListSERVERTENANTSFlags(depth int, m *models.TenantsList, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + sERVERTENANTSFlagName := fmt.Sprintf("%v.SERVER_TENANTS", cmdPrefix) + if cmd.Flags().Changed(sERVERTENANTSFlagName) { + // warning: SERVER_TENANTS array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/tier_config_model.go b/src/cli/tier_config_model.go new file mode 100644 index 0000000..2d332a6 --- /dev/null +++ b/src/cli/tier_config_model.go @@ -0,0 +1,450 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TierConfig + +// register flags to command +func registerModelTierConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTierConfigName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigSegmentAge(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigSegmentList(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigSegmentSelectorType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigServerTag(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigStorageType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigTierBackend(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTierConfigTierBackendProperties(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTierConfigName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `Required. ` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerTierConfigSegmentAge(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentAgeDescription := `` + + var segmentAgeFlagName string + if cmdPrefix == "" { + segmentAgeFlagName = "segmentAge" + } else { + segmentAgeFlagName = fmt.Sprintf("%v.segmentAge", cmdPrefix) + } + + var segmentAgeFlagDefault string + + _ = cmd.PersistentFlags().String(segmentAgeFlagName, segmentAgeFlagDefault, segmentAgeDescription) + + return nil +} + +func registerTierConfigSegmentList(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: segmentList []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerTierConfigSegmentSelectorType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + segmentSelectorTypeDescription := `Required. ` + + var segmentSelectorTypeFlagName string + if cmdPrefix == "" { + segmentSelectorTypeFlagName = "segmentSelectorType" + } else { + segmentSelectorTypeFlagName = fmt.Sprintf("%v.segmentSelectorType", cmdPrefix) + } + + var segmentSelectorTypeFlagDefault string + + _ = cmd.PersistentFlags().String(segmentSelectorTypeFlagName, segmentSelectorTypeFlagDefault, segmentSelectorTypeDescription) + + return nil +} + +func registerTierConfigServerTag(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + serverTagDescription := `` + + var serverTagFlagName string + if cmdPrefix == "" { + serverTagFlagName = "serverTag" + } else { + serverTagFlagName = fmt.Sprintf("%v.serverTag", cmdPrefix) + } + + var serverTagFlagDefault string + + _ = cmd.PersistentFlags().String(serverTagFlagName, serverTagFlagDefault, serverTagDescription) + + return nil +} + +func registerTierConfigStorageType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + storageTypeDescription := `Required. ` + + var storageTypeFlagName string + if cmdPrefix == "" { + storageTypeFlagName = "storageType" + } else { + storageTypeFlagName = fmt.Sprintf("%v.storageType", cmdPrefix) + } + + var storageTypeFlagDefault string + + _ = cmd.PersistentFlags().String(storageTypeFlagName, storageTypeFlagDefault, storageTypeDescription) + + return nil +} + +func registerTierConfigTierBackend(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + tierBackendDescription := `` + + var tierBackendFlagName string + if cmdPrefix == "" { + tierBackendFlagName = "tierBackend" + } else { + tierBackendFlagName = fmt.Sprintf("%v.tierBackend", cmdPrefix) + } + + var tierBackendFlagDefault string + + _ = cmd.PersistentFlags().String(tierBackendFlagName, tierBackendFlagDefault, tierBackendDescription) + + return nil +} + +func registerTierConfigTierBackendProperties(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tierBackendProperties map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTierConfigFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, nameAdded := retrieveTierConfigNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, segmentAgeAdded := retrieveTierConfigSegmentAgeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentAgeAdded + + err, segmentListAdded := retrieveTierConfigSegmentListFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentListAdded + + err, segmentSelectorTypeAdded := retrieveTierConfigSegmentSelectorTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || segmentSelectorTypeAdded + + err, serverTagAdded := retrieveTierConfigServerTagFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || serverTagAdded + + err, storageTypeAdded := retrieveTierConfigStorageTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || storageTypeAdded + + err, tierBackendAdded := retrieveTierConfigTierBackendFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tierBackendAdded + + err, tierBackendPropertiesAdded := retrieveTierConfigTierBackendPropertiesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tierBackendPropertiesAdded + + return nil, retAdded +} + +func retrieveTierConfigNameFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTierConfigSegmentAgeFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentAgeFlagName := fmt.Sprintf("%v.segmentAge", cmdPrefix) + if cmd.Flags().Changed(segmentAgeFlagName) { + + var segmentAgeFlagName string + if cmdPrefix == "" { + segmentAgeFlagName = "segmentAge" + } else { + segmentAgeFlagName = fmt.Sprintf("%v.segmentAge", cmdPrefix) + } + + segmentAgeFlagValue, err := cmd.Flags().GetString(segmentAgeFlagName) + if err != nil { + return err, false + } + m.SegmentAge = segmentAgeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTierConfigSegmentListFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentListFlagName := fmt.Sprintf("%v.segmentList", cmdPrefix) + if cmd.Flags().Changed(segmentListFlagName) { + // warning: segmentList array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTierConfigSegmentSelectorTypeFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + segmentSelectorTypeFlagName := fmt.Sprintf("%v.segmentSelectorType", cmdPrefix) + if cmd.Flags().Changed(segmentSelectorTypeFlagName) { + + var segmentSelectorTypeFlagName string + if cmdPrefix == "" { + segmentSelectorTypeFlagName = "segmentSelectorType" + } else { + segmentSelectorTypeFlagName = fmt.Sprintf("%v.segmentSelectorType", cmdPrefix) + } + + segmentSelectorTypeFlagValue, err := cmd.Flags().GetString(segmentSelectorTypeFlagName) + if err != nil { + return err, false + } + m.SegmentSelectorType = segmentSelectorTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTierConfigServerTagFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + serverTagFlagName := fmt.Sprintf("%v.serverTag", cmdPrefix) + if cmd.Flags().Changed(serverTagFlagName) { + + var serverTagFlagName string + if cmdPrefix == "" { + serverTagFlagName = "serverTag" + } else { + serverTagFlagName = fmt.Sprintf("%v.serverTag", cmdPrefix) + } + + serverTagFlagValue, err := cmd.Flags().GetString(serverTagFlagName) + if err != nil { + return err, false + } + m.ServerTag = serverTagFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTierConfigStorageTypeFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + storageTypeFlagName := fmt.Sprintf("%v.storageType", cmdPrefix) + if cmd.Flags().Changed(storageTypeFlagName) { + + var storageTypeFlagName string + if cmdPrefix == "" { + storageTypeFlagName = "storageType" + } else { + storageTypeFlagName = fmt.Sprintf("%v.storageType", cmdPrefix) + } + + storageTypeFlagValue, err := cmd.Flags().GetString(storageTypeFlagName) + if err != nil { + return err, false + } + m.StorageType = storageTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTierConfigTierBackendFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tierBackendFlagName := fmt.Sprintf("%v.tierBackend", cmdPrefix) + if cmd.Flags().Changed(tierBackendFlagName) { + + var tierBackendFlagName string + if cmdPrefix == "" { + tierBackendFlagName = "tierBackend" + } else { + tierBackendFlagName = fmt.Sprintf("%v.tierBackend", cmdPrefix) + } + + tierBackendFlagValue, err := cmd.Flags().GetString(tierBackendFlagName) + if err != nil { + return err, false + } + m.TierBackend = tierBackendFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTierConfigTierBackendPropertiesFlags(depth int, m *models.TierConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tierBackendPropertiesFlagName := fmt.Sprintf("%v.tierBackendProperties", cmdPrefix) + if cmd.Flags().Changed(tierBackendPropertiesFlagName) { + // warning: tierBackendProperties map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/time_field_spec_model.go b/src/cli/time_field_spec_model.go new file mode 100644 index 0000000..18a1a05 --- /dev/null +++ b/src/cli/time_field_spec_model.go @@ -0,0 +1,601 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/go-openapi/swag" + "startree.ai/cli/models" + + "github.com/spf13/cobra" +) + +// Schema cli for TimeFieldSpec + +// register flags to command +func registerModelTimeFieldSpecFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTimeFieldSpecDataType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecDefaultNullValue(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecDefaultNullValueString(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecIncomingGranularitySpec(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecMaxLength(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecOutgoingGranularitySpec(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecSingleValueField(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecTransformFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeFieldSpecVirtualColumnProvider(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTimeFieldSpecDataType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + dataTypeDescription := `Enum: ["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]. ` + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + var dataTypeFlagDefault string + + _ = cmd.PersistentFlags().String(dataTypeFlagName, dataTypeFlagDefault, dataTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(dataTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerTimeFieldSpecDefaultNullValue(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: defaultNullValue interface{} map type is not supported by go-swagger cli yet + + return nil +} + +func registerTimeFieldSpecDefaultNullValueString(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + defaultNullValueStringDescription := `` + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + var defaultNullValueStringFlagDefault string + + _ = cmd.PersistentFlags().String(defaultNullValueStringFlagName, defaultNullValueStringFlagDefault, defaultNullValueStringDescription) + + return nil +} + +func registerTimeFieldSpecIncomingGranularitySpec(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var incomingGranularitySpecFlagName string + if cmdPrefix == "" { + incomingGranularitySpecFlagName = "incomingGranularitySpec" + } else { + incomingGranularitySpecFlagName = fmt.Sprintf("%v.incomingGranularitySpec", cmdPrefix) + } + + if err := registerModelTimeGranularitySpecFlags(depth+1, incomingGranularitySpecFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTimeFieldSpecMaxLength(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + maxLengthDescription := `` + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + var maxLengthFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(maxLengthFlagName, maxLengthFlagDefault, maxLengthDescription) + + return nil +} + +func registerTimeFieldSpecName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerTimeFieldSpecOutgoingGranularitySpec(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + var outgoingGranularitySpecFlagName string + if cmdPrefix == "" { + outgoingGranularitySpecFlagName = "outgoingGranularitySpec" + } else { + outgoingGranularitySpecFlagName = fmt.Sprintf("%v.outgoingGranularitySpec", cmdPrefix) + } + + if err := registerModelTimeGranularitySpecFlags(depth+1, outgoingGranularitySpecFlagName, cmd); err != nil { + return err + } + + return nil +} + +func registerTimeFieldSpecSingleValueField(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + singleValueFieldDescription := `` + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + var singleValueFieldFlagDefault bool + + _ = cmd.PersistentFlags().Bool(singleValueFieldFlagName, singleValueFieldFlagDefault, singleValueFieldDescription) + + return nil +} + +func registerTimeFieldSpecTransformFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + transformFunctionDescription := `` + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + var transformFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(transformFunctionFlagName, transformFunctionFlagDefault, transformFunctionDescription) + + return nil +} + +func registerTimeFieldSpecVirtualColumnProvider(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + virtualColumnProviderDescription := `` + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + var virtualColumnProviderFlagDefault string + + _ = cmd.PersistentFlags().String(virtualColumnProviderFlagName, virtualColumnProviderFlagDefault, virtualColumnProviderDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTimeFieldSpecFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dataTypeAdded := retrieveTimeFieldSpecDataTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dataTypeAdded + + err, defaultNullValueAdded := retrieveTimeFieldSpecDefaultNullValueFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueAdded + + err, defaultNullValueStringAdded := retrieveTimeFieldSpecDefaultNullValueStringFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultNullValueStringAdded + + err, incomingGranularitySpecAdded := retrieveTimeFieldSpecIncomingGranularitySpecFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || incomingGranularitySpecAdded + + err, maxLengthAdded := retrieveTimeFieldSpecMaxLengthFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || maxLengthAdded + + err, nameAdded := retrieveTimeFieldSpecNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, outgoingGranularitySpecAdded := retrieveTimeFieldSpecOutgoingGranularitySpecFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || outgoingGranularitySpecAdded + + err, singleValueFieldAdded := retrieveTimeFieldSpecSingleValueFieldFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || singleValueFieldAdded + + err, transformFunctionAdded := retrieveTimeFieldSpecTransformFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || transformFunctionAdded + + err, virtualColumnProviderAdded := retrieveTimeFieldSpecVirtualColumnProviderFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || virtualColumnProviderAdded + + return nil, retAdded +} + +func retrieveTimeFieldSpecDataTypeFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dataTypeFlagName := fmt.Sprintf("%v.dataType", cmdPrefix) + if cmd.Flags().Changed(dataTypeFlagName) { + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + dataTypeFlagValue, err := cmd.Flags().GetString(dataTypeFlagName) + if err != nil { + return err, false + } + m.DataType = dataTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecDefaultNullValueFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueFlagName := fmt.Sprintf("%v.defaultNullValue", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueFlagName) { + // warning: defaultNullValue map type interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecDefaultNullValueStringFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultNullValueStringFlagName := fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + if cmd.Flags().Changed(defaultNullValueStringFlagName) { + + var defaultNullValueStringFlagName string + if cmdPrefix == "" { + defaultNullValueStringFlagName = "defaultNullValueString" + } else { + defaultNullValueStringFlagName = fmt.Sprintf("%v.defaultNullValueString", cmdPrefix) + } + + defaultNullValueStringFlagValue, err := cmd.Flags().GetString(defaultNullValueStringFlagName) + if err != nil { + return err, false + } + m.DefaultNullValueString = defaultNullValueStringFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecIncomingGranularitySpecFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + incomingGranularitySpecFlagName := fmt.Sprintf("%v.incomingGranularitySpec", cmdPrefix) + if cmd.Flags().Changed(incomingGranularitySpecFlagName) { + // info: complex object incomingGranularitySpec TimeGranularitySpec is retrieved outside this Changed() block + } + incomingGranularitySpecFlagValue := m.IncomingGranularitySpec + if swag.IsZero(incomingGranularitySpecFlagValue) { + incomingGranularitySpecFlagValue = &models.TimeGranularitySpec{} + } + + err, incomingGranularitySpecAdded := retrieveModelTimeGranularitySpecFlags(depth+1, incomingGranularitySpecFlagValue, incomingGranularitySpecFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || incomingGranularitySpecAdded + if incomingGranularitySpecAdded { + m.IncomingGranularitySpec = incomingGranularitySpecFlagValue + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecMaxLengthFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + maxLengthFlagName := fmt.Sprintf("%v.maxLength", cmdPrefix) + if cmd.Flags().Changed(maxLengthFlagName) { + + var maxLengthFlagName string + if cmdPrefix == "" { + maxLengthFlagName = "maxLength" + } else { + maxLengthFlagName = fmt.Sprintf("%v.maxLength", cmdPrefix) + } + + maxLengthFlagValue, err := cmd.Flags().GetInt32(maxLengthFlagName) + if err != nil { + return err, false + } + m.MaxLength = maxLengthFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecNameFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecOutgoingGranularitySpecFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + outgoingGranularitySpecFlagName := fmt.Sprintf("%v.outgoingGranularitySpec", cmdPrefix) + if cmd.Flags().Changed(outgoingGranularitySpecFlagName) { + // info: complex object outgoingGranularitySpec TimeGranularitySpec is retrieved outside this Changed() block + } + outgoingGranularitySpecFlagValue := m.OutgoingGranularitySpec + if swag.IsZero(outgoingGranularitySpecFlagValue) { + outgoingGranularitySpecFlagValue = &models.TimeGranularitySpec{} + } + + err, outgoingGranularitySpecAdded := retrieveModelTimeGranularitySpecFlags(depth+1, outgoingGranularitySpecFlagValue, outgoingGranularitySpecFlagName, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || outgoingGranularitySpecAdded + if outgoingGranularitySpecAdded { + m.OutgoingGranularitySpec = outgoingGranularitySpecFlagValue + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecSingleValueFieldFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + singleValueFieldFlagName := fmt.Sprintf("%v.singleValueField", cmdPrefix) + if cmd.Flags().Changed(singleValueFieldFlagName) { + + var singleValueFieldFlagName string + if cmdPrefix == "" { + singleValueFieldFlagName = "singleValueField" + } else { + singleValueFieldFlagName = fmt.Sprintf("%v.singleValueField", cmdPrefix) + } + + singleValueFieldFlagValue, err := cmd.Flags().GetBool(singleValueFieldFlagName) + if err != nil { + return err, false + } + m.SingleValueField = singleValueFieldFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecTransformFunctionFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + transformFunctionFlagName := fmt.Sprintf("%v.transformFunction", cmdPrefix) + if cmd.Flags().Changed(transformFunctionFlagName) { + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + transformFunctionFlagValue, err := cmd.Flags().GetString(transformFunctionFlagName) + if err != nil { + return err, false + } + m.TransformFunction = transformFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeFieldSpecVirtualColumnProviderFlags(depth int, m *models.TimeFieldSpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + virtualColumnProviderFlagName := fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + if cmd.Flags().Changed(virtualColumnProviderFlagName) { + + var virtualColumnProviderFlagName string + if cmdPrefix == "" { + virtualColumnProviderFlagName = "virtualColumnProvider" + } else { + virtualColumnProviderFlagName = fmt.Sprintf("%v.virtualColumnProvider", cmdPrefix) + } + + virtualColumnProviderFlagValue, err := cmd.Flags().GetString(virtualColumnProviderFlagName) + if err != nil { + return err, false + } + m.VirtualColumnProvider = virtualColumnProviderFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/time_granularity_spec_model.go b/src/cli/time_granularity_spec_model.go new file mode 100644 index 0000000..62017eb --- /dev/null +++ b/src/cli/time_granularity_spec_model.go @@ -0,0 +1,346 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TimeGranularitySpec + +// register flags to command +func registerModelTimeGranularitySpecFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTimeGranularitySpecDataType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeGranularitySpecName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeGranularitySpecTimeFormat(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeGranularitySpecTimeType(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTimeGranularitySpecTimeUnitSize(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTimeGranularitySpecDataType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + dataTypeDescription := `Enum: ["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]. ` + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + var dataTypeFlagDefault string + + _ = cmd.PersistentFlags().String(dataTypeFlagName, dataTypeFlagDefault, dataTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(dataTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerTimeGranularitySpecName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerTimeGranularitySpecTimeFormat(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeFormatDescription := `` + + var timeFormatFlagName string + if cmdPrefix == "" { + timeFormatFlagName = "timeFormat" + } else { + timeFormatFlagName = fmt.Sprintf("%v.timeFormat", cmdPrefix) + } + + var timeFormatFlagDefault string + + _ = cmd.PersistentFlags().String(timeFormatFlagName, timeFormatFlagDefault, timeFormatDescription) + + return nil +} + +func registerTimeGranularitySpecTimeType(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeTypeDescription := `Enum: ["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]. ` + + var timeTypeFlagName string + if cmdPrefix == "" { + timeTypeFlagName = "timeType" + } else { + timeTypeFlagName = fmt.Sprintf("%v.timeType", cmdPrefix) + } + + var timeTypeFlagDefault string + + _ = cmd.PersistentFlags().String(timeTypeFlagName, timeTypeFlagDefault, timeTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(timeTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerTimeGranularitySpecTimeUnitSize(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + timeUnitSizeDescription := `` + + var timeUnitSizeFlagName string + if cmdPrefix == "" { + timeUnitSizeFlagName = "timeUnitSize" + } else { + timeUnitSizeFlagName = fmt.Sprintf("%v.timeUnitSize", cmdPrefix) + } + + var timeUnitSizeFlagDefault int32 + + _ = cmd.PersistentFlags().Int32(timeUnitSizeFlagName, timeUnitSizeFlagDefault, timeUnitSizeDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTimeGranularitySpecFlags(depth int, m *models.TimeGranularitySpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, dataTypeAdded := retrieveTimeGranularitySpecDataTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || dataTypeAdded + + err, nameAdded := retrieveTimeGranularitySpecNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, timeFormatAdded := retrieveTimeGranularitySpecTimeFormatFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeFormatAdded + + err, timeTypeAdded := retrieveTimeGranularitySpecTimeTypeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeTypeAdded + + err, timeUnitSizeAdded := retrieveTimeGranularitySpecTimeUnitSizeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || timeUnitSizeAdded + + return nil, retAdded +} + +func retrieveTimeGranularitySpecDataTypeFlags(depth int, m *models.TimeGranularitySpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + dataTypeFlagName := fmt.Sprintf("%v.dataType", cmdPrefix) + if cmd.Flags().Changed(dataTypeFlagName) { + + var dataTypeFlagName string + if cmdPrefix == "" { + dataTypeFlagName = "dataType" + } else { + dataTypeFlagName = fmt.Sprintf("%v.dataType", cmdPrefix) + } + + dataTypeFlagValue, err := cmd.Flags().GetString(dataTypeFlagName) + if err != nil { + return err, false + } + m.DataType = dataTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeGranularitySpecNameFlags(depth int, m *models.TimeGranularitySpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeGranularitySpecTimeFormatFlags(depth int, m *models.TimeGranularitySpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeFormatFlagName := fmt.Sprintf("%v.timeFormat", cmdPrefix) + if cmd.Flags().Changed(timeFormatFlagName) { + + var timeFormatFlagName string + if cmdPrefix == "" { + timeFormatFlagName = "timeFormat" + } else { + timeFormatFlagName = fmt.Sprintf("%v.timeFormat", cmdPrefix) + } + + timeFormatFlagValue, err := cmd.Flags().GetString(timeFormatFlagName) + if err != nil { + return err, false + } + m.TimeFormat = timeFormatFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeGranularitySpecTimeTypeFlags(depth int, m *models.TimeGranularitySpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeTypeFlagName := fmt.Sprintf("%v.timeType", cmdPrefix) + if cmd.Flags().Changed(timeTypeFlagName) { + + var timeTypeFlagName string + if cmdPrefix == "" { + timeTypeFlagName = "timeType" + } else { + timeTypeFlagName = fmt.Sprintf("%v.timeType", cmdPrefix) + } + + timeTypeFlagValue, err := cmd.Flags().GetString(timeTypeFlagName) + if err != nil { + return err, false + } + m.TimeType = timeTypeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTimeGranularitySpecTimeUnitSizeFlags(depth int, m *models.TimeGranularitySpec, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + timeUnitSizeFlagName := fmt.Sprintf("%v.timeUnitSize", cmdPrefix) + if cmd.Flags().Changed(timeUnitSizeFlagName) { + + var timeUnitSizeFlagName string + if cmdPrefix == "" { + timeUnitSizeFlagName = "timeUnitSize" + } else { + timeUnitSizeFlagName = fmt.Sprintf("%v.timeUnitSize", cmdPrefix) + } + + timeUnitSizeFlagValue, err := cmd.Flags().GetInt32(timeUnitSizeFlagName) + if err != nil { + return err, false + } + m.TimeUnitSize = timeUnitSizeFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/timestamp_config_model.go b/src/cli/timestamp_config_model.go new file mode 100644 index 0000000..064587e --- /dev/null +++ b/src/cli/timestamp_config_model.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TimestampConfig + +// register flags to command +func registerModelTimestampConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTimestampConfigGranularities(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTimestampConfigGranularities(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: granularities []string array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTimestampConfigFlags(depth int, m *models.TimestampConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, granularitiesAdded := retrieveTimestampConfigGranularitiesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || granularitiesAdded + + return nil, retAdded +} + +func retrieveTimestampConfigGranularitiesFlags(depth int, m *models.TimestampConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + granularitiesFlagName := fmt.Sprintf("%v.granularities", cmdPrefix) + if cmd.Flags().Changed(granularitiesFlagName) { + // warning: granularities array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/toggle_instance_state_operation.go b/src/cli/toggle_instance_state_operation.go new file mode 100644 index 0000000..89c04b1 --- /dev/null +++ b/src/cli/toggle_instance_state_operation.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/instance" + + "github.com/spf13/cobra" +) + +// makeOperationInstanceToggleInstanceStateCmd returns a cmd to handle operation toggleInstanceState +func makeOperationInstanceToggleInstanceStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "toggleInstanceState", + Short: `Enable/disable/drop an instance`, + RunE: runOperationInstanceToggleInstanceState, + } + + if err := registerOperationInstanceToggleInstanceStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceToggleInstanceState uses cmd flags to call endpoint api +func runOperationInstanceToggleInstanceState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewToggleInstanceStateParams() + if err, _ := retrieveOperationInstanceToggleInstanceStateBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationInstanceToggleInstanceStateInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceToggleInstanceStateResult(appCli.Instance.ToggleInstanceState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceToggleInstanceStateParamFlags registers all flags needed to fill params +func registerOperationInstanceToggleInstanceStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceToggleInstanceStateBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationInstanceToggleInstanceStateInstanceNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceToggleInstanceStateBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationInstanceToggleInstanceStateInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func retrieveOperationInstanceToggleInstanceStateBodyFlag(m *instance.ToggleInstanceStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationInstanceToggleInstanceStateInstanceNameFlag(m *instance.ToggleInstanceStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceToggleInstanceStateResult parses request result and return the string content +func parseOperationInstanceToggleInstanceStateResult(resp0 *instance.ToggleInstanceStateOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning toggleInstanceStateOK is not supported + + // Non schema case: warning toggleInstanceStateBadRequest is not supported + + // Non schema case: warning toggleInstanceStateNotFound is not supported + + // Non schema case: warning toggleInstanceStateConflict is not supported + + // Non schema case: warning toggleInstanceStateInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response toggleInstanceStateOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/toggle_query_rate_limiting_operation.go b/src/cli/toggle_query_rate_limiting_operation.go new file mode 100644 index 0000000..319ef9c --- /dev/null +++ b/src/cli/toggle_query_rate_limiting_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/broker" + + "github.com/spf13/cobra" +) + +// makeOperationBrokerToggleQueryRateLimitingCmd returns a cmd to handle operation toggleQueryRateLimiting +func makeOperationBrokerToggleQueryRateLimitingCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "toggleQueryRateLimiting", + Short: `Enable/disable the query rate limiting for a broker instance`, + RunE: runOperationBrokerToggleQueryRateLimiting, + } + + if err := registerOperationBrokerToggleQueryRateLimitingParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationBrokerToggleQueryRateLimiting uses cmd flags to call endpoint api +func runOperationBrokerToggleQueryRateLimiting(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := broker.NewToggleQueryRateLimitingParams() + if err, _ := retrieveOperationBrokerToggleQueryRateLimitingInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationBrokerToggleQueryRateLimitingStateFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationBrokerToggleQueryRateLimitingResult(appCli.Broker.ToggleQueryRateLimiting(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationBrokerToggleQueryRateLimitingParamFlags registers all flags needed to fill params +func registerOperationBrokerToggleQueryRateLimitingParamFlags(cmd *cobra.Command) error { + if err := registerOperationBrokerToggleQueryRateLimitingInstanceNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationBrokerToggleQueryRateLimitingStateParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationBrokerToggleQueryRateLimitingInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Broker instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} +func registerOperationBrokerToggleQueryRateLimitingStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `Enum: ["ENABLE","DISABLE"]. Required. ENABLE|DISABLE` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + if err := cmd.RegisterFlagCompletionFunc(stateFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["ENABLE","DISABLE"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func retrieveOperationBrokerToggleQueryRateLimitingInstanceNameFlag(m *broker.ToggleQueryRateLimitingParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationBrokerToggleQueryRateLimitingStateFlag(m *broker.ToggleQueryRateLimitingParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = stateFlagValue + + } + return nil, retAdded +} + +// parseOperationBrokerToggleQueryRateLimitingResult parses request result and return the string content +func parseOperationBrokerToggleQueryRateLimitingResult(resp0 *broker.ToggleQueryRateLimitingOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning toggleQueryRateLimitingOK is not supported + + // Non schema case: warning toggleQueryRateLimitingBadRequest is not supported + + // Non schema case: warning toggleQueryRateLimitingNotFound is not supported + + // Non schema case: warning toggleQueryRateLimitingInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response toggleQueryRateLimitingOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/toggle_task_queue_state_operation.go b/src/cli/toggle_task_queue_state_operation.go new file mode 100644 index 0000000..3dda35f --- /dev/null +++ b/src/cli/toggle_task_queue_state_operation.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/task" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTaskToggleTaskQueueStateCmd returns a cmd to handle operation toggleTaskQueueState +func makeOperationTaskToggleTaskQueueStateCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "toggleTaskQueueState", + Short: ``, + RunE: runOperationTaskToggleTaskQueueState, + } + + if err := registerOperationTaskToggleTaskQueueStateParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTaskToggleTaskQueueState uses cmd flags to call endpoint api +func runOperationTaskToggleTaskQueueState(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := task.NewToggleTaskQueueStateParams() + if err, _ := retrieveOperationTaskToggleTaskQueueStateStateFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTaskToggleTaskQueueStateTaskTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTaskToggleTaskQueueStateResult(appCli.Task.ToggleTaskQueueState(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTaskToggleTaskQueueStateParamFlags registers all flags needed to fill params +func registerOperationTaskToggleTaskQueueStateParamFlags(cmd *cobra.Command) error { + if err := registerOperationTaskToggleTaskQueueStateStateParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTaskToggleTaskQueueStateTaskTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTaskToggleTaskQueueStateStateParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + stateDescription := `Required. state` + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + var stateFlagDefault string + + _ = cmd.PersistentFlags().String(stateFlagName, stateFlagDefault, stateDescription) + + return nil +} +func registerOperationTaskToggleTaskQueueStateTaskTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + taskTypeDescription := `Required. Task type` + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + var taskTypeFlagDefault string + + _ = cmd.PersistentFlags().String(taskTypeFlagName, taskTypeFlagDefault, taskTypeDescription) + + return nil +} + +func retrieveOperationTaskToggleTaskQueueStateStateFlag(m *task.ToggleTaskQueueStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("state") { + + var stateFlagName string + if cmdPrefix == "" { + stateFlagName = "state" + } else { + stateFlagName = fmt.Sprintf("%v.state", cmdPrefix) + } + + stateFlagValue, err := cmd.Flags().GetString(stateFlagName) + if err != nil { + return err, false + } + m.State = stateFlagValue + + } + return nil, retAdded +} +func retrieveOperationTaskToggleTaskQueueStateTaskTypeFlag(m *task.ToggleTaskQueueStateParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("taskType") { + + var taskTypeFlagName string + if cmdPrefix == "" { + taskTypeFlagName = "taskType" + } else { + taskTypeFlagName = fmt.Sprintf("%v.taskType", cmdPrefix) + } + + taskTypeFlagValue, err := cmd.Flags().GetString(taskTypeFlagName) + if err != nil { + return err, false + } + m.TaskType = taskTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationTaskToggleTaskQueueStateResult parses request result and return the string content +func parseOperationTaskToggleTaskQueueStateResult(resp0 *task.ToggleTaskQueueStateOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*task.ToggleTaskQueueStateOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/transform_config_model.go b/src/cli/transform_config_model.go new file mode 100644 index 0000000..884dd38 --- /dev/null +++ b/src/cli/transform_config_model.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TransformConfig + +// register flags to command +func registerModelTransformConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTransformConfigColumnName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTransformConfigTransformFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTransformConfigColumnName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + columnNameDescription := `` + + var columnNameFlagName string + if cmdPrefix == "" { + columnNameFlagName = "columnName" + } else { + columnNameFlagName = fmt.Sprintf("%v.columnName", cmdPrefix) + } + + var columnNameFlagDefault string + + _ = cmd.PersistentFlags().String(columnNameFlagName, columnNameFlagDefault, columnNameDescription) + + return nil +} + +func registerTransformConfigTransformFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + transformFunctionDescription := `` + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + var transformFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(transformFunctionFlagName, transformFunctionFlagDefault, transformFunctionDescription) + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTransformConfigFlags(depth int, m *models.TransformConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, columnNameAdded := retrieveTransformConfigColumnNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || columnNameAdded + + err, transformFunctionAdded := retrieveTransformConfigTransformFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || transformFunctionAdded + + return nil, retAdded +} + +func retrieveTransformConfigColumnNameFlags(depth int, m *models.TransformConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + columnNameFlagName := fmt.Sprintf("%v.columnName", cmdPrefix) + if cmd.Flags().Changed(columnNameFlagName) { + + var columnNameFlagName string + if cmdPrefix == "" { + columnNameFlagName = "columnName" + } else { + columnNameFlagName = fmt.Sprintf("%v.columnName", cmdPrefix) + } + + columnNameFlagValue, err := cmd.Flags().GetString(columnNameFlagName) + if err != nil { + return err, false + } + m.ColumnName = columnNameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTransformConfigTransformFunctionFlags(depth int, m *models.TransformConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + transformFunctionFlagName := fmt.Sprintf("%v.transformFunction", cmdPrefix) + if cmd.Flags().Changed(transformFunctionFlagName) { + + var transformFunctionFlagName string + if cmdPrefix == "" { + transformFunctionFlagName = "transformFunction" + } else { + transformFunctionFlagName = fmt.Sprintf("%v.transformFunction", cmdPrefix) + } + + transformFunctionFlagValue, err := cmd.Flags().GetString(transformFunctionFlagName) + if err != nil { + return err, false + } + m.TransformFunction = transformFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} diff --git a/src/cli/tune_table1_operation.go b/src/cli/tune_table1_operation.go new file mode 100644 index 0000000..2d3b4a1 --- /dev/null +++ b/src/cli/tune_table1_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tuner" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTunerTuneTable1Cmd returns a cmd to handle operation tuneTable1 +func makeOperationTunerTuneTable1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "tuneTable_1", + Short: ``, + RunE: runOperationTunerTuneTable1, + } + + if err := registerOperationTunerTuneTable1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTunerTuneTable1 uses cmd flags to call endpoint api +func runOperationTunerTuneTable1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tuner.NewTuneTable1Params() + if err, _ := retrieveOperationTunerTuneTable1BodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTunerTuneTable1TableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTunerTuneTable1Result(appCli.Tuner.TuneTable1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTunerTuneTable1ParamFlags registers all flags needed to fill params +func registerOperationTunerTuneTable1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationTunerTuneTable1BodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTunerTuneTable1TableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTunerTuneTable1BodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTunerTuneTable1TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTunerTuneTable1BodyFlag(m *tuner.TuneTable1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTunerTuneTable1TableNameFlag(m *tuner.TuneTable1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTunerTuneTable1Result parses request result and return the string content +func parseOperationTunerTuneTable1Result(resp0 *tuner.TuneTable1OK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*tuner.TuneTable1OK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/tune_table_operation.go b/src/cli/tune_table_operation.go new file mode 100644 index 0000000..e167833 --- /dev/null +++ b/src/cli/tune_table_operation.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tuner" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTunerTuneTableCmd returns a cmd to handle operation tuneTable +func makeOperationTunerTuneTableCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "tuneTable", + Short: ``, + RunE: runOperationTunerTuneTable, + } + + if err := registerOperationTunerTuneTableParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTunerTuneTable uses cmd flags to call endpoint api +func runOperationTunerTuneTable(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tuner.NewTuneTableParams() + if err, _ := retrieveOperationTunerTuneTableTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTunerTuneTableResult(appCli.Tuner.TuneTable(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTunerTuneTableParamFlags registers all flags needed to fill params +func registerOperationTunerTuneTableParamFlags(cmd *cobra.Command) error { + if err := registerOperationTunerTuneTableTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTunerTuneTableTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTunerTuneTableTableNameFlag(m *tuner.TuneTableParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTunerTuneTableResult parses request result and return the string content +func parseOperationTunerTuneTableResult(resp0 *tuner.TuneTableOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*tuner.TuneTableOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/tuner_config_model.go b/src/cli/tuner_config_model.go new file mode 100644 index 0000000..6ce3c62 --- /dev/null +++ b/src/cli/tuner_config_model.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for TunerConfig + +// register flags to command +func registerModelTunerConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerTunerConfigName(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerTunerConfigTunerProperties(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerTunerConfigName(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + nameDescription := `Required. ` + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + var nameFlagDefault string + + _ = cmd.PersistentFlags().String(nameFlagName, nameFlagDefault, nameDescription) + + return nil +} + +func registerTunerConfigTunerProperties(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: tunerProperties map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelTunerConfigFlags(depth int, m *models.TunerConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, nameAdded := retrieveTunerConfigNameFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || nameAdded + + err, tunerPropertiesAdded := retrieveTunerConfigTunerPropertiesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || tunerPropertiesAdded + + return nil, retAdded +} + +func retrieveTunerConfigNameFlags(depth int, m *models.TunerConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + nameFlagName := fmt.Sprintf("%v.name", cmdPrefix) + if cmd.Flags().Changed(nameFlagName) { + + var nameFlagName string + if cmdPrefix == "" { + nameFlagName = "name" + } else { + nameFlagName = fmt.Sprintf("%v.name", cmdPrefix) + } + + nameFlagValue, err := cmd.Flags().GetString(nameFlagName) + if err != nil { + return err, false + } + m.Name = &nameFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveTunerConfigTunerPropertiesFlags(depth int, m *models.TunerConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + tunerPropertiesFlagName := fmt.Sprintf("%v.tunerProperties", cmdPrefix) + if cmd.Flags().Changed(tunerPropertiesFlagName) { + // warning: tunerProperties map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/update_broker_resource_operation.go b/src/cli/update_broker_resource_operation.go new file mode 100644 index 0000000..ca5e228 --- /dev/null +++ b/src/cli/update_broker_resource_operation.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/instance" + + "github.com/spf13/cobra" +) + +// makeOperationInstanceUpdateBrokerResourceCmd returns a cmd to handle operation updateBrokerResource +func makeOperationInstanceUpdateBrokerResourceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateBrokerResource", + Short: `Broker resource should be updated when a new broker instance is added, or the tags for an existing broker are changed. Updating broker resource requires reading all the table configs, which can be costly for large cluster. Consider updating broker resource for each table individually.`, + RunE: runOperationInstanceUpdateBrokerResource, + } + + if err := registerOperationInstanceUpdateBrokerResourceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceUpdateBrokerResource uses cmd flags to call endpoint api +func runOperationInstanceUpdateBrokerResource(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewUpdateBrokerResourceParams() + if err, _ := retrieveOperationInstanceUpdateBrokerResourceInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceUpdateBrokerResourceResult(appCli.Instance.UpdateBrokerResource(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceUpdateBrokerResourceParamFlags registers all flags needed to fill params +func registerOperationInstanceUpdateBrokerResourceParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceUpdateBrokerResourceInstanceNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceUpdateBrokerResourceInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} + +func retrieveOperationInstanceUpdateBrokerResourceInstanceNameFlag(m *instance.UpdateBrokerResourceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceUpdateBrokerResourceResult parses request result and return the string content +func parseOperationInstanceUpdateBrokerResourceResult(resp0 *instance.UpdateBrokerResourceOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateBrokerResourceOK is not supported + + // Non schema case: warning updateBrokerResourceBadRequest is not supported + + // Non schema case: warning updateBrokerResourceNotFound is not supported + + // Non schema case: warning updateBrokerResourceInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateBrokerResourceOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_cluster_config_operation.go b/src/cli/update_cluster_config_operation.go new file mode 100644 index 0000000..9ff29e4 --- /dev/null +++ b/src/cli/update_cluster_config_operation.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/cluster" + + "github.com/spf13/cobra" +) + +// makeOperationClusterUpdateClusterConfigCmd returns a cmd to handle operation updateClusterConfig +func makeOperationClusterUpdateClusterConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateClusterConfig", + Short: ``, + RunE: runOperationClusterUpdateClusterConfig, + } + + if err := registerOperationClusterUpdateClusterConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationClusterUpdateClusterConfig uses cmd flags to call endpoint api +func runOperationClusterUpdateClusterConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := cluster.NewUpdateClusterConfigParams() + if err, _ := retrieveOperationClusterUpdateClusterConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationClusterUpdateClusterConfigResult(appCli.Cluster.UpdateClusterConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationClusterUpdateClusterConfigParamFlags registers all flags needed to fill params +func registerOperationClusterUpdateClusterConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationClusterUpdateClusterConfigBodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationClusterUpdateClusterConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} + +func retrieveOperationClusterUpdateClusterConfigBodyFlag(m *cluster.UpdateClusterConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} + +// parseOperationClusterUpdateClusterConfigResult parses request result and return the string content +func parseOperationClusterUpdateClusterConfigResult(resp0 *cluster.UpdateClusterConfigOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateClusterConfigOK is not supported + + // Non schema case: warning updateClusterConfigInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateClusterConfigOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_config_operation.go b/src/cli/update_config_operation.go new file mode 100644 index 0000000..f3681c8 --- /dev/null +++ b/src/cli/update_config_operation.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableUpdateConfigCmd returns a cmd to handle operation updateConfig +func makeOperationTableUpdateConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateConfig", + Short: `Update the TableConfigs provided by the tableConfigsStr json`, + RunE: runOperationTableUpdateConfig, + } + + if err := registerOperationTableUpdateConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableUpdateConfig uses cmd flags to call endpoint api +func runOperationTableUpdateConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewUpdateConfigParams() + if err, _ := retrieveOperationTableUpdateConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateConfigReloadFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateConfigTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateConfigValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableUpdateConfigResult(appCli.Table.UpdateConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableUpdateConfigParamFlags registers all flags needed to fill params +func registerOperationTableUpdateConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableUpdateConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateConfigReloadParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateConfigTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateConfigValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableUpdateConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableUpdateConfigReloadParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + reloadDescription := `Reload the table if the new schema is backward compatible` + + var reloadFlagName string + if cmdPrefix == "" { + reloadFlagName = "reload" + } else { + reloadFlagName = fmt.Sprintf("%v.reload", cmdPrefix) + } + + var reloadFlagDefault bool + + _ = cmd.PersistentFlags().Bool(reloadFlagName, reloadFlagDefault, reloadDescription) + + return nil +} +func registerOperationTableUpdateConfigTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. TableConfigs name i.e. raw table name` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableUpdateConfigValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableUpdateConfigBodyFlag(m *table.UpdateConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateConfigReloadFlag(m *table.UpdateConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("reload") { + + var reloadFlagName string + if cmdPrefix == "" { + reloadFlagName = "reload" + } else { + reloadFlagName = fmt.Sprintf("%v.reload", cmdPrefix) + } + + reloadFlagValue, err := cmd.Flags().GetBool(reloadFlagName) + if err != nil { + return err, false + } + m.Reload = &reloadFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateConfigTableNameFlag(m *table.UpdateConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateConfigValidationTypesToSkipFlag(m *table.UpdateConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableUpdateConfigResult parses request result and return the string content +func parseOperationTableUpdateConfigResult(resp0 *table.UpdateConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.UpdateConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/update_indexing_config_operation.go b/src/cli/update_indexing_config_operation.go new file mode 100644 index 0000000..e09fe12 --- /dev/null +++ b/src/cli/update_indexing_config_operation.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableUpdateIndexingConfigCmd returns a cmd to handle operation updateIndexingConfig +func makeOperationTableUpdateIndexingConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateIndexingConfig", + Short: ``, + RunE: runOperationTableUpdateIndexingConfig, + } + + if err := registerOperationTableUpdateIndexingConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableUpdateIndexingConfig uses cmd flags to call endpoint api +func runOperationTableUpdateIndexingConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewUpdateIndexingConfigParams() + if err, _ := retrieveOperationTableUpdateIndexingConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateIndexingConfigTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableUpdateIndexingConfigResult(appCli.Table.UpdateIndexingConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableUpdateIndexingConfigParamFlags registers all flags needed to fill params +func registerOperationTableUpdateIndexingConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableUpdateIndexingConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateIndexingConfigTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableUpdateIndexingConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableUpdateIndexingConfigTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Table name (without type)` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableUpdateIndexingConfigBodyFlag(m *table.UpdateIndexingConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateIndexingConfigTableNameFlag(m *table.UpdateIndexingConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableUpdateIndexingConfigResult parses request result and return the string content +func parseOperationTableUpdateIndexingConfigResult(resp0 *table.UpdateIndexingConfigOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateIndexingConfigOK is not supported + + // Non schema case: warning updateIndexingConfigNotFound is not supported + + // Non schema case: warning updateIndexingConfigInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateIndexingConfigOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_instance_operation.go b/src/cli/update_instance_operation.go new file mode 100644 index 0000000..b9c6270 --- /dev/null +++ b/src/cli/update_instance_operation.go @@ -0,0 +1,228 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/instance" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationInstanceUpdateInstanceCmd returns a cmd to handle operation updateInstance +func makeOperationInstanceUpdateInstanceCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateInstance", + Short: `Update specified instance with given instance config`, + RunE: runOperationInstanceUpdateInstance, + } + + if err := registerOperationInstanceUpdateInstanceParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceUpdateInstance uses cmd flags to call endpoint api +func runOperationInstanceUpdateInstance(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewUpdateInstanceParams() + if err, _ := retrieveOperationInstanceUpdateInstanceBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationInstanceUpdateInstanceInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationInstanceUpdateInstanceUpdateBrokerResourceFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceUpdateInstanceResult(appCli.Instance.UpdateInstance(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceUpdateInstanceParamFlags registers all flags needed to fill params +func registerOperationInstanceUpdateInstanceParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceUpdateInstanceBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationInstanceUpdateInstanceInstanceNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationInstanceUpdateInstanceUpdateBrokerResourceParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceUpdateInstanceBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelInstanceFlags(0, "instance", cmd); err != nil { + return err + } + + return nil +} +func registerOperationInstanceUpdateInstanceInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} +func registerOperationInstanceUpdateInstanceUpdateBrokerResourceParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + updateBrokerResourceDescription := `Whether to update broker resource for broker instance` + + var updateBrokerResourceFlagName string + if cmdPrefix == "" { + updateBrokerResourceFlagName = "updateBrokerResource" + } else { + updateBrokerResourceFlagName = fmt.Sprintf("%v.updateBrokerResource", cmdPrefix) + } + + var updateBrokerResourceFlagDefault bool + + _ = cmd.PersistentFlags().Bool(updateBrokerResourceFlagName, updateBrokerResourceFlagDefault, updateBrokerResourceDescription) + + return nil +} + +func retrieveOperationInstanceUpdateInstanceBodyFlag(m *instance.UpdateInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.Instance{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.Instance: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.Instance{} + } + err, added := retrieveModelInstanceFlags(0, bodyValueModel, "instance", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationInstanceUpdateInstanceInstanceNameFlag(m *instance.UpdateInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationInstanceUpdateInstanceUpdateBrokerResourceFlag(m *instance.UpdateInstanceParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("updateBrokerResource") { + + var updateBrokerResourceFlagName string + if cmdPrefix == "" { + updateBrokerResourceFlagName = "updateBrokerResource" + } else { + updateBrokerResourceFlagName = fmt.Sprintf("%v.updateBrokerResource", cmdPrefix) + } + + updateBrokerResourceFlagValue, err := cmd.Flags().GetBool(updateBrokerResourceFlagName) + if err != nil { + return err, false + } + m.UpdateBrokerResource = &updateBrokerResourceFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceUpdateInstanceResult parses request result and return the string content +func parseOperationInstanceUpdateInstanceResult(resp0 *instance.UpdateInstanceOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateInstanceOK is not supported + + // Non schema case: warning updateInstanceInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateInstanceOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_instance_tags_operation.go b/src/cli/update_instance_tags_operation.go new file mode 100644 index 0000000..dc14afa --- /dev/null +++ b/src/cli/update_instance_tags_operation.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/instance" + + "github.com/spf13/cobra" +) + +// makeOperationInstanceUpdateInstanceTagsCmd returns a cmd to handle operation updateInstanceTags +func makeOperationInstanceUpdateInstanceTagsCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateInstanceTags", + Short: `Update the tags of the specified instance`, + RunE: runOperationInstanceUpdateInstanceTags, + } + + if err := registerOperationInstanceUpdateInstanceTagsParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationInstanceUpdateInstanceTags uses cmd flags to call endpoint api +func runOperationInstanceUpdateInstanceTags(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := instance.NewUpdateInstanceTagsParams() + if err, _ := retrieveOperationInstanceUpdateInstanceTagsInstanceNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationInstanceUpdateInstanceTagsTagsFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationInstanceUpdateInstanceTagsUpdateBrokerResourceFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationInstanceUpdateInstanceTagsResult(appCli.Instance.UpdateInstanceTags(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationInstanceUpdateInstanceTagsParamFlags registers all flags needed to fill params +func registerOperationInstanceUpdateInstanceTagsParamFlags(cmd *cobra.Command) error { + if err := registerOperationInstanceUpdateInstanceTagsInstanceNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationInstanceUpdateInstanceTagsTagsParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationInstanceUpdateInstanceTagsUpdateBrokerResourceParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationInstanceUpdateInstanceTagsInstanceNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + instanceNameDescription := `Required. Instance name` + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + var instanceNameFlagDefault string + + _ = cmd.PersistentFlags().String(instanceNameFlagName, instanceNameFlagDefault, instanceNameDescription) + + return nil +} +func registerOperationInstanceUpdateInstanceTagsTagsParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tagsDescription := `Required. Comma separated tags list` + + var tagsFlagName string + if cmdPrefix == "" { + tagsFlagName = "tags" + } else { + tagsFlagName = fmt.Sprintf("%v.tags", cmdPrefix) + } + + var tagsFlagDefault string + + _ = cmd.PersistentFlags().String(tagsFlagName, tagsFlagDefault, tagsDescription) + + return nil +} +func registerOperationInstanceUpdateInstanceTagsUpdateBrokerResourceParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + updateBrokerResourceDescription := `Whether to update broker resource for broker instance` + + var updateBrokerResourceFlagName string + if cmdPrefix == "" { + updateBrokerResourceFlagName = "updateBrokerResource" + } else { + updateBrokerResourceFlagName = fmt.Sprintf("%v.updateBrokerResource", cmdPrefix) + } + + var updateBrokerResourceFlagDefault bool + + _ = cmd.PersistentFlags().Bool(updateBrokerResourceFlagName, updateBrokerResourceFlagDefault, updateBrokerResourceDescription) + + return nil +} + +func retrieveOperationInstanceUpdateInstanceTagsInstanceNameFlag(m *instance.UpdateInstanceTagsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("instanceName") { + + var instanceNameFlagName string + if cmdPrefix == "" { + instanceNameFlagName = "instanceName" + } else { + instanceNameFlagName = fmt.Sprintf("%v.instanceName", cmdPrefix) + } + + instanceNameFlagValue, err := cmd.Flags().GetString(instanceNameFlagName) + if err != nil { + return err, false + } + m.InstanceName = instanceNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationInstanceUpdateInstanceTagsTagsFlag(m *instance.UpdateInstanceTagsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tags") { + + var tagsFlagName string + if cmdPrefix == "" { + tagsFlagName = "tags" + } else { + tagsFlagName = fmt.Sprintf("%v.tags", cmdPrefix) + } + + tagsFlagValue, err := cmd.Flags().GetString(tagsFlagName) + if err != nil { + return err, false + } + m.Tags = tagsFlagValue + + } + return nil, retAdded +} +func retrieveOperationInstanceUpdateInstanceTagsUpdateBrokerResourceFlag(m *instance.UpdateInstanceTagsParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("updateBrokerResource") { + + var updateBrokerResourceFlagName string + if cmdPrefix == "" { + updateBrokerResourceFlagName = "updateBrokerResource" + } else { + updateBrokerResourceFlagName = fmt.Sprintf("%v.updateBrokerResource", cmdPrefix) + } + + updateBrokerResourceFlagValue, err := cmd.Flags().GetBool(updateBrokerResourceFlagName) + if err != nil { + return err, false + } + m.UpdateBrokerResource = &updateBrokerResourceFlagValue + + } + return nil, retAdded +} + +// parseOperationInstanceUpdateInstanceTagsResult parses request result and return the string content +func parseOperationInstanceUpdateInstanceTagsResult(resp0 *instance.UpdateInstanceTagsOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateInstanceTagsOK is not supported + + // Non schema case: warning updateInstanceTagsBadRequest is not supported + + // Non schema case: warning updateInstanceTagsNotFound is not supported + + // Non schema case: warning updateInstanceTagsInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateInstanceTagsOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_schema1_operation.go b/src/cli/update_schema1_operation.go new file mode 100644 index 0000000..6ff30b4 --- /dev/null +++ b/src/cli/update_schema1_operation.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/schema" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSchemaUpdateSchema1Cmd returns a cmd to handle operation updateSchema1 +func makeOperationSchemaUpdateSchema1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateSchema_1", + Short: `Updates a schema`, + RunE: runOperationSchemaUpdateSchema1, + } + + if err := registerOperationSchemaUpdateSchema1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaUpdateSchema1 uses cmd flags to call endpoint api +func runOperationSchemaUpdateSchema1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewUpdateSchema1Params() + if err, _ := retrieveOperationSchemaUpdateSchema1BodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSchemaUpdateSchema1ReloadFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSchemaUpdateSchema1SchemaNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaUpdateSchema1Result(appCli.Schema.UpdateSchema1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaUpdateSchema1ParamFlags registers all flags needed to fill params +func registerOperationSchemaUpdateSchema1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSchemaUpdateSchema1BodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSchemaUpdateSchema1ReloadParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSchemaUpdateSchema1SchemaNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSchemaUpdateSchema1BodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelFormDataMultiPartFlags(0, "formDataMultiPart", cmd); err != nil { + return err + } + + return nil +} +func registerOperationSchemaUpdateSchema1ReloadParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + reloadDescription := `Whether to reload the table if the new schema is backward compatible` + + var reloadFlagName string + if cmdPrefix == "" { + reloadFlagName = "reload" + } else { + reloadFlagName = fmt.Sprintf("%v.reload", cmdPrefix) + } + + var reloadFlagDefault bool + + _ = cmd.PersistentFlags().Bool(reloadFlagName, reloadFlagDefault, reloadDescription) + + return nil +} +func registerOperationSchemaUpdateSchema1SchemaNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + schemaNameDescription := `Required. Name of the schema` + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + var schemaNameFlagDefault string + + _ = cmd.PersistentFlags().String(schemaNameFlagName, schemaNameFlagDefault, schemaNameDescription) + + return nil +} + +func retrieveOperationSchemaUpdateSchema1BodyFlag(m *schema.UpdateSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.FormDataMultiPart{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.FormDataMultiPart: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.FormDataMultiPart{} + } + err, added := retrieveModelFormDataMultiPartFlags(0, bodyValueModel, "formDataMultiPart", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationSchemaUpdateSchema1ReloadFlag(m *schema.UpdateSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("reload") { + + var reloadFlagName string + if cmdPrefix == "" { + reloadFlagName = "reload" + } else { + reloadFlagName = fmt.Sprintf("%v.reload", cmdPrefix) + } + + reloadFlagValue, err := cmd.Flags().GetBool(reloadFlagName) + if err != nil { + return err, false + } + m.Reload = &reloadFlagValue + + } + return nil, retAdded +} +func retrieveOperationSchemaUpdateSchema1SchemaNameFlag(m *schema.UpdateSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("schemaName") { + + var schemaNameFlagName string + if cmdPrefix == "" { + schemaNameFlagName = "schemaName" + } else { + schemaNameFlagName = fmt.Sprintf("%v.schemaName", cmdPrefix) + } + + schemaNameFlagValue, err := cmd.Flags().GetString(schemaNameFlagName) + if err != nil { + return err, false + } + m.SchemaName = schemaNameFlagValue + + } + return nil, retAdded +} + +// parseOperationSchemaUpdateSchema1Result parses request result and return the string content +func parseOperationSchemaUpdateSchema1Result(resp0 *schema.UpdateSchema1OK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateSchema1OK is not supported + + // Non schema case: warning updateSchema1BadRequest is not supported + + // Non schema case: warning updateSchema1NotFound is not supported + + // Non schema case: warning updateSchema1InternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateSchema1OK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_table_config_operation.go b/src/cli/update_table_config_operation.go new file mode 100644 index 0000000..4325103 --- /dev/null +++ b/src/cli/update_table_config_operation.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableUpdateTableConfigCmd returns a cmd to handle operation updateTableConfig +func makeOperationTableUpdateTableConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateTableConfig", + Short: `Updates table config for a table`, + RunE: runOperationTableUpdateTableConfig, + } + + if err := registerOperationTableUpdateTableConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableUpdateTableConfig uses cmd flags to call endpoint api +func runOperationTableUpdateTableConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewUpdateTableConfigParams() + if err, _ := retrieveOperationTableUpdateTableConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateTableConfigTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateTableConfigValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableUpdateTableConfigResult(appCli.Table.UpdateTableConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableUpdateTableConfigParamFlags registers all flags needed to fill params +func registerOperationTableUpdateTableConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableUpdateTableConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateTableConfigTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateTableConfigValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableUpdateTableConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableUpdateTableConfigTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. Name of the table to update` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationTableUpdateTableConfigValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableUpdateTableConfigBodyFlag(m *table.UpdateTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateTableConfigTableNameFlag(m *table.UpdateTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateTableConfigValidationTypesToSkipFlag(m *table.UpdateTableConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableUpdateTableConfigResult parses request result and return the string content +func parseOperationTableUpdateTableConfigResult(resp0 *table.UpdateTableConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.UpdateTableConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/update_table_metadata_operation.go b/src/cli/update_table_metadata_operation.go new file mode 100644 index 0000000..a111786 --- /dev/null +++ b/src/cli/update_table_metadata_operation.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/table" + + "github.com/spf13/cobra" +) + +// makeOperationTableUpdateTableMetadataCmd returns a cmd to handle operation updateTableMetadata +func makeOperationTableUpdateTableMetadataCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateTableMetadata", + Short: `Updates table configuration`, + RunE: runOperationTableUpdateTableMetadata, + } + + if err := registerOperationTableUpdateTableMetadataParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableUpdateTableMetadata uses cmd flags to call endpoint api +func runOperationTableUpdateTableMetadata(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewUpdateTableMetadataParams() + if err, _ := retrieveOperationTableUpdateTableMetadataBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableUpdateTableMetadataTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableUpdateTableMetadataResult(appCli.Table.UpdateTableMetadata(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableUpdateTableMetadataParamFlags registers all flags needed to fill params +func registerOperationTableUpdateTableMetadataParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableUpdateTableMetadataBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableUpdateTableMetadataTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableUpdateTableMetadataBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableUpdateTableMetadataTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Required. ` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationTableUpdateTableMetadataBodyFlag(m *table.UpdateTableMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableUpdateTableMetadataTableNameFlag(m *table.UpdateTableMetadataParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationTableUpdateTableMetadataResult parses request result and return the string content +func parseOperationTableUpdateTableMetadataResult(resp0 *table.UpdateTableMetadataOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateTableMetadataOK is not supported + + // Non schema case: warning updateTableMetadataNotFound is not supported + + // Non schema case: warning updateTableMetadataInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateTableMetadataOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_tenant_operation.go b/src/cli/update_tenant_operation.go new file mode 100644 index 0000000..c1bf64b --- /dev/null +++ b/src/cli/update_tenant_operation.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/tenant" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTenantUpdateTenantCmd returns a cmd to handle operation updateTenant +func makeOperationTenantUpdateTenantCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateTenant", + Short: ``, + RunE: runOperationTenantUpdateTenant, + } + + if err := registerOperationTenantUpdateTenantParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTenantUpdateTenant uses cmd flags to call endpoint api +func runOperationTenantUpdateTenant(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := tenant.NewUpdateTenantParams() + if err, _ := retrieveOperationTenantUpdateTenantBodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTenantUpdateTenantResult(appCli.Tenant.UpdateTenant(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTenantUpdateTenantParamFlags registers all flags needed to fill params +func registerOperationTenantUpdateTenantParamFlags(cmd *cobra.Command) error { + if err := registerOperationTenantUpdateTenantBodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTenantUpdateTenantBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelTenantFlags(0, "tenant", cmd); err != nil { + return err + } + + return nil +} + +func retrieveOperationTenantUpdateTenantBodyFlag(m *tenant.UpdateTenantParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.Tenant{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.Tenant: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.Tenant{} + } + err, added := retrieveModelTenantFlags(0, bodyValueModel, "tenant", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} + +// parseOperationTenantUpdateTenantResult parses request result and return the string content +func parseOperationTenantUpdateTenantResult(resp0 *tenant.UpdateTenantOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateTenantOK is not supported + + // Non schema case: warning updateTenantInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateTenantOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_time_interval_z_k_operation.go b/src/cli/update_time_interval_z_k_operation.go new file mode 100644 index 0000000..56eb6bf --- /dev/null +++ b/src/cli/update_time_interval_z_k_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/segment" + + "github.com/spf13/cobra" +) + +// makeOperationSegmentUpdateTimeIntervalZKCmd returns a cmd to handle operation updateTimeIntervalZK +func makeOperationSegmentUpdateTimeIntervalZKCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateTimeIntervalZK", + Short: `Update the start and end time of the segments based on latest schema`, + RunE: runOperationSegmentUpdateTimeIntervalZK, + } + + if err := registerOperationSegmentUpdateTimeIntervalZKParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentUpdateTimeIntervalZK uses cmd flags to call endpoint api +func runOperationSegmentUpdateTimeIntervalZK(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewUpdateTimeIntervalZKParams() + if err, _ := retrieveOperationSegmentUpdateTimeIntervalZKTableNameWithTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentUpdateTimeIntervalZKResult(appCli.Segment.UpdateTimeIntervalZK(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentUpdateTimeIntervalZKParamFlags registers all flags needed to fill params +func registerOperationSegmentUpdateTimeIntervalZKParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentUpdateTimeIntervalZKTableNameWithTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentUpdateTimeIntervalZKTableNameWithTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameWithTypeDescription := `Required. Table name with type` + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + var tableNameWithTypeFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameWithTypeFlagName, tableNameWithTypeFlagDefault, tableNameWithTypeDescription) + + return nil +} + +func retrieveOperationSegmentUpdateTimeIntervalZKTableNameWithTypeFlag(m *segment.UpdateTimeIntervalZKParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableNameWithType") { + + var tableNameWithTypeFlagName string + if cmdPrefix == "" { + tableNameWithTypeFlagName = "tableNameWithType" + } else { + tableNameWithTypeFlagName = fmt.Sprintf("%v.tableNameWithType", cmdPrefix) + } + + tableNameWithTypeFlagValue, err := cmd.Flags().GetString(tableNameWithTypeFlagName) + if err != nil { + return err, false + } + m.TableNameWithType = tableNameWithTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentUpdateTimeIntervalZKResult parses request result and return the string content +func parseOperationSegmentUpdateTimeIntervalZKResult(resp0 *segment.UpdateTimeIntervalZKOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateTimeIntervalZKOK is not supported + + // Non schema case: warning updateTimeIntervalZKNotFound is not supported + + // Non schema case: warning updateTimeIntervalZKInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response updateTimeIntervalZKOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/update_user_config_operation.go b/src/cli/update_user_config_operation.go new file mode 100644 index 0000000..d6536c3 --- /dev/null +++ b/src/cli/update_user_config_operation.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/user" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationUserUpdateUserConfigCmd returns a cmd to handle operation updateUserConfig +func makeOperationUserUpdateUserConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateUserConfig", + Short: `Update user config for user`, + RunE: runOperationUserUpdateUserConfig, + } + + if err := registerOperationUserUpdateUserConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationUserUpdateUserConfig uses cmd flags to call endpoint api +func runOperationUserUpdateUserConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := user.NewUpdateUserConfigParams() + if err, _ := retrieveOperationUserUpdateUserConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUserUpdateUserConfigComponentFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUserUpdateUserConfigPasswordChangedFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationUserUpdateUserConfigUsernameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationUserUpdateUserConfigResult(appCli.User.UpdateUserConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationUserUpdateUserConfigParamFlags registers all flags needed to fill params +func registerOperationUserUpdateUserConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationUserUpdateUserConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUserUpdateUserConfigComponentParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUserUpdateUserConfigPasswordChangedParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationUserUpdateUserConfigUsernameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationUserUpdateUserConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationUserUpdateUserConfigComponentParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + componentDescription := `` + + var componentFlagName string + if cmdPrefix == "" { + componentFlagName = "component" + } else { + componentFlagName = fmt.Sprintf("%v.component", cmdPrefix) + } + + var componentFlagDefault string + + _ = cmd.PersistentFlags().String(componentFlagName, componentFlagDefault, componentDescription) + + return nil +} +func registerOperationUserUpdateUserConfigPasswordChangedParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + passwordChangedDescription := `` + + var passwordChangedFlagName string + if cmdPrefix == "" { + passwordChangedFlagName = "passwordChanged" + } else { + passwordChangedFlagName = fmt.Sprintf("%v.passwordChanged", cmdPrefix) + } + + var passwordChangedFlagDefault bool + + _ = cmd.PersistentFlags().Bool(passwordChangedFlagName, passwordChangedFlagDefault, passwordChangedDescription) + + return nil +} +func registerOperationUserUpdateUserConfigUsernameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + usernameDescription := `Required. ` + + var usernameFlagName string + if cmdPrefix == "" { + usernameFlagName = "username" + } else { + usernameFlagName = fmt.Sprintf("%v.username", cmdPrefix) + } + + var usernameFlagDefault string + + _ = cmd.PersistentFlags().String(usernameFlagName, usernameFlagDefault, usernameDescription) + + return nil +} + +func retrieveOperationUserUpdateUserConfigBodyFlag(m *user.UpdateUserConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationUserUpdateUserConfigComponentFlag(m *user.UpdateUserConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("component") { + + var componentFlagName string + if cmdPrefix == "" { + componentFlagName = "component" + } else { + componentFlagName = fmt.Sprintf("%v.component", cmdPrefix) + } + + componentFlagValue, err := cmd.Flags().GetString(componentFlagName) + if err != nil { + return err, false + } + m.Component = &componentFlagValue + + } + return nil, retAdded +} +func retrieveOperationUserUpdateUserConfigPasswordChangedFlag(m *user.UpdateUserConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("passwordChanged") { + + var passwordChangedFlagName string + if cmdPrefix == "" { + passwordChangedFlagName = "passwordChanged" + } else { + passwordChangedFlagName = fmt.Sprintf("%v.passwordChanged", cmdPrefix) + } + + passwordChangedFlagValue, err := cmd.Flags().GetBool(passwordChangedFlagName) + if err != nil { + return err, false + } + m.PasswordChanged = &passwordChangedFlagValue + + } + return nil, retAdded +} +func retrieveOperationUserUpdateUserConfigUsernameFlag(m *user.UpdateUserConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("username") { + + var usernameFlagName string + if cmdPrefix == "" { + usernameFlagName = "username" + } else { + usernameFlagName = fmt.Sprintf("%v.username", cmdPrefix) + } + + usernameFlagValue, err := cmd.Flags().GetString(usernameFlagName) + if err != nil { + return err, false + } + m.Username = usernameFlagValue + + } + return nil, retAdded +} + +// parseOperationUserUpdateUserConfigResult parses request result and return the string content +func parseOperationUserUpdateUserConfigResult(resp0 *user.UpdateUserConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*user.UpdateUserConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/update_write_config_operation.go b/src/cli/update_write_config_operation.go new file mode 100644 index 0000000..a310bd1 --- /dev/null +++ b/src/cli/update_write_config_operation.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/write_api" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationWriteAPIUpdateWriteConfigCmd returns a cmd to handle operation updateWriteConfig +func makeOperationWriteAPIUpdateWriteConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "updateWriteConfig", + Short: `Gets a config for specific table. May contain Kafka producer configs`, + RunE: runOperationWriteAPIUpdateWriteConfig, + } + + if err := registerOperationWriteAPIUpdateWriteConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationWriteAPIUpdateWriteConfig uses cmd flags to call endpoint api +func runOperationWriteAPIUpdateWriteConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := write_api.NewUpdateWriteConfigParams() + if err, _ := retrieveOperationWriteAPIUpdateWriteConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationWriteAPIUpdateWriteConfigTableFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationWriteAPIUpdateWriteConfigResult(appCli.WriteAPI.UpdateWriteConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationWriteAPIUpdateWriteConfigParamFlags registers all flags needed to fill params +func registerOperationWriteAPIUpdateWriteConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationWriteAPIUpdateWriteConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationWriteAPIUpdateWriteConfigTableParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationWriteAPIUpdateWriteConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelTableWriteConfigFlags(0, "tableWriteConfig", cmd); err != nil { + return err + } + + return nil +} +func registerOperationWriteAPIUpdateWriteConfigTableParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableDescription := `Required. ` + + var tableFlagName string + if cmdPrefix == "" { + tableFlagName = "table" + } else { + tableFlagName = fmt.Sprintf("%v.table", cmdPrefix) + } + + var tableFlagDefault string + + _ = cmd.PersistentFlags().String(tableFlagName, tableFlagDefault, tableDescription) + + return nil +} + +func retrieveOperationWriteAPIUpdateWriteConfigBodyFlag(m *write_api.UpdateWriteConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.TableWriteConfig{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.TableWriteConfig: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.TableWriteConfig{} + } + err, added := retrieveModelTableWriteConfigFlags(0, bodyValueModel, "tableWriteConfig", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationWriteAPIUpdateWriteConfigTableFlag(m *write_api.UpdateWriteConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("table") { + + var tableFlagName string + if cmdPrefix == "" { + tableFlagName = "table" + } else { + tableFlagName = fmt.Sprintf("%v.table", cmdPrefix) + } + + tableFlagValue, err := cmd.Flags().GetString(tableFlagName) + if err != nil { + return err, false + } + m.Table = tableFlagValue + + } + return nil, retAdded +} + +// parseOperationWriteAPIUpdateWriteConfigResult parses request result and return the string content +func parseOperationWriteAPIUpdateWriteConfigResult(respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning updateWriteConfig default is not supported + + return "", respErr + } + return "", nil +} diff --git a/src/cli/upload_segment_as_multi_part_operation.go b/src/cli/upload_segment_as_multi_part_operation.go new file mode 100644 index 0000000..fa40e04 --- /dev/null +++ b/src/cli/upload_segment_as_multi_part_operation.go @@ -0,0 +1,324 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentUploadSegmentAsMultiPartCmd returns a cmd to handle operation uploadSegmentAsMultiPart +func makeOperationSegmentUploadSegmentAsMultiPartCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "uploadSegmentAsMultiPart", + Short: `Upload a segment as binary`, + RunE: runOperationSegmentUploadSegmentAsMultiPart, + } + + if err := registerOperationSegmentUploadSegmentAsMultiPartParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentUploadSegmentAsMultiPart uses cmd flags to call endpoint api +func runOperationSegmentUploadSegmentAsMultiPart(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewUploadSegmentAsMultiPartParams() + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartAllowRefreshFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartEnableParallelPushProtectionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartTableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartTableTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentUploadSegmentAsMultiPartResult(appCli.Segment.UploadSegmentAsMultiPart(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentUploadSegmentAsMultiPartParamFlags registers all flags needed to fill params +func registerOperationSegmentUploadSegmentAsMultiPartParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentUploadSegmentAsMultiPartAllowRefreshParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartEnableParallelPushProtectionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartTableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartTableTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentUploadSegmentAsMultiPartAllowRefreshParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + allowRefreshDescription := `Whether to refresh if the segment already exists` + + var allowRefreshFlagName string + if cmdPrefix == "" { + allowRefreshFlagName = "allowRefresh" + } else { + allowRefreshFlagName = fmt.Sprintf("%v.allowRefresh", cmdPrefix) + } + + var allowRefreshFlagDefault bool = true + + _ = cmd.PersistentFlags().Bool(allowRefreshFlagName, allowRefreshFlagDefault, allowRefreshDescription) + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelFormDataMultiPartFlags(0, "formDataMultiPart", cmd); err != nil { + return err + } + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartEnableParallelPushProtectionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + enableParallelPushProtectionDescription := `Whether to enable parallel push protection` + + var enableParallelPushProtectionFlagName string + if cmdPrefix == "" { + enableParallelPushProtectionFlagName = "enableParallelPushProtection" + } else { + enableParallelPushProtectionFlagName = fmt.Sprintf("%v.enableParallelPushProtection", cmdPrefix) + } + + var enableParallelPushProtectionFlagDefault bool + + _ = cmd.PersistentFlags().Bool(enableParallelPushProtectionFlagName, enableParallelPushProtectionFlagDefault, enableParallelPushProtectionDescription) + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartTableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `Type of the table` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string = "OFFLINE" + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} + +func retrieveOperationSegmentUploadSegmentAsMultiPartAllowRefreshFlag(m *segment.UploadSegmentAsMultiPartParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("allowRefresh") { + + var allowRefreshFlagName string + if cmdPrefix == "" { + allowRefreshFlagName = "allowRefresh" + } else { + allowRefreshFlagName = fmt.Sprintf("%v.allowRefresh", cmdPrefix) + } + + allowRefreshFlagValue, err := cmd.Flags().GetBool(allowRefreshFlagName) + if err != nil { + return err, false + } + m.AllowRefresh = &allowRefreshFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartBodyFlag(m *segment.UploadSegmentAsMultiPartParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.FormDataMultiPart{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.FormDataMultiPart: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.FormDataMultiPart{} + } + err, added := retrieveModelFormDataMultiPartFlags(0, bodyValueModel, "formDataMultiPart", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartEnableParallelPushProtectionFlag(m *segment.UploadSegmentAsMultiPartParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("enableParallelPushProtection") { + + var enableParallelPushProtectionFlagName string + if cmdPrefix == "" { + enableParallelPushProtectionFlagName = "enableParallelPushProtection" + } else { + enableParallelPushProtectionFlagName = fmt.Sprintf("%v.enableParallelPushProtection", cmdPrefix) + } + + enableParallelPushProtectionFlagValue, err := cmd.Flags().GetBool(enableParallelPushProtectionFlagName) + if err != nil { + return err, false + } + m.EnableParallelPushProtection = &enableParallelPushProtectionFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartTableNameFlag(m *segment.UploadSegmentAsMultiPartParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = &tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartTableTypeFlag(m *segment.UploadSegmentAsMultiPartParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = &tableTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentUploadSegmentAsMultiPartResult parses request result and return the string content +func parseOperationSegmentUploadSegmentAsMultiPartResult(resp0 *segment.UploadSegmentAsMultiPartOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning uploadSegmentAsMultiPartOK is not supported + + // Non schema case: warning uploadSegmentAsMultiPartBadRequest is not supported + + // Non schema case: warning uploadSegmentAsMultiPartForbidden is not supported + + // Non schema case: warning uploadSegmentAsMultiPartConflict is not supported + + // Non schema case: warning uploadSegmentAsMultiPartGone is not supported + + // Non schema case: warning uploadSegmentAsMultiPartPreconditionFailed is not supported + + // Non schema case: warning uploadSegmentAsMultiPartInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response uploadSegmentAsMultiPartOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/upload_segment_as_multi_part_v2_operation.go b/src/cli/upload_segment_as_multi_part_v2_operation.go new file mode 100644 index 0000000..15a0c2a --- /dev/null +++ b/src/cli/upload_segment_as_multi_part_v2_operation.go @@ -0,0 +1,324 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/segment" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationSegmentUploadSegmentAsMultiPartV2Cmd returns a cmd to handle operation uploadSegmentAsMultiPartV2 +func makeOperationSegmentUploadSegmentAsMultiPartV2Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "uploadSegmentAsMultiPartV2", + Short: `Upload a segment as binary`, + RunE: runOperationSegmentUploadSegmentAsMultiPartV2, + } + + if err := registerOperationSegmentUploadSegmentAsMultiPartV2ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSegmentUploadSegmentAsMultiPartV2 uses cmd flags to call endpoint api +func runOperationSegmentUploadSegmentAsMultiPartV2(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := segment.NewUploadSegmentAsMultiPartV2Params() + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartV2AllowRefreshFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartV2BodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartV2EnableParallelPushProtectionFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartV2TableNameFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationSegmentUploadSegmentAsMultiPartV2TableTypeFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSegmentUploadSegmentAsMultiPartV2Result(appCli.Segment.UploadSegmentAsMultiPartV2(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSegmentUploadSegmentAsMultiPartV2ParamFlags registers all flags needed to fill params +func registerOperationSegmentUploadSegmentAsMultiPartV2ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSegmentUploadSegmentAsMultiPartV2AllowRefreshParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartV2BodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartV2EnableParallelPushProtectionParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartV2TableNameParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationSegmentUploadSegmentAsMultiPartV2TableTypeParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSegmentUploadSegmentAsMultiPartV2AllowRefreshParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + allowRefreshDescription := `Whether to refresh if the segment already exists` + + var allowRefreshFlagName string + if cmdPrefix == "" { + allowRefreshFlagName = "allowRefresh" + } else { + allowRefreshFlagName = fmt.Sprintf("%v.allowRefresh", cmdPrefix) + } + + var allowRefreshFlagDefault bool = true + + _ = cmd.PersistentFlags().Bool(allowRefreshFlagName, allowRefreshFlagDefault, allowRefreshDescription) + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartV2BodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelFormDataMultiPartFlags(0, "formDataMultiPart", cmd); err != nil { + return err + } + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartV2EnableParallelPushProtectionParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + enableParallelPushProtectionDescription := `Whether to enable parallel push protection` + + var enableParallelPushProtectionFlagName string + if cmdPrefix == "" { + enableParallelPushProtectionFlagName = "enableParallelPushProtection" + } else { + enableParallelPushProtectionFlagName = fmt.Sprintf("%v.enableParallelPushProtection", cmdPrefix) + } + + var enableParallelPushProtectionFlagDefault bool + + _ = cmd.PersistentFlags().Bool(enableParallelPushProtectionFlagName, enableParallelPushProtectionFlagDefault, enableParallelPushProtectionDescription) + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartV2TableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Name of the table` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} +func registerOperationSegmentUploadSegmentAsMultiPartV2TableTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableTypeDescription := `Type of the table` + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + var tableTypeFlagDefault string = "OFFLINE" + + _ = cmd.PersistentFlags().String(tableTypeFlagName, tableTypeFlagDefault, tableTypeDescription) + + return nil +} + +func retrieveOperationSegmentUploadSegmentAsMultiPartV2AllowRefreshFlag(m *segment.UploadSegmentAsMultiPartV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("allowRefresh") { + + var allowRefreshFlagName string + if cmdPrefix == "" { + allowRefreshFlagName = "allowRefresh" + } else { + allowRefreshFlagName = fmt.Sprintf("%v.allowRefresh", cmdPrefix) + } + + allowRefreshFlagValue, err := cmd.Flags().GetBool(allowRefreshFlagName) + if err != nil { + return err, false + } + m.AllowRefresh = &allowRefreshFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartV2BodyFlag(m *segment.UploadSegmentAsMultiPartV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.FormDataMultiPart{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.FormDataMultiPart: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.FormDataMultiPart{} + } + err, added := retrieveModelFormDataMultiPartFlags(0, bodyValueModel, "formDataMultiPart", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartV2EnableParallelPushProtectionFlag(m *segment.UploadSegmentAsMultiPartV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("enableParallelPushProtection") { + + var enableParallelPushProtectionFlagName string + if cmdPrefix == "" { + enableParallelPushProtectionFlagName = "enableParallelPushProtection" + } else { + enableParallelPushProtectionFlagName = fmt.Sprintf("%v.enableParallelPushProtection", cmdPrefix) + } + + enableParallelPushProtectionFlagValue, err := cmd.Flags().GetBool(enableParallelPushProtectionFlagName) + if err != nil { + return err, false + } + m.EnableParallelPushProtection = &enableParallelPushProtectionFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartV2TableNameFlag(m *segment.UploadSegmentAsMultiPartV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = &tableNameFlagValue + + } + return nil, retAdded +} +func retrieveOperationSegmentUploadSegmentAsMultiPartV2TableTypeFlag(m *segment.UploadSegmentAsMultiPartV2Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableType") { + + var tableTypeFlagName string + if cmdPrefix == "" { + tableTypeFlagName = "tableType" + } else { + tableTypeFlagName = fmt.Sprintf("%v.tableType", cmdPrefix) + } + + tableTypeFlagValue, err := cmd.Flags().GetString(tableTypeFlagName) + if err != nil { + return err, false + } + m.TableType = &tableTypeFlagValue + + } + return nil, retAdded +} + +// parseOperationSegmentUploadSegmentAsMultiPartV2Result parses request result and return the string content +func parseOperationSegmentUploadSegmentAsMultiPartV2Result(resp0 *segment.UploadSegmentAsMultiPartV2OK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning uploadSegmentAsMultiPartV2OK is not supported + + // Non schema case: warning uploadSegmentAsMultiPartV2BadRequest is not supported + + // Non schema case: warning uploadSegmentAsMultiPartV2Forbidden is not supported + + // Non schema case: warning uploadSegmentAsMultiPartV2Conflict is not supported + + // Non schema case: warning uploadSegmentAsMultiPartV2Gone is not supported + + // Non schema case: warning uploadSegmentAsMultiPartV2PreconditionFailed is not supported + + // Non schema case: warning uploadSegmentAsMultiPartV2InternalServerError is not supported + + return "", respErr + } + + // warning: non schema response uploadSegmentAsMultiPartV2OK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/upsert_config_model.go b/src/cli/upsert_config_model.go new file mode 100644 index 0000000..443199d --- /dev/null +++ b/src/cli/upsert_config_model.go @@ -0,0 +1,484 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for UpsertConfig + +// register flags to command +func registerModelUpsertConfigFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerUpsertConfigComparisonColumn(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigDefaultPartialUpsertStrategy(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigEnableSnapshot(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigHashFunction(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigMetadataManagerClass(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigMetadataManagerConfigs(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigMode(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerUpsertConfigPartialUpsertStrategies(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerUpsertConfigComparisonColumn(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + comparisonColumnDescription := `` + + var comparisonColumnFlagName string + if cmdPrefix == "" { + comparisonColumnFlagName = "comparisonColumn" + } else { + comparisonColumnFlagName = fmt.Sprintf("%v.comparisonColumn", cmdPrefix) + } + + var comparisonColumnFlagDefault string + + _ = cmd.PersistentFlags().String(comparisonColumnFlagName, comparisonColumnFlagDefault, comparisonColumnDescription) + + return nil +} + +func registerUpsertConfigDefaultPartialUpsertStrategy(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + defaultPartialUpsertStrategyDescription := `Enum: ["APPEND","IGNORE","INCREMENT","MAX","MIN","OVERWRITE","UNION"]. ` + + var defaultPartialUpsertStrategyFlagName string + if cmdPrefix == "" { + defaultPartialUpsertStrategyFlagName = "defaultPartialUpsertStrategy" + } else { + defaultPartialUpsertStrategyFlagName = fmt.Sprintf("%v.defaultPartialUpsertStrategy", cmdPrefix) + } + + var defaultPartialUpsertStrategyFlagDefault string + + _ = cmd.PersistentFlags().String(defaultPartialUpsertStrategyFlagName, defaultPartialUpsertStrategyFlagDefault, defaultPartialUpsertStrategyDescription) + + if err := cmd.RegisterFlagCompletionFunc(defaultPartialUpsertStrategyFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["APPEND","IGNORE","INCREMENT","MAX","MIN","OVERWRITE","UNION"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerUpsertConfigEnableSnapshot(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + enableSnapshotDescription := `` + + var enableSnapshotFlagName string + if cmdPrefix == "" { + enableSnapshotFlagName = "enableSnapshot" + } else { + enableSnapshotFlagName = fmt.Sprintf("%v.enableSnapshot", cmdPrefix) + } + + var enableSnapshotFlagDefault bool + + _ = cmd.PersistentFlags().Bool(enableSnapshotFlagName, enableSnapshotFlagDefault, enableSnapshotDescription) + + return nil +} + +func registerUpsertConfigHashFunction(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + hashFunctionDescription := `Enum: ["NONE","MD5","MURMUR3"]. ` + + var hashFunctionFlagName string + if cmdPrefix == "" { + hashFunctionFlagName = "hashFunction" + } else { + hashFunctionFlagName = fmt.Sprintf("%v.hashFunction", cmdPrefix) + } + + var hashFunctionFlagDefault string + + _ = cmd.PersistentFlags().String(hashFunctionFlagName, hashFunctionFlagDefault, hashFunctionDescription) + + if err := cmd.RegisterFlagCompletionFunc(hashFunctionFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["NONE","MD5","MURMUR3"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerUpsertConfigMetadataManagerClass(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + metadataManagerClassDescription := `` + + var metadataManagerClassFlagName string + if cmdPrefix == "" { + metadataManagerClassFlagName = "metadataManagerClass" + } else { + metadataManagerClassFlagName = fmt.Sprintf("%v.metadataManagerClass", cmdPrefix) + } + + var metadataManagerClassFlagDefault string + + _ = cmd.PersistentFlags().String(metadataManagerClassFlagName, metadataManagerClassFlagDefault, metadataManagerClassDescription) + + return nil +} + +func registerUpsertConfigMetadataManagerConfigs(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: metadataManagerConfigs map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +func registerUpsertConfigMode(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + modeDescription := `Enum: ["FULL","PARTIAL","NONE"]. Required. ` + + var modeFlagName string + if cmdPrefix == "" { + modeFlagName = "mode" + } else { + modeFlagName = fmt.Sprintf("%v.mode", cmdPrefix) + } + + var modeFlagDefault string + + _ = cmd.PersistentFlags().String(modeFlagName, modeFlagDefault, modeDescription) + + if err := cmd.RegisterFlagCompletionFunc(modeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["FULL","PARTIAL","NONE"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} + +func registerUpsertConfigPartialUpsertStrategies(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: partialUpsertStrategies map[string]string map type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelUpsertConfigFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, comparisonColumnAdded := retrieveUpsertConfigComparisonColumnFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || comparisonColumnAdded + + err, defaultPartialUpsertStrategyAdded := retrieveUpsertConfigDefaultPartialUpsertStrategyFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || defaultPartialUpsertStrategyAdded + + err, enableSnapshotAdded := retrieveUpsertConfigEnableSnapshotFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || enableSnapshotAdded + + err, hashFunctionAdded := retrieveUpsertConfigHashFunctionFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || hashFunctionAdded + + err, metadataManagerClassAdded := retrieveUpsertConfigMetadataManagerClassFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || metadataManagerClassAdded + + err, metadataManagerConfigsAdded := retrieveUpsertConfigMetadataManagerConfigsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || metadataManagerConfigsAdded + + err, modeAdded := retrieveUpsertConfigModeFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || modeAdded + + err, partialUpsertStrategiesAdded := retrieveUpsertConfigPartialUpsertStrategiesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || partialUpsertStrategiesAdded + + return nil, retAdded +} + +func retrieveUpsertConfigComparisonColumnFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + comparisonColumnFlagName := fmt.Sprintf("%v.comparisonColumn", cmdPrefix) + if cmd.Flags().Changed(comparisonColumnFlagName) { + + var comparisonColumnFlagName string + if cmdPrefix == "" { + comparisonColumnFlagName = "comparisonColumn" + } else { + comparisonColumnFlagName = fmt.Sprintf("%v.comparisonColumn", cmdPrefix) + } + + comparisonColumnFlagValue, err := cmd.Flags().GetString(comparisonColumnFlagName) + if err != nil { + return err, false + } + m.ComparisonColumn = comparisonColumnFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveUpsertConfigDefaultPartialUpsertStrategyFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + defaultPartialUpsertStrategyFlagName := fmt.Sprintf("%v.defaultPartialUpsertStrategy", cmdPrefix) + if cmd.Flags().Changed(defaultPartialUpsertStrategyFlagName) { + + var defaultPartialUpsertStrategyFlagName string + if cmdPrefix == "" { + defaultPartialUpsertStrategyFlagName = "defaultPartialUpsertStrategy" + } else { + defaultPartialUpsertStrategyFlagName = fmt.Sprintf("%v.defaultPartialUpsertStrategy", cmdPrefix) + } + + defaultPartialUpsertStrategyFlagValue, err := cmd.Flags().GetString(defaultPartialUpsertStrategyFlagName) + if err != nil { + return err, false + } + m.DefaultPartialUpsertStrategy = defaultPartialUpsertStrategyFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveUpsertConfigEnableSnapshotFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + enableSnapshotFlagName := fmt.Sprintf("%v.enableSnapshot", cmdPrefix) + if cmd.Flags().Changed(enableSnapshotFlagName) { + + var enableSnapshotFlagName string + if cmdPrefix == "" { + enableSnapshotFlagName = "enableSnapshot" + } else { + enableSnapshotFlagName = fmt.Sprintf("%v.enableSnapshot", cmdPrefix) + } + + enableSnapshotFlagValue, err := cmd.Flags().GetBool(enableSnapshotFlagName) + if err != nil { + return err, false + } + m.EnableSnapshot = enableSnapshotFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveUpsertConfigHashFunctionFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + hashFunctionFlagName := fmt.Sprintf("%v.hashFunction", cmdPrefix) + if cmd.Flags().Changed(hashFunctionFlagName) { + + var hashFunctionFlagName string + if cmdPrefix == "" { + hashFunctionFlagName = "hashFunction" + } else { + hashFunctionFlagName = fmt.Sprintf("%v.hashFunction", cmdPrefix) + } + + hashFunctionFlagValue, err := cmd.Flags().GetString(hashFunctionFlagName) + if err != nil { + return err, false + } + m.HashFunction = hashFunctionFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveUpsertConfigMetadataManagerClassFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + metadataManagerClassFlagName := fmt.Sprintf("%v.metadataManagerClass", cmdPrefix) + if cmd.Flags().Changed(metadataManagerClassFlagName) { + + var metadataManagerClassFlagName string + if cmdPrefix == "" { + metadataManagerClassFlagName = "metadataManagerClass" + } else { + metadataManagerClassFlagName = fmt.Sprintf("%v.metadataManagerClass", cmdPrefix) + } + + metadataManagerClassFlagValue, err := cmd.Flags().GetString(metadataManagerClassFlagName) + if err != nil { + return err, false + } + m.MetadataManagerClass = metadataManagerClassFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveUpsertConfigMetadataManagerConfigsFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + metadataManagerConfigsFlagName := fmt.Sprintf("%v.metadataManagerConfigs", cmdPrefix) + if cmd.Flags().Changed(metadataManagerConfigsFlagName) { + // warning: metadataManagerConfigs map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveUpsertConfigModeFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + modeFlagName := fmt.Sprintf("%v.mode", cmdPrefix) + if cmd.Flags().Changed(modeFlagName) { + + var modeFlagName string + if cmdPrefix == "" { + modeFlagName = "mode" + } else { + modeFlagName = fmt.Sprintf("%v.mode", cmdPrefix) + } + + modeFlagValue, err := cmd.Flags().GetString(modeFlagName) + if err != nil { + return err, false + } + m.Mode = modeFlagValue + + retAdded = true + } + + return nil, retAdded +} + +func retrieveUpsertConfigPartialUpsertStrategiesFlags(depth int, m *models.UpsertConfig, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + partialUpsertStrategiesFlagName := fmt.Sprintf("%v.partialUpsertStrategies", cmdPrefix) + if cmd.Flags().Changed(partialUpsertStrategiesFlagName) { + // warning: partialUpsertStrategies map type map[string]string is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/cli/validate_config_operation.go b/src/cli/validate_config_operation.go new file mode 100644 index 0000000..396a3ed --- /dev/null +++ b/src/cli/validate_config_operation.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableValidateConfigCmd returns a cmd to handle operation validateConfig +func makeOperationTableValidateConfigCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "validateConfig", + Short: `Validate the TableConfigs`, + RunE: runOperationTableValidateConfig, + } + + if err := registerOperationTableValidateConfigParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableValidateConfig uses cmd flags to call endpoint api +func runOperationTableValidateConfig(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewValidateConfigParams() + if err, _ := retrieveOperationTableValidateConfigBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableValidateConfigValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableValidateConfigResult(appCli.Table.ValidateConfig(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableValidateConfigParamFlags registers all flags needed to fill params +func registerOperationTableValidateConfigParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableValidateConfigBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableValidateConfigValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableValidateConfigBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} +func registerOperationTableValidateConfigValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableValidateConfigBodyFlag(m *table.ValidateConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} +func retrieveOperationTableValidateConfigValidationTypesToSkipFlag(m *table.ValidateConfigParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableValidateConfigResult parses request result and return the string content +func parseOperationTableValidateConfigResult(resp0 *table.ValidateConfigOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.ValidateConfigOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/validate_schema1_operation.go b/src/cli/validate_schema1_operation.go new file mode 100644 index 0000000..f5194c7 --- /dev/null +++ b/src/cli/validate_schema1_operation.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "startree.ai/cli/client/schema" + + "github.com/spf13/cobra" +) + +// makeOperationSchemaValidateSchema1Cmd returns a cmd to handle operation validateSchema1 +func makeOperationSchemaValidateSchema1Cmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "validateSchema_1", + Short: `This API returns the schema that matches the one you get from 'GET /schema/{schemaName}'. This allows us to validate schema before apply.`, + RunE: runOperationSchemaValidateSchema1, + } + + if err := registerOperationSchemaValidateSchema1ParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationSchemaValidateSchema1 uses cmd flags to call endpoint api +func runOperationSchemaValidateSchema1(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := schema.NewValidateSchema1Params() + if err, _ := retrieveOperationSchemaValidateSchema1BodyFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationSchemaValidateSchema1Result(appCli.Schema.ValidateSchema1(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationSchemaValidateSchema1ParamFlags registers all flags needed to fill params +func registerOperationSchemaValidateSchema1ParamFlags(cmd *cobra.Command) error { + if err := registerOperationSchemaValidateSchema1BodyParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationSchemaValidateSchema1BodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + bodyDescription := `` + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + var bodyFlagDefault string + + _ = cmd.PersistentFlags().String(bodyFlagName, bodyFlagDefault, bodyDescription) + + return nil +} + +func retrieveOperationSchemaValidateSchema1BodyFlag(m *schema.ValidateSchema1Params, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + bodyFlagValue, err := cmd.Flags().GetString(bodyFlagName) + if err != nil { + return err, false + } + m.Body = bodyFlagValue + + } + return nil, retAdded +} + +// parseOperationSchemaValidateSchema1Result parses request result and return the string content +func parseOperationSchemaValidateSchema1Result(resp0 *schema.ValidateSchema1OK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning validateSchema1OK is not supported + + // Non schema case: warning validateSchema1BadRequest is not supported + + // Non schema case: warning validateSchema1InternalServerError is not supported + + return "", respErr + } + + // warning: non schema response validateSchema1OK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/validate_table_and_schema_operation.go b/src/cli/validate_table_and_schema_operation.go new file mode 100644 index 0000000..a7d74ef --- /dev/null +++ b/src/cli/validate_table_and_schema_operation.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/table" + "startree.ai/cli/models" + + "github.com/go-openapi/swag" + "github.com/spf13/cobra" +) + +// makeOperationTableValidateTableAndSchemaCmd returns a cmd to handle operation validateTableAndSchema +func makeOperationTableValidateTableAndSchemaCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "validateTableAndSchema", + Short: `Deprecated. Use /tableConfigs/validate instead.Validate given table config and schema. If specified schema is null, attempt to retrieve schema using the table name. This API returns the table config that matches the one you get from 'GET /tables/{tableName}'. This allows us to validate table config before apply.`, + RunE: runOperationTableValidateTableAndSchema, + } + + if err := registerOperationTableValidateTableAndSchemaParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationTableValidateTableAndSchema uses cmd flags to call endpoint api +func runOperationTableValidateTableAndSchema(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := table.NewValidateTableAndSchemaParams() + if err, _ := retrieveOperationTableValidateTableAndSchemaBodyFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationTableValidateTableAndSchemaValidationTypesToSkipFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationTableValidateTableAndSchemaResult(appCli.Table.ValidateTableAndSchema(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationTableValidateTableAndSchemaParamFlags registers all flags needed to fill params +func registerOperationTableValidateTableAndSchemaParamFlags(cmd *cobra.Command) error { + if err := registerOperationTableValidateTableAndSchemaBodyParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationTableValidateTableAndSchemaValidationTypesToSkipParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationTableValidateTableAndSchemaBodyParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + var bodyFlagName string + if cmdPrefix == "" { + bodyFlagName = "body" + } else { + bodyFlagName = fmt.Sprintf("%v.body", cmdPrefix) + } + + _ = cmd.PersistentFlags().String(bodyFlagName, "", "Optional json string for [body]. ") + + // add flags for body + if err := registerModelTableAndSchemaConfigFlags(0, "tableAndSchemaConfig", cmd); err != nil { + return err + } + + return nil +} +func registerOperationTableValidateTableAndSchemaValidationTypesToSkipParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + validationTypesToSkipDescription := `comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)` + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + var validationTypesToSkipFlagDefault string + + _ = cmd.PersistentFlags().String(validationTypesToSkipFlagName, validationTypesToSkipFlagDefault, validationTypesToSkipDescription) + + return nil +} + +func retrieveOperationTableValidateTableAndSchemaBodyFlag(m *table.ValidateTableAndSchemaParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("body") { + // Read body string from cmd and unmarshal + bodyValueStr, err := cmd.Flags().GetString("body") + if err != nil { + return err, false + } + + bodyValue := models.TableAndSchemaConfig{} + if err := json.Unmarshal([]byte(bodyValueStr), &bodyValue); err != nil { + return fmt.Errorf("cannot unmarshal body string in models.TableAndSchemaConfig: %v", err), false + } + m.Body = &bodyValue + } + bodyValueModel := m.Body + if swag.IsZero(bodyValueModel) { + bodyValueModel = &models.TableAndSchemaConfig{} + } + err, added := retrieveModelTableAndSchemaConfigFlags(0, bodyValueModel, "tableAndSchemaConfig", cmd) + if err != nil { + return err, false + } + if added { + m.Body = bodyValueModel + } + if dryRun && debug { + + bodyValueDebugBytes, err := json.Marshal(m.Body) + if err != nil { + return err, false + } + logDebugf("Body dry-run payload: %v", string(bodyValueDebugBytes)) + } + retAdded = retAdded || added + + return nil, retAdded +} +func retrieveOperationTableValidateTableAndSchemaValidationTypesToSkipFlag(m *table.ValidateTableAndSchemaParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("validationTypesToSkip") { + + var validationTypesToSkipFlagName string + if cmdPrefix == "" { + validationTypesToSkipFlagName = "validationTypesToSkip" + } else { + validationTypesToSkipFlagName = fmt.Sprintf("%v.validationTypesToSkip", cmdPrefix) + } + + validationTypesToSkipFlagValue, err := cmd.Flags().GetString(validationTypesToSkipFlagName) + if err != nil { + return err, false + } + m.ValidationTypesToSkip = &validationTypesToSkipFlagValue + + } + return nil, retAdded +} + +// parseOperationTableValidateTableAndSchemaResult parses request result and return the string content +func parseOperationTableValidateTableAndSchemaResult(resp0 *table.ValidateTableAndSchemaOK, respErr error) (string, error) { + if respErr != nil { + + var iResp0 interface{} = respErr + resp0, ok := iResp0.(*table.ValidateTableAndSchemaOK) + if ok { + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr, err := json.Marshal(resp0.Payload) + if err != nil { + return "", err + } + return string(msgStr), nil + } + } + + return "", respErr + } + + if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payload) { + msgStr := fmt.Sprintf("%v", resp0.Payload) + return string(msgStr), nil + } + + return "", nil +} diff --git a/src/cli/verify_operation.go b/src/cli/verify_operation.go new file mode 100644 index 0000000..7b7eb96 --- /dev/null +++ b/src/cli/verify_operation.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + + "startree.ai/cli/client/auth" + + "github.com/spf13/cobra" +) + +// makeOperationAuthVerifyCmd returns a cmd to handle operation verify +func makeOperationAuthVerifyCmd() (*cobra.Command, error) { + cmd := &cobra.Command{ + Use: "verify", + Short: ``, + RunE: runOperationAuthVerify, + } + + if err := registerOperationAuthVerifyParamFlags(cmd); err != nil { + return nil, err + } + + return cmd, nil +} + +// runOperationAuthVerify uses cmd flags to call endpoint api +func runOperationAuthVerify(cmd *cobra.Command, args []string) error { + appCli, err := makeClient(cmd, args) + if err != nil { + return err + } + // retrieve flag values from cmd and fill params + params := auth.NewVerifyParams() + if err, _ := retrieveOperationAuthVerifyAccessTypeFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAuthVerifyEndpointURLFlag(params, "", cmd); err != nil { + return err + } + if err, _ := retrieveOperationAuthVerifyTableNameFlag(params, "", cmd); err != nil { + return err + } + if dryRun { + + logDebugf("dry-run flag specified. Skip sending request.") + return nil + } + // make request and then print result + msgStr, err := parseOperationAuthVerifyResult(appCli.Auth.Verify(params, nil)) + if err != nil { + return err + } + if !debug { + + fmt.Println(msgStr) + } + return nil +} + +// registerOperationAuthVerifyParamFlags registers all flags needed to fill params +func registerOperationAuthVerifyParamFlags(cmd *cobra.Command) error { + if err := registerOperationAuthVerifyAccessTypeParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAuthVerifyEndpointURLParamFlags("", cmd); err != nil { + return err + } + if err := registerOperationAuthVerifyTableNameParamFlags("", cmd); err != nil { + return err + } + return nil +} + +func registerOperationAuthVerifyAccessTypeParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + accessTypeDescription := `Enum: ["CREATE","READ","UPDATE","DELETE"]. API access type` + + var accessTypeFlagName string + if cmdPrefix == "" { + accessTypeFlagName = "accessType" + } else { + accessTypeFlagName = fmt.Sprintf("%v.accessType", cmdPrefix) + } + + var accessTypeFlagDefault string + + _ = cmd.PersistentFlags().String(accessTypeFlagName, accessTypeFlagDefault, accessTypeDescription) + + if err := cmd.RegisterFlagCompletionFunc(accessTypeFlagName, + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + var res []string + if err := json.Unmarshal([]byte(`["CREATE","READ","UPDATE","DELETE"]`), &res); err != nil { + panic(err) + } + return res, cobra.ShellCompDirectiveDefault + }); err != nil { + return err + } + + return nil +} +func registerOperationAuthVerifyEndpointURLParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + endpointUrlDescription := `Endpoint URL` + + var endpointUrlFlagName string + if cmdPrefix == "" { + endpointUrlFlagName = "endpointUrl" + } else { + endpointUrlFlagName = fmt.Sprintf("%v.endpointUrl", cmdPrefix) + } + + var endpointUrlFlagDefault string + + _ = cmd.PersistentFlags().String(endpointUrlFlagName, endpointUrlFlagDefault, endpointUrlDescription) + + return nil +} +func registerOperationAuthVerifyTableNameParamFlags(cmdPrefix string, cmd *cobra.Command) error { + + tableNameDescription := `Table name without type` + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + var tableNameFlagDefault string + + _ = cmd.PersistentFlags().String(tableNameFlagName, tableNameFlagDefault, tableNameDescription) + + return nil +} + +func retrieveOperationAuthVerifyAccessTypeFlag(m *auth.VerifyParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("accessType") { + + var accessTypeFlagName string + if cmdPrefix == "" { + accessTypeFlagName = "accessType" + } else { + accessTypeFlagName = fmt.Sprintf("%v.accessType", cmdPrefix) + } + + accessTypeFlagValue, err := cmd.Flags().GetString(accessTypeFlagName) + if err != nil { + return err, false + } + m.AccessType = &accessTypeFlagValue + + } + return nil, retAdded +} +func retrieveOperationAuthVerifyEndpointURLFlag(m *auth.VerifyParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("endpointUrl") { + + var endpointUrlFlagName string + if cmdPrefix == "" { + endpointUrlFlagName = "endpointUrl" + } else { + endpointUrlFlagName = fmt.Sprintf("%v.endpointUrl", cmdPrefix) + } + + endpointUrlFlagValue, err := cmd.Flags().GetString(endpointUrlFlagName) + if err != nil { + return err, false + } + m.EndpointURL = &endpointUrlFlagValue + + } + return nil, retAdded +} +func retrieveOperationAuthVerifyTableNameFlag(m *auth.VerifyParams, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + if cmd.Flags().Changed("tableName") { + + var tableNameFlagName string + if cmdPrefix == "" { + tableNameFlagName = "tableName" + } else { + tableNameFlagName = fmt.Sprintf("%v.tableName", cmdPrefix) + } + + tableNameFlagValue, err := cmd.Flags().GetString(tableNameFlagName) + if err != nil { + return err, false + } + m.TableName = &tableNameFlagValue + + } + return nil, retAdded +} + +// parseOperationAuthVerifyResult parses request result and return the string content +func parseOperationAuthVerifyResult(resp0 *auth.VerifyOK, respErr error) (string, error) { + if respErr != nil { + + // Non schema case: warning verifyOK is not supported + + // Non schema case: warning verifyInternalServerError is not supported + + return "", respErr + } + + // warning: non schema response verifyOK is not supported by go-swagger cli yet. + + return "", nil +} diff --git a/src/cli/write_payload_model.go b/src/cli/write_payload_model.go new file mode 100644 index 0000000..20a78dc --- /dev/null +++ b/src/cli/write_payload_model.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cli + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/spf13/cobra" + "startree.ai/cli/models" +) + +// Schema cli for WritePayload + +// register flags to command +func registerModelWritePayloadFlags(depth int, cmdPrefix string, cmd *cobra.Command) error { + + if err := registerWritePayloadColumnNames(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerWritePayloadRows(depth, cmdPrefix, cmd); err != nil { + return err + } + + if err := registerWritePayloadValues(depth, cmdPrefix, cmd); err != nil { + return err + } + + return nil +} + +func registerWritePayloadColumnNames(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: columnNames []string array type is not supported by go-swagger cli yet + + return nil +} + +func registerWritePayloadRows(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: rows [][]interface{} array type is not supported by go-swagger cli yet + + return nil +} + +func registerWritePayloadValues(depth int, cmdPrefix string, cmd *cobra.Command) error { + if depth > maxDepth { + return nil + } + + // warning: values []map[string]interface{} array type is not supported by go-swagger cli yet + + return nil +} + +// retrieve flags from commands, and set value in model. Return true if any flag is passed by user to fill model field. +func retrieveModelWritePayloadFlags(depth int, m *models.WritePayload, cmdPrefix string, cmd *cobra.Command) (error, bool) { + retAdded := false + + err, columnNamesAdded := retrieveWritePayloadColumnNamesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || columnNamesAdded + + err, rowsAdded := retrieveWritePayloadRowsFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || rowsAdded + + err, valuesAdded := retrieveWritePayloadValuesFlags(depth, m, cmdPrefix, cmd) + if err != nil { + return err, false + } + retAdded = retAdded || valuesAdded + + return nil, retAdded +} + +func retrieveWritePayloadColumnNamesFlags(depth int, m *models.WritePayload, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + columnNamesFlagName := fmt.Sprintf("%v.columnNames", cmdPrefix) + if cmd.Flags().Changed(columnNamesFlagName) { + // warning: columnNames array type []string is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveWritePayloadRowsFlags(depth int, m *models.WritePayload, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + rowsFlagName := fmt.Sprintf("%v.rows", cmdPrefix) + if cmd.Flags().Changed(rowsFlagName) { + // warning: rows array type [][]interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} + +func retrieveWritePayloadValuesFlags(depth int, m *models.WritePayload, cmdPrefix string, cmd *cobra.Command) (error, bool) { + if depth > maxDepth { + return nil, false + } + retAdded := false + + valuesFlagName := fmt.Sprintf("%v.values", cmdPrefix) + if cmd.Flags().Changed(valuesFlagName) { + // warning: values array type []map[string]interface{} is not supported by go-swagger cli yet + } + + return nil, retAdded +} diff --git a/src/client/app_configs/app_configs_client.go b/src/client/app_configs/app_configs_client.go new file mode 100644 index 0000000..08180b0 --- /dev/null +++ b/src/client/app_configs/app_configs_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package app_configs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new app configs API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for app configs API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetAppConfigs(params *GetAppConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAppConfigsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetAppConfigs get app configs API +*/ +func (a *Client) GetAppConfigs(params *GetAppConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAppConfigsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAppConfigsParams() + } + op := &runtime.ClientOperation{ + ID: "getAppConfigs", + Method: "GET", + PathPattern: "/appconfigs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAppConfigsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetAppConfigsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getAppConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/app_configs/get_app_configs_parameters.go b/src/client/app_configs/get_app_configs_parameters.go new file mode 100644 index 0000000..9eabd30 --- /dev/null +++ b/src/client/app_configs/get_app_configs_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package app_configs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAppConfigsParams creates a new GetAppConfigsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAppConfigsParams() *GetAppConfigsParams { + return &GetAppConfigsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAppConfigsParamsWithTimeout creates a new GetAppConfigsParams object +// with the ability to set a timeout on a request. +func NewGetAppConfigsParamsWithTimeout(timeout time.Duration) *GetAppConfigsParams { + return &GetAppConfigsParams{ + timeout: timeout, + } +} + +// NewGetAppConfigsParamsWithContext creates a new GetAppConfigsParams object +// with the ability to set a context for a request. +func NewGetAppConfigsParamsWithContext(ctx context.Context) *GetAppConfigsParams { + return &GetAppConfigsParams{ + Context: ctx, + } +} + +// NewGetAppConfigsParamsWithHTTPClient creates a new GetAppConfigsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAppConfigsParamsWithHTTPClient(client *http.Client) *GetAppConfigsParams { + return &GetAppConfigsParams{ + HTTPClient: client, + } +} + +/* +GetAppConfigsParams contains all the parameters to send to the API endpoint + + for the get app configs operation. + + Typically these are written to a http.Request. +*/ +type GetAppConfigsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get app configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAppConfigsParams) WithDefaults() *GetAppConfigsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get app configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAppConfigsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get app configs params +func (o *GetAppConfigsParams) WithTimeout(timeout time.Duration) *GetAppConfigsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get app configs params +func (o *GetAppConfigsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get app configs params +func (o *GetAppConfigsParams) WithContext(ctx context.Context) *GetAppConfigsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get app configs params +func (o *GetAppConfigsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get app configs params +func (o *GetAppConfigsParams) WithHTTPClient(client *http.Client) *GetAppConfigsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get app configs params +func (o *GetAppConfigsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAppConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/app_configs/get_app_configs_responses.go b/src/client/app_configs/get_app_configs_responses.go new file mode 100644 index 0000000..ee577e8 --- /dev/null +++ b/src/client/app_configs/get_app_configs_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package app_configs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetAppConfigsReader is a Reader for the GetAppConfigs structure. +type GetAppConfigsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAppConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAppConfigsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAppConfigsOK creates a GetAppConfigsOK with default headers values +func NewGetAppConfigsOK() *GetAppConfigsOK { + return &GetAppConfigsOK{} +} + +/* +GetAppConfigsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetAppConfigsOK struct { + Payload string +} + +// IsSuccess returns true when this get app configs o k response has a 2xx status code +func (o *GetAppConfigsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get app configs o k response has a 3xx status code +func (o *GetAppConfigsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get app configs o k response has a 4xx status code +func (o *GetAppConfigsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get app configs o k response has a 5xx status code +func (o *GetAppConfigsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get app configs o k response a status code equal to that given +func (o *GetAppConfigsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get app configs o k response +func (o *GetAppConfigsOK) Code() int { + return 200 +} + +func (o *GetAppConfigsOK) Error() string { + return fmt.Sprintf("[GET /appconfigs][%d] getAppConfigsOK %+v", 200, o.Payload) +} + +func (o *GetAppConfigsOK) String() string { + return fmt.Sprintf("[GET /appconfigs][%d] getAppConfigsOK %+v", 200, o.Payload) +} + +func (o *GetAppConfigsOK) GetPayload() string { + return o.Payload +} + +func (o *GetAppConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/atomic_ingestion/atomic_ingestion_client.go b/src/client/atomic_ingestion/atomic_ingestion_client.go new file mode 100644 index 0000000..c1db708 --- /dev/null +++ b/src/client/atomic_ingestion/atomic_ingestion_client.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package atomic_ingestion + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new atomic ingestion API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for atomic ingestion API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + EndDataIngestRequest(params *EndDataIngestRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + StartDataIngestRequest(params *StartDataIngestRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + SetTransport(transport runtime.ClientTransport) +} + +/* +EndDataIngestRequest marks the end of data ingestion to upload multiple segments +*/ +func (a *Client) EndDataIngestRequest(params *EndDataIngestRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewEndDataIngestRequestParams() + } + op := &runtime.ClientOperation{ + ID: "endDataIngestRequest", + Method: "POST", + PathPattern: "/segments/{tableName}/endDataIngestRequest", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &EndDataIngestRequestReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +StartDataIngestRequest marks the start of data ingestion to upload multiple segments +*/ +func (a *Client) StartDataIngestRequest(params *StartDataIngestRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewStartDataIngestRequestParams() + } + op := &runtime.ClientOperation{ + ID: "startDataIngestRequest", + Method: "POST", + PathPattern: "/segments/{tableName}/startDataIngestRequest", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &StartDataIngestRequestReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/atomic_ingestion/end_data_ingest_request_parameters.go b/src/client/atomic_ingestion/end_data_ingest_request_parameters.go new file mode 100644 index 0000000..b7fa7a2 --- /dev/null +++ b/src/client/atomic_ingestion/end_data_ingest_request_parameters.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package atomic_ingestion + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewEndDataIngestRequestParams creates a new EndDataIngestRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewEndDataIngestRequestParams() *EndDataIngestRequestParams { + return &EndDataIngestRequestParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEndDataIngestRequestParamsWithTimeout creates a new EndDataIngestRequestParams object +// with the ability to set a timeout on a request. +func NewEndDataIngestRequestParamsWithTimeout(timeout time.Duration) *EndDataIngestRequestParams { + return &EndDataIngestRequestParams{ + timeout: timeout, + } +} + +// NewEndDataIngestRequestParamsWithContext creates a new EndDataIngestRequestParams object +// with the ability to set a context for a request. +func NewEndDataIngestRequestParamsWithContext(ctx context.Context) *EndDataIngestRequestParams { + return &EndDataIngestRequestParams{ + Context: ctx, + } +} + +// NewEndDataIngestRequestParamsWithHTTPClient creates a new EndDataIngestRequestParams object +// with the ability to set a custom HTTPClient for a request. +func NewEndDataIngestRequestParamsWithHTTPClient(client *http.Client) *EndDataIngestRequestParams { + return &EndDataIngestRequestParams{ + HTTPClient: client, + } +} + +/* +EndDataIngestRequestParams contains all the parameters to send to the API endpoint + + for the end data ingest request operation. + + Typically these are written to a http.Request. +*/ +type EndDataIngestRequestParams struct { + + /* CheckpointEntryKey. + + Key of checkpoint entry + */ + CheckpointEntryKey string + + /* TableName. + + Name of the table + */ + TableName string + + /* TableType. + + OFFLINE|REALTIME + */ + TableType string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the end data ingest request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EndDataIngestRequestParams) WithDefaults() *EndDataIngestRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the end data ingest request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EndDataIngestRequestParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the end data ingest request params +func (o *EndDataIngestRequestParams) WithTimeout(timeout time.Duration) *EndDataIngestRequestParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the end data ingest request params +func (o *EndDataIngestRequestParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the end data ingest request params +func (o *EndDataIngestRequestParams) WithContext(ctx context.Context) *EndDataIngestRequestParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the end data ingest request params +func (o *EndDataIngestRequestParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the end data ingest request params +func (o *EndDataIngestRequestParams) WithHTTPClient(client *http.Client) *EndDataIngestRequestParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the end data ingest request params +func (o *EndDataIngestRequestParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCheckpointEntryKey adds the checkpointEntryKey to the end data ingest request params +func (o *EndDataIngestRequestParams) WithCheckpointEntryKey(checkpointEntryKey string) *EndDataIngestRequestParams { + o.SetCheckpointEntryKey(checkpointEntryKey) + return o +} + +// SetCheckpointEntryKey adds the checkpointEntryKey to the end data ingest request params +func (o *EndDataIngestRequestParams) SetCheckpointEntryKey(checkpointEntryKey string) { + o.CheckpointEntryKey = checkpointEntryKey +} + +// WithTableName adds the tableName to the end data ingest request params +func (o *EndDataIngestRequestParams) WithTableName(tableName string) *EndDataIngestRequestParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the end data ingest request params +func (o *EndDataIngestRequestParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithTableType adds the tableType to the end data ingest request params +func (o *EndDataIngestRequestParams) WithTableType(tableType string) *EndDataIngestRequestParams { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the end data ingest request params +func (o *EndDataIngestRequestParams) SetTableType(tableType string) { + o.TableType = tableType +} + +// WithTaskType adds the taskType to the end data ingest request params +func (o *EndDataIngestRequestParams) WithTaskType(taskType string) *EndDataIngestRequestParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the end data ingest request params +func (o *EndDataIngestRequestParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *EndDataIngestRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param checkpointEntryKey + qrCheckpointEntryKey := o.CheckpointEntryKey + qCheckpointEntryKey := qrCheckpointEntryKey + if qCheckpointEntryKey != "" { + + if err := r.SetQueryParam("checkpointEntryKey", qCheckpointEntryKey); err != nil { + return err + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param tableType + qrTableType := o.TableType + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + + // query param taskType + qrTaskType := o.TaskType + qTaskType := qrTaskType + if qTaskType != "" { + + if err := r.SetQueryParam("taskType", qTaskType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/atomic_ingestion/end_data_ingest_request_responses.go b/src/client/atomic_ingestion/end_data_ingest_request_responses.go new file mode 100644 index 0000000..5b82771 --- /dev/null +++ b/src/client/atomic_ingestion/end_data_ingest_request_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package atomic_ingestion + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// EndDataIngestRequestReader is a Reader for the EndDataIngestRequest structure. +type EndDataIngestRequestReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EndDataIngestRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewEndDataIngestRequestDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewEndDataIngestRequestDefault creates a EndDataIngestRequestDefault with default headers values +func NewEndDataIngestRequestDefault(code int) *EndDataIngestRequestDefault { + return &EndDataIngestRequestDefault{ + _statusCode: code, + } +} + +/* +EndDataIngestRequestDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type EndDataIngestRequestDefault struct { + _statusCode int +} + +// IsSuccess returns true when this end data ingest request default response has a 2xx status code +func (o *EndDataIngestRequestDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this end data ingest request default response has a 3xx status code +func (o *EndDataIngestRequestDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this end data ingest request default response has a 4xx status code +func (o *EndDataIngestRequestDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this end data ingest request default response has a 5xx status code +func (o *EndDataIngestRequestDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this end data ingest request default response a status code equal to that given +func (o *EndDataIngestRequestDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the end data ingest request default response +func (o *EndDataIngestRequestDefault) Code() int { + return o._statusCode +} + +func (o *EndDataIngestRequestDefault) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/endDataIngestRequest][%d] endDataIngestRequest default ", o._statusCode) +} + +func (o *EndDataIngestRequestDefault) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/endDataIngestRequest][%d] endDataIngestRequest default ", o._statusCode) +} + +func (o *EndDataIngestRequestDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/atomic_ingestion/start_data_ingest_request_parameters.go b/src/client/atomic_ingestion/start_data_ingest_request_parameters.go new file mode 100644 index 0000000..3004dec --- /dev/null +++ b/src/client/atomic_ingestion/start_data_ingest_request_parameters.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package atomic_ingestion + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStartDataIngestRequestParams creates a new StartDataIngestRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStartDataIngestRequestParams() *StartDataIngestRequestParams { + return &StartDataIngestRequestParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStartDataIngestRequestParamsWithTimeout creates a new StartDataIngestRequestParams object +// with the ability to set a timeout on a request. +func NewStartDataIngestRequestParamsWithTimeout(timeout time.Duration) *StartDataIngestRequestParams { + return &StartDataIngestRequestParams{ + timeout: timeout, + } +} + +// NewStartDataIngestRequestParamsWithContext creates a new StartDataIngestRequestParams object +// with the ability to set a context for a request. +func NewStartDataIngestRequestParamsWithContext(ctx context.Context) *StartDataIngestRequestParams { + return &StartDataIngestRequestParams{ + Context: ctx, + } +} + +// NewStartDataIngestRequestParamsWithHTTPClient creates a new StartDataIngestRequestParams object +// with the ability to set a custom HTTPClient for a request. +func NewStartDataIngestRequestParamsWithHTTPClient(client *http.Client) *StartDataIngestRequestParams { + return &StartDataIngestRequestParams{ + HTTPClient: client, + } +} + +/* +StartDataIngestRequestParams contains all the parameters to send to the API endpoint + + for the start data ingest request operation. + + Typically these are written to a http.Request. +*/ +type StartDataIngestRequestParams struct { + + // Body. + Body string + + /* TableName. + + Name of the table + */ + TableName string + + /* TableType. + + OFFLINE|REALTIME + */ + TableType string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the start data ingest request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartDataIngestRequestParams) WithDefaults() *StartDataIngestRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start data ingest request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartDataIngestRequestParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the start data ingest request params +func (o *StartDataIngestRequestParams) WithTimeout(timeout time.Duration) *StartDataIngestRequestParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the start data ingest request params +func (o *StartDataIngestRequestParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the start data ingest request params +func (o *StartDataIngestRequestParams) WithContext(ctx context.Context) *StartDataIngestRequestParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the start data ingest request params +func (o *StartDataIngestRequestParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the start data ingest request params +func (o *StartDataIngestRequestParams) WithHTTPClient(client *http.Client) *StartDataIngestRequestParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the start data ingest request params +func (o *StartDataIngestRequestParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the start data ingest request params +func (o *StartDataIngestRequestParams) WithBody(body string) *StartDataIngestRequestParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the start data ingest request params +func (o *StartDataIngestRequestParams) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the start data ingest request params +func (o *StartDataIngestRequestParams) WithTableName(tableName string) *StartDataIngestRequestParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the start data ingest request params +func (o *StartDataIngestRequestParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithTableType adds the tableType to the start data ingest request params +func (o *StartDataIngestRequestParams) WithTableType(tableType string) *StartDataIngestRequestParams { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the start data ingest request params +func (o *StartDataIngestRequestParams) SetTableType(tableType string) { + o.TableType = tableType +} + +// WithTaskType adds the taskType to the start data ingest request params +func (o *StartDataIngestRequestParams) WithTaskType(taskType string) *StartDataIngestRequestParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the start data ingest request params +func (o *StartDataIngestRequestParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *StartDataIngestRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param tableType + qrTableType := o.TableType + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + + // query param taskType + qrTaskType := o.TaskType + qTaskType := qrTaskType + if qTaskType != "" { + + if err := r.SetQueryParam("taskType", qTaskType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/atomic_ingestion/start_data_ingest_request_responses.go b/src/client/atomic_ingestion/start_data_ingest_request_responses.go new file mode 100644 index 0000000..9048b0d --- /dev/null +++ b/src/client/atomic_ingestion/start_data_ingest_request_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package atomic_ingestion + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StartDataIngestRequestReader is a Reader for the StartDataIngestRequest structure. +type StartDataIngestRequestReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StartDataIngestRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewStartDataIngestRequestDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewStartDataIngestRequestDefault creates a StartDataIngestRequestDefault with default headers values +func NewStartDataIngestRequestDefault(code int) *StartDataIngestRequestDefault { + return &StartDataIngestRequestDefault{ + _statusCode: code, + } +} + +/* +StartDataIngestRequestDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type StartDataIngestRequestDefault struct { + _statusCode int +} + +// IsSuccess returns true when this start data ingest request default response has a 2xx status code +func (o *StartDataIngestRequestDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this start data ingest request default response has a 3xx status code +func (o *StartDataIngestRequestDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this start data ingest request default response has a 4xx status code +func (o *StartDataIngestRequestDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this start data ingest request default response has a 5xx status code +func (o *StartDataIngestRequestDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this start data ingest request default response a status code equal to that given +func (o *StartDataIngestRequestDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the start data ingest request default response +func (o *StartDataIngestRequestDefault) Code() int { + return o._statusCode +} + +func (o *StartDataIngestRequestDefault) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/startDataIngestRequest][%d] startDataIngestRequest default ", o._statusCode) +} + +func (o *StartDataIngestRequestDefault) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/startDataIngestRequest][%d] startDataIngestRequest default ", o._statusCode) +} + +func (o *StartDataIngestRequestDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/auth/auth_client.go b/src/client/auth/auth_client.go new file mode 100644 index 0000000..d521ab0 --- /dev/null +++ b/src/client/auth/auth_client.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package auth + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new auth API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for auth API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + Info(params *InfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InfoOK, error) + + Verify(params *VerifyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +Info retrieves auth workflow info +*/ +func (a *Client) Info(params *InfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewInfoParams() + } + op := &runtime.ClientOperation{ + ID: "info", + Method: "GET", + PathPattern: "/auth/info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &InfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*InfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for info: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Verify checks whether authentication is enabled +*/ +func (a *Client) Verify(params *VerifyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVerifyParams() + } + op := &runtime.ClientOperation{ + ID: "verify", + Method: "GET", + PathPattern: "/auth/verify", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &VerifyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*VerifyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for verify: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/auth/info_parameters.go b/src/client/auth/info_parameters.go new file mode 100644 index 0000000..45bced8 --- /dev/null +++ b/src/client/auth/info_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package auth + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewInfoParams creates a new InfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewInfoParams() *InfoParams { + return &InfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewInfoParamsWithTimeout creates a new InfoParams object +// with the ability to set a timeout on a request. +func NewInfoParamsWithTimeout(timeout time.Duration) *InfoParams { + return &InfoParams{ + timeout: timeout, + } +} + +// NewInfoParamsWithContext creates a new InfoParams object +// with the ability to set a context for a request. +func NewInfoParamsWithContext(ctx context.Context) *InfoParams { + return &InfoParams{ + Context: ctx, + } +} + +// NewInfoParamsWithHTTPClient creates a new InfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewInfoParamsWithHTTPClient(client *http.Client) *InfoParams { + return &InfoParams{ + HTTPClient: client, + } +} + +/* +InfoParams contains all the parameters to send to the API endpoint + + for the info operation. + + Typically these are written to a http.Request. +*/ +type InfoParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InfoParams) WithDefaults() *InfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the info params +func (o *InfoParams) WithTimeout(timeout time.Duration) *InfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the info params +func (o *InfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the info params +func (o *InfoParams) WithContext(ctx context.Context) *InfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the info params +func (o *InfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the info params +func (o *InfoParams) WithHTTPClient(client *http.Client) *InfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the info params +func (o *InfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *InfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/auth/info_responses.go b/src/client/auth/info_responses.go new file mode 100644 index 0000000..7e1f742 --- /dev/null +++ b/src/client/auth/info_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package auth + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// InfoReader is a Reader for the Info structure. +type InfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewInfoOK creates a InfoOK with default headers values +func NewInfoOK() *InfoOK { + return &InfoOK{} +} + +/* +InfoOK describes a response with status code 200, with default header values. + +Auth workflow info provided +*/ +type InfoOK struct { +} + +// IsSuccess returns true when this info o k response has a 2xx status code +func (o *InfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this info o k response has a 3xx status code +func (o *InfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this info o k response has a 4xx status code +func (o *InfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this info o k response has a 5xx status code +func (o *InfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this info o k response a status code equal to that given +func (o *InfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the info o k response +func (o *InfoOK) Code() int { + return 200 +} + +func (o *InfoOK) Error() string { + return fmt.Sprintf("[GET /auth/info][%d] infoOK ", 200) +} + +func (o *InfoOK) String() string { + return fmt.Sprintf("[GET /auth/info][%d] infoOK ", 200) +} + +func (o *InfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/auth/verify_parameters.go b/src/client/auth/verify_parameters.go new file mode 100644 index 0000000..b997f55 --- /dev/null +++ b/src/client/auth/verify_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package auth + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewVerifyParams creates a new VerifyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewVerifyParams() *VerifyParams { + return &VerifyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewVerifyParamsWithTimeout creates a new VerifyParams object +// with the ability to set a timeout on a request. +func NewVerifyParamsWithTimeout(timeout time.Duration) *VerifyParams { + return &VerifyParams{ + timeout: timeout, + } +} + +// NewVerifyParamsWithContext creates a new VerifyParams object +// with the ability to set a context for a request. +func NewVerifyParamsWithContext(ctx context.Context) *VerifyParams { + return &VerifyParams{ + Context: ctx, + } +} + +// NewVerifyParamsWithHTTPClient creates a new VerifyParams object +// with the ability to set a custom HTTPClient for a request. +func NewVerifyParamsWithHTTPClient(client *http.Client) *VerifyParams { + return &VerifyParams{ + HTTPClient: client, + } +} + +/* +VerifyParams contains all the parameters to send to the API endpoint + + for the verify operation. + + Typically these are written to a http.Request. +*/ +type VerifyParams struct { + + /* AccessType. + + API access type + */ + AccessType *string + + /* EndpointURL. + + Endpoint URL + */ + EndpointURL *string + + /* TableName. + + Table name without type + */ + TableName *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the verify params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *VerifyParams) WithDefaults() *VerifyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the verify params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *VerifyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the verify params +func (o *VerifyParams) WithTimeout(timeout time.Duration) *VerifyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the verify params +func (o *VerifyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the verify params +func (o *VerifyParams) WithContext(ctx context.Context) *VerifyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the verify params +func (o *VerifyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the verify params +func (o *VerifyParams) WithHTTPClient(client *http.Client) *VerifyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the verify params +func (o *VerifyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccessType adds the accessType to the verify params +func (o *VerifyParams) WithAccessType(accessType *string) *VerifyParams { + o.SetAccessType(accessType) + return o +} + +// SetAccessType adds the accessType to the verify params +func (o *VerifyParams) SetAccessType(accessType *string) { + o.AccessType = accessType +} + +// WithEndpointURL adds the endpointURL to the verify params +func (o *VerifyParams) WithEndpointURL(endpointURL *string) *VerifyParams { + o.SetEndpointURL(endpointURL) + return o +} + +// SetEndpointURL adds the endpointUrl to the verify params +func (o *VerifyParams) SetEndpointURL(endpointURL *string) { + o.EndpointURL = endpointURL +} + +// WithTableName adds the tableName to the verify params +func (o *VerifyParams) WithTableName(tableName *string) *VerifyParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the verify params +func (o *VerifyParams) SetTableName(tableName *string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *VerifyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccessType != nil { + + // query param accessType + var qrAccessType string + + if o.AccessType != nil { + qrAccessType = *o.AccessType + } + qAccessType := qrAccessType + if qAccessType != "" { + + if err := r.SetQueryParam("accessType", qAccessType); err != nil { + return err + } + } + } + + if o.EndpointURL != nil { + + // query param endpointUrl + var qrEndpointURL string + + if o.EndpointURL != nil { + qrEndpointURL = *o.EndpointURL + } + qEndpointURL := qrEndpointURL + if qEndpointURL != "" { + + if err := r.SetQueryParam("endpointUrl", qEndpointURL); err != nil { + return err + } + } + } + + if o.TableName != nil { + + // query param tableName + var qrTableName string + + if o.TableName != nil { + qrTableName = *o.TableName + } + qTableName := qrTableName + if qTableName != "" { + + if err := r.SetQueryParam("tableName", qTableName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/auth/verify_responses.go b/src/client/auth/verify_responses.go new file mode 100644 index 0000000..eedbe19 --- /dev/null +++ b/src/client/auth/verify_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package auth + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// VerifyReader is a Reader for the Verify structure. +type VerifyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VerifyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewVerifyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewVerifyInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewVerifyOK creates a VerifyOK with default headers values +func NewVerifyOK() *VerifyOK { + return &VerifyOK{} +} + +/* +VerifyOK describes a response with status code 200, with default header values. + +Verification result provided +*/ +type VerifyOK struct { +} + +// IsSuccess returns true when this verify o k response has a 2xx status code +func (o *VerifyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this verify o k response has a 3xx status code +func (o *VerifyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this verify o k response has a 4xx status code +func (o *VerifyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this verify o k response has a 5xx status code +func (o *VerifyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this verify o k response a status code equal to that given +func (o *VerifyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the verify o k response +func (o *VerifyOK) Code() int { + return 200 +} + +func (o *VerifyOK) Error() string { + return fmt.Sprintf("[GET /auth/verify][%d] verifyOK ", 200) +} + +func (o *VerifyOK) String() string { + return fmt.Sprintf("[GET /auth/verify][%d] verifyOK ", 200) +} + +func (o *VerifyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewVerifyInternalServerError creates a VerifyInternalServerError with default headers values +func NewVerifyInternalServerError() *VerifyInternalServerError { + return &VerifyInternalServerError{} +} + +/* +VerifyInternalServerError describes a response with status code 500, with default header values. + +Verification error +*/ +type VerifyInternalServerError struct { +} + +// IsSuccess returns true when this verify internal server error response has a 2xx status code +func (o *VerifyInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this verify internal server error response has a 3xx status code +func (o *VerifyInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this verify internal server error response has a 4xx status code +func (o *VerifyInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this verify internal server error response has a 5xx status code +func (o *VerifyInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this verify internal server error response a status code equal to that given +func (o *VerifyInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the verify internal server error response +func (o *VerifyInternalServerError) Code() int { + return 500 +} + +func (o *VerifyInternalServerError) Error() string { + return fmt.Sprintf("[GET /auth/verify][%d] verifyInternalServerError ", 500) +} + +func (o *VerifyInternalServerError) String() string { + return fmt.Sprintf("[GET /auth/verify][%d] verifyInternalServerError ", 500) +} + +func (o *VerifyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/broker/broker_client.go b/src/client/broker/broker_client.go new file mode 100644 index 0000000..599d7ff --- /dev/null +++ b/src/client/broker/broker_client.go @@ -0,0 +1,512 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new broker API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for broker API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetBrokersForTable(params *GetBrokersForTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTableOK, error) + + GetBrokersForTableV2(params *GetBrokersForTableV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTableV2OK, error) + + GetBrokersForTenant(params *GetBrokersForTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTenantOK, error) + + GetBrokersForTenantV2(params *GetBrokersForTenantV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTenantV2OK, error) + + GetTablesToBrokersMapping(params *GetTablesToBrokersMappingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTablesToBrokersMappingOK, error) + + GetTablesToBrokersMappingV2(params *GetTablesToBrokersMappingV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTablesToBrokersMappingV2OK, error) + + GetTenantsToBrokersMapping(params *GetTenantsToBrokersMappingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsToBrokersMappingOK, error) + + GetTenantsToBrokersMappingV2(params *GetTenantsToBrokersMappingV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsToBrokersMappingV2OK, error) + + ListBrokersMapping(params *ListBrokersMappingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListBrokersMappingOK, error) + + ListBrokersMappingV2(params *ListBrokersMappingV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListBrokersMappingV2OK, error) + + ToggleQueryRateLimiting(params *ToggleQueryRateLimitingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ToggleQueryRateLimitingOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetBrokersForTable lists brokers for a given table + +List brokers for a given table +*/ +func (a *Client) GetBrokersForTable(params *GetBrokersForTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBrokersForTableParams() + } + op := &runtime.ClientOperation{ + ID: "getBrokersForTable", + Method: "GET", + PathPattern: "/brokers/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetBrokersForTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBrokersForTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBrokersForTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetBrokersForTableV2 lists brokers for a given table + +List brokers for a given table +*/ +func (a *Client) GetBrokersForTableV2(params *GetBrokersForTableV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTableV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBrokersForTableV2Params() + } + op := &runtime.ClientOperation{ + ID: "getBrokersForTableV2", + Method: "GET", + PathPattern: "/v2/brokers/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetBrokersForTableV2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBrokersForTableV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBrokersForTableV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetBrokersForTenant lists brokers for a given tenant + +List brokers for a given tenant +*/ +func (a *Client) GetBrokersForTenant(params *GetBrokersForTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBrokersForTenantParams() + } + op := &runtime.ClientOperation{ + ID: "getBrokersForTenant", + Method: "GET", + PathPattern: "/brokers/tenants/{tenantName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetBrokersForTenantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBrokersForTenantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBrokersForTenant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetBrokersForTenantV2 lists brokers for a given tenant + +List brokers for a given tenant +*/ +func (a *Client) GetBrokersForTenantV2(params *GetBrokersForTenantV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBrokersForTenantV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBrokersForTenantV2Params() + } + op := &runtime.ClientOperation{ + ID: "getBrokersForTenantV2", + Method: "GET", + PathPattern: "/v2/brokers/tenants/{tenantName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetBrokersForTenantV2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBrokersForTenantV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getBrokersForTenantV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTablesToBrokersMapping lists tables to brokers mappings + +List tables to brokers mappings +*/ +func (a *Client) GetTablesToBrokersMapping(params *GetTablesToBrokersMappingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTablesToBrokersMappingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTablesToBrokersMappingParams() + } + op := &runtime.ClientOperation{ + ID: "getTablesToBrokersMapping", + Method: "GET", + PathPattern: "/brokers/tables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTablesToBrokersMappingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTablesToBrokersMappingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTablesToBrokersMapping: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTablesToBrokersMappingV2 lists tables to brokers mappings + +List tables to brokers mappings +*/ +func (a *Client) GetTablesToBrokersMappingV2(params *GetTablesToBrokersMappingV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTablesToBrokersMappingV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTablesToBrokersMappingV2Params() + } + op := &runtime.ClientOperation{ + ID: "getTablesToBrokersMappingV2", + Method: "GET", + PathPattern: "/v2/brokers/tables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTablesToBrokersMappingV2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTablesToBrokersMappingV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTablesToBrokersMappingV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTenantsToBrokersMapping lists tenants to brokers mappings + +List tenants to brokers mappings +*/ +func (a *Client) GetTenantsToBrokersMapping(params *GetTenantsToBrokersMappingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsToBrokersMappingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsToBrokersMappingParams() + } + op := &runtime.ClientOperation{ + ID: "getTenantsToBrokersMapping", + Method: "GET", + PathPattern: "/brokers/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTenantsToBrokersMappingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTenantsToBrokersMappingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTenantsToBrokersMapping: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTenantsToBrokersMappingV2 lists tenants to brokers mappings + +List tenants to brokers mappings +*/ +func (a *Client) GetTenantsToBrokersMappingV2(params *GetTenantsToBrokersMappingV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsToBrokersMappingV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsToBrokersMappingV2Params() + } + op := &runtime.ClientOperation{ + ID: "getTenantsToBrokersMappingV2", + Method: "GET", + PathPattern: "/v2/brokers/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTenantsToBrokersMappingV2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTenantsToBrokersMappingV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTenantsToBrokersMappingV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListBrokersMapping lists tenants and tables to brokers mappings + +List tenants and tables to brokers mappings +*/ +func (a *Client) ListBrokersMapping(params *ListBrokersMappingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListBrokersMappingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListBrokersMappingParams() + } + op := &runtime.ClientOperation{ + ID: "listBrokersMapping", + Method: "GET", + PathPattern: "/brokers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListBrokersMappingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListBrokersMappingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listBrokersMapping: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListBrokersMappingV2 lists tenants and tables to brokers mappings + +List tenants and tables to brokers mappings +*/ +func (a *Client) ListBrokersMappingV2(params *ListBrokersMappingV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListBrokersMappingV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListBrokersMappingV2Params() + } + op := &runtime.ClientOperation{ + ID: "listBrokersMappingV2", + Method: "GET", + PathPattern: "/v2/brokers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListBrokersMappingV2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListBrokersMappingV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listBrokersMappingV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ToggleQueryRateLimiting enables disable the query rate limiting for a broker instance + +Enable/disable the query rate limiting for a broker instance +*/ +func (a *Client) ToggleQueryRateLimiting(params *ToggleQueryRateLimitingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ToggleQueryRateLimitingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewToggleQueryRateLimitingParams() + } + op := &runtime.ClientOperation{ + ID: "toggleQueryRateLimiting", + Method: "POST", + PathPattern: "/brokers/instances/{instanceName}/qps", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"text/plain"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ToggleQueryRateLimitingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ToggleQueryRateLimitingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for toggleQueryRateLimiting: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/broker/get_brokers_for_table_parameters.go b/src/client/broker/get_brokers_for_table_parameters.go new file mode 100644 index 0000000..6d1542a --- /dev/null +++ b/src/client/broker/get_brokers_for_table_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetBrokersForTableParams creates a new GetBrokersForTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBrokersForTableParams() *GetBrokersForTableParams { + return &GetBrokersForTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBrokersForTableParamsWithTimeout creates a new GetBrokersForTableParams object +// with the ability to set a timeout on a request. +func NewGetBrokersForTableParamsWithTimeout(timeout time.Duration) *GetBrokersForTableParams { + return &GetBrokersForTableParams{ + timeout: timeout, + } +} + +// NewGetBrokersForTableParamsWithContext creates a new GetBrokersForTableParams object +// with the ability to set a context for a request. +func NewGetBrokersForTableParamsWithContext(ctx context.Context) *GetBrokersForTableParams { + return &GetBrokersForTableParams{ + Context: ctx, + } +} + +// NewGetBrokersForTableParamsWithHTTPClient creates a new GetBrokersForTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBrokersForTableParamsWithHTTPClient(client *http.Client) *GetBrokersForTableParams { + return &GetBrokersForTableParams{ + HTTPClient: client, + } +} + +/* +GetBrokersForTableParams contains all the parameters to send to the API endpoint + + for the get brokers for table operation. + + Typically these are written to a http.Request. +*/ +type GetBrokersForTableParams struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get brokers for table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTableParams) WithDefaults() *GetBrokersForTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get brokers for table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get brokers for table params +func (o *GetBrokersForTableParams) WithTimeout(timeout time.Duration) *GetBrokersForTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get brokers for table params +func (o *GetBrokersForTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get brokers for table params +func (o *GetBrokersForTableParams) WithContext(ctx context.Context) *GetBrokersForTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get brokers for table params +func (o *GetBrokersForTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get brokers for table params +func (o *GetBrokersForTableParams) WithHTTPClient(client *http.Client) *GetBrokersForTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get brokers for table params +func (o *GetBrokersForTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get brokers for table params +func (o *GetBrokersForTableParams) WithState(state *string) *GetBrokersForTableParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get brokers for table params +func (o *GetBrokersForTableParams) SetState(state *string) { + o.State = state +} + +// WithTableName adds the tableName to the get brokers for table params +func (o *GetBrokersForTableParams) WithTableName(tableName string) *GetBrokersForTableParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get brokers for table params +func (o *GetBrokersForTableParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get brokers for table params +func (o *GetBrokersForTableParams) WithType(typeVar *string) *GetBrokersForTableParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get brokers for table params +func (o *GetBrokersForTableParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBrokersForTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_brokers_for_table_responses.go b/src/client/broker/get_brokers_for_table_responses.go new file mode 100644 index 0000000..68321e4 --- /dev/null +++ b/src/client/broker/get_brokers_for_table_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetBrokersForTableReader is a Reader for the GetBrokersForTable structure. +type GetBrokersForTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBrokersForTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBrokersForTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetBrokersForTableOK creates a GetBrokersForTableOK with default headers values +func NewGetBrokersForTableOK() *GetBrokersForTableOK { + return &GetBrokersForTableOK{} +} + +/* +GetBrokersForTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetBrokersForTableOK struct { + Payload []string +} + +// IsSuccess returns true when this get brokers for table o k response has a 2xx status code +func (o *GetBrokersForTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get brokers for table o k response has a 3xx status code +func (o *GetBrokersForTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get brokers for table o k response has a 4xx status code +func (o *GetBrokersForTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get brokers for table o k response has a 5xx status code +func (o *GetBrokersForTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get brokers for table o k response a status code equal to that given +func (o *GetBrokersForTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get brokers for table o k response +func (o *GetBrokersForTableOK) Code() int { + return 200 +} + +func (o *GetBrokersForTableOK) Error() string { + return fmt.Sprintf("[GET /brokers/tables/{tableName}][%d] getBrokersForTableOK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTableOK) String() string { + return fmt.Sprintf("[GET /brokers/tables/{tableName}][%d] getBrokersForTableOK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTableOK) GetPayload() []string { + return o.Payload +} + +func (o *GetBrokersForTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_brokers_for_table_v2_parameters.go b/src/client/broker/get_brokers_for_table_v2_parameters.go new file mode 100644 index 0000000..13c02aa --- /dev/null +++ b/src/client/broker/get_brokers_for_table_v2_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetBrokersForTableV2Params creates a new GetBrokersForTableV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBrokersForTableV2Params() *GetBrokersForTableV2Params { + return &GetBrokersForTableV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBrokersForTableV2ParamsWithTimeout creates a new GetBrokersForTableV2Params object +// with the ability to set a timeout on a request. +func NewGetBrokersForTableV2ParamsWithTimeout(timeout time.Duration) *GetBrokersForTableV2Params { + return &GetBrokersForTableV2Params{ + timeout: timeout, + } +} + +// NewGetBrokersForTableV2ParamsWithContext creates a new GetBrokersForTableV2Params object +// with the ability to set a context for a request. +func NewGetBrokersForTableV2ParamsWithContext(ctx context.Context) *GetBrokersForTableV2Params { + return &GetBrokersForTableV2Params{ + Context: ctx, + } +} + +// NewGetBrokersForTableV2ParamsWithHTTPClient creates a new GetBrokersForTableV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetBrokersForTableV2ParamsWithHTTPClient(client *http.Client) *GetBrokersForTableV2Params { + return &GetBrokersForTableV2Params{ + HTTPClient: client, + } +} + +/* +GetBrokersForTableV2Params contains all the parameters to send to the API endpoint + + for the get brokers for table v2 operation. + + Typically these are written to a http.Request. +*/ +type GetBrokersForTableV2Params struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get brokers for table v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTableV2Params) WithDefaults() *GetBrokersForTableV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get brokers for table v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTableV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) WithTimeout(timeout time.Duration) *GetBrokersForTableV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) WithContext(ctx context.Context) *GetBrokersForTableV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) WithHTTPClient(client *http.Client) *GetBrokersForTableV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) WithState(state *string) *GetBrokersForTableV2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) SetState(state *string) { + o.State = state +} + +// WithTableName adds the tableName to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) WithTableName(tableName string) *GetBrokersForTableV2Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) WithType(typeVar *string) *GetBrokersForTableV2Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get brokers for table v2 params +func (o *GetBrokersForTableV2Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBrokersForTableV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_brokers_for_table_v2_responses.go b/src/client/broker/get_brokers_for_table_v2_responses.go new file mode 100644 index 0000000..563b8d1 --- /dev/null +++ b/src/client/broker/get_brokers_for_table_v2_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetBrokersForTableV2Reader is a Reader for the GetBrokersForTableV2 structure. +type GetBrokersForTableV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBrokersForTableV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBrokersForTableV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetBrokersForTableV2OK creates a GetBrokersForTableV2OK with default headers values +func NewGetBrokersForTableV2OK() *GetBrokersForTableV2OK { + return &GetBrokersForTableV2OK{} +} + +/* +GetBrokersForTableV2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetBrokersForTableV2OK struct { + Payload []*models.InstanceInfo +} + +// IsSuccess returns true when this get brokers for table v2 o k response has a 2xx status code +func (o *GetBrokersForTableV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get brokers for table v2 o k response has a 3xx status code +func (o *GetBrokersForTableV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get brokers for table v2 o k response has a 4xx status code +func (o *GetBrokersForTableV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get brokers for table v2 o k response has a 5xx status code +func (o *GetBrokersForTableV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get brokers for table v2 o k response a status code equal to that given +func (o *GetBrokersForTableV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get brokers for table v2 o k response +func (o *GetBrokersForTableV2OK) Code() int { + return 200 +} + +func (o *GetBrokersForTableV2OK) Error() string { + return fmt.Sprintf("[GET /v2/brokers/tables/{tableName}][%d] getBrokersForTableV2OK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTableV2OK) String() string { + return fmt.Sprintf("[GET /v2/brokers/tables/{tableName}][%d] getBrokersForTableV2OK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTableV2OK) GetPayload() []*models.InstanceInfo { + return o.Payload +} + +func (o *GetBrokersForTableV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_brokers_for_tenant_parameters.go b/src/client/broker/get_brokers_for_tenant_parameters.go new file mode 100644 index 0000000..24e2452 --- /dev/null +++ b/src/client/broker/get_brokers_for_tenant_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetBrokersForTenantParams creates a new GetBrokersForTenantParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBrokersForTenantParams() *GetBrokersForTenantParams { + return &GetBrokersForTenantParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBrokersForTenantParamsWithTimeout creates a new GetBrokersForTenantParams object +// with the ability to set a timeout on a request. +func NewGetBrokersForTenantParamsWithTimeout(timeout time.Duration) *GetBrokersForTenantParams { + return &GetBrokersForTenantParams{ + timeout: timeout, + } +} + +// NewGetBrokersForTenantParamsWithContext creates a new GetBrokersForTenantParams object +// with the ability to set a context for a request. +func NewGetBrokersForTenantParamsWithContext(ctx context.Context) *GetBrokersForTenantParams { + return &GetBrokersForTenantParams{ + Context: ctx, + } +} + +// NewGetBrokersForTenantParamsWithHTTPClient creates a new GetBrokersForTenantParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBrokersForTenantParamsWithHTTPClient(client *http.Client) *GetBrokersForTenantParams { + return &GetBrokersForTenantParams{ + HTTPClient: client, + } +} + +/* +GetBrokersForTenantParams contains all the parameters to send to the API endpoint + + for the get brokers for tenant operation. + + Typically these are written to a http.Request. +*/ +type GetBrokersForTenantParams struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + /* TenantName. + + Name of the tenant + */ + TenantName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get brokers for tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTenantParams) WithDefaults() *GetBrokersForTenantParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get brokers for tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTenantParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get brokers for tenant params +func (o *GetBrokersForTenantParams) WithTimeout(timeout time.Duration) *GetBrokersForTenantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get brokers for tenant params +func (o *GetBrokersForTenantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get brokers for tenant params +func (o *GetBrokersForTenantParams) WithContext(ctx context.Context) *GetBrokersForTenantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get brokers for tenant params +func (o *GetBrokersForTenantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get brokers for tenant params +func (o *GetBrokersForTenantParams) WithHTTPClient(client *http.Client) *GetBrokersForTenantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get brokers for tenant params +func (o *GetBrokersForTenantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get brokers for tenant params +func (o *GetBrokersForTenantParams) WithState(state *string) *GetBrokersForTenantParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get brokers for tenant params +func (o *GetBrokersForTenantParams) SetState(state *string) { + o.State = state +} + +// WithTenantName adds the tenantName to the get brokers for tenant params +func (o *GetBrokersForTenantParams) WithTenantName(tenantName string) *GetBrokersForTenantParams { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the get brokers for tenant params +func (o *GetBrokersForTenantParams) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBrokersForTenantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_brokers_for_tenant_responses.go b/src/client/broker/get_brokers_for_tenant_responses.go new file mode 100644 index 0000000..d04bd26 --- /dev/null +++ b/src/client/broker/get_brokers_for_tenant_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetBrokersForTenantReader is a Reader for the GetBrokersForTenant structure. +type GetBrokersForTenantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBrokersForTenantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBrokersForTenantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetBrokersForTenantOK creates a GetBrokersForTenantOK with default headers values +func NewGetBrokersForTenantOK() *GetBrokersForTenantOK { + return &GetBrokersForTenantOK{} +} + +/* +GetBrokersForTenantOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetBrokersForTenantOK struct { + Payload []string +} + +// IsSuccess returns true when this get brokers for tenant o k response has a 2xx status code +func (o *GetBrokersForTenantOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get brokers for tenant o k response has a 3xx status code +func (o *GetBrokersForTenantOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get brokers for tenant o k response has a 4xx status code +func (o *GetBrokersForTenantOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get brokers for tenant o k response has a 5xx status code +func (o *GetBrokersForTenantOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get brokers for tenant o k response a status code equal to that given +func (o *GetBrokersForTenantOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get brokers for tenant o k response +func (o *GetBrokersForTenantOK) Code() int { + return 200 +} + +func (o *GetBrokersForTenantOK) Error() string { + return fmt.Sprintf("[GET /brokers/tenants/{tenantName}][%d] getBrokersForTenantOK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTenantOK) String() string { + return fmt.Sprintf("[GET /brokers/tenants/{tenantName}][%d] getBrokersForTenantOK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTenantOK) GetPayload() []string { + return o.Payload +} + +func (o *GetBrokersForTenantOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_brokers_for_tenant_v2_parameters.go b/src/client/broker/get_brokers_for_tenant_v2_parameters.go new file mode 100644 index 0000000..73440aa --- /dev/null +++ b/src/client/broker/get_brokers_for_tenant_v2_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetBrokersForTenantV2Params creates a new GetBrokersForTenantV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBrokersForTenantV2Params() *GetBrokersForTenantV2Params { + return &GetBrokersForTenantV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBrokersForTenantV2ParamsWithTimeout creates a new GetBrokersForTenantV2Params object +// with the ability to set a timeout on a request. +func NewGetBrokersForTenantV2ParamsWithTimeout(timeout time.Duration) *GetBrokersForTenantV2Params { + return &GetBrokersForTenantV2Params{ + timeout: timeout, + } +} + +// NewGetBrokersForTenantV2ParamsWithContext creates a new GetBrokersForTenantV2Params object +// with the ability to set a context for a request. +func NewGetBrokersForTenantV2ParamsWithContext(ctx context.Context) *GetBrokersForTenantV2Params { + return &GetBrokersForTenantV2Params{ + Context: ctx, + } +} + +// NewGetBrokersForTenantV2ParamsWithHTTPClient creates a new GetBrokersForTenantV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetBrokersForTenantV2ParamsWithHTTPClient(client *http.Client) *GetBrokersForTenantV2Params { + return &GetBrokersForTenantV2Params{ + HTTPClient: client, + } +} + +/* +GetBrokersForTenantV2Params contains all the parameters to send to the API endpoint + + for the get brokers for tenant v2 operation. + + Typically these are written to a http.Request. +*/ +type GetBrokersForTenantV2Params struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + /* TenantName. + + Name of the tenant + */ + TenantName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get brokers for tenant v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTenantV2Params) WithDefaults() *GetBrokersForTenantV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get brokers for tenant v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBrokersForTenantV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) WithTimeout(timeout time.Duration) *GetBrokersForTenantV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) WithContext(ctx context.Context) *GetBrokersForTenantV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) WithHTTPClient(client *http.Client) *GetBrokersForTenantV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) WithState(state *string) *GetBrokersForTenantV2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) SetState(state *string) { + o.State = state +} + +// WithTenantName adds the tenantName to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) WithTenantName(tenantName string) *GetBrokersForTenantV2Params { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the get brokers for tenant v2 params +func (o *GetBrokersForTenantV2Params) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBrokersForTenantV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_brokers_for_tenant_v2_responses.go b/src/client/broker/get_brokers_for_tenant_v2_responses.go new file mode 100644 index 0000000..f7b4554 --- /dev/null +++ b/src/client/broker/get_brokers_for_tenant_v2_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetBrokersForTenantV2Reader is a Reader for the GetBrokersForTenantV2 structure. +type GetBrokersForTenantV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBrokersForTenantV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBrokersForTenantV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetBrokersForTenantV2OK creates a GetBrokersForTenantV2OK with default headers values +func NewGetBrokersForTenantV2OK() *GetBrokersForTenantV2OK { + return &GetBrokersForTenantV2OK{} +} + +/* +GetBrokersForTenantV2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetBrokersForTenantV2OK struct { + Payload []*models.InstanceInfo +} + +// IsSuccess returns true when this get brokers for tenant v2 o k response has a 2xx status code +func (o *GetBrokersForTenantV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get brokers for tenant v2 o k response has a 3xx status code +func (o *GetBrokersForTenantV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get brokers for tenant v2 o k response has a 4xx status code +func (o *GetBrokersForTenantV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get brokers for tenant v2 o k response has a 5xx status code +func (o *GetBrokersForTenantV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get brokers for tenant v2 o k response a status code equal to that given +func (o *GetBrokersForTenantV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get brokers for tenant v2 o k response +func (o *GetBrokersForTenantV2OK) Code() int { + return 200 +} + +func (o *GetBrokersForTenantV2OK) Error() string { + return fmt.Sprintf("[GET /v2/brokers/tenants/{tenantName}][%d] getBrokersForTenantV2OK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTenantV2OK) String() string { + return fmt.Sprintf("[GET /v2/brokers/tenants/{tenantName}][%d] getBrokersForTenantV2OK %+v", 200, o.Payload) +} + +func (o *GetBrokersForTenantV2OK) GetPayload() []*models.InstanceInfo { + return o.Payload +} + +func (o *GetBrokersForTenantV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_tables_to_brokers_mapping_parameters.go b/src/client/broker/get_tables_to_brokers_mapping_parameters.go new file mode 100644 index 0000000..a29ea54 --- /dev/null +++ b/src/client/broker/get_tables_to_brokers_mapping_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTablesToBrokersMappingParams creates a new GetTablesToBrokersMappingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTablesToBrokersMappingParams() *GetTablesToBrokersMappingParams { + return &GetTablesToBrokersMappingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTablesToBrokersMappingParamsWithTimeout creates a new GetTablesToBrokersMappingParams object +// with the ability to set a timeout on a request. +func NewGetTablesToBrokersMappingParamsWithTimeout(timeout time.Duration) *GetTablesToBrokersMappingParams { + return &GetTablesToBrokersMappingParams{ + timeout: timeout, + } +} + +// NewGetTablesToBrokersMappingParamsWithContext creates a new GetTablesToBrokersMappingParams object +// with the ability to set a context for a request. +func NewGetTablesToBrokersMappingParamsWithContext(ctx context.Context) *GetTablesToBrokersMappingParams { + return &GetTablesToBrokersMappingParams{ + Context: ctx, + } +} + +// NewGetTablesToBrokersMappingParamsWithHTTPClient creates a new GetTablesToBrokersMappingParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTablesToBrokersMappingParamsWithHTTPClient(client *http.Client) *GetTablesToBrokersMappingParams { + return &GetTablesToBrokersMappingParams{ + HTTPClient: client, + } +} + +/* +GetTablesToBrokersMappingParams contains all the parameters to send to the API endpoint + + for the get tables to brokers mapping operation. + + Typically these are written to a http.Request. +*/ +type GetTablesToBrokersMappingParams struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tables to brokers mapping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTablesToBrokersMappingParams) WithDefaults() *GetTablesToBrokersMappingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tables to brokers mapping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTablesToBrokersMappingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) WithTimeout(timeout time.Duration) *GetTablesToBrokersMappingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) WithContext(ctx context.Context) *GetTablesToBrokersMappingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) WithHTTPClient(client *http.Client) *GetTablesToBrokersMappingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) WithState(state *string) *GetTablesToBrokersMappingParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get tables to brokers mapping params +func (o *GetTablesToBrokersMappingParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTablesToBrokersMappingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_tables_to_brokers_mapping_responses.go b/src/client/broker/get_tables_to_brokers_mapping_responses.go new file mode 100644 index 0000000..5f46f7e --- /dev/null +++ b/src/client/broker/get_tables_to_brokers_mapping_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTablesToBrokersMappingReader is a Reader for the GetTablesToBrokersMapping structure. +type GetTablesToBrokersMappingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTablesToBrokersMappingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTablesToBrokersMappingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTablesToBrokersMappingOK creates a GetTablesToBrokersMappingOK with default headers values +func NewGetTablesToBrokersMappingOK() *GetTablesToBrokersMappingOK { + return &GetTablesToBrokersMappingOK{} +} + +/* +GetTablesToBrokersMappingOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTablesToBrokersMappingOK struct { + Payload map[string][]string +} + +// IsSuccess returns true when this get tables to brokers mapping o k response has a 2xx status code +func (o *GetTablesToBrokersMappingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tables to brokers mapping o k response has a 3xx status code +func (o *GetTablesToBrokersMappingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tables to brokers mapping o k response has a 4xx status code +func (o *GetTablesToBrokersMappingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tables to brokers mapping o k response has a 5xx status code +func (o *GetTablesToBrokersMappingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tables to brokers mapping o k response a status code equal to that given +func (o *GetTablesToBrokersMappingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tables to brokers mapping o k response +func (o *GetTablesToBrokersMappingOK) Code() int { + return 200 +} + +func (o *GetTablesToBrokersMappingOK) Error() string { + return fmt.Sprintf("[GET /brokers/tables][%d] getTablesToBrokersMappingOK %+v", 200, o.Payload) +} + +func (o *GetTablesToBrokersMappingOK) String() string { + return fmt.Sprintf("[GET /brokers/tables][%d] getTablesToBrokersMappingOK %+v", 200, o.Payload) +} + +func (o *GetTablesToBrokersMappingOK) GetPayload() map[string][]string { + return o.Payload +} + +func (o *GetTablesToBrokersMappingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_tables_to_brokers_mapping_v2_parameters.go b/src/client/broker/get_tables_to_brokers_mapping_v2_parameters.go new file mode 100644 index 0000000..a830888 --- /dev/null +++ b/src/client/broker/get_tables_to_brokers_mapping_v2_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTablesToBrokersMappingV2Params creates a new GetTablesToBrokersMappingV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTablesToBrokersMappingV2Params() *GetTablesToBrokersMappingV2Params { + return &GetTablesToBrokersMappingV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTablesToBrokersMappingV2ParamsWithTimeout creates a new GetTablesToBrokersMappingV2Params object +// with the ability to set a timeout on a request. +func NewGetTablesToBrokersMappingV2ParamsWithTimeout(timeout time.Duration) *GetTablesToBrokersMappingV2Params { + return &GetTablesToBrokersMappingV2Params{ + timeout: timeout, + } +} + +// NewGetTablesToBrokersMappingV2ParamsWithContext creates a new GetTablesToBrokersMappingV2Params object +// with the ability to set a context for a request. +func NewGetTablesToBrokersMappingV2ParamsWithContext(ctx context.Context) *GetTablesToBrokersMappingV2Params { + return &GetTablesToBrokersMappingV2Params{ + Context: ctx, + } +} + +// NewGetTablesToBrokersMappingV2ParamsWithHTTPClient creates a new GetTablesToBrokersMappingV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetTablesToBrokersMappingV2ParamsWithHTTPClient(client *http.Client) *GetTablesToBrokersMappingV2Params { + return &GetTablesToBrokersMappingV2Params{ + HTTPClient: client, + } +} + +/* +GetTablesToBrokersMappingV2Params contains all the parameters to send to the API endpoint + + for the get tables to brokers mapping v2 operation. + + Typically these are written to a http.Request. +*/ +type GetTablesToBrokersMappingV2Params struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tables to brokers mapping v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTablesToBrokersMappingV2Params) WithDefaults() *GetTablesToBrokersMappingV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tables to brokers mapping v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTablesToBrokersMappingV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) WithTimeout(timeout time.Duration) *GetTablesToBrokersMappingV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) WithContext(ctx context.Context) *GetTablesToBrokersMappingV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) WithHTTPClient(client *http.Client) *GetTablesToBrokersMappingV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) WithState(state *string) *GetTablesToBrokersMappingV2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get tables to brokers mapping v2 params +func (o *GetTablesToBrokersMappingV2Params) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTablesToBrokersMappingV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_tables_to_brokers_mapping_v2_responses.go b/src/client/broker/get_tables_to_brokers_mapping_v2_responses.go new file mode 100644 index 0000000..96bee20 --- /dev/null +++ b/src/client/broker/get_tables_to_brokers_mapping_v2_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTablesToBrokersMappingV2Reader is a Reader for the GetTablesToBrokersMappingV2 structure. +type GetTablesToBrokersMappingV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTablesToBrokersMappingV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTablesToBrokersMappingV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTablesToBrokersMappingV2OK creates a GetTablesToBrokersMappingV2OK with default headers values +func NewGetTablesToBrokersMappingV2OK() *GetTablesToBrokersMappingV2OK { + return &GetTablesToBrokersMappingV2OK{} +} + +/* +GetTablesToBrokersMappingV2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTablesToBrokersMappingV2OK struct { + Payload map[string][]models.InstanceInfo +} + +// IsSuccess returns true when this get tables to brokers mapping v2 o k response has a 2xx status code +func (o *GetTablesToBrokersMappingV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tables to brokers mapping v2 o k response has a 3xx status code +func (o *GetTablesToBrokersMappingV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tables to brokers mapping v2 o k response has a 4xx status code +func (o *GetTablesToBrokersMappingV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tables to brokers mapping v2 o k response has a 5xx status code +func (o *GetTablesToBrokersMappingV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tables to brokers mapping v2 o k response a status code equal to that given +func (o *GetTablesToBrokersMappingV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tables to brokers mapping v2 o k response +func (o *GetTablesToBrokersMappingV2OK) Code() int { + return 200 +} + +func (o *GetTablesToBrokersMappingV2OK) Error() string { + return fmt.Sprintf("[GET /v2/brokers/tables][%d] getTablesToBrokersMappingV2OK %+v", 200, o.Payload) +} + +func (o *GetTablesToBrokersMappingV2OK) String() string { + return fmt.Sprintf("[GET /v2/brokers/tables][%d] getTablesToBrokersMappingV2OK %+v", 200, o.Payload) +} + +func (o *GetTablesToBrokersMappingV2OK) GetPayload() map[string][]models.InstanceInfo { + return o.Payload +} + +func (o *GetTablesToBrokersMappingV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_tenants_to_brokers_mapping_parameters.go b/src/client/broker/get_tenants_to_brokers_mapping_parameters.go new file mode 100644 index 0000000..06673da --- /dev/null +++ b/src/client/broker/get_tenants_to_brokers_mapping_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTenantsToBrokersMappingParams creates a new GetTenantsToBrokersMappingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTenantsToBrokersMappingParams() *GetTenantsToBrokersMappingParams { + return &GetTenantsToBrokersMappingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsToBrokersMappingParamsWithTimeout creates a new GetTenantsToBrokersMappingParams object +// with the ability to set a timeout on a request. +func NewGetTenantsToBrokersMappingParamsWithTimeout(timeout time.Duration) *GetTenantsToBrokersMappingParams { + return &GetTenantsToBrokersMappingParams{ + timeout: timeout, + } +} + +// NewGetTenantsToBrokersMappingParamsWithContext creates a new GetTenantsToBrokersMappingParams object +// with the ability to set a context for a request. +func NewGetTenantsToBrokersMappingParamsWithContext(ctx context.Context) *GetTenantsToBrokersMappingParams { + return &GetTenantsToBrokersMappingParams{ + Context: ctx, + } +} + +// NewGetTenantsToBrokersMappingParamsWithHTTPClient creates a new GetTenantsToBrokersMappingParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTenantsToBrokersMappingParamsWithHTTPClient(client *http.Client) *GetTenantsToBrokersMappingParams { + return &GetTenantsToBrokersMappingParams{ + HTTPClient: client, + } +} + +/* +GetTenantsToBrokersMappingParams contains all the parameters to send to the API endpoint + + for the get tenants to brokers mapping operation. + + Typically these are written to a http.Request. +*/ +type GetTenantsToBrokersMappingParams struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tenants to brokers mapping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsToBrokersMappingParams) WithDefaults() *GetTenantsToBrokersMappingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tenants to brokers mapping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsToBrokersMappingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) WithTimeout(timeout time.Duration) *GetTenantsToBrokersMappingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) WithContext(ctx context.Context) *GetTenantsToBrokersMappingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) WithHTTPClient(client *http.Client) *GetTenantsToBrokersMappingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) WithState(state *string) *GetTenantsToBrokersMappingParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get tenants to brokers mapping params +func (o *GetTenantsToBrokersMappingParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTenantsToBrokersMappingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_tenants_to_brokers_mapping_responses.go b/src/client/broker/get_tenants_to_brokers_mapping_responses.go new file mode 100644 index 0000000..a4fc907 --- /dev/null +++ b/src/client/broker/get_tenants_to_brokers_mapping_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTenantsToBrokersMappingReader is a Reader for the GetTenantsToBrokersMapping structure. +type GetTenantsToBrokersMappingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTenantsToBrokersMappingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTenantsToBrokersMappingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTenantsToBrokersMappingOK creates a GetTenantsToBrokersMappingOK with default headers values +func NewGetTenantsToBrokersMappingOK() *GetTenantsToBrokersMappingOK { + return &GetTenantsToBrokersMappingOK{} +} + +/* +GetTenantsToBrokersMappingOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTenantsToBrokersMappingOK struct { + Payload map[string][]string +} + +// IsSuccess returns true when this get tenants to brokers mapping o k response has a 2xx status code +func (o *GetTenantsToBrokersMappingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tenants to brokers mapping o k response has a 3xx status code +func (o *GetTenantsToBrokersMappingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tenants to brokers mapping o k response has a 4xx status code +func (o *GetTenantsToBrokersMappingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tenants to brokers mapping o k response has a 5xx status code +func (o *GetTenantsToBrokersMappingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tenants to brokers mapping o k response a status code equal to that given +func (o *GetTenantsToBrokersMappingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tenants to brokers mapping o k response +func (o *GetTenantsToBrokersMappingOK) Code() int { + return 200 +} + +func (o *GetTenantsToBrokersMappingOK) Error() string { + return fmt.Sprintf("[GET /brokers/tenants][%d] getTenantsToBrokersMappingOK %+v", 200, o.Payload) +} + +func (o *GetTenantsToBrokersMappingOK) String() string { + return fmt.Sprintf("[GET /brokers/tenants][%d] getTenantsToBrokersMappingOK %+v", 200, o.Payload) +} + +func (o *GetTenantsToBrokersMappingOK) GetPayload() map[string][]string { + return o.Payload +} + +func (o *GetTenantsToBrokersMappingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/get_tenants_to_brokers_mapping_v2_parameters.go b/src/client/broker/get_tenants_to_brokers_mapping_v2_parameters.go new file mode 100644 index 0000000..0f0cd90 --- /dev/null +++ b/src/client/broker/get_tenants_to_brokers_mapping_v2_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTenantsToBrokersMappingV2Params creates a new GetTenantsToBrokersMappingV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTenantsToBrokersMappingV2Params() *GetTenantsToBrokersMappingV2Params { + return &GetTenantsToBrokersMappingV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsToBrokersMappingV2ParamsWithTimeout creates a new GetTenantsToBrokersMappingV2Params object +// with the ability to set a timeout on a request. +func NewGetTenantsToBrokersMappingV2ParamsWithTimeout(timeout time.Duration) *GetTenantsToBrokersMappingV2Params { + return &GetTenantsToBrokersMappingV2Params{ + timeout: timeout, + } +} + +// NewGetTenantsToBrokersMappingV2ParamsWithContext creates a new GetTenantsToBrokersMappingV2Params object +// with the ability to set a context for a request. +func NewGetTenantsToBrokersMappingV2ParamsWithContext(ctx context.Context) *GetTenantsToBrokersMappingV2Params { + return &GetTenantsToBrokersMappingV2Params{ + Context: ctx, + } +} + +// NewGetTenantsToBrokersMappingV2ParamsWithHTTPClient creates a new GetTenantsToBrokersMappingV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetTenantsToBrokersMappingV2ParamsWithHTTPClient(client *http.Client) *GetTenantsToBrokersMappingV2Params { + return &GetTenantsToBrokersMappingV2Params{ + HTTPClient: client, + } +} + +/* +GetTenantsToBrokersMappingV2Params contains all the parameters to send to the API endpoint + + for the get tenants to brokers mapping v2 operation. + + Typically these are written to a http.Request. +*/ +type GetTenantsToBrokersMappingV2Params struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tenants to brokers mapping v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsToBrokersMappingV2Params) WithDefaults() *GetTenantsToBrokersMappingV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tenants to brokers mapping v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsToBrokersMappingV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) WithTimeout(timeout time.Duration) *GetTenantsToBrokersMappingV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) WithContext(ctx context.Context) *GetTenantsToBrokersMappingV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) WithHTTPClient(client *http.Client) *GetTenantsToBrokersMappingV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) WithState(state *string) *GetTenantsToBrokersMappingV2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get tenants to brokers mapping v2 params +func (o *GetTenantsToBrokersMappingV2Params) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTenantsToBrokersMappingV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/get_tenants_to_brokers_mapping_v2_responses.go b/src/client/broker/get_tenants_to_brokers_mapping_v2_responses.go new file mode 100644 index 0000000..2b9098e --- /dev/null +++ b/src/client/broker/get_tenants_to_brokers_mapping_v2_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTenantsToBrokersMappingV2Reader is a Reader for the GetTenantsToBrokersMappingV2 structure. +type GetTenantsToBrokersMappingV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTenantsToBrokersMappingV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTenantsToBrokersMappingV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTenantsToBrokersMappingV2OK creates a GetTenantsToBrokersMappingV2OK with default headers values +func NewGetTenantsToBrokersMappingV2OK() *GetTenantsToBrokersMappingV2OK { + return &GetTenantsToBrokersMappingV2OK{} +} + +/* +GetTenantsToBrokersMappingV2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTenantsToBrokersMappingV2OK struct { + Payload map[string][]models.InstanceInfo +} + +// IsSuccess returns true when this get tenants to brokers mapping v2 o k response has a 2xx status code +func (o *GetTenantsToBrokersMappingV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tenants to brokers mapping v2 o k response has a 3xx status code +func (o *GetTenantsToBrokersMappingV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tenants to brokers mapping v2 o k response has a 4xx status code +func (o *GetTenantsToBrokersMappingV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tenants to brokers mapping v2 o k response has a 5xx status code +func (o *GetTenantsToBrokersMappingV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tenants to brokers mapping v2 o k response a status code equal to that given +func (o *GetTenantsToBrokersMappingV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tenants to brokers mapping v2 o k response +func (o *GetTenantsToBrokersMappingV2OK) Code() int { + return 200 +} + +func (o *GetTenantsToBrokersMappingV2OK) Error() string { + return fmt.Sprintf("[GET /v2/brokers/tenants][%d] getTenantsToBrokersMappingV2OK %+v", 200, o.Payload) +} + +func (o *GetTenantsToBrokersMappingV2OK) String() string { + return fmt.Sprintf("[GET /v2/brokers/tenants][%d] getTenantsToBrokersMappingV2OK %+v", 200, o.Payload) +} + +func (o *GetTenantsToBrokersMappingV2OK) GetPayload() map[string][]models.InstanceInfo { + return o.Payload +} + +func (o *GetTenantsToBrokersMappingV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/list_brokers_mapping_parameters.go b/src/client/broker/list_brokers_mapping_parameters.go new file mode 100644 index 0000000..24afd02 --- /dev/null +++ b/src/client/broker/list_brokers_mapping_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListBrokersMappingParams creates a new ListBrokersMappingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListBrokersMappingParams() *ListBrokersMappingParams { + return &ListBrokersMappingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListBrokersMappingParamsWithTimeout creates a new ListBrokersMappingParams object +// with the ability to set a timeout on a request. +func NewListBrokersMappingParamsWithTimeout(timeout time.Duration) *ListBrokersMappingParams { + return &ListBrokersMappingParams{ + timeout: timeout, + } +} + +// NewListBrokersMappingParamsWithContext creates a new ListBrokersMappingParams object +// with the ability to set a context for a request. +func NewListBrokersMappingParamsWithContext(ctx context.Context) *ListBrokersMappingParams { + return &ListBrokersMappingParams{ + Context: ctx, + } +} + +// NewListBrokersMappingParamsWithHTTPClient creates a new ListBrokersMappingParams object +// with the ability to set a custom HTTPClient for a request. +func NewListBrokersMappingParamsWithHTTPClient(client *http.Client) *ListBrokersMappingParams { + return &ListBrokersMappingParams{ + HTTPClient: client, + } +} + +/* +ListBrokersMappingParams contains all the parameters to send to the API endpoint + + for the list brokers mapping operation. + + Typically these are written to a http.Request. +*/ +type ListBrokersMappingParams struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list brokers mapping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBrokersMappingParams) WithDefaults() *ListBrokersMappingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list brokers mapping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBrokersMappingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list brokers mapping params +func (o *ListBrokersMappingParams) WithTimeout(timeout time.Duration) *ListBrokersMappingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list brokers mapping params +func (o *ListBrokersMappingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list brokers mapping params +func (o *ListBrokersMappingParams) WithContext(ctx context.Context) *ListBrokersMappingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list brokers mapping params +func (o *ListBrokersMappingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list brokers mapping params +func (o *ListBrokersMappingParams) WithHTTPClient(client *http.Client) *ListBrokersMappingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list brokers mapping params +func (o *ListBrokersMappingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the list brokers mapping params +func (o *ListBrokersMappingParams) WithState(state *string) *ListBrokersMappingParams { + o.SetState(state) + return o +} + +// SetState adds the state to the list brokers mapping params +func (o *ListBrokersMappingParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *ListBrokersMappingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/list_brokers_mapping_responses.go b/src/client/broker/list_brokers_mapping_responses.go new file mode 100644 index 0000000..1fbe2e3 --- /dev/null +++ b/src/client/broker/list_brokers_mapping_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListBrokersMappingReader is a Reader for the ListBrokersMapping structure. +type ListBrokersMappingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListBrokersMappingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListBrokersMappingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListBrokersMappingOK creates a ListBrokersMappingOK with default headers values +func NewListBrokersMappingOK() *ListBrokersMappingOK { + return &ListBrokersMappingOK{} +} + +/* +ListBrokersMappingOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListBrokersMappingOK struct { + Payload map[string]map[string][]string +} + +// IsSuccess returns true when this list brokers mapping o k response has a 2xx status code +func (o *ListBrokersMappingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list brokers mapping o k response has a 3xx status code +func (o *ListBrokersMappingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list brokers mapping o k response has a 4xx status code +func (o *ListBrokersMappingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list brokers mapping o k response has a 5xx status code +func (o *ListBrokersMappingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list brokers mapping o k response a status code equal to that given +func (o *ListBrokersMappingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list brokers mapping o k response +func (o *ListBrokersMappingOK) Code() int { + return 200 +} + +func (o *ListBrokersMappingOK) Error() string { + return fmt.Sprintf("[GET /brokers][%d] listBrokersMappingOK %+v", 200, o.Payload) +} + +func (o *ListBrokersMappingOK) String() string { + return fmt.Sprintf("[GET /brokers][%d] listBrokersMappingOK %+v", 200, o.Payload) +} + +func (o *ListBrokersMappingOK) GetPayload() map[string]map[string][]string { + return o.Payload +} + +func (o *ListBrokersMappingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/list_brokers_mapping_v2_parameters.go b/src/client/broker/list_brokers_mapping_v2_parameters.go new file mode 100644 index 0000000..f31a354 --- /dev/null +++ b/src/client/broker/list_brokers_mapping_v2_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListBrokersMappingV2Params creates a new ListBrokersMappingV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListBrokersMappingV2Params() *ListBrokersMappingV2Params { + return &ListBrokersMappingV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewListBrokersMappingV2ParamsWithTimeout creates a new ListBrokersMappingV2Params object +// with the ability to set a timeout on a request. +func NewListBrokersMappingV2ParamsWithTimeout(timeout time.Duration) *ListBrokersMappingV2Params { + return &ListBrokersMappingV2Params{ + timeout: timeout, + } +} + +// NewListBrokersMappingV2ParamsWithContext creates a new ListBrokersMappingV2Params object +// with the ability to set a context for a request. +func NewListBrokersMappingV2ParamsWithContext(ctx context.Context) *ListBrokersMappingV2Params { + return &ListBrokersMappingV2Params{ + Context: ctx, + } +} + +// NewListBrokersMappingV2ParamsWithHTTPClient creates a new ListBrokersMappingV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewListBrokersMappingV2ParamsWithHTTPClient(client *http.Client) *ListBrokersMappingV2Params { + return &ListBrokersMappingV2Params{ + HTTPClient: client, + } +} + +/* +ListBrokersMappingV2Params contains all the parameters to send to the API endpoint + + for the list brokers mapping v2 operation. + + Typically these are written to a http.Request. +*/ +type ListBrokersMappingV2Params struct { + + /* State. + + ONLINE|OFFLINE + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list brokers mapping v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBrokersMappingV2Params) WithDefaults() *ListBrokersMappingV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list brokers mapping v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListBrokersMappingV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) WithTimeout(timeout time.Duration) *ListBrokersMappingV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) WithContext(ctx context.Context) *ListBrokersMappingV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) WithHTTPClient(client *http.Client) *ListBrokersMappingV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) WithState(state *string) *ListBrokersMappingV2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the list brokers mapping v2 params +func (o *ListBrokersMappingV2Params) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *ListBrokersMappingV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/list_brokers_mapping_v2_responses.go b/src/client/broker/list_brokers_mapping_v2_responses.go new file mode 100644 index 0000000..bef59b5 --- /dev/null +++ b/src/client/broker/list_brokers_mapping_v2_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ListBrokersMappingV2Reader is a Reader for the ListBrokersMappingV2 structure. +type ListBrokersMappingV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListBrokersMappingV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListBrokersMappingV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListBrokersMappingV2OK creates a ListBrokersMappingV2OK with default headers values +func NewListBrokersMappingV2OK() *ListBrokersMappingV2OK { + return &ListBrokersMappingV2OK{} +} + +/* +ListBrokersMappingV2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListBrokersMappingV2OK struct { + Payload map[string]map[string][]models.InstanceInfo +} + +// IsSuccess returns true when this list brokers mapping v2 o k response has a 2xx status code +func (o *ListBrokersMappingV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list brokers mapping v2 o k response has a 3xx status code +func (o *ListBrokersMappingV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list brokers mapping v2 o k response has a 4xx status code +func (o *ListBrokersMappingV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list brokers mapping v2 o k response has a 5xx status code +func (o *ListBrokersMappingV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this list brokers mapping v2 o k response a status code equal to that given +func (o *ListBrokersMappingV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list brokers mapping v2 o k response +func (o *ListBrokersMappingV2OK) Code() int { + return 200 +} + +func (o *ListBrokersMappingV2OK) Error() string { + return fmt.Sprintf("[GET /v2/brokers][%d] listBrokersMappingV2OK %+v", 200, o.Payload) +} + +func (o *ListBrokersMappingV2OK) String() string { + return fmt.Sprintf("[GET /v2/brokers][%d] listBrokersMappingV2OK %+v", 200, o.Payload) +} + +func (o *ListBrokersMappingV2OK) GetPayload() map[string]map[string][]models.InstanceInfo { + return o.Payload +} + +func (o *ListBrokersMappingV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/broker/toggle_query_rate_limiting_parameters.go b/src/client/broker/toggle_query_rate_limiting_parameters.go new file mode 100644 index 0000000..6616de8 --- /dev/null +++ b/src/client/broker/toggle_query_rate_limiting_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewToggleQueryRateLimitingParams creates a new ToggleQueryRateLimitingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewToggleQueryRateLimitingParams() *ToggleQueryRateLimitingParams { + return &ToggleQueryRateLimitingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewToggleQueryRateLimitingParamsWithTimeout creates a new ToggleQueryRateLimitingParams object +// with the ability to set a timeout on a request. +func NewToggleQueryRateLimitingParamsWithTimeout(timeout time.Duration) *ToggleQueryRateLimitingParams { + return &ToggleQueryRateLimitingParams{ + timeout: timeout, + } +} + +// NewToggleQueryRateLimitingParamsWithContext creates a new ToggleQueryRateLimitingParams object +// with the ability to set a context for a request. +func NewToggleQueryRateLimitingParamsWithContext(ctx context.Context) *ToggleQueryRateLimitingParams { + return &ToggleQueryRateLimitingParams{ + Context: ctx, + } +} + +// NewToggleQueryRateLimitingParamsWithHTTPClient creates a new ToggleQueryRateLimitingParams object +// with the ability to set a custom HTTPClient for a request. +func NewToggleQueryRateLimitingParamsWithHTTPClient(client *http.Client) *ToggleQueryRateLimitingParams { + return &ToggleQueryRateLimitingParams{ + HTTPClient: client, + } +} + +/* +ToggleQueryRateLimitingParams contains all the parameters to send to the API endpoint + + for the toggle query rate limiting operation. + + Typically these are written to a http.Request. +*/ +type ToggleQueryRateLimitingParams struct { + + /* InstanceName. + + Broker instance name + */ + InstanceName string + + /* State. + + ENABLE|DISABLE + */ + State string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the toggle query rate limiting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleQueryRateLimitingParams) WithDefaults() *ToggleQueryRateLimitingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the toggle query rate limiting params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleQueryRateLimitingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) WithTimeout(timeout time.Duration) *ToggleQueryRateLimitingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) WithContext(ctx context.Context) *ToggleQueryRateLimitingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) WithHTTPClient(client *http.Client) *ToggleQueryRateLimitingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstanceName adds the instanceName to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) WithInstanceName(instanceName string) *ToggleQueryRateLimitingParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WithState adds the state to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) WithState(state string) *ToggleQueryRateLimitingParams { + o.SetState(state) + return o +} + +// SetState adds the state to the toggle query rate limiting params +func (o *ToggleQueryRateLimitingParams) SetState(state string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *ToggleQueryRateLimitingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/broker/toggle_query_rate_limiting_responses.go b/src/client/broker/toggle_query_rate_limiting_responses.go new file mode 100644 index 0000000..3a6775e --- /dev/null +++ b/src/client/broker/toggle_query_rate_limiting_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package broker + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ToggleQueryRateLimitingReader is a Reader for the ToggleQueryRateLimiting structure. +type ToggleQueryRateLimitingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ToggleQueryRateLimitingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewToggleQueryRateLimitingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewToggleQueryRateLimitingBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewToggleQueryRateLimitingNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewToggleQueryRateLimitingInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewToggleQueryRateLimitingOK creates a ToggleQueryRateLimitingOK with default headers values +func NewToggleQueryRateLimitingOK() *ToggleQueryRateLimitingOK { + return &ToggleQueryRateLimitingOK{} +} + +/* +ToggleQueryRateLimitingOK describes a response with status code 200, with default header values. + +Success +*/ +type ToggleQueryRateLimitingOK struct { +} + +// IsSuccess returns true when this toggle query rate limiting o k response has a 2xx status code +func (o *ToggleQueryRateLimitingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this toggle query rate limiting o k response has a 3xx status code +func (o *ToggleQueryRateLimitingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle query rate limiting o k response has a 4xx status code +func (o *ToggleQueryRateLimitingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this toggle query rate limiting o k response has a 5xx status code +func (o *ToggleQueryRateLimitingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle query rate limiting o k response a status code equal to that given +func (o *ToggleQueryRateLimitingOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the toggle query rate limiting o k response +func (o *ToggleQueryRateLimitingOK) Code() int { + return 200 +} + +func (o *ToggleQueryRateLimitingOK) Error() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingOK ", 200) +} + +func (o *ToggleQueryRateLimitingOK) String() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingOK ", 200) +} + +func (o *ToggleQueryRateLimitingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleQueryRateLimitingBadRequest creates a ToggleQueryRateLimitingBadRequest with default headers values +func NewToggleQueryRateLimitingBadRequest() *ToggleQueryRateLimitingBadRequest { + return &ToggleQueryRateLimitingBadRequest{} +} + +/* +ToggleQueryRateLimitingBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ToggleQueryRateLimitingBadRequest struct { +} + +// IsSuccess returns true when this toggle query rate limiting bad request response has a 2xx status code +func (o *ToggleQueryRateLimitingBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle query rate limiting bad request response has a 3xx status code +func (o *ToggleQueryRateLimitingBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle query rate limiting bad request response has a 4xx status code +func (o *ToggleQueryRateLimitingBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this toggle query rate limiting bad request response has a 5xx status code +func (o *ToggleQueryRateLimitingBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle query rate limiting bad request response a status code equal to that given +func (o *ToggleQueryRateLimitingBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the toggle query rate limiting bad request response +func (o *ToggleQueryRateLimitingBadRequest) Code() int { + return 400 +} + +func (o *ToggleQueryRateLimitingBadRequest) Error() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingBadRequest ", 400) +} + +func (o *ToggleQueryRateLimitingBadRequest) String() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingBadRequest ", 400) +} + +func (o *ToggleQueryRateLimitingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleQueryRateLimitingNotFound creates a ToggleQueryRateLimitingNotFound with default headers values +func NewToggleQueryRateLimitingNotFound() *ToggleQueryRateLimitingNotFound { + return &ToggleQueryRateLimitingNotFound{} +} + +/* +ToggleQueryRateLimitingNotFound describes a response with status code 404, with default header values. + +Instance not found +*/ +type ToggleQueryRateLimitingNotFound struct { +} + +// IsSuccess returns true when this toggle query rate limiting not found response has a 2xx status code +func (o *ToggleQueryRateLimitingNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle query rate limiting not found response has a 3xx status code +func (o *ToggleQueryRateLimitingNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle query rate limiting not found response has a 4xx status code +func (o *ToggleQueryRateLimitingNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this toggle query rate limiting not found response has a 5xx status code +func (o *ToggleQueryRateLimitingNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle query rate limiting not found response a status code equal to that given +func (o *ToggleQueryRateLimitingNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the toggle query rate limiting not found response +func (o *ToggleQueryRateLimitingNotFound) Code() int { + return 404 +} + +func (o *ToggleQueryRateLimitingNotFound) Error() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingNotFound ", 404) +} + +func (o *ToggleQueryRateLimitingNotFound) String() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingNotFound ", 404) +} + +func (o *ToggleQueryRateLimitingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleQueryRateLimitingInternalServerError creates a ToggleQueryRateLimitingInternalServerError with default headers values +func NewToggleQueryRateLimitingInternalServerError() *ToggleQueryRateLimitingInternalServerError { + return &ToggleQueryRateLimitingInternalServerError{} +} + +/* +ToggleQueryRateLimitingInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type ToggleQueryRateLimitingInternalServerError struct { +} + +// IsSuccess returns true when this toggle query rate limiting internal server error response has a 2xx status code +func (o *ToggleQueryRateLimitingInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle query rate limiting internal server error response has a 3xx status code +func (o *ToggleQueryRateLimitingInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle query rate limiting internal server error response has a 4xx status code +func (o *ToggleQueryRateLimitingInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this toggle query rate limiting internal server error response has a 5xx status code +func (o *ToggleQueryRateLimitingInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this toggle query rate limiting internal server error response a status code equal to that given +func (o *ToggleQueryRateLimitingInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the toggle query rate limiting internal server error response +func (o *ToggleQueryRateLimitingInternalServerError) Code() int { + return 500 +} + +func (o *ToggleQueryRateLimitingInternalServerError) Error() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingInternalServerError ", 500) +} + +func (o *ToggleQueryRateLimitingInternalServerError) String() string { + return fmt.Sprintf("[POST /brokers/instances/{instanceName}/qps][%d] toggleQueryRateLimitingInternalServerError ", 500) +} + +func (o *ToggleQueryRateLimitingInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster/cluster_client.go b/src/client/cluster/cluster_client.go new file mode 100644 index 0000000..b421741 --- /dev/null +++ b/src/client/cluster/cluster_client.go @@ -0,0 +1,293 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new cluster API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cluster API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteClusterConfig(params *DeleteClusterConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteClusterConfigOK, error) + + GetClusterInfo(params *GetClusterInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterInfoOK, error) + + GetSegmentDebugInfo(params *GetSegmentDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentDebugInfoOK, error) + + GetTableDebugInfo(params *GetTableDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableDebugInfoOK, error) + + ListClusterConfigs(params *ListClusterConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListClusterConfigsOK, error) + + UpdateClusterConfig(params *UpdateClusterConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateClusterConfigOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +DeleteClusterConfig deletes cluster configuration +*/ +func (a *Client) DeleteClusterConfig(params *DeleteClusterConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteClusterConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteClusterConfigParams() + } + op := &runtime.ClientOperation{ + ID: "deleteClusterConfig", + Method: "DELETE", + PathPattern: "/cluster/configs/{configName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteClusterConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteClusterConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteClusterConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetClusterInfo gets cluster info + +Get cluster Info +*/ +func (a *Client) GetClusterInfo(params *GetClusterInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getClusterInfo", + Method: "GET", + PathPattern: "/cluster/info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetClusterInfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getClusterInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentDebugInfo gets debug information for segment + +Debug information for segment. +*/ +func (a *Client) GetSegmentDebugInfo(params *GetSegmentDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentDebugInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentDebugInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getSegmentDebugInfo", + Method: "GET", + PathPattern: "/debug/segments/{tableName}/{segmentName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentDebugInfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentDebugInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentDebugInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableDebugInfo gets debug information for table + +Debug information for table. +*/ +func (a *Client) GetTableDebugInfo(params *GetTableDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableDebugInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableDebugInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getTableDebugInfo", + Method: "GET", + PathPattern: "/debug/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableDebugInfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableDebugInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableDebugInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListClusterConfigs lists cluster configurations + +List cluster level configurations +*/ +func (a *Client) ListClusterConfigs(params *ListClusterConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListClusterConfigsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListClusterConfigsParams() + } + op := &runtime.ClientOperation{ + ID: "listClusterConfigs", + Method: "GET", + PathPattern: "/cluster/configs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListClusterConfigsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListClusterConfigsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listClusterConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateClusterConfig updates cluster configuration +*/ +func (a *Client) UpdateClusterConfig(params *UpdateClusterConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateClusterConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateClusterConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateClusterConfig", + Method: "POST", + PathPattern: "/cluster/configs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateClusterConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateClusterConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateClusterConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/cluster/delete_cluster_config_parameters.go b/src/client/cluster/delete_cluster_config_parameters.go new file mode 100644 index 0000000..371ccc9 --- /dev/null +++ b/src/client/cluster/delete_cluster_config_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteClusterConfigParams creates a new DeleteClusterConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteClusterConfigParams() *DeleteClusterConfigParams { + return &DeleteClusterConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteClusterConfigParamsWithTimeout creates a new DeleteClusterConfigParams object +// with the ability to set a timeout on a request. +func NewDeleteClusterConfigParamsWithTimeout(timeout time.Duration) *DeleteClusterConfigParams { + return &DeleteClusterConfigParams{ + timeout: timeout, + } +} + +// NewDeleteClusterConfigParamsWithContext creates a new DeleteClusterConfigParams object +// with the ability to set a context for a request. +func NewDeleteClusterConfigParamsWithContext(ctx context.Context) *DeleteClusterConfigParams { + return &DeleteClusterConfigParams{ + Context: ctx, + } +} + +// NewDeleteClusterConfigParamsWithHTTPClient creates a new DeleteClusterConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteClusterConfigParamsWithHTTPClient(client *http.Client) *DeleteClusterConfigParams { + return &DeleteClusterConfigParams{ + HTTPClient: client, + } +} + +/* +DeleteClusterConfigParams contains all the parameters to send to the API endpoint + + for the delete cluster config operation. + + Typically these are written to a http.Request. +*/ +type DeleteClusterConfigParams struct { + + /* ConfigName. + + Name of the config to delete + */ + ConfigName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete cluster config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteClusterConfigParams) WithDefaults() *DeleteClusterConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete cluster config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteClusterConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete cluster config params +func (o *DeleteClusterConfigParams) WithTimeout(timeout time.Duration) *DeleteClusterConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete cluster config params +func (o *DeleteClusterConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete cluster config params +func (o *DeleteClusterConfigParams) WithContext(ctx context.Context) *DeleteClusterConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete cluster config params +func (o *DeleteClusterConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete cluster config params +func (o *DeleteClusterConfigParams) WithHTTPClient(client *http.Client) *DeleteClusterConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete cluster config params +func (o *DeleteClusterConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConfigName adds the configName to the delete cluster config params +func (o *DeleteClusterConfigParams) WithConfigName(configName string) *DeleteClusterConfigParams { + o.SetConfigName(configName) + return o +} + +// SetConfigName adds the configName to the delete cluster config params +func (o *DeleteClusterConfigParams) SetConfigName(configName string) { + o.ConfigName = configName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteClusterConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param configName + if err := r.SetPathParam("configName", o.ConfigName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster/delete_cluster_config_responses.go b/src/client/cluster/delete_cluster_config_responses.go new file mode 100644 index 0000000..d84b602 --- /dev/null +++ b/src/client/cluster/delete_cluster_config_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteClusterConfigReader is a Reader for the DeleteClusterConfig structure. +type DeleteClusterConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteClusterConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteClusterConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewDeleteClusterConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteClusterConfigOK creates a DeleteClusterConfigOK with default headers values +func NewDeleteClusterConfigOK() *DeleteClusterConfigOK { + return &DeleteClusterConfigOK{} +} + +/* +DeleteClusterConfigOK describes a response with status code 200, with default header values. + +Success +*/ +type DeleteClusterConfigOK struct { +} + +// IsSuccess returns true when this delete cluster config o k response has a 2xx status code +func (o *DeleteClusterConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete cluster config o k response has a 3xx status code +func (o *DeleteClusterConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete cluster config o k response has a 4xx status code +func (o *DeleteClusterConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete cluster config o k response has a 5xx status code +func (o *DeleteClusterConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete cluster config o k response a status code equal to that given +func (o *DeleteClusterConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete cluster config o k response +func (o *DeleteClusterConfigOK) Code() int { + return 200 +} + +func (o *DeleteClusterConfigOK) Error() string { + return fmt.Sprintf("[DELETE /cluster/configs/{configName}][%d] deleteClusterConfigOK ", 200) +} + +func (o *DeleteClusterConfigOK) String() string { + return fmt.Sprintf("[DELETE /cluster/configs/{configName}][%d] deleteClusterConfigOK ", 200) +} + +func (o *DeleteClusterConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteClusterConfigInternalServerError creates a DeleteClusterConfigInternalServerError with default headers values +func NewDeleteClusterConfigInternalServerError() *DeleteClusterConfigInternalServerError { + return &DeleteClusterConfigInternalServerError{} +} + +/* +DeleteClusterConfigInternalServerError describes a response with status code 500, with default header values. + +Server error deleting configuration +*/ +type DeleteClusterConfigInternalServerError struct { +} + +// IsSuccess returns true when this delete cluster config internal server error response has a 2xx status code +func (o *DeleteClusterConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete cluster config internal server error response has a 3xx status code +func (o *DeleteClusterConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete cluster config internal server error response has a 4xx status code +func (o *DeleteClusterConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete cluster config internal server error response has a 5xx status code +func (o *DeleteClusterConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete cluster config internal server error response a status code equal to that given +func (o *DeleteClusterConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete cluster config internal server error response +func (o *DeleteClusterConfigInternalServerError) Code() int { + return 500 +} + +func (o *DeleteClusterConfigInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /cluster/configs/{configName}][%d] deleteClusterConfigInternalServerError ", 500) +} + +func (o *DeleteClusterConfigInternalServerError) String() string { + return fmt.Sprintf("[DELETE /cluster/configs/{configName}][%d] deleteClusterConfigInternalServerError ", 500) +} + +func (o *DeleteClusterConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster/get_cluster_info_parameters.go b/src/client/cluster/get_cluster_info_parameters.go new file mode 100644 index 0000000..54bd679 --- /dev/null +++ b/src/client/cluster/get_cluster_info_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterInfoParams creates a new GetClusterInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetClusterInfoParams() *GetClusterInfoParams { + return &GetClusterInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterInfoParamsWithTimeout creates a new GetClusterInfoParams object +// with the ability to set a timeout on a request. +func NewGetClusterInfoParamsWithTimeout(timeout time.Duration) *GetClusterInfoParams { + return &GetClusterInfoParams{ + timeout: timeout, + } +} + +// NewGetClusterInfoParamsWithContext creates a new GetClusterInfoParams object +// with the ability to set a context for a request. +func NewGetClusterInfoParamsWithContext(ctx context.Context) *GetClusterInfoParams { + return &GetClusterInfoParams{ + Context: ctx, + } +} + +// NewGetClusterInfoParamsWithHTTPClient creates a new GetClusterInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetClusterInfoParamsWithHTTPClient(client *http.Client) *GetClusterInfoParams { + return &GetClusterInfoParams{ + HTTPClient: client, + } +} + +/* +GetClusterInfoParams contains all the parameters to send to the API endpoint + + for the get cluster info operation. + + Typically these are written to a http.Request. +*/ +type GetClusterInfoParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cluster info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterInfoParams) WithDefaults() *GetClusterInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cluster info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cluster info params +func (o *GetClusterInfoParams) WithTimeout(timeout time.Duration) *GetClusterInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster info params +func (o *GetClusterInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster info params +func (o *GetClusterInfoParams) WithContext(ctx context.Context) *GetClusterInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster info params +func (o *GetClusterInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster info params +func (o *GetClusterInfoParams) WithHTTPClient(client *http.Client) *GetClusterInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster info params +func (o *GetClusterInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster/get_cluster_info_responses.go b/src/client/cluster/get_cluster_info_responses.go new file mode 100644 index 0000000..f57acf0 --- /dev/null +++ b/src/client/cluster/get_cluster_info_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetClusterInfoReader is a Reader for the GetClusterInfo structure. +type GetClusterInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetClusterInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetClusterInfoOK creates a GetClusterInfoOK with default headers values +func NewGetClusterInfoOK() *GetClusterInfoOK { + return &GetClusterInfoOK{} +} + +/* +GetClusterInfoOK describes a response with status code 200, with default header values. + +Success +*/ +type GetClusterInfoOK struct { +} + +// IsSuccess returns true when this get cluster info o k response has a 2xx status code +func (o *GetClusterInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get cluster info o k response has a 3xx status code +func (o *GetClusterInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get cluster info o k response has a 4xx status code +func (o *GetClusterInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get cluster info o k response has a 5xx status code +func (o *GetClusterInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get cluster info o k response a status code equal to that given +func (o *GetClusterInfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get cluster info o k response +func (o *GetClusterInfoOK) Code() int { + return 200 +} + +func (o *GetClusterInfoOK) Error() string { + return fmt.Sprintf("[GET /cluster/info][%d] getClusterInfoOK ", 200) +} + +func (o *GetClusterInfoOK) String() string { + return fmt.Sprintf("[GET /cluster/info][%d] getClusterInfoOK ", 200) +} + +func (o *GetClusterInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetClusterInfoInternalServerError creates a GetClusterInfoInternalServerError with default headers values +func NewGetClusterInfoInternalServerError() *GetClusterInfoInternalServerError { + return &GetClusterInfoInternalServerError{} +} + +/* +GetClusterInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetClusterInfoInternalServerError struct { +} + +// IsSuccess returns true when this get cluster info internal server error response has a 2xx status code +func (o *GetClusterInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get cluster info internal server error response has a 3xx status code +func (o *GetClusterInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get cluster info internal server error response has a 4xx status code +func (o *GetClusterInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get cluster info internal server error response has a 5xx status code +func (o *GetClusterInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get cluster info internal server error response a status code equal to that given +func (o *GetClusterInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get cluster info internal server error response +func (o *GetClusterInfoInternalServerError) Code() int { + return 500 +} + +func (o *GetClusterInfoInternalServerError) Error() string { + return fmt.Sprintf("[GET /cluster/info][%d] getClusterInfoInternalServerError ", 500) +} + +func (o *GetClusterInfoInternalServerError) String() string { + return fmt.Sprintf("[GET /cluster/info][%d] getClusterInfoInternalServerError ", 500) +} + +func (o *GetClusterInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster/get_segment_debug_info_parameters.go b/src/client/cluster/get_segment_debug_info_parameters.go new file mode 100644 index 0000000..6a34539 --- /dev/null +++ b/src/client/cluster/get_segment_debug_info_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentDebugInfoParams creates a new GetSegmentDebugInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentDebugInfoParams() *GetSegmentDebugInfoParams { + return &GetSegmentDebugInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentDebugInfoParamsWithTimeout creates a new GetSegmentDebugInfoParams object +// with the ability to set a timeout on a request. +func NewGetSegmentDebugInfoParamsWithTimeout(timeout time.Duration) *GetSegmentDebugInfoParams { + return &GetSegmentDebugInfoParams{ + timeout: timeout, + } +} + +// NewGetSegmentDebugInfoParamsWithContext creates a new GetSegmentDebugInfoParams object +// with the ability to set a context for a request. +func NewGetSegmentDebugInfoParamsWithContext(ctx context.Context) *GetSegmentDebugInfoParams { + return &GetSegmentDebugInfoParams{ + Context: ctx, + } +} + +// NewGetSegmentDebugInfoParamsWithHTTPClient creates a new GetSegmentDebugInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentDebugInfoParamsWithHTTPClient(client *http.Client) *GetSegmentDebugInfoParams { + return &GetSegmentDebugInfoParams{ + HTTPClient: client, + } +} + +/* +GetSegmentDebugInfoParams contains all the parameters to send to the API endpoint + + for the get segment debug info operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentDebugInfoParams struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table (with type) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentDebugInfoParams) WithDefaults() *GetSegmentDebugInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentDebugInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment debug info params +func (o *GetSegmentDebugInfoParams) WithTimeout(timeout time.Duration) *GetSegmentDebugInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment debug info params +func (o *GetSegmentDebugInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment debug info params +func (o *GetSegmentDebugInfoParams) WithContext(ctx context.Context) *GetSegmentDebugInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment debug info params +func (o *GetSegmentDebugInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment debug info params +func (o *GetSegmentDebugInfoParams) WithHTTPClient(client *http.Client) *GetSegmentDebugInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment debug info params +func (o *GetSegmentDebugInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the get segment debug info params +func (o *GetSegmentDebugInfoParams) WithSegmentName(segmentName string) *GetSegmentDebugInfoParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the get segment debug info params +func (o *GetSegmentDebugInfoParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the get segment debug info params +func (o *GetSegmentDebugInfoParams) WithTableName(tableName string) *GetSegmentDebugInfoParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment debug info params +func (o *GetSegmentDebugInfoParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentDebugInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster/get_segment_debug_info_responses.go b/src/client/cluster/get_segment_debug_info_responses.go new file mode 100644 index 0000000..07318de --- /dev/null +++ b/src/client/cluster/get_segment_debug_info_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentDebugInfoReader is a Reader for the GetSegmentDebugInfo structure. +type GetSegmentDebugInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentDebugInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentDebugInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetSegmentDebugInfoNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSegmentDebugInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentDebugInfoOK creates a GetSegmentDebugInfoOK with default headers values +func NewGetSegmentDebugInfoOK() *GetSegmentDebugInfoOK { + return &GetSegmentDebugInfoOK{} +} + +/* +GetSegmentDebugInfoOK describes a response with status code 200, with default header values. + +Success +*/ +type GetSegmentDebugInfoOK struct { +} + +// IsSuccess returns true when this get segment debug info o k response has a 2xx status code +func (o *GetSegmentDebugInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment debug info o k response has a 3xx status code +func (o *GetSegmentDebugInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment debug info o k response has a 4xx status code +func (o *GetSegmentDebugInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment debug info o k response has a 5xx status code +func (o *GetSegmentDebugInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment debug info o k response a status code equal to that given +func (o *GetSegmentDebugInfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment debug info o k response +func (o *GetSegmentDebugInfoOK) Code() int { + return 200 +} + +func (o *GetSegmentDebugInfoOK) Error() string { + return fmt.Sprintf("[GET /debug/segments/{tableName}/{segmentName}][%d] getSegmentDebugInfoOK ", 200) +} + +func (o *GetSegmentDebugInfoOK) String() string { + return fmt.Sprintf("[GET /debug/segments/{tableName}/{segmentName}][%d] getSegmentDebugInfoOK ", 200) +} + +func (o *GetSegmentDebugInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSegmentDebugInfoNotFound creates a GetSegmentDebugInfoNotFound with default headers values +func NewGetSegmentDebugInfoNotFound() *GetSegmentDebugInfoNotFound { + return &GetSegmentDebugInfoNotFound{} +} + +/* +GetSegmentDebugInfoNotFound describes a response with status code 404, with default header values. + +Segment not found +*/ +type GetSegmentDebugInfoNotFound struct { +} + +// IsSuccess returns true when this get segment debug info not found response has a 2xx status code +func (o *GetSegmentDebugInfoNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get segment debug info not found response has a 3xx status code +func (o *GetSegmentDebugInfoNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment debug info not found response has a 4xx status code +func (o *GetSegmentDebugInfoNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get segment debug info not found response has a 5xx status code +func (o *GetSegmentDebugInfoNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment debug info not found response a status code equal to that given +func (o *GetSegmentDebugInfoNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get segment debug info not found response +func (o *GetSegmentDebugInfoNotFound) Code() int { + return 404 +} + +func (o *GetSegmentDebugInfoNotFound) Error() string { + return fmt.Sprintf("[GET /debug/segments/{tableName}/{segmentName}][%d] getSegmentDebugInfoNotFound ", 404) +} + +func (o *GetSegmentDebugInfoNotFound) String() string { + return fmt.Sprintf("[GET /debug/segments/{tableName}/{segmentName}][%d] getSegmentDebugInfoNotFound ", 404) +} + +func (o *GetSegmentDebugInfoNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSegmentDebugInfoInternalServerError creates a GetSegmentDebugInfoInternalServerError with default headers values +func NewGetSegmentDebugInfoInternalServerError() *GetSegmentDebugInfoInternalServerError { + return &GetSegmentDebugInfoInternalServerError{} +} + +/* +GetSegmentDebugInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetSegmentDebugInfoInternalServerError struct { +} + +// IsSuccess returns true when this get segment debug info internal server error response has a 2xx status code +func (o *GetSegmentDebugInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get segment debug info internal server error response has a 3xx status code +func (o *GetSegmentDebugInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment debug info internal server error response has a 4xx status code +func (o *GetSegmentDebugInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment debug info internal server error response has a 5xx status code +func (o *GetSegmentDebugInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get segment debug info internal server error response a status code equal to that given +func (o *GetSegmentDebugInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get segment debug info internal server error response +func (o *GetSegmentDebugInfoInternalServerError) Code() int { + return 500 +} + +func (o *GetSegmentDebugInfoInternalServerError) Error() string { + return fmt.Sprintf("[GET /debug/segments/{tableName}/{segmentName}][%d] getSegmentDebugInfoInternalServerError ", 500) +} + +func (o *GetSegmentDebugInfoInternalServerError) String() string { + return fmt.Sprintf("[GET /debug/segments/{tableName}/{segmentName}][%d] getSegmentDebugInfoInternalServerError ", 500) +} + +func (o *GetSegmentDebugInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster/get_table_debug_info_parameters.go b/src/client/cluster/get_table_debug_info_parameters.go new file mode 100644 index 0000000..34b0a3d --- /dev/null +++ b/src/client/cluster/get_table_debug_info_parameters.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTableDebugInfoParams creates a new GetTableDebugInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableDebugInfoParams() *GetTableDebugInfoParams { + return &GetTableDebugInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableDebugInfoParamsWithTimeout creates a new GetTableDebugInfoParams object +// with the ability to set a timeout on a request. +func NewGetTableDebugInfoParamsWithTimeout(timeout time.Duration) *GetTableDebugInfoParams { + return &GetTableDebugInfoParams{ + timeout: timeout, + } +} + +// NewGetTableDebugInfoParamsWithContext creates a new GetTableDebugInfoParams object +// with the ability to set a context for a request. +func NewGetTableDebugInfoParamsWithContext(ctx context.Context) *GetTableDebugInfoParams { + return &GetTableDebugInfoParams{ + Context: ctx, + } +} + +// NewGetTableDebugInfoParamsWithHTTPClient creates a new GetTableDebugInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableDebugInfoParamsWithHTTPClient(client *http.Client) *GetTableDebugInfoParams { + return &GetTableDebugInfoParams{ + HTTPClient: client, + } +} + +/* +GetTableDebugInfoParams contains all the parameters to send to the API endpoint + + for the get table debug info operation. + + Typically these are written to a http.Request. +*/ +type GetTableDebugInfoParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + /* Verbosity. + + Verbosity of debug information + + Format: int32 + */ + Verbosity *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableDebugInfoParams) WithDefaults() *GetTableDebugInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableDebugInfoParams) SetDefaults() { + var ( + verbosityDefault = int32(0) + ) + + val := GetTableDebugInfoParams{ + Verbosity: &verbosityDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get table debug info params +func (o *GetTableDebugInfoParams) WithTimeout(timeout time.Duration) *GetTableDebugInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table debug info params +func (o *GetTableDebugInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table debug info params +func (o *GetTableDebugInfoParams) WithContext(ctx context.Context) *GetTableDebugInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table debug info params +func (o *GetTableDebugInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table debug info params +func (o *GetTableDebugInfoParams) WithHTTPClient(client *http.Client) *GetTableDebugInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table debug info params +func (o *GetTableDebugInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table debug info params +func (o *GetTableDebugInfoParams) WithTableName(tableName string) *GetTableDebugInfoParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table debug info params +func (o *GetTableDebugInfoParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table debug info params +func (o *GetTableDebugInfoParams) WithType(typeVar *string) *GetTableDebugInfoParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table debug info params +func (o *GetTableDebugInfoParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithVerbosity adds the verbosity to the get table debug info params +func (o *GetTableDebugInfoParams) WithVerbosity(verbosity *int32) *GetTableDebugInfoParams { + o.SetVerbosity(verbosity) + return o +} + +// SetVerbosity adds the verbosity to the get table debug info params +func (o *GetTableDebugInfoParams) SetVerbosity(verbosity *int32) { + o.Verbosity = verbosity +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableDebugInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if o.Verbosity != nil { + + // query param verbosity + var qrVerbosity int32 + + if o.Verbosity != nil { + qrVerbosity = *o.Verbosity + } + qVerbosity := swag.FormatInt32(qrVerbosity) + if qVerbosity != "" { + + if err := r.SetQueryParam("verbosity", qVerbosity); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster/get_table_debug_info_responses.go b/src/client/cluster/get_table_debug_info_responses.go new file mode 100644 index 0000000..36b538e --- /dev/null +++ b/src/client/cluster/get_table_debug_info_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableDebugInfoReader is a Reader for the GetTableDebugInfo structure. +type GetTableDebugInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableDebugInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableDebugInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetTableDebugInfoNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTableDebugInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableDebugInfoOK creates a GetTableDebugInfoOK with default headers values +func NewGetTableDebugInfoOK() *GetTableDebugInfoOK { + return &GetTableDebugInfoOK{} +} + +/* +GetTableDebugInfoOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTableDebugInfoOK struct { +} + +// IsSuccess returns true when this get table debug info o k response has a 2xx status code +func (o *GetTableDebugInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table debug info o k response has a 3xx status code +func (o *GetTableDebugInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table debug info o k response has a 4xx status code +func (o *GetTableDebugInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table debug info o k response has a 5xx status code +func (o *GetTableDebugInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table debug info o k response a status code equal to that given +func (o *GetTableDebugInfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table debug info o k response +func (o *GetTableDebugInfoOK) Code() int { + return 200 +} + +func (o *GetTableDebugInfoOK) Error() string { + return fmt.Sprintf("[GET /debug/tables/{tableName}][%d] getTableDebugInfoOK ", 200) +} + +func (o *GetTableDebugInfoOK) String() string { + return fmt.Sprintf("[GET /debug/tables/{tableName}][%d] getTableDebugInfoOK ", 200) +} + +func (o *GetTableDebugInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableDebugInfoNotFound creates a GetTableDebugInfoNotFound with default headers values +func NewGetTableDebugInfoNotFound() *GetTableDebugInfoNotFound { + return &GetTableDebugInfoNotFound{} +} + +/* +GetTableDebugInfoNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetTableDebugInfoNotFound struct { +} + +// IsSuccess returns true when this get table debug info not found response has a 2xx status code +func (o *GetTableDebugInfoNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table debug info not found response has a 3xx status code +func (o *GetTableDebugInfoNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table debug info not found response has a 4xx status code +func (o *GetTableDebugInfoNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get table debug info not found response has a 5xx status code +func (o *GetTableDebugInfoNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get table debug info not found response a status code equal to that given +func (o *GetTableDebugInfoNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get table debug info not found response +func (o *GetTableDebugInfoNotFound) Code() int { + return 404 +} + +func (o *GetTableDebugInfoNotFound) Error() string { + return fmt.Sprintf("[GET /debug/tables/{tableName}][%d] getTableDebugInfoNotFound ", 404) +} + +func (o *GetTableDebugInfoNotFound) String() string { + return fmt.Sprintf("[GET /debug/tables/{tableName}][%d] getTableDebugInfoNotFound ", 404) +} + +func (o *GetTableDebugInfoNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableDebugInfoInternalServerError creates a GetTableDebugInfoInternalServerError with default headers values +func NewGetTableDebugInfoInternalServerError() *GetTableDebugInfoInternalServerError { + return &GetTableDebugInfoInternalServerError{} +} + +/* +GetTableDebugInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetTableDebugInfoInternalServerError struct { +} + +// IsSuccess returns true when this get table debug info internal server error response has a 2xx status code +func (o *GetTableDebugInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table debug info internal server error response has a 3xx status code +func (o *GetTableDebugInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table debug info internal server error response has a 4xx status code +func (o *GetTableDebugInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table debug info internal server error response has a 5xx status code +func (o *GetTableDebugInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get table debug info internal server error response a status code equal to that given +func (o *GetTableDebugInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get table debug info internal server error response +func (o *GetTableDebugInfoInternalServerError) Code() int { + return 500 +} + +func (o *GetTableDebugInfoInternalServerError) Error() string { + return fmt.Sprintf("[GET /debug/tables/{tableName}][%d] getTableDebugInfoInternalServerError ", 500) +} + +func (o *GetTableDebugInfoInternalServerError) String() string { + return fmt.Sprintf("[GET /debug/tables/{tableName}][%d] getTableDebugInfoInternalServerError ", 500) +} + +func (o *GetTableDebugInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster/list_cluster_configs_parameters.go b/src/client/cluster/list_cluster_configs_parameters.go new file mode 100644 index 0000000..61ddeb7 --- /dev/null +++ b/src/client/cluster/list_cluster_configs_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListClusterConfigsParams creates a new ListClusterConfigsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListClusterConfigsParams() *ListClusterConfigsParams { + return &ListClusterConfigsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListClusterConfigsParamsWithTimeout creates a new ListClusterConfigsParams object +// with the ability to set a timeout on a request. +func NewListClusterConfigsParamsWithTimeout(timeout time.Duration) *ListClusterConfigsParams { + return &ListClusterConfigsParams{ + timeout: timeout, + } +} + +// NewListClusterConfigsParamsWithContext creates a new ListClusterConfigsParams object +// with the ability to set a context for a request. +func NewListClusterConfigsParamsWithContext(ctx context.Context) *ListClusterConfigsParams { + return &ListClusterConfigsParams{ + Context: ctx, + } +} + +// NewListClusterConfigsParamsWithHTTPClient creates a new ListClusterConfigsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListClusterConfigsParamsWithHTTPClient(client *http.Client) *ListClusterConfigsParams { + return &ListClusterConfigsParams{ + HTTPClient: client, + } +} + +/* +ListClusterConfigsParams contains all the parameters to send to the API endpoint + + for the list cluster configs operation. + + Typically these are written to a http.Request. +*/ +type ListClusterConfigsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list cluster configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListClusterConfigsParams) WithDefaults() *ListClusterConfigsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list cluster configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListClusterConfigsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list cluster configs params +func (o *ListClusterConfigsParams) WithTimeout(timeout time.Duration) *ListClusterConfigsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list cluster configs params +func (o *ListClusterConfigsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list cluster configs params +func (o *ListClusterConfigsParams) WithContext(ctx context.Context) *ListClusterConfigsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list cluster configs params +func (o *ListClusterConfigsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list cluster configs params +func (o *ListClusterConfigsParams) WithHTTPClient(client *http.Client) *ListClusterConfigsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list cluster configs params +func (o *ListClusterConfigsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListClusterConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster/list_cluster_configs_responses.go b/src/client/cluster/list_cluster_configs_responses.go new file mode 100644 index 0000000..200da72 --- /dev/null +++ b/src/client/cluster/list_cluster_configs_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListClusterConfigsReader is a Reader for the ListClusterConfigs structure. +type ListClusterConfigsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListClusterConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListClusterConfigsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewListClusterConfigsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListClusterConfigsOK creates a ListClusterConfigsOK with default headers values +func NewListClusterConfigsOK() *ListClusterConfigsOK { + return &ListClusterConfigsOK{} +} + +/* +ListClusterConfigsOK describes a response with status code 200, with default header values. + +Success +*/ +type ListClusterConfigsOK struct { +} + +// IsSuccess returns true when this list cluster configs o k response has a 2xx status code +func (o *ListClusterConfigsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list cluster configs o k response has a 3xx status code +func (o *ListClusterConfigsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list cluster configs o k response has a 4xx status code +func (o *ListClusterConfigsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list cluster configs o k response has a 5xx status code +func (o *ListClusterConfigsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list cluster configs o k response a status code equal to that given +func (o *ListClusterConfigsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list cluster configs o k response +func (o *ListClusterConfigsOK) Code() int { + return 200 +} + +func (o *ListClusterConfigsOK) Error() string { + return fmt.Sprintf("[GET /cluster/configs][%d] listClusterConfigsOK ", 200) +} + +func (o *ListClusterConfigsOK) String() string { + return fmt.Sprintf("[GET /cluster/configs][%d] listClusterConfigsOK ", 200) +} + +func (o *ListClusterConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewListClusterConfigsInternalServerError creates a ListClusterConfigsInternalServerError with default headers values +func NewListClusterConfigsInternalServerError() *ListClusterConfigsInternalServerError { + return &ListClusterConfigsInternalServerError{} +} + +/* +ListClusterConfigsInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type ListClusterConfigsInternalServerError struct { +} + +// IsSuccess returns true when this list cluster configs internal server error response has a 2xx status code +func (o *ListClusterConfigsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list cluster configs internal server error response has a 3xx status code +func (o *ListClusterConfigsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list cluster configs internal server error response has a 4xx status code +func (o *ListClusterConfigsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list cluster configs internal server error response has a 5xx status code +func (o *ListClusterConfigsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list cluster configs internal server error response a status code equal to that given +func (o *ListClusterConfigsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list cluster configs internal server error response +func (o *ListClusterConfigsInternalServerError) Code() int { + return 500 +} + +func (o *ListClusterConfigsInternalServerError) Error() string { + return fmt.Sprintf("[GET /cluster/configs][%d] listClusterConfigsInternalServerError ", 500) +} + +func (o *ListClusterConfigsInternalServerError) String() string { + return fmt.Sprintf("[GET /cluster/configs][%d] listClusterConfigsInternalServerError ", 500) +} + +func (o *ListClusterConfigsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster/update_cluster_config_parameters.go b/src/client/cluster/update_cluster_config_parameters.go new file mode 100644 index 0000000..e079092 --- /dev/null +++ b/src/client/cluster/update_cluster_config_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateClusterConfigParams creates a new UpdateClusterConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateClusterConfigParams() *UpdateClusterConfigParams { + return &UpdateClusterConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateClusterConfigParamsWithTimeout creates a new UpdateClusterConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateClusterConfigParamsWithTimeout(timeout time.Duration) *UpdateClusterConfigParams { + return &UpdateClusterConfigParams{ + timeout: timeout, + } +} + +// NewUpdateClusterConfigParamsWithContext creates a new UpdateClusterConfigParams object +// with the ability to set a context for a request. +func NewUpdateClusterConfigParamsWithContext(ctx context.Context) *UpdateClusterConfigParams { + return &UpdateClusterConfigParams{ + Context: ctx, + } +} + +// NewUpdateClusterConfigParamsWithHTTPClient creates a new UpdateClusterConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateClusterConfigParamsWithHTTPClient(client *http.Client) *UpdateClusterConfigParams { + return &UpdateClusterConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateClusterConfigParams contains all the parameters to send to the API endpoint + + for the update cluster config operation. + + Typically these are written to a http.Request. +*/ +type UpdateClusterConfigParams struct { + + // Body. + Body string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update cluster config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateClusterConfigParams) WithDefaults() *UpdateClusterConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update cluster config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateClusterConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update cluster config params +func (o *UpdateClusterConfigParams) WithTimeout(timeout time.Duration) *UpdateClusterConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update cluster config params +func (o *UpdateClusterConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update cluster config params +func (o *UpdateClusterConfigParams) WithContext(ctx context.Context) *UpdateClusterConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update cluster config params +func (o *UpdateClusterConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update cluster config params +func (o *UpdateClusterConfigParams) WithHTTPClient(client *http.Client) *UpdateClusterConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update cluster config params +func (o *UpdateClusterConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update cluster config params +func (o *UpdateClusterConfigParams) WithBody(body string) *UpdateClusterConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update cluster config params +func (o *UpdateClusterConfigParams) SetBody(body string) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateClusterConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster/update_cluster_config_responses.go b/src/client/cluster/update_cluster_config_responses.go new file mode 100644 index 0000000..ec1be71 --- /dev/null +++ b/src/client/cluster/update_cluster_config_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateClusterConfigReader is a Reader for the UpdateClusterConfig structure. +type UpdateClusterConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateClusterConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateClusterConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewUpdateClusterConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateClusterConfigOK creates a UpdateClusterConfigOK with default headers values +func NewUpdateClusterConfigOK() *UpdateClusterConfigOK { + return &UpdateClusterConfigOK{} +} + +/* +UpdateClusterConfigOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateClusterConfigOK struct { +} + +// IsSuccess returns true when this update cluster config o k response has a 2xx status code +func (o *UpdateClusterConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update cluster config o k response has a 3xx status code +func (o *UpdateClusterConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update cluster config o k response has a 4xx status code +func (o *UpdateClusterConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update cluster config o k response has a 5xx status code +func (o *UpdateClusterConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update cluster config o k response a status code equal to that given +func (o *UpdateClusterConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update cluster config o k response +func (o *UpdateClusterConfigOK) Code() int { + return 200 +} + +func (o *UpdateClusterConfigOK) Error() string { + return fmt.Sprintf("[POST /cluster/configs][%d] updateClusterConfigOK ", 200) +} + +func (o *UpdateClusterConfigOK) String() string { + return fmt.Sprintf("[POST /cluster/configs][%d] updateClusterConfigOK ", 200) +} + +func (o *UpdateClusterConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateClusterConfigInternalServerError creates a UpdateClusterConfigInternalServerError with default headers values +func NewUpdateClusterConfigInternalServerError() *UpdateClusterConfigInternalServerError { + return &UpdateClusterConfigInternalServerError{} +} + +/* +UpdateClusterConfigInternalServerError describes a response with status code 500, with default header values. + +Server error updating configuration +*/ +type UpdateClusterConfigInternalServerError struct { +} + +// IsSuccess returns true when this update cluster config internal server error response has a 2xx status code +func (o *UpdateClusterConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update cluster config internal server error response has a 3xx status code +func (o *UpdateClusterConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update cluster config internal server error response has a 4xx status code +func (o *UpdateClusterConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update cluster config internal server error response has a 5xx status code +func (o *UpdateClusterConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update cluster config internal server error response a status code equal to that given +func (o *UpdateClusterConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update cluster config internal server error response +func (o *UpdateClusterConfigInternalServerError) Code() int { + return 500 +} + +func (o *UpdateClusterConfigInternalServerError) Error() string { + return fmt.Sprintf("[POST /cluster/configs][%d] updateClusterConfigInternalServerError ", 500) +} + +func (o *UpdateClusterConfigInternalServerError) String() string { + return fmt.Sprintf("[POST /cluster/configs][%d] updateClusterConfigInternalServerError ", 500) +} + +func (o *UpdateClusterConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/cluster_health/cluster_health_client.go b/src/client/cluster_health/cluster_health_client.go new file mode 100644 index 0000000..b8d02b8 --- /dev/null +++ b/src/client/cluster_health/cluster_health_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster_health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new cluster health API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cluster health API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetClusterHealthDetails(params *GetClusterHealthDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterHealthDetailsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetClusterHealthDetails gets cached cluster health details +*/ +func (a *Client) GetClusterHealthDetails(params *GetClusterHealthDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterHealthDetailsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterHealthDetailsParams() + } + op := &runtime.ClientOperation{ + ID: "getClusterHealthDetails", + Method: "GET", + PathPattern: "/clusterHealth", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetClusterHealthDetailsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterHealthDetailsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getClusterHealthDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/cluster_health/get_cluster_health_details_parameters.go b/src/client/cluster_health/get_cluster_health_details_parameters.go new file mode 100644 index 0000000..3ced60c --- /dev/null +++ b/src/client/cluster_health/get_cluster_health_details_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster_health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterHealthDetailsParams creates a new GetClusterHealthDetailsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetClusterHealthDetailsParams() *GetClusterHealthDetailsParams { + return &GetClusterHealthDetailsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterHealthDetailsParamsWithTimeout creates a new GetClusterHealthDetailsParams object +// with the ability to set a timeout on a request. +func NewGetClusterHealthDetailsParamsWithTimeout(timeout time.Duration) *GetClusterHealthDetailsParams { + return &GetClusterHealthDetailsParams{ + timeout: timeout, + } +} + +// NewGetClusterHealthDetailsParamsWithContext creates a new GetClusterHealthDetailsParams object +// with the ability to set a context for a request. +func NewGetClusterHealthDetailsParamsWithContext(ctx context.Context) *GetClusterHealthDetailsParams { + return &GetClusterHealthDetailsParams{ + Context: ctx, + } +} + +// NewGetClusterHealthDetailsParamsWithHTTPClient creates a new GetClusterHealthDetailsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetClusterHealthDetailsParamsWithHTTPClient(client *http.Client) *GetClusterHealthDetailsParams { + return &GetClusterHealthDetailsParams{ + HTTPClient: client, + } +} + +/* +GetClusterHealthDetailsParams contains all the parameters to send to the API endpoint + + for the get cluster health details operation. + + Typically these are written to a http.Request. +*/ +type GetClusterHealthDetailsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cluster health details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterHealthDetailsParams) WithDefaults() *GetClusterHealthDetailsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cluster health details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterHealthDetailsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cluster health details params +func (o *GetClusterHealthDetailsParams) WithTimeout(timeout time.Duration) *GetClusterHealthDetailsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster health details params +func (o *GetClusterHealthDetailsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster health details params +func (o *GetClusterHealthDetailsParams) WithContext(ctx context.Context) *GetClusterHealthDetailsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster health details params +func (o *GetClusterHealthDetailsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster health details params +func (o *GetClusterHealthDetailsParams) WithHTTPClient(client *http.Client) *GetClusterHealthDetailsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster health details params +func (o *GetClusterHealthDetailsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterHealthDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/cluster_health/get_cluster_health_details_responses.go b/src/client/cluster_health/get_cluster_health_details_responses.go new file mode 100644 index 0000000..d18826e --- /dev/null +++ b/src/client/cluster_health/get_cluster_health_details_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster_health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetClusterHealthDetailsReader is a Reader for the GetClusterHealthDetails structure. +type GetClusterHealthDetailsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterHealthDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterHealthDetailsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetClusterHealthDetailsOK creates a GetClusterHealthDetailsOK with default headers values +func NewGetClusterHealthDetailsOK() *GetClusterHealthDetailsOK { + return &GetClusterHealthDetailsOK{} +} + +/* +GetClusterHealthDetailsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetClusterHealthDetailsOK struct { + Payload *models.ClusterHealthResponse +} + +// IsSuccess returns true when this get cluster health details o k response has a 2xx status code +func (o *GetClusterHealthDetailsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get cluster health details o k response has a 3xx status code +func (o *GetClusterHealthDetailsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get cluster health details o k response has a 4xx status code +func (o *GetClusterHealthDetailsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get cluster health details o k response has a 5xx status code +func (o *GetClusterHealthDetailsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get cluster health details o k response a status code equal to that given +func (o *GetClusterHealthDetailsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get cluster health details o k response +func (o *GetClusterHealthDetailsOK) Code() int { + return 200 +} + +func (o *GetClusterHealthDetailsOK) Error() string { + return fmt.Sprintf("[GET /clusterHealth][%d] getClusterHealthDetailsOK %+v", 200, o.Payload) +} + +func (o *GetClusterHealthDetailsOK) String() string { + return fmt.Sprintf("[GET /clusterHealth][%d] getClusterHealthDetailsOK %+v", 200, o.Payload) +} + +func (o *GetClusterHealthDetailsOK) GetPayload() *models.ClusterHealthResponse { + return o.Payload +} + +func (o *GetClusterHealthDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterHealthResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/health/check_health_legacy_parameters.go b/src/client/health/check_health_legacy_parameters.go new file mode 100644 index 0000000..27d7d1f --- /dev/null +++ b/src/client/health/check_health_legacy_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCheckHealthLegacyParams creates a new CheckHealthLegacyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCheckHealthLegacyParams() *CheckHealthLegacyParams { + return &CheckHealthLegacyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCheckHealthLegacyParamsWithTimeout creates a new CheckHealthLegacyParams object +// with the ability to set a timeout on a request. +func NewCheckHealthLegacyParamsWithTimeout(timeout time.Duration) *CheckHealthLegacyParams { + return &CheckHealthLegacyParams{ + timeout: timeout, + } +} + +// NewCheckHealthLegacyParamsWithContext creates a new CheckHealthLegacyParams object +// with the ability to set a context for a request. +func NewCheckHealthLegacyParamsWithContext(ctx context.Context) *CheckHealthLegacyParams { + return &CheckHealthLegacyParams{ + Context: ctx, + } +} + +// NewCheckHealthLegacyParamsWithHTTPClient creates a new CheckHealthLegacyParams object +// with the ability to set a custom HTTPClient for a request. +func NewCheckHealthLegacyParamsWithHTTPClient(client *http.Client) *CheckHealthLegacyParams { + return &CheckHealthLegacyParams{ + HTTPClient: client, + } +} + +/* +CheckHealthLegacyParams contains all the parameters to send to the API endpoint + + for the check health legacy operation. + + Typically these are written to a http.Request. +*/ +type CheckHealthLegacyParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the check health legacy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckHealthLegacyParams) WithDefaults() *CheckHealthLegacyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the check health legacy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckHealthLegacyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the check health legacy params +func (o *CheckHealthLegacyParams) WithTimeout(timeout time.Duration) *CheckHealthLegacyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the check health legacy params +func (o *CheckHealthLegacyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the check health legacy params +func (o *CheckHealthLegacyParams) WithContext(ctx context.Context) *CheckHealthLegacyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the check health legacy params +func (o *CheckHealthLegacyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the check health legacy params +func (o *CheckHealthLegacyParams) WithHTTPClient(client *http.Client) *CheckHealthLegacyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the check health legacy params +func (o *CheckHealthLegacyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CheckHealthLegacyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/health/check_health_legacy_responses.go b/src/client/health/check_health_legacy_responses.go new file mode 100644 index 0000000..9ead969 --- /dev/null +++ b/src/client/health/check_health_legacy_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CheckHealthLegacyReader is a Reader for the CheckHealthLegacy structure. +type CheckHealthLegacyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CheckHealthLegacyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCheckHealthLegacyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCheckHealthLegacyOK creates a CheckHealthLegacyOK with default headers values +func NewCheckHealthLegacyOK() *CheckHealthLegacyOK { + return &CheckHealthLegacyOK{} +} + +/* +CheckHealthLegacyOK describes a response with status code 200, with default header values. + +Good +*/ +type CheckHealthLegacyOK struct { +} + +// IsSuccess returns true when this check health legacy o k response has a 2xx status code +func (o *CheckHealthLegacyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this check health legacy o k response has a 3xx status code +func (o *CheckHealthLegacyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this check health legacy o k response has a 4xx status code +func (o *CheckHealthLegacyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this check health legacy o k response has a 5xx status code +func (o *CheckHealthLegacyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this check health legacy o k response a status code equal to that given +func (o *CheckHealthLegacyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the check health legacy o k response +func (o *CheckHealthLegacyOK) Code() int { + return 200 +} + +func (o *CheckHealthLegacyOK) Error() string { + return fmt.Sprintf("[GET /pinot-controller/admin][%d] checkHealthLegacyOK ", 200) +} + +func (o *CheckHealthLegacyOK) String() string { + return fmt.Sprintf("[GET /pinot-controller/admin][%d] checkHealthLegacyOK ", 200) +} + +func (o *CheckHealthLegacyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/health/check_health_parameters.go b/src/client/health/check_health_parameters.go new file mode 100644 index 0000000..43cf1e3 --- /dev/null +++ b/src/client/health/check_health_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCheckHealthParams creates a new CheckHealthParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCheckHealthParams() *CheckHealthParams { + return &CheckHealthParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCheckHealthParamsWithTimeout creates a new CheckHealthParams object +// with the ability to set a timeout on a request. +func NewCheckHealthParamsWithTimeout(timeout time.Duration) *CheckHealthParams { + return &CheckHealthParams{ + timeout: timeout, + } +} + +// NewCheckHealthParamsWithContext creates a new CheckHealthParams object +// with the ability to set a context for a request. +func NewCheckHealthParamsWithContext(ctx context.Context) *CheckHealthParams { + return &CheckHealthParams{ + Context: ctx, + } +} + +// NewCheckHealthParamsWithHTTPClient creates a new CheckHealthParams object +// with the ability to set a custom HTTPClient for a request. +func NewCheckHealthParamsWithHTTPClient(client *http.Client) *CheckHealthParams { + return &CheckHealthParams{ + HTTPClient: client, + } +} + +/* +CheckHealthParams contains all the parameters to send to the API endpoint + + for the check health operation. + + Typically these are written to a http.Request. +*/ +type CheckHealthParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the check health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckHealthParams) WithDefaults() *CheckHealthParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the check health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckHealthParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the check health params +func (o *CheckHealthParams) WithTimeout(timeout time.Duration) *CheckHealthParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the check health params +func (o *CheckHealthParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the check health params +func (o *CheckHealthParams) WithContext(ctx context.Context) *CheckHealthParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the check health params +func (o *CheckHealthParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the check health params +func (o *CheckHealthParams) WithHTTPClient(client *http.Client) *CheckHealthParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the check health params +func (o *CheckHealthParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CheckHealthParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/health/check_health_responses.go b/src/client/health/check_health_responses.go new file mode 100644 index 0000000..521b2bd --- /dev/null +++ b/src/client/health/check_health_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CheckHealthReader is a Reader for the CheckHealth structure. +type CheckHealthReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CheckHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCheckHealthOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCheckHealthOK creates a CheckHealthOK with default headers values +func NewCheckHealthOK() *CheckHealthOK { + return &CheckHealthOK{} +} + +/* +CheckHealthOK describes a response with status code 200, with default header values. + +Good +*/ +type CheckHealthOK struct { +} + +// IsSuccess returns true when this check health o k response has a 2xx status code +func (o *CheckHealthOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this check health o k response has a 3xx status code +func (o *CheckHealthOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this check health o k response has a 4xx status code +func (o *CheckHealthOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this check health o k response has a 5xx status code +func (o *CheckHealthOK) IsServerError() bool { + return false +} + +// IsCode returns true when this check health o k response a status code equal to that given +func (o *CheckHealthOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the check health o k response +func (o *CheckHealthOK) Code() int { + return 200 +} + +func (o *CheckHealthOK) Error() string { + return fmt.Sprintf("[GET /health][%d] checkHealthOK ", 200) +} + +func (o *CheckHealthOK) String() string { + return fmt.Sprintf("[GET /health][%d] checkHealthOK ", 200) +} + +func (o *CheckHealthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/health/health_client.go b/src/client/health/health_client.go new file mode 100644 index 0000000..41ae10b --- /dev/null +++ b/src/client/health/health_client.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new health API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for health API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CheckHealth(params *CheckHealthParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckHealthOK, error) + + CheckHealthLegacy(params *CheckHealthLegacyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckHealthLegacyOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CheckHealth checks controller health +*/ +func (a *Client) CheckHealth(params *CheckHealthParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckHealthOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCheckHealthParams() + } + op := &runtime.ClientOperation{ + ID: "checkHealth", + Method: "GET", + PathPattern: "/health", + ProducesMediaTypes: []string{"text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CheckHealthReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CheckHealthOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for checkHealth: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CheckHealthLegacy checks controller health +*/ +func (a *Client) CheckHealthLegacy(params *CheckHealthLegacyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckHealthLegacyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCheckHealthLegacyParams() + } + op := &runtime.ClientOperation{ + ID: "checkHealthLegacy", + Method: "GET", + PathPattern: "/pinot-controller/admin", + ProducesMediaTypes: []string{"text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CheckHealthLegacyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CheckHealthLegacyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for checkHealthLegacy: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/instance/add_instance_parameters.go b/src/client/instance/add_instance_parameters.go new file mode 100644 index 0000000..d51026a --- /dev/null +++ b/src/client/instance/add_instance_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "startree.ai/cli/models" +) + +// NewAddInstanceParams creates a new AddInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddInstanceParams() *AddInstanceParams { + return &AddInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddInstanceParamsWithTimeout creates a new AddInstanceParams object +// with the ability to set a timeout on a request. +func NewAddInstanceParamsWithTimeout(timeout time.Duration) *AddInstanceParams { + return &AddInstanceParams{ + timeout: timeout, + } +} + +// NewAddInstanceParamsWithContext creates a new AddInstanceParams object +// with the ability to set a context for a request. +func NewAddInstanceParamsWithContext(ctx context.Context) *AddInstanceParams { + return &AddInstanceParams{ + Context: ctx, + } +} + +// NewAddInstanceParamsWithHTTPClient creates a new AddInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddInstanceParamsWithHTTPClient(client *http.Client) *AddInstanceParams { + return &AddInstanceParams{ + HTTPClient: client, + } +} + +/* +AddInstanceParams contains all the parameters to send to the API endpoint + + for the add instance operation. + + Typically these are written to a http.Request. +*/ +type AddInstanceParams struct { + + // Body. + Body *models.Instance + + /* UpdateBrokerResource. + + Whether to update broker resource for broker instance + */ + UpdateBrokerResource *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddInstanceParams) WithDefaults() *AddInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddInstanceParams) SetDefaults() { + var ( + updateBrokerResourceDefault = bool(false) + ) + + val := AddInstanceParams{ + UpdateBrokerResource: &updateBrokerResourceDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the add instance params +func (o *AddInstanceParams) WithTimeout(timeout time.Duration) *AddInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add instance params +func (o *AddInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add instance params +func (o *AddInstanceParams) WithContext(ctx context.Context) *AddInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add instance params +func (o *AddInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add instance params +func (o *AddInstanceParams) WithHTTPClient(client *http.Client) *AddInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add instance params +func (o *AddInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add instance params +func (o *AddInstanceParams) WithBody(body *models.Instance) *AddInstanceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add instance params +func (o *AddInstanceParams) SetBody(body *models.Instance) { + o.Body = body +} + +// WithUpdateBrokerResource adds the updateBrokerResource to the add instance params +func (o *AddInstanceParams) WithUpdateBrokerResource(updateBrokerResource *bool) *AddInstanceParams { + o.SetUpdateBrokerResource(updateBrokerResource) + return o +} + +// SetUpdateBrokerResource adds the updateBrokerResource to the add instance params +func (o *AddInstanceParams) SetUpdateBrokerResource(updateBrokerResource *bool) { + o.UpdateBrokerResource = updateBrokerResource +} + +// WriteToRequest writes these params to a swagger request +func (o *AddInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.UpdateBrokerResource != nil { + + // query param updateBrokerResource + var qrUpdateBrokerResource bool + + if o.UpdateBrokerResource != nil { + qrUpdateBrokerResource = *o.UpdateBrokerResource + } + qUpdateBrokerResource := swag.FormatBool(qrUpdateBrokerResource) + if qUpdateBrokerResource != "" { + + if err := r.SetQueryParam("updateBrokerResource", qUpdateBrokerResource); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/add_instance_responses.go b/src/client/instance/add_instance_responses.go new file mode 100644 index 0000000..821daf6 --- /dev/null +++ b/src/client/instance/add_instance_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// AddInstanceReader is a Reader for the AddInstance structure. +type AddInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 409: + result := NewAddInstanceConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAddInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAddInstanceOK creates a AddInstanceOK with default headers values +func NewAddInstanceOK() *AddInstanceOK { + return &AddInstanceOK{} +} + +/* +AddInstanceOK describes a response with status code 200, with default header values. + +Success +*/ +type AddInstanceOK struct { +} + +// IsSuccess returns true when this add instance o k response has a 2xx status code +func (o *AddInstanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this add instance o k response has a 3xx status code +func (o *AddInstanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add instance o k response has a 4xx status code +func (o *AddInstanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this add instance o k response has a 5xx status code +func (o *AddInstanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this add instance o k response a status code equal to that given +func (o *AddInstanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the add instance o k response +func (o *AddInstanceOK) Code() int { + return 200 +} + +func (o *AddInstanceOK) Error() string { + return fmt.Sprintf("[POST /instances][%d] addInstanceOK ", 200) +} + +func (o *AddInstanceOK) String() string { + return fmt.Sprintf("[POST /instances][%d] addInstanceOK ", 200) +} + +func (o *AddInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAddInstanceConflict creates a AddInstanceConflict with default headers values +func NewAddInstanceConflict() *AddInstanceConflict { + return &AddInstanceConflict{} +} + +/* +AddInstanceConflict describes a response with status code 409, with default header values. + +Instance already exists +*/ +type AddInstanceConflict struct { +} + +// IsSuccess returns true when this add instance conflict response has a 2xx status code +func (o *AddInstanceConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this add instance conflict response has a 3xx status code +func (o *AddInstanceConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add instance conflict response has a 4xx status code +func (o *AddInstanceConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this add instance conflict response has a 5xx status code +func (o *AddInstanceConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this add instance conflict response a status code equal to that given +func (o *AddInstanceConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the add instance conflict response +func (o *AddInstanceConflict) Code() int { + return 409 +} + +func (o *AddInstanceConflict) Error() string { + return fmt.Sprintf("[POST /instances][%d] addInstanceConflict ", 409) +} + +func (o *AddInstanceConflict) String() string { + return fmt.Sprintf("[POST /instances][%d] addInstanceConflict ", 409) +} + +func (o *AddInstanceConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAddInstanceInternalServerError creates a AddInstanceInternalServerError with default headers values +func NewAddInstanceInternalServerError() *AddInstanceInternalServerError { + return &AddInstanceInternalServerError{} +} + +/* +AddInstanceInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type AddInstanceInternalServerError struct { +} + +// IsSuccess returns true when this add instance internal server error response has a 2xx status code +func (o *AddInstanceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this add instance internal server error response has a 3xx status code +func (o *AddInstanceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add instance internal server error response has a 4xx status code +func (o *AddInstanceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this add instance internal server error response has a 5xx status code +func (o *AddInstanceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this add instance internal server error response a status code equal to that given +func (o *AddInstanceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the add instance internal server error response +func (o *AddInstanceInternalServerError) Code() int { + return 500 +} + +func (o *AddInstanceInternalServerError) Error() string { + return fmt.Sprintf("[POST /instances][%d] addInstanceInternalServerError ", 500) +} + +func (o *AddInstanceInternalServerError) String() string { + return fmt.Sprintf("[POST /instances][%d] addInstanceInternalServerError ", 500) +} + +func (o *AddInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/drop_instance_parameters.go b/src/client/instance/drop_instance_parameters.go new file mode 100644 index 0000000..9d67129 --- /dev/null +++ b/src/client/instance/drop_instance_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDropInstanceParams creates a new DropInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDropInstanceParams() *DropInstanceParams { + return &DropInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDropInstanceParamsWithTimeout creates a new DropInstanceParams object +// with the ability to set a timeout on a request. +func NewDropInstanceParamsWithTimeout(timeout time.Duration) *DropInstanceParams { + return &DropInstanceParams{ + timeout: timeout, + } +} + +// NewDropInstanceParamsWithContext creates a new DropInstanceParams object +// with the ability to set a context for a request. +func NewDropInstanceParamsWithContext(ctx context.Context) *DropInstanceParams { + return &DropInstanceParams{ + Context: ctx, + } +} + +// NewDropInstanceParamsWithHTTPClient creates a new DropInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewDropInstanceParamsWithHTTPClient(client *http.Client) *DropInstanceParams { + return &DropInstanceParams{ + HTTPClient: client, + } +} + +/* +DropInstanceParams contains all the parameters to send to the API endpoint + + for the drop instance operation. + + Typically these are written to a http.Request. +*/ +type DropInstanceParams struct { + + /* InstanceName. + + Instance name + */ + InstanceName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the drop instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DropInstanceParams) WithDefaults() *DropInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the drop instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DropInstanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the drop instance params +func (o *DropInstanceParams) WithTimeout(timeout time.Duration) *DropInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the drop instance params +func (o *DropInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the drop instance params +func (o *DropInstanceParams) WithContext(ctx context.Context) *DropInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the drop instance params +func (o *DropInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the drop instance params +func (o *DropInstanceParams) WithHTTPClient(client *http.Client) *DropInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the drop instance params +func (o *DropInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstanceName adds the instanceName to the drop instance params +func (o *DropInstanceParams) WithInstanceName(instanceName string) *DropInstanceParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the drop instance params +func (o *DropInstanceParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WriteToRequest writes these params to a swagger request +func (o *DropInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/drop_instance_responses.go b/src/client/instance/drop_instance_responses.go new file mode 100644 index 0000000..aa16f58 --- /dev/null +++ b/src/client/instance/drop_instance_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DropInstanceReader is a Reader for the DropInstance structure. +type DropInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DropInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDropInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDropInstanceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewDropInstanceConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDropInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDropInstanceOK creates a DropInstanceOK with default headers values +func NewDropInstanceOK() *DropInstanceOK { + return &DropInstanceOK{} +} + +/* +DropInstanceOK describes a response with status code 200, with default header values. + +Success +*/ +type DropInstanceOK struct { +} + +// IsSuccess returns true when this drop instance o k response has a 2xx status code +func (o *DropInstanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this drop instance o k response has a 3xx status code +func (o *DropInstanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this drop instance o k response has a 4xx status code +func (o *DropInstanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this drop instance o k response has a 5xx status code +func (o *DropInstanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this drop instance o k response a status code equal to that given +func (o *DropInstanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the drop instance o k response +func (o *DropInstanceOK) Code() int { + return 200 +} + +func (o *DropInstanceOK) Error() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceOK ", 200) +} + +func (o *DropInstanceOK) String() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceOK ", 200) +} + +func (o *DropInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDropInstanceNotFound creates a DropInstanceNotFound with default headers values +func NewDropInstanceNotFound() *DropInstanceNotFound { + return &DropInstanceNotFound{} +} + +/* +DropInstanceNotFound describes a response with status code 404, with default header values. + +Instance not found +*/ +type DropInstanceNotFound struct { +} + +// IsSuccess returns true when this drop instance not found response has a 2xx status code +func (o *DropInstanceNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this drop instance not found response has a 3xx status code +func (o *DropInstanceNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this drop instance not found response has a 4xx status code +func (o *DropInstanceNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this drop instance not found response has a 5xx status code +func (o *DropInstanceNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this drop instance not found response a status code equal to that given +func (o *DropInstanceNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the drop instance not found response +func (o *DropInstanceNotFound) Code() int { + return 404 +} + +func (o *DropInstanceNotFound) Error() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceNotFound ", 404) +} + +func (o *DropInstanceNotFound) String() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceNotFound ", 404) +} + +func (o *DropInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDropInstanceConflict creates a DropInstanceConflict with default headers values +func NewDropInstanceConflict() *DropInstanceConflict { + return &DropInstanceConflict{} +} + +/* +DropInstanceConflict describes a response with status code 409, with default header values. + +Instance cannot be dropped +*/ +type DropInstanceConflict struct { +} + +// IsSuccess returns true when this drop instance conflict response has a 2xx status code +func (o *DropInstanceConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this drop instance conflict response has a 3xx status code +func (o *DropInstanceConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this drop instance conflict response has a 4xx status code +func (o *DropInstanceConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this drop instance conflict response has a 5xx status code +func (o *DropInstanceConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this drop instance conflict response a status code equal to that given +func (o *DropInstanceConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the drop instance conflict response +func (o *DropInstanceConflict) Code() int { + return 409 +} + +func (o *DropInstanceConflict) Error() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceConflict ", 409) +} + +func (o *DropInstanceConflict) String() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceConflict ", 409) +} + +func (o *DropInstanceConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDropInstanceInternalServerError creates a DropInstanceInternalServerError with default headers values +func NewDropInstanceInternalServerError() *DropInstanceInternalServerError { + return &DropInstanceInternalServerError{} +} + +/* +DropInstanceInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type DropInstanceInternalServerError struct { +} + +// IsSuccess returns true when this drop instance internal server error response has a 2xx status code +func (o *DropInstanceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this drop instance internal server error response has a 3xx status code +func (o *DropInstanceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this drop instance internal server error response has a 4xx status code +func (o *DropInstanceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this drop instance internal server error response has a 5xx status code +func (o *DropInstanceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this drop instance internal server error response a status code equal to that given +func (o *DropInstanceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the drop instance internal server error response +func (o *DropInstanceInternalServerError) Code() int { + return 500 +} + +func (o *DropInstanceInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceInternalServerError ", 500) +} + +func (o *DropInstanceInternalServerError) String() string { + return fmt.Sprintf("[DELETE /instances/{instanceName}][%d] dropInstanceInternalServerError ", 500) +} + +func (o *DropInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/get_all_instances_parameters.go b/src/client/instance/get_all_instances_parameters.go new file mode 100644 index 0000000..1539cfb --- /dev/null +++ b/src/client/instance/get_all_instances_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAllInstancesParams creates a new GetAllInstancesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAllInstancesParams() *GetAllInstancesParams { + return &GetAllInstancesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAllInstancesParamsWithTimeout creates a new GetAllInstancesParams object +// with the ability to set a timeout on a request. +func NewGetAllInstancesParamsWithTimeout(timeout time.Duration) *GetAllInstancesParams { + return &GetAllInstancesParams{ + timeout: timeout, + } +} + +// NewGetAllInstancesParamsWithContext creates a new GetAllInstancesParams object +// with the ability to set a context for a request. +func NewGetAllInstancesParamsWithContext(ctx context.Context) *GetAllInstancesParams { + return &GetAllInstancesParams{ + Context: ctx, + } +} + +// NewGetAllInstancesParamsWithHTTPClient creates a new GetAllInstancesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAllInstancesParamsWithHTTPClient(client *http.Client) *GetAllInstancesParams { + return &GetAllInstancesParams{ + HTTPClient: client, + } +} + +/* +GetAllInstancesParams contains all the parameters to send to the API endpoint + + for the get all instances operation. + + Typically these are written to a http.Request. +*/ +type GetAllInstancesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get all instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAllInstancesParams) WithDefaults() *GetAllInstancesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get all instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAllInstancesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get all instances params +func (o *GetAllInstancesParams) WithTimeout(timeout time.Duration) *GetAllInstancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get all instances params +func (o *GetAllInstancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get all instances params +func (o *GetAllInstancesParams) WithContext(ctx context.Context) *GetAllInstancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get all instances params +func (o *GetAllInstancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get all instances params +func (o *GetAllInstancesParams) WithHTTPClient(client *http.Client) *GetAllInstancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get all instances params +func (o *GetAllInstancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAllInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/get_all_instances_responses.go b/src/client/instance/get_all_instances_responses.go new file mode 100644 index 0000000..b7f5bf1 --- /dev/null +++ b/src/client/instance/get_all_instances_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetAllInstancesReader is a Reader for the GetAllInstances structure. +type GetAllInstancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAllInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAllInstancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetAllInstancesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAllInstancesOK creates a GetAllInstancesOK with default headers values +func NewGetAllInstancesOK() *GetAllInstancesOK { + return &GetAllInstancesOK{} +} + +/* +GetAllInstancesOK describes a response with status code 200, with default header values. + +Success +*/ +type GetAllInstancesOK struct { +} + +// IsSuccess returns true when this get all instances o k response has a 2xx status code +func (o *GetAllInstancesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get all instances o k response has a 3xx status code +func (o *GetAllInstancesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get all instances o k response has a 4xx status code +func (o *GetAllInstancesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get all instances o k response has a 5xx status code +func (o *GetAllInstancesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get all instances o k response a status code equal to that given +func (o *GetAllInstancesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get all instances o k response +func (o *GetAllInstancesOK) Code() int { + return 200 +} + +func (o *GetAllInstancesOK) Error() string { + return fmt.Sprintf("[GET /instances][%d] getAllInstancesOK ", 200) +} + +func (o *GetAllInstancesOK) String() string { + return fmt.Sprintf("[GET /instances][%d] getAllInstancesOK ", 200) +} + +func (o *GetAllInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAllInstancesInternalServerError creates a GetAllInstancesInternalServerError with default headers values +func NewGetAllInstancesInternalServerError() *GetAllInstancesInternalServerError { + return &GetAllInstancesInternalServerError{} +} + +/* +GetAllInstancesInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type GetAllInstancesInternalServerError struct { +} + +// IsSuccess returns true when this get all instances internal server error response has a 2xx status code +func (o *GetAllInstancesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get all instances internal server error response has a 3xx status code +func (o *GetAllInstancesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get all instances internal server error response has a 4xx status code +func (o *GetAllInstancesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get all instances internal server error response has a 5xx status code +func (o *GetAllInstancesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get all instances internal server error response a status code equal to that given +func (o *GetAllInstancesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get all instances internal server error response +func (o *GetAllInstancesInternalServerError) Code() int { + return 500 +} + +func (o *GetAllInstancesInternalServerError) Error() string { + return fmt.Sprintf("[GET /instances][%d] getAllInstancesInternalServerError ", 500) +} + +func (o *GetAllInstancesInternalServerError) String() string { + return fmt.Sprintf("[GET /instances][%d] getAllInstancesInternalServerError ", 500) +} + +func (o *GetAllInstancesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/get_instance_parameters.go b/src/client/instance/get_instance_parameters.go new file mode 100644 index 0000000..d681b73 --- /dev/null +++ b/src/client/instance/get_instance_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetInstanceParams creates a new GetInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetInstanceParams() *GetInstanceParams { + return &GetInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetInstanceParamsWithTimeout creates a new GetInstanceParams object +// with the ability to set a timeout on a request. +func NewGetInstanceParamsWithTimeout(timeout time.Duration) *GetInstanceParams { + return &GetInstanceParams{ + timeout: timeout, + } +} + +// NewGetInstanceParamsWithContext creates a new GetInstanceParams object +// with the ability to set a context for a request. +func NewGetInstanceParamsWithContext(ctx context.Context) *GetInstanceParams { + return &GetInstanceParams{ + Context: ctx, + } +} + +// NewGetInstanceParamsWithHTTPClient creates a new GetInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetInstanceParamsWithHTTPClient(client *http.Client) *GetInstanceParams { + return &GetInstanceParams{ + HTTPClient: client, + } +} + +/* +GetInstanceParams contains all the parameters to send to the API endpoint + + for the get instance operation. + + Typically these are written to a http.Request. +*/ +type GetInstanceParams struct { + + /* InstanceName. + + Instance name + */ + InstanceName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInstanceParams) WithDefaults() *GetInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInstanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get instance params +func (o *GetInstanceParams) WithTimeout(timeout time.Duration) *GetInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get instance params +func (o *GetInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get instance params +func (o *GetInstanceParams) WithContext(ctx context.Context) *GetInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get instance params +func (o *GetInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get instance params +func (o *GetInstanceParams) WithHTTPClient(client *http.Client) *GetInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get instance params +func (o *GetInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstanceName adds the instanceName to the get instance params +func (o *GetInstanceParams) WithInstanceName(instanceName string) *GetInstanceParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the get instance params +func (o *GetInstanceParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/get_instance_responses.go b/src/client/instance/get_instance_responses.go new file mode 100644 index 0000000..83f75dc --- /dev/null +++ b/src/client/instance/get_instance_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetInstanceReader is a Reader for the GetInstance structure. +type GetInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetInstanceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetInstanceOK creates a GetInstanceOK with default headers values +func NewGetInstanceOK() *GetInstanceOK { + return &GetInstanceOK{} +} + +/* +GetInstanceOK describes a response with status code 200, with default header values. + +Success +*/ +type GetInstanceOK struct { +} + +// IsSuccess returns true when this get instance o k response has a 2xx status code +func (o *GetInstanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get instance o k response has a 3xx status code +func (o *GetInstanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get instance o k response has a 4xx status code +func (o *GetInstanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get instance o k response has a 5xx status code +func (o *GetInstanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get instance o k response a status code equal to that given +func (o *GetInstanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get instance o k response +func (o *GetInstanceOK) Code() int { + return 200 +} + +func (o *GetInstanceOK) Error() string { + return fmt.Sprintf("[GET /instances/{instanceName}][%d] getInstanceOK ", 200) +} + +func (o *GetInstanceOK) String() string { + return fmt.Sprintf("[GET /instances/{instanceName}][%d] getInstanceOK ", 200) +} + +func (o *GetInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetInstanceNotFound creates a GetInstanceNotFound with default headers values +func NewGetInstanceNotFound() *GetInstanceNotFound { + return &GetInstanceNotFound{} +} + +/* +GetInstanceNotFound describes a response with status code 404, with default header values. + +Instance not found +*/ +type GetInstanceNotFound struct { +} + +// IsSuccess returns true when this get instance not found response has a 2xx status code +func (o *GetInstanceNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get instance not found response has a 3xx status code +func (o *GetInstanceNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get instance not found response has a 4xx status code +func (o *GetInstanceNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get instance not found response has a 5xx status code +func (o *GetInstanceNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get instance not found response a status code equal to that given +func (o *GetInstanceNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get instance not found response +func (o *GetInstanceNotFound) Code() int { + return 404 +} + +func (o *GetInstanceNotFound) Error() string { + return fmt.Sprintf("[GET /instances/{instanceName}][%d] getInstanceNotFound ", 404) +} + +func (o *GetInstanceNotFound) String() string { + return fmt.Sprintf("[GET /instances/{instanceName}][%d] getInstanceNotFound ", 404) +} + +func (o *GetInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetInstanceInternalServerError creates a GetInstanceInternalServerError with default headers values +func NewGetInstanceInternalServerError() *GetInstanceInternalServerError { + return &GetInstanceInternalServerError{} +} + +/* +GetInstanceInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type GetInstanceInternalServerError struct { +} + +// IsSuccess returns true when this get instance internal server error response has a 2xx status code +func (o *GetInstanceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get instance internal server error response has a 3xx status code +func (o *GetInstanceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get instance internal server error response has a 4xx status code +func (o *GetInstanceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get instance internal server error response has a 5xx status code +func (o *GetInstanceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get instance internal server error response a status code equal to that given +func (o *GetInstanceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get instance internal server error response +func (o *GetInstanceInternalServerError) Code() int { + return 500 +} + +func (o *GetInstanceInternalServerError) Error() string { + return fmt.Sprintf("[GET /instances/{instanceName}][%d] getInstanceInternalServerError ", 500) +} + +func (o *GetInstanceInternalServerError) String() string { + return fmt.Sprintf("[GET /instances/{instanceName}][%d] getInstanceInternalServerError ", 500) +} + +func (o *GetInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/instance_client.go b/src/client/instance/instance_client.go new file mode 100644 index 0000000..59d13d8 --- /dev/null +++ b/src/client/instance/instance_client.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new instance API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for instance API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + AddInstance(params *AddInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddInstanceOK, error) + + DropInstance(params *DropInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DropInstanceOK, error) + + GetAllInstances(params *GetAllInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllInstancesOK, error) + + GetInstance(params *GetInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInstanceOK, error) + + ToggleInstanceState(params *ToggleInstanceStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ToggleInstanceStateOK, error) + + UpdateBrokerResource(params *UpdateBrokerResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateBrokerResourceOK, error) + + UpdateInstance(params *UpdateInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInstanceOK, error) + + UpdateInstanceTags(params *UpdateInstanceTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInstanceTagsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AddInstance creates a new instance + +Creates a new instance with given instance config +*/ +func (a *Client) AddInstance(params *AddInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "addInstance", + Method: "POST", + PathPattern: "/instances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AddInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for addInstance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DropInstance drops an instance + +Drop an instance +*/ +func (a *Client) DropInstance(params *DropInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DropInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDropInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "dropInstance", + Method: "DELETE", + PathPattern: "/instances/{instanceName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"text/plain"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DropInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DropInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for dropInstance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetAllInstances lists all instances +*/ +func (a *Client) GetAllInstances(params *GetAllInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllInstancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAllInstancesParams() + } + op := &runtime.ClientOperation{ + ID: "getAllInstances", + Method: "GET", + PathPattern: "/instances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAllInstancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetAllInstancesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getAllInstances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetInstance gets instance information +*/ +func (a *Client) GetInstance(params *GetInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "getInstance", + Method: "GET", + PathPattern: "/instances/{instanceName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getInstance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ToggleInstanceState enables disable drop an instance + +Enable/disable/drop an instance +*/ +func (a *Client) ToggleInstanceState(params *ToggleInstanceStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ToggleInstanceStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewToggleInstanceStateParams() + } + op := &runtime.ClientOperation{ + ID: "toggleInstanceState", + Method: "POST", + PathPattern: "/instances/{instanceName}/state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"text/plain"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ToggleInstanceStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ToggleInstanceStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for toggleInstanceState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateBrokerResource updates the tables served by the specified broker instance in the broker resource + +Broker resource should be updated when a new broker instance is added, or the tags for an existing broker are changed. Updating broker resource requires reading all the table configs, which can be costly for large cluster. Consider updating broker resource for each table individually. +*/ +func (a *Client) UpdateBrokerResource(params *UpdateBrokerResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateBrokerResourceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateBrokerResourceParams() + } + op := &runtime.ClientOperation{ + ID: "updateBrokerResource", + Method: "POST", + PathPattern: "/instances/{instanceName}/updateBrokerResource", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateBrokerResourceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateBrokerResourceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateBrokerResource: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateInstance updates the specified instance + +Update specified instance with given instance config +*/ +func (a *Client) UpdateInstance(params *UpdateInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "updateInstance", + Method: "PUT", + PathPattern: "/instances/{instanceName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateInstance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateInstanceTags updates the tags of the specified instance + +Update the tags of the specified instance +*/ +func (a *Client) UpdateInstanceTags(params *UpdateInstanceTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInstanceTagsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateInstanceTagsParams() + } + op := &runtime.ClientOperation{ + ID: "updateInstanceTags", + Method: "PUT", + PathPattern: "/instances/{instanceName}/updateTags", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateInstanceTagsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateInstanceTagsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateInstanceTags: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/instance/toggle_instance_state_parameters.go b/src/client/instance/toggle_instance_state_parameters.go new file mode 100644 index 0000000..6748802 --- /dev/null +++ b/src/client/instance/toggle_instance_state_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewToggleInstanceStateParams creates a new ToggleInstanceStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewToggleInstanceStateParams() *ToggleInstanceStateParams { + return &ToggleInstanceStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewToggleInstanceStateParamsWithTimeout creates a new ToggleInstanceStateParams object +// with the ability to set a timeout on a request. +func NewToggleInstanceStateParamsWithTimeout(timeout time.Duration) *ToggleInstanceStateParams { + return &ToggleInstanceStateParams{ + timeout: timeout, + } +} + +// NewToggleInstanceStateParamsWithContext creates a new ToggleInstanceStateParams object +// with the ability to set a context for a request. +func NewToggleInstanceStateParamsWithContext(ctx context.Context) *ToggleInstanceStateParams { + return &ToggleInstanceStateParams{ + Context: ctx, + } +} + +// NewToggleInstanceStateParamsWithHTTPClient creates a new ToggleInstanceStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewToggleInstanceStateParamsWithHTTPClient(client *http.Client) *ToggleInstanceStateParams { + return &ToggleInstanceStateParams{ + HTTPClient: client, + } +} + +/* +ToggleInstanceStateParams contains all the parameters to send to the API endpoint + + for the toggle instance state operation. + + Typically these are written to a http.Request. +*/ +type ToggleInstanceStateParams struct { + + // Body. + Body string + + /* InstanceName. + + Instance name + */ + InstanceName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the toggle instance state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleInstanceStateParams) WithDefaults() *ToggleInstanceStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the toggle instance state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleInstanceStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the toggle instance state params +func (o *ToggleInstanceStateParams) WithTimeout(timeout time.Duration) *ToggleInstanceStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the toggle instance state params +func (o *ToggleInstanceStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the toggle instance state params +func (o *ToggleInstanceStateParams) WithContext(ctx context.Context) *ToggleInstanceStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the toggle instance state params +func (o *ToggleInstanceStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the toggle instance state params +func (o *ToggleInstanceStateParams) WithHTTPClient(client *http.Client) *ToggleInstanceStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the toggle instance state params +func (o *ToggleInstanceStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the toggle instance state params +func (o *ToggleInstanceStateParams) WithBody(body string) *ToggleInstanceStateParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the toggle instance state params +func (o *ToggleInstanceStateParams) SetBody(body string) { + o.Body = body +} + +// WithInstanceName adds the instanceName to the toggle instance state params +func (o *ToggleInstanceStateParams) WithInstanceName(instanceName string) *ToggleInstanceStateParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the toggle instance state params +func (o *ToggleInstanceStateParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WriteToRequest writes these params to a swagger request +func (o *ToggleInstanceStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/toggle_instance_state_responses.go b/src/client/instance/toggle_instance_state_responses.go new file mode 100644 index 0000000..a502a32 --- /dev/null +++ b/src/client/instance/toggle_instance_state_responses.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ToggleInstanceStateReader is a Reader for the ToggleInstanceState structure. +type ToggleInstanceStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ToggleInstanceStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewToggleInstanceStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewToggleInstanceStateBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewToggleInstanceStateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewToggleInstanceStateConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewToggleInstanceStateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewToggleInstanceStateOK creates a ToggleInstanceStateOK with default headers values +func NewToggleInstanceStateOK() *ToggleInstanceStateOK { + return &ToggleInstanceStateOK{} +} + +/* +ToggleInstanceStateOK describes a response with status code 200, with default header values. + +Success +*/ +type ToggleInstanceStateOK struct { +} + +// IsSuccess returns true when this toggle instance state o k response has a 2xx status code +func (o *ToggleInstanceStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this toggle instance state o k response has a 3xx status code +func (o *ToggleInstanceStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle instance state o k response has a 4xx status code +func (o *ToggleInstanceStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this toggle instance state o k response has a 5xx status code +func (o *ToggleInstanceStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle instance state o k response a status code equal to that given +func (o *ToggleInstanceStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the toggle instance state o k response +func (o *ToggleInstanceStateOK) Code() int { + return 200 +} + +func (o *ToggleInstanceStateOK) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateOK ", 200) +} + +func (o *ToggleInstanceStateOK) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateOK ", 200) +} + +func (o *ToggleInstanceStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleInstanceStateBadRequest creates a ToggleInstanceStateBadRequest with default headers values +func NewToggleInstanceStateBadRequest() *ToggleInstanceStateBadRequest { + return &ToggleInstanceStateBadRequest{} +} + +/* +ToggleInstanceStateBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ToggleInstanceStateBadRequest struct { +} + +// IsSuccess returns true when this toggle instance state bad request response has a 2xx status code +func (o *ToggleInstanceStateBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle instance state bad request response has a 3xx status code +func (o *ToggleInstanceStateBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle instance state bad request response has a 4xx status code +func (o *ToggleInstanceStateBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this toggle instance state bad request response has a 5xx status code +func (o *ToggleInstanceStateBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle instance state bad request response a status code equal to that given +func (o *ToggleInstanceStateBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the toggle instance state bad request response +func (o *ToggleInstanceStateBadRequest) Code() int { + return 400 +} + +func (o *ToggleInstanceStateBadRequest) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateBadRequest ", 400) +} + +func (o *ToggleInstanceStateBadRequest) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateBadRequest ", 400) +} + +func (o *ToggleInstanceStateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleInstanceStateNotFound creates a ToggleInstanceStateNotFound with default headers values +func NewToggleInstanceStateNotFound() *ToggleInstanceStateNotFound { + return &ToggleInstanceStateNotFound{} +} + +/* +ToggleInstanceStateNotFound describes a response with status code 404, with default header values. + +Instance not found +*/ +type ToggleInstanceStateNotFound struct { +} + +// IsSuccess returns true when this toggle instance state not found response has a 2xx status code +func (o *ToggleInstanceStateNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle instance state not found response has a 3xx status code +func (o *ToggleInstanceStateNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle instance state not found response has a 4xx status code +func (o *ToggleInstanceStateNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this toggle instance state not found response has a 5xx status code +func (o *ToggleInstanceStateNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle instance state not found response a status code equal to that given +func (o *ToggleInstanceStateNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the toggle instance state not found response +func (o *ToggleInstanceStateNotFound) Code() int { + return 404 +} + +func (o *ToggleInstanceStateNotFound) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateNotFound ", 404) +} + +func (o *ToggleInstanceStateNotFound) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateNotFound ", 404) +} + +func (o *ToggleInstanceStateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleInstanceStateConflict creates a ToggleInstanceStateConflict with default headers values +func NewToggleInstanceStateConflict() *ToggleInstanceStateConflict { + return &ToggleInstanceStateConflict{} +} + +/* +ToggleInstanceStateConflict describes a response with status code 409, with default header values. + +Instance cannot be dropped +*/ +type ToggleInstanceStateConflict struct { +} + +// IsSuccess returns true when this toggle instance state conflict response has a 2xx status code +func (o *ToggleInstanceStateConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle instance state conflict response has a 3xx status code +func (o *ToggleInstanceStateConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle instance state conflict response has a 4xx status code +func (o *ToggleInstanceStateConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this toggle instance state conflict response has a 5xx status code +func (o *ToggleInstanceStateConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle instance state conflict response a status code equal to that given +func (o *ToggleInstanceStateConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the toggle instance state conflict response +func (o *ToggleInstanceStateConflict) Code() int { + return 409 +} + +func (o *ToggleInstanceStateConflict) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateConflict ", 409) +} + +func (o *ToggleInstanceStateConflict) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateConflict ", 409) +} + +func (o *ToggleInstanceStateConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewToggleInstanceStateInternalServerError creates a ToggleInstanceStateInternalServerError with default headers values +func NewToggleInstanceStateInternalServerError() *ToggleInstanceStateInternalServerError { + return &ToggleInstanceStateInternalServerError{} +} + +/* +ToggleInstanceStateInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type ToggleInstanceStateInternalServerError struct { +} + +// IsSuccess returns true when this toggle instance state internal server error response has a 2xx status code +func (o *ToggleInstanceStateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this toggle instance state internal server error response has a 3xx status code +func (o *ToggleInstanceStateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle instance state internal server error response has a 4xx status code +func (o *ToggleInstanceStateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this toggle instance state internal server error response has a 5xx status code +func (o *ToggleInstanceStateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this toggle instance state internal server error response a status code equal to that given +func (o *ToggleInstanceStateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the toggle instance state internal server error response +func (o *ToggleInstanceStateInternalServerError) Code() int { + return 500 +} + +func (o *ToggleInstanceStateInternalServerError) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateInternalServerError ", 500) +} + +func (o *ToggleInstanceStateInternalServerError) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/state][%d] toggleInstanceStateInternalServerError ", 500) +} + +func (o *ToggleInstanceStateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/update_broker_resource_parameters.go b/src/client/instance/update_broker_resource_parameters.go new file mode 100644 index 0000000..747587e --- /dev/null +++ b/src/client/instance/update_broker_resource_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateBrokerResourceParams creates a new UpdateBrokerResourceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateBrokerResourceParams() *UpdateBrokerResourceParams { + return &UpdateBrokerResourceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateBrokerResourceParamsWithTimeout creates a new UpdateBrokerResourceParams object +// with the ability to set a timeout on a request. +func NewUpdateBrokerResourceParamsWithTimeout(timeout time.Duration) *UpdateBrokerResourceParams { + return &UpdateBrokerResourceParams{ + timeout: timeout, + } +} + +// NewUpdateBrokerResourceParamsWithContext creates a new UpdateBrokerResourceParams object +// with the ability to set a context for a request. +func NewUpdateBrokerResourceParamsWithContext(ctx context.Context) *UpdateBrokerResourceParams { + return &UpdateBrokerResourceParams{ + Context: ctx, + } +} + +// NewUpdateBrokerResourceParamsWithHTTPClient creates a new UpdateBrokerResourceParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateBrokerResourceParamsWithHTTPClient(client *http.Client) *UpdateBrokerResourceParams { + return &UpdateBrokerResourceParams{ + HTTPClient: client, + } +} + +/* +UpdateBrokerResourceParams contains all the parameters to send to the API endpoint + + for the update broker resource operation. + + Typically these are written to a http.Request. +*/ +type UpdateBrokerResourceParams struct { + + /* InstanceName. + + Instance name + */ + InstanceName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update broker resource params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateBrokerResourceParams) WithDefaults() *UpdateBrokerResourceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update broker resource params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateBrokerResourceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update broker resource params +func (o *UpdateBrokerResourceParams) WithTimeout(timeout time.Duration) *UpdateBrokerResourceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update broker resource params +func (o *UpdateBrokerResourceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update broker resource params +func (o *UpdateBrokerResourceParams) WithContext(ctx context.Context) *UpdateBrokerResourceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update broker resource params +func (o *UpdateBrokerResourceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update broker resource params +func (o *UpdateBrokerResourceParams) WithHTTPClient(client *http.Client) *UpdateBrokerResourceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update broker resource params +func (o *UpdateBrokerResourceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstanceName adds the instanceName to the update broker resource params +func (o *UpdateBrokerResourceParams) WithInstanceName(instanceName string) *UpdateBrokerResourceParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the update broker resource params +func (o *UpdateBrokerResourceParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateBrokerResourceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/update_broker_resource_responses.go b/src/client/instance/update_broker_resource_responses.go new file mode 100644 index 0000000..ebdeded --- /dev/null +++ b/src/client/instance/update_broker_resource_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateBrokerResourceReader is a Reader for the UpdateBrokerResource structure. +type UpdateBrokerResourceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateBrokerResourceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateBrokerResourceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateBrokerResourceBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateBrokerResourceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateBrokerResourceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateBrokerResourceOK creates a UpdateBrokerResourceOK with default headers values +func NewUpdateBrokerResourceOK() *UpdateBrokerResourceOK { + return &UpdateBrokerResourceOK{} +} + +/* +UpdateBrokerResourceOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateBrokerResourceOK struct { +} + +// IsSuccess returns true when this update broker resource o k response has a 2xx status code +func (o *UpdateBrokerResourceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update broker resource o k response has a 3xx status code +func (o *UpdateBrokerResourceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update broker resource o k response has a 4xx status code +func (o *UpdateBrokerResourceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update broker resource o k response has a 5xx status code +func (o *UpdateBrokerResourceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update broker resource o k response a status code equal to that given +func (o *UpdateBrokerResourceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update broker resource o k response +func (o *UpdateBrokerResourceOK) Code() int { + return 200 +} + +func (o *UpdateBrokerResourceOK) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceOK ", 200) +} + +func (o *UpdateBrokerResourceOK) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceOK ", 200) +} + +func (o *UpdateBrokerResourceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBrokerResourceBadRequest creates a UpdateBrokerResourceBadRequest with default headers values +func NewUpdateBrokerResourceBadRequest() *UpdateBrokerResourceBadRequest { + return &UpdateBrokerResourceBadRequest{} +} + +/* +UpdateBrokerResourceBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateBrokerResourceBadRequest struct { +} + +// IsSuccess returns true when this update broker resource bad request response has a 2xx status code +func (o *UpdateBrokerResourceBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update broker resource bad request response has a 3xx status code +func (o *UpdateBrokerResourceBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update broker resource bad request response has a 4xx status code +func (o *UpdateBrokerResourceBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update broker resource bad request response has a 5xx status code +func (o *UpdateBrokerResourceBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update broker resource bad request response a status code equal to that given +func (o *UpdateBrokerResourceBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update broker resource bad request response +func (o *UpdateBrokerResourceBadRequest) Code() int { + return 400 +} + +func (o *UpdateBrokerResourceBadRequest) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceBadRequest ", 400) +} + +func (o *UpdateBrokerResourceBadRequest) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceBadRequest ", 400) +} + +func (o *UpdateBrokerResourceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBrokerResourceNotFound creates a UpdateBrokerResourceNotFound with default headers values +func NewUpdateBrokerResourceNotFound() *UpdateBrokerResourceNotFound { + return &UpdateBrokerResourceNotFound{} +} + +/* +UpdateBrokerResourceNotFound describes a response with status code 404, with default header values. + +Instance not found +*/ +type UpdateBrokerResourceNotFound struct { +} + +// IsSuccess returns true when this update broker resource not found response has a 2xx status code +func (o *UpdateBrokerResourceNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update broker resource not found response has a 3xx status code +func (o *UpdateBrokerResourceNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update broker resource not found response has a 4xx status code +func (o *UpdateBrokerResourceNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update broker resource not found response has a 5xx status code +func (o *UpdateBrokerResourceNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update broker resource not found response a status code equal to that given +func (o *UpdateBrokerResourceNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update broker resource not found response +func (o *UpdateBrokerResourceNotFound) Code() int { + return 404 +} + +func (o *UpdateBrokerResourceNotFound) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceNotFound ", 404) +} + +func (o *UpdateBrokerResourceNotFound) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceNotFound ", 404) +} + +func (o *UpdateBrokerResourceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateBrokerResourceInternalServerError creates a UpdateBrokerResourceInternalServerError with default headers values +func NewUpdateBrokerResourceInternalServerError() *UpdateBrokerResourceInternalServerError { + return &UpdateBrokerResourceInternalServerError{} +} + +/* +UpdateBrokerResourceInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type UpdateBrokerResourceInternalServerError struct { +} + +// IsSuccess returns true when this update broker resource internal server error response has a 2xx status code +func (o *UpdateBrokerResourceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update broker resource internal server error response has a 3xx status code +func (o *UpdateBrokerResourceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update broker resource internal server error response has a 4xx status code +func (o *UpdateBrokerResourceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update broker resource internal server error response has a 5xx status code +func (o *UpdateBrokerResourceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update broker resource internal server error response a status code equal to that given +func (o *UpdateBrokerResourceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update broker resource internal server error response +func (o *UpdateBrokerResourceInternalServerError) Code() int { + return 500 +} + +func (o *UpdateBrokerResourceInternalServerError) Error() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceInternalServerError ", 500) +} + +func (o *UpdateBrokerResourceInternalServerError) String() string { + return fmt.Sprintf("[POST /instances/{instanceName}/updateBrokerResource][%d] updateBrokerResourceInternalServerError ", 500) +} + +func (o *UpdateBrokerResourceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/update_instance_parameters.go b/src/client/instance/update_instance_parameters.go new file mode 100644 index 0000000..b78904e --- /dev/null +++ b/src/client/instance/update_instance_parameters.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "startree.ai/cli/models" +) + +// NewUpdateInstanceParams creates a new UpdateInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateInstanceParams() *UpdateInstanceParams { + return &UpdateInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateInstanceParamsWithTimeout creates a new UpdateInstanceParams object +// with the ability to set a timeout on a request. +func NewUpdateInstanceParamsWithTimeout(timeout time.Duration) *UpdateInstanceParams { + return &UpdateInstanceParams{ + timeout: timeout, + } +} + +// NewUpdateInstanceParamsWithContext creates a new UpdateInstanceParams object +// with the ability to set a context for a request. +func NewUpdateInstanceParamsWithContext(ctx context.Context) *UpdateInstanceParams { + return &UpdateInstanceParams{ + Context: ctx, + } +} + +// NewUpdateInstanceParamsWithHTTPClient creates a new UpdateInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateInstanceParamsWithHTTPClient(client *http.Client) *UpdateInstanceParams { + return &UpdateInstanceParams{ + HTTPClient: client, + } +} + +/* +UpdateInstanceParams contains all the parameters to send to the API endpoint + + for the update instance operation. + + Typically these are written to a http.Request. +*/ +type UpdateInstanceParams struct { + + // Body. + Body *models.Instance + + /* InstanceName. + + Instance name + */ + InstanceName string + + /* UpdateBrokerResource. + + Whether to update broker resource for broker instance + */ + UpdateBrokerResource *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInstanceParams) WithDefaults() *UpdateInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInstanceParams) SetDefaults() { + var ( + updateBrokerResourceDefault = bool(false) + ) + + val := UpdateInstanceParams{ + UpdateBrokerResource: &updateBrokerResourceDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the update instance params +func (o *UpdateInstanceParams) WithTimeout(timeout time.Duration) *UpdateInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update instance params +func (o *UpdateInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update instance params +func (o *UpdateInstanceParams) WithContext(ctx context.Context) *UpdateInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update instance params +func (o *UpdateInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update instance params +func (o *UpdateInstanceParams) WithHTTPClient(client *http.Client) *UpdateInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update instance params +func (o *UpdateInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update instance params +func (o *UpdateInstanceParams) WithBody(body *models.Instance) *UpdateInstanceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update instance params +func (o *UpdateInstanceParams) SetBody(body *models.Instance) { + o.Body = body +} + +// WithInstanceName adds the instanceName to the update instance params +func (o *UpdateInstanceParams) WithInstanceName(instanceName string) *UpdateInstanceParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the update instance params +func (o *UpdateInstanceParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WithUpdateBrokerResource adds the updateBrokerResource to the update instance params +func (o *UpdateInstanceParams) WithUpdateBrokerResource(updateBrokerResource *bool) *UpdateInstanceParams { + o.SetUpdateBrokerResource(updateBrokerResource) + return o +} + +// SetUpdateBrokerResource adds the updateBrokerResource to the update instance params +func (o *UpdateInstanceParams) SetUpdateBrokerResource(updateBrokerResource *bool) { + o.UpdateBrokerResource = updateBrokerResource +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if o.UpdateBrokerResource != nil { + + // query param updateBrokerResource + var qrUpdateBrokerResource bool + + if o.UpdateBrokerResource != nil { + qrUpdateBrokerResource = *o.UpdateBrokerResource + } + qUpdateBrokerResource := swag.FormatBool(qrUpdateBrokerResource) + if qUpdateBrokerResource != "" { + + if err := r.SetQueryParam("updateBrokerResource", qUpdateBrokerResource); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/update_instance_responses.go b/src/client/instance/update_instance_responses.go new file mode 100644 index 0000000..61b000f --- /dev/null +++ b/src/client/instance/update_instance_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateInstanceReader is a Reader for the UpdateInstance structure. +type UpdateInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewUpdateInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateInstanceOK creates a UpdateInstanceOK with default headers values +func NewUpdateInstanceOK() *UpdateInstanceOK { + return &UpdateInstanceOK{} +} + +/* +UpdateInstanceOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateInstanceOK struct { +} + +// IsSuccess returns true when this update instance o k response has a 2xx status code +func (o *UpdateInstanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update instance o k response has a 3xx status code +func (o *UpdateInstanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update instance o k response has a 4xx status code +func (o *UpdateInstanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update instance o k response has a 5xx status code +func (o *UpdateInstanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update instance o k response a status code equal to that given +func (o *UpdateInstanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update instance o k response +func (o *UpdateInstanceOK) Code() int { + return 200 +} + +func (o *UpdateInstanceOK) Error() string { + return fmt.Sprintf("[PUT /instances/{instanceName}][%d] updateInstanceOK ", 200) +} + +func (o *UpdateInstanceOK) String() string { + return fmt.Sprintf("[PUT /instances/{instanceName}][%d] updateInstanceOK ", 200) +} + +func (o *UpdateInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateInstanceInternalServerError creates a UpdateInstanceInternalServerError with default headers values +func NewUpdateInstanceInternalServerError() *UpdateInstanceInternalServerError { + return &UpdateInstanceInternalServerError{} +} + +/* +UpdateInstanceInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type UpdateInstanceInternalServerError struct { +} + +// IsSuccess returns true when this update instance internal server error response has a 2xx status code +func (o *UpdateInstanceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update instance internal server error response has a 3xx status code +func (o *UpdateInstanceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update instance internal server error response has a 4xx status code +func (o *UpdateInstanceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update instance internal server error response has a 5xx status code +func (o *UpdateInstanceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update instance internal server error response a status code equal to that given +func (o *UpdateInstanceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update instance internal server error response +func (o *UpdateInstanceInternalServerError) Code() int { + return 500 +} + +func (o *UpdateInstanceInternalServerError) Error() string { + return fmt.Sprintf("[PUT /instances/{instanceName}][%d] updateInstanceInternalServerError ", 500) +} + +func (o *UpdateInstanceInternalServerError) String() string { + return fmt.Sprintf("[PUT /instances/{instanceName}][%d] updateInstanceInternalServerError ", 500) +} + +func (o *UpdateInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/instance/update_instance_tags_parameters.go b/src/client/instance/update_instance_tags_parameters.go new file mode 100644 index 0000000..99b1915 --- /dev/null +++ b/src/client/instance/update_instance_tags_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateInstanceTagsParams creates a new UpdateInstanceTagsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateInstanceTagsParams() *UpdateInstanceTagsParams { + return &UpdateInstanceTagsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateInstanceTagsParamsWithTimeout creates a new UpdateInstanceTagsParams object +// with the ability to set a timeout on a request. +func NewUpdateInstanceTagsParamsWithTimeout(timeout time.Duration) *UpdateInstanceTagsParams { + return &UpdateInstanceTagsParams{ + timeout: timeout, + } +} + +// NewUpdateInstanceTagsParamsWithContext creates a new UpdateInstanceTagsParams object +// with the ability to set a context for a request. +func NewUpdateInstanceTagsParamsWithContext(ctx context.Context) *UpdateInstanceTagsParams { + return &UpdateInstanceTagsParams{ + Context: ctx, + } +} + +// NewUpdateInstanceTagsParamsWithHTTPClient creates a new UpdateInstanceTagsParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateInstanceTagsParamsWithHTTPClient(client *http.Client) *UpdateInstanceTagsParams { + return &UpdateInstanceTagsParams{ + HTTPClient: client, + } +} + +/* +UpdateInstanceTagsParams contains all the parameters to send to the API endpoint + + for the update instance tags operation. + + Typically these are written to a http.Request. +*/ +type UpdateInstanceTagsParams struct { + + /* InstanceName. + + Instance name + */ + InstanceName string + + /* Tags. + + Comma separated tags list + */ + Tags string + + /* UpdateBrokerResource. + + Whether to update broker resource for broker instance + */ + UpdateBrokerResource *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update instance tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInstanceTagsParams) WithDefaults() *UpdateInstanceTagsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update instance tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInstanceTagsParams) SetDefaults() { + var ( + updateBrokerResourceDefault = bool(false) + ) + + val := UpdateInstanceTagsParams{ + UpdateBrokerResource: &updateBrokerResourceDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the update instance tags params +func (o *UpdateInstanceTagsParams) WithTimeout(timeout time.Duration) *UpdateInstanceTagsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update instance tags params +func (o *UpdateInstanceTagsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update instance tags params +func (o *UpdateInstanceTagsParams) WithContext(ctx context.Context) *UpdateInstanceTagsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update instance tags params +func (o *UpdateInstanceTagsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update instance tags params +func (o *UpdateInstanceTagsParams) WithHTTPClient(client *http.Client) *UpdateInstanceTagsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update instance tags params +func (o *UpdateInstanceTagsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstanceName adds the instanceName to the update instance tags params +func (o *UpdateInstanceTagsParams) WithInstanceName(instanceName string) *UpdateInstanceTagsParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the update instance tags params +func (o *UpdateInstanceTagsParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WithTags adds the tags to the update instance tags params +func (o *UpdateInstanceTagsParams) WithTags(tags string) *UpdateInstanceTagsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the update instance tags params +func (o *UpdateInstanceTagsParams) SetTags(tags string) { + o.Tags = tags +} + +// WithUpdateBrokerResource adds the updateBrokerResource to the update instance tags params +func (o *UpdateInstanceTagsParams) WithUpdateBrokerResource(updateBrokerResource *bool) *UpdateInstanceTagsParams { + o.SetUpdateBrokerResource(updateBrokerResource) + return o +} + +// SetUpdateBrokerResource adds the updateBrokerResource to the update instance tags params +func (o *UpdateInstanceTagsParams) SetUpdateBrokerResource(updateBrokerResource *bool) { + o.UpdateBrokerResource = updateBrokerResource +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateInstanceTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + // query param tags + qrTags := o.Tags + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + + if o.UpdateBrokerResource != nil { + + // query param updateBrokerResource + var qrUpdateBrokerResource bool + + if o.UpdateBrokerResource != nil { + qrUpdateBrokerResource = *o.UpdateBrokerResource + } + qUpdateBrokerResource := swag.FormatBool(qrUpdateBrokerResource) + if qUpdateBrokerResource != "" { + + if err := r.SetQueryParam("updateBrokerResource", qUpdateBrokerResource); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/instance/update_instance_tags_responses.go b/src/client/instance/update_instance_tags_responses.go new file mode 100644 index 0000000..9d38aac --- /dev/null +++ b/src/client/instance/update_instance_tags_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package instance + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateInstanceTagsReader is a Reader for the UpdateInstanceTags structure. +type UpdateInstanceTagsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateInstanceTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateInstanceTagsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateInstanceTagsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateInstanceTagsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateInstanceTagsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateInstanceTagsOK creates a UpdateInstanceTagsOK with default headers values +func NewUpdateInstanceTagsOK() *UpdateInstanceTagsOK { + return &UpdateInstanceTagsOK{} +} + +/* +UpdateInstanceTagsOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateInstanceTagsOK struct { +} + +// IsSuccess returns true when this update instance tags o k response has a 2xx status code +func (o *UpdateInstanceTagsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update instance tags o k response has a 3xx status code +func (o *UpdateInstanceTagsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update instance tags o k response has a 4xx status code +func (o *UpdateInstanceTagsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update instance tags o k response has a 5xx status code +func (o *UpdateInstanceTagsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update instance tags o k response a status code equal to that given +func (o *UpdateInstanceTagsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update instance tags o k response +func (o *UpdateInstanceTagsOK) Code() int { + return 200 +} + +func (o *UpdateInstanceTagsOK) Error() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsOK ", 200) +} + +func (o *UpdateInstanceTagsOK) String() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsOK ", 200) +} + +func (o *UpdateInstanceTagsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateInstanceTagsBadRequest creates a UpdateInstanceTagsBadRequest with default headers values +func NewUpdateInstanceTagsBadRequest() *UpdateInstanceTagsBadRequest { + return &UpdateInstanceTagsBadRequest{} +} + +/* +UpdateInstanceTagsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateInstanceTagsBadRequest struct { +} + +// IsSuccess returns true when this update instance tags bad request response has a 2xx status code +func (o *UpdateInstanceTagsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update instance tags bad request response has a 3xx status code +func (o *UpdateInstanceTagsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update instance tags bad request response has a 4xx status code +func (o *UpdateInstanceTagsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update instance tags bad request response has a 5xx status code +func (o *UpdateInstanceTagsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update instance tags bad request response a status code equal to that given +func (o *UpdateInstanceTagsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update instance tags bad request response +func (o *UpdateInstanceTagsBadRequest) Code() int { + return 400 +} + +func (o *UpdateInstanceTagsBadRequest) Error() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsBadRequest ", 400) +} + +func (o *UpdateInstanceTagsBadRequest) String() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsBadRequest ", 400) +} + +func (o *UpdateInstanceTagsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateInstanceTagsNotFound creates a UpdateInstanceTagsNotFound with default headers values +func NewUpdateInstanceTagsNotFound() *UpdateInstanceTagsNotFound { + return &UpdateInstanceTagsNotFound{} +} + +/* +UpdateInstanceTagsNotFound describes a response with status code 404, with default header values. + +Instance not found +*/ +type UpdateInstanceTagsNotFound struct { +} + +// IsSuccess returns true when this update instance tags not found response has a 2xx status code +func (o *UpdateInstanceTagsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update instance tags not found response has a 3xx status code +func (o *UpdateInstanceTagsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update instance tags not found response has a 4xx status code +func (o *UpdateInstanceTagsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update instance tags not found response has a 5xx status code +func (o *UpdateInstanceTagsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update instance tags not found response a status code equal to that given +func (o *UpdateInstanceTagsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update instance tags not found response +func (o *UpdateInstanceTagsNotFound) Code() int { + return 404 +} + +func (o *UpdateInstanceTagsNotFound) Error() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsNotFound ", 404) +} + +func (o *UpdateInstanceTagsNotFound) String() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsNotFound ", 404) +} + +func (o *UpdateInstanceTagsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateInstanceTagsInternalServerError creates a UpdateInstanceTagsInternalServerError with default headers values +func NewUpdateInstanceTagsInternalServerError() *UpdateInstanceTagsInternalServerError { + return &UpdateInstanceTagsInternalServerError{} +} + +/* +UpdateInstanceTagsInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type UpdateInstanceTagsInternalServerError struct { +} + +// IsSuccess returns true when this update instance tags internal server error response has a 2xx status code +func (o *UpdateInstanceTagsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update instance tags internal server error response has a 3xx status code +func (o *UpdateInstanceTagsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update instance tags internal server error response has a 4xx status code +func (o *UpdateInstanceTagsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update instance tags internal server error response has a 5xx status code +func (o *UpdateInstanceTagsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update instance tags internal server error response a status code equal to that given +func (o *UpdateInstanceTagsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update instance tags internal server error response +func (o *UpdateInstanceTagsInternalServerError) Code() int { + return 500 +} + +func (o *UpdateInstanceTagsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsInternalServerError ", 500) +} + +func (o *UpdateInstanceTagsInternalServerError) String() string { + return fmt.Sprintf("[PUT /instances/{instanceName}/updateTags][%d] updateInstanceTagsInternalServerError ", 500) +} + +func (o *UpdateInstanceTagsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/leader/get_leader_for_table_parameters.go b/src/client/leader/get_leader_for_table_parameters.go new file mode 100644 index 0000000..87af5e3 --- /dev/null +++ b/src/client/leader/get_leader_for_table_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package leader + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLeaderForTableParams creates a new GetLeaderForTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLeaderForTableParams() *GetLeaderForTableParams { + return &GetLeaderForTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLeaderForTableParamsWithTimeout creates a new GetLeaderForTableParams object +// with the ability to set a timeout on a request. +func NewGetLeaderForTableParamsWithTimeout(timeout time.Duration) *GetLeaderForTableParams { + return &GetLeaderForTableParams{ + timeout: timeout, + } +} + +// NewGetLeaderForTableParamsWithContext creates a new GetLeaderForTableParams object +// with the ability to set a context for a request. +func NewGetLeaderForTableParamsWithContext(ctx context.Context) *GetLeaderForTableParams { + return &GetLeaderForTableParams{ + Context: ctx, + } +} + +// NewGetLeaderForTableParamsWithHTTPClient creates a new GetLeaderForTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLeaderForTableParamsWithHTTPClient(client *http.Client) *GetLeaderForTableParams { + return &GetLeaderForTableParams{ + HTTPClient: client, + } +} + +/* +GetLeaderForTableParams contains all the parameters to send to the API endpoint + + for the get leader for table operation. + + Typically these are written to a http.Request. +*/ +type GetLeaderForTableParams struct { + + /* TableName. + + Table name + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get leader for table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeaderForTableParams) WithDefaults() *GetLeaderForTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get leader for table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeaderForTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get leader for table params +func (o *GetLeaderForTableParams) WithTimeout(timeout time.Duration) *GetLeaderForTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get leader for table params +func (o *GetLeaderForTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get leader for table params +func (o *GetLeaderForTableParams) WithContext(ctx context.Context) *GetLeaderForTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get leader for table params +func (o *GetLeaderForTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get leader for table params +func (o *GetLeaderForTableParams) WithHTTPClient(client *http.Client) *GetLeaderForTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get leader for table params +func (o *GetLeaderForTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get leader for table params +func (o *GetLeaderForTableParams) WithTableName(tableName string) *GetLeaderForTableParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get leader for table params +func (o *GetLeaderForTableParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLeaderForTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/leader/get_leader_for_table_responses.go b/src/client/leader/get_leader_for_table_responses.go new file mode 100644 index 0000000..d94081a --- /dev/null +++ b/src/client/leader/get_leader_for_table_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package leader + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetLeaderForTableReader is a Reader for the GetLeaderForTable structure. +type GetLeaderForTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLeaderForTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLeaderForTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLeaderForTableOK creates a GetLeaderForTableOK with default headers values +func NewGetLeaderForTableOK() *GetLeaderForTableOK { + return &GetLeaderForTableOK{} +} + +/* +GetLeaderForTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLeaderForTableOK struct { + Payload *models.LeadControllerResponse +} + +// IsSuccess returns true when this get leader for table o k response has a 2xx status code +func (o *GetLeaderForTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get leader for table o k response has a 3xx status code +func (o *GetLeaderForTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get leader for table o k response has a 4xx status code +func (o *GetLeaderForTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get leader for table o k response has a 5xx status code +func (o *GetLeaderForTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get leader for table o k response a status code equal to that given +func (o *GetLeaderForTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get leader for table o k response +func (o *GetLeaderForTableOK) Code() int { + return 200 +} + +func (o *GetLeaderForTableOK) Error() string { + return fmt.Sprintf("[GET /leader/tables/{tableName}][%d] getLeaderForTableOK %+v", 200, o.Payload) +} + +func (o *GetLeaderForTableOK) String() string { + return fmt.Sprintf("[GET /leader/tables/{tableName}][%d] getLeaderForTableOK %+v", 200, o.Payload) +} + +func (o *GetLeaderForTableOK) GetPayload() *models.LeadControllerResponse { + return o.Payload +} + +func (o *GetLeaderForTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LeadControllerResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/leader/get_leaders_for_all_tables_parameters.go b/src/client/leader/get_leaders_for_all_tables_parameters.go new file mode 100644 index 0000000..74c1aea --- /dev/null +++ b/src/client/leader/get_leaders_for_all_tables_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package leader + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLeadersForAllTablesParams creates a new GetLeadersForAllTablesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLeadersForAllTablesParams() *GetLeadersForAllTablesParams { + return &GetLeadersForAllTablesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLeadersForAllTablesParamsWithTimeout creates a new GetLeadersForAllTablesParams object +// with the ability to set a timeout on a request. +func NewGetLeadersForAllTablesParamsWithTimeout(timeout time.Duration) *GetLeadersForAllTablesParams { + return &GetLeadersForAllTablesParams{ + timeout: timeout, + } +} + +// NewGetLeadersForAllTablesParamsWithContext creates a new GetLeadersForAllTablesParams object +// with the ability to set a context for a request. +func NewGetLeadersForAllTablesParamsWithContext(ctx context.Context) *GetLeadersForAllTablesParams { + return &GetLeadersForAllTablesParams{ + Context: ctx, + } +} + +// NewGetLeadersForAllTablesParamsWithHTTPClient creates a new GetLeadersForAllTablesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLeadersForAllTablesParamsWithHTTPClient(client *http.Client) *GetLeadersForAllTablesParams { + return &GetLeadersForAllTablesParams{ + HTTPClient: client, + } +} + +/* +GetLeadersForAllTablesParams contains all the parameters to send to the API endpoint + + for the get leaders for all tables operation. + + Typically these are written to a http.Request. +*/ +type GetLeadersForAllTablesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get leaders for all tables params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeadersForAllTablesParams) WithDefaults() *GetLeadersForAllTablesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get leaders for all tables params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeadersForAllTablesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get leaders for all tables params +func (o *GetLeadersForAllTablesParams) WithTimeout(timeout time.Duration) *GetLeadersForAllTablesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get leaders for all tables params +func (o *GetLeadersForAllTablesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get leaders for all tables params +func (o *GetLeadersForAllTablesParams) WithContext(ctx context.Context) *GetLeadersForAllTablesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get leaders for all tables params +func (o *GetLeadersForAllTablesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get leaders for all tables params +func (o *GetLeadersForAllTablesParams) WithHTTPClient(client *http.Client) *GetLeadersForAllTablesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get leaders for all tables params +func (o *GetLeadersForAllTablesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLeadersForAllTablesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/leader/get_leaders_for_all_tables_responses.go b/src/client/leader/get_leaders_for_all_tables_responses.go new file mode 100644 index 0000000..5e98839 --- /dev/null +++ b/src/client/leader/get_leaders_for_all_tables_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package leader + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetLeadersForAllTablesReader is a Reader for the GetLeadersForAllTables structure. +type GetLeadersForAllTablesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLeadersForAllTablesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLeadersForAllTablesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLeadersForAllTablesOK creates a GetLeadersForAllTablesOK with default headers values +func NewGetLeadersForAllTablesOK() *GetLeadersForAllTablesOK { + return &GetLeadersForAllTablesOK{} +} + +/* +GetLeadersForAllTablesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLeadersForAllTablesOK struct { + Payload *models.LeadControllerResponse +} + +// IsSuccess returns true when this get leaders for all tables o k response has a 2xx status code +func (o *GetLeadersForAllTablesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get leaders for all tables o k response has a 3xx status code +func (o *GetLeadersForAllTablesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get leaders for all tables o k response has a 4xx status code +func (o *GetLeadersForAllTablesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get leaders for all tables o k response has a 5xx status code +func (o *GetLeadersForAllTablesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get leaders for all tables o k response a status code equal to that given +func (o *GetLeadersForAllTablesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get leaders for all tables o k response +func (o *GetLeadersForAllTablesOK) Code() int { + return 200 +} + +func (o *GetLeadersForAllTablesOK) Error() string { + return fmt.Sprintf("[GET /leader/tables][%d] getLeadersForAllTablesOK %+v", 200, o.Payload) +} + +func (o *GetLeadersForAllTablesOK) String() string { + return fmt.Sprintf("[GET /leader/tables][%d] getLeadersForAllTablesOK %+v", 200, o.Payload) +} + +func (o *GetLeadersForAllTablesOK) GetPayload() *models.LeadControllerResponse { + return o.Payload +} + +func (o *GetLeadersForAllTablesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LeadControllerResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/leader/leader_client.go b/src/client/leader/leader_client.go new file mode 100644 index 0000000..9087984 --- /dev/null +++ b/src/client/leader/leader_client.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package leader + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new leader API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for leader API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetLeaderForTable(params *GetLeaderForTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeaderForTableOK, error) + + GetLeadersForAllTables(params *GetLeadersForAllTablesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadersForAllTablesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetLeaderForTable gets leader for a given table + +Gets leader for a given table +*/ +func (a *Client) GetLeaderForTable(params *GetLeaderForTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeaderForTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLeaderForTableParams() + } + op := &runtime.ClientOperation{ + ID: "getLeaderForTable", + Method: "GET", + PathPattern: "/leader/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLeaderForTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLeaderForTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLeaderForTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLeadersForAllTables gets leaders for all tables + +Gets leaders for all tables +*/ +func (a *Client) GetLeadersForAllTables(params *GetLeadersForAllTablesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadersForAllTablesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLeadersForAllTablesParams() + } + op := &runtime.ClientOperation{ + ID: "getLeadersForAllTables", + Method: "GET", + PathPattern: "/leader/tables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLeadersForAllTablesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLeadersForAllTablesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLeadersForAllTables: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/logger/download_log_file_from_instance_parameters.go b/src/client/logger/download_log_file_from_instance_parameters.go new file mode 100644 index 0000000..b7e9c60 --- /dev/null +++ b/src/client/logger/download_log_file_from_instance_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDownloadLogFileFromInstanceParams creates a new DownloadLogFileFromInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDownloadLogFileFromInstanceParams() *DownloadLogFileFromInstanceParams { + return &DownloadLogFileFromInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadLogFileFromInstanceParamsWithTimeout creates a new DownloadLogFileFromInstanceParams object +// with the ability to set a timeout on a request. +func NewDownloadLogFileFromInstanceParamsWithTimeout(timeout time.Duration) *DownloadLogFileFromInstanceParams { + return &DownloadLogFileFromInstanceParams{ + timeout: timeout, + } +} + +// NewDownloadLogFileFromInstanceParamsWithContext creates a new DownloadLogFileFromInstanceParams object +// with the ability to set a context for a request. +func NewDownloadLogFileFromInstanceParamsWithContext(ctx context.Context) *DownloadLogFileFromInstanceParams { + return &DownloadLogFileFromInstanceParams{ + Context: ctx, + } +} + +// NewDownloadLogFileFromInstanceParamsWithHTTPClient creates a new DownloadLogFileFromInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewDownloadLogFileFromInstanceParamsWithHTTPClient(client *http.Client) *DownloadLogFileFromInstanceParams { + return &DownloadLogFileFromInstanceParams{ + HTTPClient: client, + } +} + +/* +DownloadLogFileFromInstanceParams contains all the parameters to send to the API endpoint + + for the download log file from instance operation. + + Typically these are written to a http.Request. +*/ +type DownloadLogFileFromInstanceParams struct { + + /* FilePath. + + Log file path + */ + FilePath string + + /* InstanceName. + + Instance Name + */ + InstanceName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the download log file from instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadLogFileFromInstanceParams) WithDefaults() *DownloadLogFileFromInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download log file from instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadLogFileFromInstanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) WithTimeout(timeout time.Duration) *DownloadLogFileFromInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) WithContext(ctx context.Context) *DownloadLogFileFromInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) WithHTTPClient(client *http.Client) *DownloadLogFileFromInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilePath adds the filePath to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) WithFilePath(filePath string) *DownloadLogFileFromInstanceParams { + o.SetFilePath(filePath) + return o +} + +// SetFilePath adds the filePath to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) SetFilePath(filePath string) { + o.FilePath = filePath +} + +// WithInstanceName adds the instanceName to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) WithInstanceName(instanceName string) *DownloadLogFileFromInstanceParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the download log file from instance params +func (o *DownloadLogFileFromInstanceParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadLogFileFromInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param filePath + qrFilePath := o.FilePath + qFilePath := qrFilePath + if qFilePath != "" { + + if err := r.SetQueryParam("filePath", qFilePath); err != nil { + return err + } + } + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/download_log_file_from_instance_responses.go b/src/client/logger/download_log_file_from_instance_responses.go new file mode 100644 index 0000000..3be7f55 --- /dev/null +++ b/src/client/logger/download_log_file_from_instance_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DownloadLogFileFromInstanceReader is a Reader for the DownloadLogFileFromInstance structure. +type DownloadLogFileFromInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadLogFileFromInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewDownloadLogFileFromInstanceDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewDownloadLogFileFromInstanceDefault creates a DownloadLogFileFromInstanceDefault with default headers values +func NewDownloadLogFileFromInstanceDefault(code int) *DownloadLogFileFromInstanceDefault { + return &DownloadLogFileFromInstanceDefault{ + _statusCode: code, + } +} + +/* +DownloadLogFileFromInstanceDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type DownloadLogFileFromInstanceDefault struct { + _statusCode int +} + +// IsSuccess returns true when this download log file from instance default response has a 2xx status code +func (o *DownloadLogFileFromInstanceDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this download log file from instance default response has a 3xx status code +func (o *DownloadLogFileFromInstanceDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this download log file from instance default response has a 4xx status code +func (o *DownloadLogFileFromInstanceDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this download log file from instance default response has a 5xx status code +func (o *DownloadLogFileFromInstanceDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this download log file from instance default response a status code equal to that given +func (o *DownloadLogFileFromInstanceDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the download log file from instance default response +func (o *DownloadLogFileFromInstanceDefault) Code() int { + return o._statusCode +} + +func (o *DownloadLogFileFromInstanceDefault) Error() string { + return fmt.Sprintf("[GET /loggers/instances/{instanceName}/download][%d] downloadLogFileFromInstance default ", o._statusCode) +} + +func (o *DownloadLogFileFromInstanceDefault) String() string { + return fmt.Sprintf("[GET /loggers/instances/{instanceName}/download][%d] downloadLogFileFromInstance default ", o._statusCode) +} + +func (o *DownloadLogFileFromInstanceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/logger/download_log_file_parameters.go b/src/client/logger/download_log_file_parameters.go new file mode 100644 index 0000000..df5eb31 --- /dev/null +++ b/src/client/logger/download_log_file_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDownloadLogFileParams creates a new DownloadLogFileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDownloadLogFileParams() *DownloadLogFileParams { + return &DownloadLogFileParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadLogFileParamsWithTimeout creates a new DownloadLogFileParams object +// with the ability to set a timeout on a request. +func NewDownloadLogFileParamsWithTimeout(timeout time.Duration) *DownloadLogFileParams { + return &DownloadLogFileParams{ + timeout: timeout, + } +} + +// NewDownloadLogFileParamsWithContext creates a new DownloadLogFileParams object +// with the ability to set a context for a request. +func NewDownloadLogFileParamsWithContext(ctx context.Context) *DownloadLogFileParams { + return &DownloadLogFileParams{ + Context: ctx, + } +} + +// NewDownloadLogFileParamsWithHTTPClient creates a new DownloadLogFileParams object +// with the ability to set a custom HTTPClient for a request. +func NewDownloadLogFileParamsWithHTTPClient(client *http.Client) *DownloadLogFileParams { + return &DownloadLogFileParams{ + HTTPClient: client, + } +} + +/* +DownloadLogFileParams contains all the parameters to send to the API endpoint + + for the download log file operation. + + Typically these are written to a http.Request. +*/ +type DownloadLogFileParams struct { + + /* FilePath. + + Log file path + */ + FilePath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the download log file params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadLogFileParams) WithDefaults() *DownloadLogFileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download log file params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadLogFileParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the download log file params +func (o *DownloadLogFileParams) WithTimeout(timeout time.Duration) *DownloadLogFileParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download log file params +func (o *DownloadLogFileParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download log file params +func (o *DownloadLogFileParams) WithContext(ctx context.Context) *DownloadLogFileParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download log file params +func (o *DownloadLogFileParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download log file params +func (o *DownloadLogFileParams) WithHTTPClient(client *http.Client) *DownloadLogFileParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download log file params +func (o *DownloadLogFileParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilePath adds the filePath to the download log file params +func (o *DownloadLogFileParams) WithFilePath(filePath string) *DownloadLogFileParams { + o.SetFilePath(filePath) + return o +} + +// SetFilePath adds the filePath to the download log file params +func (o *DownloadLogFileParams) SetFilePath(filePath string) { + o.FilePath = filePath +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadLogFileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param filePath + qrFilePath := o.FilePath + qFilePath := qrFilePath + if qFilePath != "" { + + if err := r.SetQueryParam("filePath", qFilePath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/download_log_file_responses.go b/src/client/logger/download_log_file_responses.go new file mode 100644 index 0000000..305cb34 --- /dev/null +++ b/src/client/logger/download_log_file_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DownloadLogFileReader is a Reader for the DownloadLogFile structure. +type DownloadLogFileReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadLogFileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewDownloadLogFileDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewDownloadLogFileDefault creates a DownloadLogFileDefault with default headers values +func NewDownloadLogFileDefault(code int) *DownloadLogFileDefault { + return &DownloadLogFileDefault{ + _statusCode: code, + } +} + +/* +DownloadLogFileDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type DownloadLogFileDefault struct { + _statusCode int +} + +// IsSuccess returns true when this download log file default response has a 2xx status code +func (o *DownloadLogFileDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this download log file default response has a 3xx status code +func (o *DownloadLogFileDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this download log file default response has a 4xx status code +func (o *DownloadLogFileDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this download log file default response has a 5xx status code +func (o *DownloadLogFileDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this download log file default response a status code equal to that given +func (o *DownloadLogFileDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the download log file default response +func (o *DownloadLogFileDefault) Code() int { + return o._statusCode +} + +func (o *DownloadLogFileDefault) Error() string { + return fmt.Sprintf("[GET /loggers/download][%d] downloadLogFile default ", o._statusCode) +} + +func (o *DownloadLogFileDefault) String() string { + return fmt.Sprintf("[GET /loggers/download][%d] downloadLogFile default ", o._statusCode) +} + +func (o *DownloadLogFileDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/logger/get_local_log_files_parameters.go b/src/client/logger/get_local_log_files_parameters.go new file mode 100644 index 0000000..4c9e953 --- /dev/null +++ b/src/client/logger/get_local_log_files_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLocalLogFilesParams creates a new GetLocalLogFilesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLocalLogFilesParams() *GetLocalLogFilesParams { + return &GetLocalLogFilesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLocalLogFilesParamsWithTimeout creates a new GetLocalLogFilesParams object +// with the ability to set a timeout on a request. +func NewGetLocalLogFilesParamsWithTimeout(timeout time.Duration) *GetLocalLogFilesParams { + return &GetLocalLogFilesParams{ + timeout: timeout, + } +} + +// NewGetLocalLogFilesParamsWithContext creates a new GetLocalLogFilesParams object +// with the ability to set a context for a request. +func NewGetLocalLogFilesParamsWithContext(ctx context.Context) *GetLocalLogFilesParams { + return &GetLocalLogFilesParams{ + Context: ctx, + } +} + +// NewGetLocalLogFilesParamsWithHTTPClient creates a new GetLocalLogFilesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLocalLogFilesParamsWithHTTPClient(client *http.Client) *GetLocalLogFilesParams { + return &GetLocalLogFilesParams{ + HTTPClient: client, + } +} + +/* +GetLocalLogFilesParams contains all the parameters to send to the API endpoint + + for the get local log files operation. + + Typically these are written to a http.Request. +*/ +type GetLocalLogFilesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get local log files params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLocalLogFilesParams) WithDefaults() *GetLocalLogFilesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get local log files params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLocalLogFilesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get local log files params +func (o *GetLocalLogFilesParams) WithTimeout(timeout time.Duration) *GetLocalLogFilesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get local log files params +func (o *GetLocalLogFilesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get local log files params +func (o *GetLocalLogFilesParams) WithContext(ctx context.Context) *GetLocalLogFilesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get local log files params +func (o *GetLocalLogFilesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get local log files params +func (o *GetLocalLogFilesParams) WithHTTPClient(client *http.Client) *GetLocalLogFilesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get local log files params +func (o *GetLocalLogFilesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLocalLogFilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/get_local_log_files_responses.go b/src/client/logger/get_local_log_files_responses.go new file mode 100644 index 0000000..96b3426 --- /dev/null +++ b/src/client/logger/get_local_log_files_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLocalLogFilesReader is a Reader for the GetLocalLogFiles structure. +type GetLocalLogFilesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLocalLogFilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLocalLogFilesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLocalLogFilesOK creates a GetLocalLogFilesOK with default headers values +func NewGetLocalLogFilesOK() *GetLocalLogFilesOK { + return &GetLocalLogFilesOK{} +} + +/* +GetLocalLogFilesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLocalLogFilesOK struct { + Payload []string +} + +// IsSuccess returns true when this get local log files o k response has a 2xx status code +func (o *GetLocalLogFilesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get local log files o k response has a 3xx status code +func (o *GetLocalLogFilesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get local log files o k response has a 4xx status code +func (o *GetLocalLogFilesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get local log files o k response has a 5xx status code +func (o *GetLocalLogFilesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get local log files o k response a status code equal to that given +func (o *GetLocalLogFilesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get local log files o k response +func (o *GetLocalLogFilesOK) Code() int { + return 200 +} + +func (o *GetLocalLogFilesOK) Error() string { + return fmt.Sprintf("[GET /loggers/files][%d] getLocalLogFilesOK %+v", 200, o.Payload) +} + +func (o *GetLocalLogFilesOK) String() string { + return fmt.Sprintf("[GET /loggers/files][%d] getLocalLogFilesOK %+v", 200, o.Payload) +} + +func (o *GetLocalLogFilesOK) GetPayload() []string { + return o.Payload +} + +func (o *GetLocalLogFilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/logger/get_log_files_from_all_instances_parameters.go b/src/client/logger/get_log_files_from_all_instances_parameters.go new file mode 100644 index 0000000..613da04 --- /dev/null +++ b/src/client/logger/get_log_files_from_all_instances_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLogFilesFromAllInstancesParams creates a new GetLogFilesFromAllInstancesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLogFilesFromAllInstancesParams() *GetLogFilesFromAllInstancesParams { + return &GetLogFilesFromAllInstancesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLogFilesFromAllInstancesParamsWithTimeout creates a new GetLogFilesFromAllInstancesParams object +// with the ability to set a timeout on a request. +func NewGetLogFilesFromAllInstancesParamsWithTimeout(timeout time.Duration) *GetLogFilesFromAllInstancesParams { + return &GetLogFilesFromAllInstancesParams{ + timeout: timeout, + } +} + +// NewGetLogFilesFromAllInstancesParamsWithContext creates a new GetLogFilesFromAllInstancesParams object +// with the ability to set a context for a request. +func NewGetLogFilesFromAllInstancesParamsWithContext(ctx context.Context) *GetLogFilesFromAllInstancesParams { + return &GetLogFilesFromAllInstancesParams{ + Context: ctx, + } +} + +// NewGetLogFilesFromAllInstancesParamsWithHTTPClient creates a new GetLogFilesFromAllInstancesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLogFilesFromAllInstancesParamsWithHTTPClient(client *http.Client) *GetLogFilesFromAllInstancesParams { + return &GetLogFilesFromAllInstancesParams{ + HTTPClient: client, + } +} + +/* +GetLogFilesFromAllInstancesParams contains all the parameters to send to the API endpoint + + for the get log files from all instances operation. + + Typically these are written to a http.Request. +*/ +type GetLogFilesFromAllInstancesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get log files from all instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLogFilesFromAllInstancesParams) WithDefaults() *GetLogFilesFromAllInstancesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get log files from all instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLogFilesFromAllInstancesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get log files from all instances params +func (o *GetLogFilesFromAllInstancesParams) WithTimeout(timeout time.Duration) *GetLogFilesFromAllInstancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get log files from all instances params +func (o *GetLogFilesFromAllInstancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get log files from all instances params +func (o *GetLogFilesFromAllInstancesParams) WithContext(ctx context.Context) *GetLogFilesFromAllInstancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get log files from all instances params +func (o *GetLogFilesFromAllInstancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get log files from all instances params +func (o *GetLogFilesFromAllInstancesParams) WithHTTPClient(client *http.Client) *GetLogFilesFromAllInstancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get log files from all instances params +func (o *GetLogFilesFromAllInstancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLogFilesFromAllInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/get_log_files_from_all_instances_responses.go b/src/client/logger/get_log_files_from_all_instances_responses.go new file mode 100644 index 0000000..23a01f9 --- /dev/null +++ b/src/client/logger/get_log_files_from_all_instances_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLogFilesFromAllInstancesReader is a Reader for the GetLogFilesFromAllInstances structure. +type GetLogFilesFromAllInstancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLogFilesFromAllInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLogFilesFromAllInstancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLogFilesFromAllInstancesOK creates a GetLogFilesFromAllInstancesOK with default headers values +func NewGetLogFilesFromAllInstancesOK() *GetLogFilesFromAllInstancesOK { + return &GetLogFilesFromAllInstancesOK{} +} + +/* +GetLogFilesFromAllInstancesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLogFilesFromAllInstancesOK struct { + Payload map[string][]string +} + +// IsSuccess returns true when this get log files from all instances o k response has a 2xx status code +func (o *GetLogFilesFromAllInstancesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get log files from all instances o k response has a 3xx status code +func (o *GetLogFilesFromAllInstancesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get log files from all instances o k response has a 4xx status code +func (o *GetLogFilesFromAllInstancesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get log files from all instances o k response has a 5xx status code +func (o *GetLogFilesFromAllInstancesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get log files from all instances o k response a status code equal to that given +func (o *GetLogFilesFromAllInstancesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get log files from all instances o k response +func (o *GetLogFilesFromAllInstancesOK) Code() int { + return 200 +} + +func (o *GetLogFilesFromAllInstancesOK) Error() string { + return fmt.Sprintf("[GET /loggers/instances][%d] getLogFilesFromAllInstancesOK %+v", 200, o.Payload) +} + +func (o *GetLogFilesFromAllInstancesOK) String() string { + return fmt.Sprintf("[GET /loggers/instances][%d] getLogFilesFromAllInstancesOK %+v", 200, o.Payload) +} + +func (o *GetLogFilesFromAllInstancesOK) GetPayload() map[string][]string { + return o.Payload +} + +func (o *GetLogFilesFromAllInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/logger/get_log_files_from_instance_parameters.go b/src/client/logger/get_log_files_from_instance_parameters.go new file mode 100644 index 0000000..e1ae490 --- /dev/null +++ b/src/client/logger/get_log_files_from_instance_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLogFilesFromInstanceParams creates a new GetLogFilesFromInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLogFilesFromInstanceParams() *GetLogFilesFromInstanceParams { + return &GetLogFilesFromInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLogFilesFromInstanceParamsWithTimeout creates a new GetLogFilesFromInstanceParams object +// with the ability to set a timeout on a request. +func NewGetLogFilesFromInstanceParamsWithTimeout(timeout time.Duration) *GetLogFilesFromInstanceParams { + return &GetLogFilesFromInstanceParams{ + timeout: timeout, + } +} + +// NewGetLogFilesFromInstanceParamsWithContext creates a new GetLogFilesFromInstanceParams object +// with the ability to set a context for a request. +func NewGetLogFilesFromInstanceParamsWithContext(ctx context.Context) *GetLogFilesFromInstanceParams { + return &GetLogFilesFromInstanceParams{ + Context: ctx, + } +} + +// NewGetLogFilesFromInstanceParamsWithHTTPClient creates a new GetLogFilesFromInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLogFilesFromInstanceParamsWithHTTPClient(client *http.Client) *GetLogFilesFromInstanceParams { + return &GetLogFilesFromInstanceParams{ + HTTPClient: client, + } +} + +/* +GetLogFilesFromInstanceParams contains all the parameters to send to the API endpoint + + for the get log files from instance operation. + + Typically these are written to a http.Request. +*/ +type GetLogFilesFromInstanceParams struct { + + /* InstanceName. + + Instance Name + */ + InstanceName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get log files from instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLogFilesFromInstanceParams) WithDefaults() *GetLogFilesFromInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get log files from instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLogFilesFromInstanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) WithTimeout(timeout time.Duration) *GetLogFilesFromInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) WithContext(ctx context.Context) *GetLogFilesFromInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) WithHTTPClient(client *http.Client) *GetLogFilesFromInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstanceName adds the instanceName to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) WithInstanceName(instanceName string) *GetLogFilesFromInstanceParams { + o.SetInstanceName(instanceName) + return o +} + +// SetInstanceName adds the instanceName to the get log files from instance params +func (o *GetLogFilesFromInstanceParams) SetInstanceName(instanceName string) { + o.InstanceName = instanceName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLogFilesFromInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instanceName + if err := r.SetPathParam("instanceName", o.InstanceName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/get_log_files_from_instance_responses.go b/src/client/logger/get_log_files_from_instance_responses.go new file mode 100644 index 0000000..fbd1df4 --- /dev/null +++ b/src/client/logger/get_log_files_from_instance_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLogFilesFromInstanceReader is a Reader for the GetLogFilesFromInstance structure. +type GetLogFilesFromInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLogFilesFromInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLogFilesFromInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLogFilesFromInstanceOK creates a GetLogFilesFromInstanceOK with default headers values +func NewGetLogFilesFromInstanceOK() *GetLogFilesFromInstanceOK { + return &GetLogFilesFromInstanceOK{} +} + +/* +GetLogFilesFromInstanceOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLogFilesFromInstanceOK struct { + Payload []string +} + +// IsSuccess returns true when this get log files from instance o k response has a 2xx status code +func (o *GetLogFilesFromInstanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get log files from instance o k response has a 3xx status code +func (o *GetLogFilesFromInstanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get log files from instance o k response has a 4xx status code +func (o *GetLogFilesFromInstanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get log files from instance o k response has a 5xx status code +func (o *GetLogFilesFromInstanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get log files from instance o k response a status code equal to that given +func (o *GetLogFilesFromInstanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get log files from instance o k response +func (o *GetLogFilesFromInstanceOK) Code() int { + return 200 +} + +func (o *GetLogFilesFromInstanceOK) Error() string { + return fmt.Sprintf("[GET /loggers/instances/{instanceName}][%d] getLogFilesFromInstanceOK %+v", 200, o.Payload) +} + +func (o *GetLogFilesFromInstanceOK) String() string { + return fmt.Sprintf("[GET /loggers/instances/{instanceName}][%d] getLogFilesFromInstanceOK %+v", 200, o.Payload) +} + +func (o *GetLogFilesFromInstanceOK) GetPayload() []string { + return o.Payload +} + +func (o *GetLogFilesFromInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/logger/get_logger_parameters.go b/src/client/logger/get_logger_parameters.go new file mode 100644 index 0000000..a326d0c --- /dev/null +++ b/src/client/logger/get_logger_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLoggerParams creates a new GetLoggerParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLoggerParams() *GetLoggerParams { + return &GetLoggerParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLoggerParamsWithTimeout creates a new GetLoggerParams object +// with the ability to set a timeout on a request. +func NewGetLoggerParamsWithTimeout(timeout time.Duration) *GetLoggerParams { + return &GetLoggerParams{ + timeout: timeout, + } +} + +// NewGetLoggerParamsWithContext creates a new GetLoggerParams object +// with the ability to set a context for a request. +func NewGetLoggerParamsWithContext(ctx context.Context) *GetLoggerParams { + return &GetLoggerParams{ + Context: ctx, + } +} + +// NewGetLoggerParamsWithHTTPClient creates a new GetLoggerParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLoggerParamsWithHTTPClient(client *http.Client) *GetLoggerParams { + return &GetLoggerParams{ + HTTPClient: client, + } +} + +/* +GetLoggerParams contains all the parameters to send to the API endpoint + + for the get logger operation. + + Typically these are written to a http.Request. +*/ +type GetLoggerParams struct { + + /* LoggerName. + + Logger name + */ + LoggerName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get logger params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoggerParams) WithDefaults() *GetLoggerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get logger params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoggerParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get logger params +func (o *GetLoggerParams) WithTimeout(timeout time.Duration) *GetLoggerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get logger params +func (o *GetLoggerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get logger params +func (o *GetLoggerParams) WithContext(ctx context.Context) *GetLoggerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get logger params +func (o *GetLoggerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get logger params +func (o *GetLoggerParams) WithHTTPClient(client *http.Client) *GetLoggerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get logger params +func (o *GetLoggerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLoggerName adds the loggerName to the get logger params +func (o *GetLoggerParams) WithLoggerName(loggerName string) *GetLoggerParams { + o.SetLoggerName(loggerName) + return o +} + +// SetLoggerName adds the loggerName to the get logger params +func (o *GetLoggerParams) SetLoggerName(loggerName string) { + o.LoggerName = loggerName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLoggerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param loggerName + if err := r.SetPathParam("loggerName", o.LoggerName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/get_logger_responses.go b/src/client/logger/get_logger_responses.go new file mode 100644 index 0000000..fe68e71 --- /dev/null +++ b/src/client/logger/get_logger_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLoggerReader is a Reader for the GetLogger structure. +type GetLoggerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLoggerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLoggerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLoggerOK creates a GetLoggerOK with default headers values +func NewGetLoggerOK() *GetLoggerOK { + return &GetLoggerOK{} +} + +/* +GetLoggerOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLoggerOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get logger o k response has a 2xx status code +func (o *GetLoggerOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get logger o k response has a 3xx status code +func (o *GetLoggerOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get logger o k response has a 4xx status code +func (o *GetLoggerOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get logger o k response has a 5xx status code +func (o *GetLoggerOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get logger o k response a status code equal to that given +func (o *GetLoggerOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get logger o k response +func (o *GetLoggerOK) Code() int { + return 200 +} + +func (o *GetLoggerOK) Error() string { + return fmt.Sprintf("[GET /loggers/{loggerName}][%d] getLoggerOK %+v", 200, o.Payload) +} + +func (o *GetLoggerOK) String() string { + return fmt.Sprintf("[GET /loggers/{loggerName}][%d] getLoggerOK %+v", 200, o.Payload) +} + +func (o *GetLoggerOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetLoggerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/logger/get_loggers_parameters.go b/src/client/logger/get_loggers_parameters.go new file mode 100644 index 0000000..f48b7fe --- /dev/null +++ b/src/client/logger/get_loggers_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLoggersParams creates a new GetLoggersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLoggersParams() *GetLoggersParams { + return &GetLoggersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLoggersParamsWithTimeout creates a new GetLoggersParams object +// with the ability to set a timeout on a request. +func NewGetLoggersParamsWithTimeout(timeout time.Duration) *GetLoggersParams { + return &GetLoggersParams{ + timeout: timeout, + } +} + +// NewGetLoggersParamsWithContext creates a new GetLoggersParams object +// with the ability to set a context for a request. +func NewGetLoggersParamsWithContext(ctx context.Context) *GetLoggersParams { + return &GetLoggersParams{ + Context: ctx, + } +} + +// NewGetLoggersParamsWithHTTPClient creates a new GetLoggersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLoggersParamsWithHTTPClient(client *http.Client) *GetLoggersParams { + return &GetLoggersParams{ + HTTPClient: client, + } +} + +/* +GetLoggersParams contains all the parameters to send to the API endpoint + + for the get loggers operation. + + Typically these are written to a http.Request. +*/ +type GetLoggersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get loggers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoggersParams) WithDefaults() *GetLoggersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get loggers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoggersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get loggers params +func (o *GetLoggersParams) WithTimeout(timeout time.Duration) *GetLoggersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get loggers params +func (o *GetLoggersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get loggers params +func (o *GetLoggersParams) WithContext(ctx context.Context) *GetLoggersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get loggers params +func (o *GetLoggersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get loggers params +func (o *GetLoggersParams) WithHTTPClient(client *http.Client) *GetLoggersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get loggers params +func (o *GetLoggersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLoggersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/get_loggers_responses.go b/src/client/logger/get_loggers_responses.go new file mode 100644 index 0000000..0eb58cd --- /dev/null +++ b/src/client/logger/get_loggers_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLoggersReader is a Reader for the GetLoggers structure. +type GetLoggersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLoggersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLoggersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLoggersOK creates a GetLoggersOK with default headers values +func NewGetLoggersOK() *GetLoggersOK { + return &GetLoggersOK{} +} + +/* +GetLoggersOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetLoggersOK struct { + Payload []string +} + +// IsSuccess returns true when this get loggers o k response has a 2xx status code +func (o *GetLoggersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get loggers o k response has a 3xx status code +func (o *GetLoggersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get loggers o k response has a 4xx status code +func (o *GetLoggersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get loggers o k response has a 5xx status code +func (o *GetLoggersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get loggers o k response a status code equal to that given +func (o *GetLoggersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get loggers o k response +func (o *GetLoggersOK) Code() int { + return 200 +} + +func (o *GetLoggersOK) Error() string { + return fmt.Sprintf("[GET /loggers][%d] getLoggersOK %+v", 200, o.Payload) +} + +func (o *GetLoggersOK) String() string { + return fmt.Sprintf("[GET /loggers][%d] getLoggersOK %+v", 200, o.Payload) +} + +func (o *GetLoggersOK) GetPayload() []string { + return o.Payload +} + +func (o *GetLoggersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/logger/logger_client.go b/src/client/logger/logger_client.go new file mode 100644 index 0000000..0ad918b --- /dev/null +++ b/src/client/logger/logger_client.go @@ -0,0 +1,359 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new logger API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for logger API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + DownloadLogFile(params *DownloadLogFileParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + DownloadLogFileFromInstance(params *DownloadLogFileFromInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + GetLocalLogFiles(params *GetLocalLogFilesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLocalLogFilesOK, error) + + GetLogFilesFromAllInstances(params *GetLogFilesFromAllInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLogFilesFromAllInstancesOK, error) + + GetLogFilesFromInstance(params *GetLogFilesFromInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLogFilesFromInstanceOK, error) + + GetLogger(params *GetLoggerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLoggerOK, error) + + GetLoggers(params *GetLoggersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLoggersOK, error) + + SetLoggerLevel(params *SetLoggerLevelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetLoggerLevelOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +DownloadLogFile downloads a log file +*/ +func (a *Client) DownloadLogFile(params *DownloadLogFileParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadLogFileParams() + } + op := &runtime.ClientOperation{ + ID: "downloadLogFile", + Method: "GET", + PathPattern: "/loggers/download", + ProducesMediaTypes: []string{"application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DownloadLogFileReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +DownloadLogFileFromInstance downloads a log file from a given instance +*/ +func (a *Client) DownloadLogFileFromInstance(params *DownloadLogFileFromInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadLogFileFromInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "downloadLogFileFromInstance", + Method: "GET", + PathPattern: "/loggers/instances/{instanceName}/download", + ProducesMediaTypes: []string{"application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DownloadLogFileFromInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +GetLocalLogFiles gets all local log files +*/ +func (a *Client) GetLocalLogFiles(params *GetLocalLogFilesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLocalLogFilesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLocalLogFilesParams() + } + op := &runtime.ClientOperation{ + ID: "getLocalLogFiles", + Method: "GET", + PathPattern: "/loggers/files", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLocalLogFilesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLocalLogFilesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLocalLogFiles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLogFilesFromAllInstances collects log files from all the instances +*/ +func (a *Client) GetLogFilesFromAllInstances(params *GetLogFilesFromAllInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLogFilesFromAllInstancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLogFilesFromAllInstancesParams() + } + op := &runtime.ClientOperation{ + ID: "getLogFilesFromAllInstances", + Method: "GET", + PathPattern: "/loggers/instances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLogFilesFromAllInstancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLogFilesFromAllInstancesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLogFilesFromAllInstances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLogFilesFromInstance collects log files from a given instance +*/ +func (a *Client) GetLogFilesFromInstance(params *GetLogFilesFromInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLogFilesFromInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLogFilesFromInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "getLogFilesFromInstance", + Method: "GET", + PathPattern: "/loggers/instances/{instanceName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLogFilesFromInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLogFilesFromInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLogFilesFromInstance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLogger gets logger configs + +Return logger info +*/ +func (a *Client) GetLogger(params *GetLoggerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLoggerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLoggerParams() + } + op := &runtime.ClientOperation{ + ID: "getLogger", + Method: "GET", + PathPattern: "/loggers/{loggerName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLoggerReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLoggerOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLogger: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLoggers gets all the loggers + +Return all the logger names +*/ +func (a *Client) GetLoggers(params *GetLoggersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLoggersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLoggersParams() + } + op := &runtime.ClientOperation{ + ID: "getLoggers", + Method: "GET", + PathPattern: "/loggers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLoggersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLoggersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLoggers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +SetLoggerLevel sets logger level + +Set logger level for a given logger +*/ +func (a *Client) SetLoggerLevel(params *SetLoggerLevelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetLoggerLevelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSetLoggerLevelParams() + } + op := &runtime.ClientOperation{ + ID: "setLoggerLevel", + Method: "PUT", + PathPattern: "/loggers/{loggerName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SetLoggerLevelReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*SetLoggerLevelOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for setLoggerLevel: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/logger/set_logger_level_parameters.go b/src/client/logger/set_logger_level_parameters.go new file mode 100644 index 0000000..44d532d --- /dev/null +++ b/src/client/logger/set_logger_level_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSetLoggerLevelParams creates a new SetLoggerLevelParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSetLoggerLevelParams() *SetLoggerLevelParams { + return &SetLoggerLevelParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetLoggerLevelParamsWithTimeout creates a new SetLoggerLevelParams object +// with the ability to set a timeout on a request. +func NewSetLoggerLevelParamsWithTimeout(timeout time.Duration) *SetLoggerLevelParams { + return &SetLoggerLevelParams{ + timeout: timeout, + } +} + +// NewSetLoggerLevelParamsWithContext creates a new SetLoggerLevelParams object +// with the ability to set a context for a request. +func NewSetLoggerLevelParamsWithContext(ctx context.Context) *SetLoggerLevelParams { + return &SetLoggerLevelParams{ + Context: ctx, + } +} + +// NewSetLoggerLevelParamsWithHTTPClient creates a new SetLoggerLevelParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetLoggerLevelParamsWithHTTPClient(client *http.Client) *SetLoggerLevelParams { + return &SetLoggerLevelParams{ + HTTPClient: client, + } +} + +/* +SetLoggerLevelParams contains all the parameters to send to the API endpoint + + for the set logger level operation. + + Typically these are written to a http.Request. +*/ +type SetLoggerLevelParams struct { + + /* Level. + + Logger level + */ + Level *string + + /* LoggerName. + + Logger name + */ + LoggerName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set logger level params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetLoggerLevelParams) WithDefaults() *SetLoggerLevelParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set logger level params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetLoggerLevelParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set logger level params +func (o *SetLoggerLevelParams) WithTimeout(timeout time.Duration) *SetLoggerLevelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set logger level params +func (o *SetLoggerLevelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set logger level params +func (o *SetLoggerLevelParams) WithContext(ctx context.Context) *SetLoggerLevelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set logger level params +func (o *SetLoggerLevelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set logger level params +func (o *SetLoggerLevelParams) WithHTTPClient(client *http.Client) *SetLoggerLevelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set logger level params +func (o *SetLoggerLevelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLevel adds the level to the set logger level params +func (o *SetLoggerLevelParams) WithLevel(level *string) *SetLoggerLevelParams { + o.SetLevel(level) + return o +} + +// SetLevel adds the level to the set logger level params +func (o *SetLoggerLevelParams) SetLevel(level *string) { + o.Level = level +} + +// WithLoggerName adds the loggerName to the set logger level params +func (o *SetLoggerLevelParams) WithLoggerName(loggerName string) *SetLoggerLevelParams { + o.SetLoggerName(loggerName) + return o +} + +// SetLoggerName adds the loggerName to the set logger level params +func (o *SetLoggerLevelParams) SetLoggerName(loggerName string) { + o.LoggerName = loggerName +} + +// WriteToRequest writes these params to a swagger request +func (o *SetLoggerLevelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Level != nil { + + // query param level + var qrLevel string + + if o.Level != nil { + qrLevel = *o.Level + } + qLevel := qrLevel + if qLevel != "" { + + if err := r.SetQueryParam("level", qLevel); err != nil { + return err + } + } + } + + // path param loggerName + if err := r.SetPathParam("loggerName", o.LoggerName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/logger/set_logger_level_responses.go b/src/client/logger/set_logger_level_responses.go new file mode 100644 index 0000000..6f3b431 --- /dev/null +++ b/src/client/logger/set_logger_level_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package logger + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// SetLoggerLevelReader is a Reader for the SetLoggerLevel structure. +type SetLoggerLevelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetLoggerLevelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetLoggerLevelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewSetLoggerLevelOK creates a SetLoggerLevelOK with default headers values +func NewSetLoggerLevelOK() *SetLoggerLevelOK { + return &SetLoggerLevelOK{} +} + +/* +SetLoggerLevelOK describes a response with status code 200, with default header values. + +successful operation +*/ +type SetLoggerLevelOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this set logger level o k response has a 2xx status code +func (o *SetLoggerLevelOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set logger level o k response has a 3xx status code +func (o *SetLoggerLevelOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set logger level o k response has a 4xx status code +func (o *SetLoggerLevelOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set logger level o k response has a 5xx status code +func (o *SetLoggerLevelOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set logger level o k response a status code equal to that given +func (o *SetLoggerLevelOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the set logger level o k response +func (o *SetLoggerLevelOK) Code() int { + return 200 +} + +func (o *SetLoggerLevelOK) Error() string { + return fmt.Sprintf("[PUT /loggers/{loggerName}][%d] setLoggerLevelOK %+v", 200, o.Payload) +} + +func (o *SetLoggerLevelOK) String() string { + return fmt.Sprintf("[PUT /loggers/{loggerName}][%d] setLoggerLevelOK %+v", 200, o.Payload) +} + +func (o *SetLoggerLevelOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *SetLoggerLevelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/periodic_task/get_periodic_task_names_parameters.go b/src/client/periodic_task/get_periodic_task_names_parameters.go new file mode 100644 index 0000000..d37a9ab --- /dev/null +++ b/src/client/periodic_task/get_periodic_task_names_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package periodic_task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetPeriodicTaskNamesParams creates a new GetPeriodicTaskNamesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPeriodicTaskNamesParams() *GetPeriodicTaskNamesParams { + return &GetPeriodicTaskNamesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPeriodicTaskNamesParamsWithTimeout creates a new GetPeriodicTaskNamesParams object +// with the ability to set a timeout on a request. +func NewGetPeriodicTaskNamesParamsWithTimeout(timeout time.Duration) *GetPeriodicTaskNamesParams { + return &GetPeriodicTaskNamesParams{ + timeout: timeout, + } +} + +// NewGetPeriodicTaskNamesParamsWithContext creates a new GetPeriodicTaskNamesParams object +// with the ability to set a context for a request. +func NewGetPeriodicTaskNamesParamsWithContext(ctx context.Context) *GetPeriodicTaskNamesParams { + return &GetPeriodicTaskNamesParams{ + Context: ctx, + } +} + +// NewGetPeriodicTaskNamesParamsWithHTTPClient creates a new GetPeriodicTaskNamesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPeriodicTaskNamesParamsWithHTTPClient(client *http.Client) *GetPeriodicTaskNamesParams { + return &GetPeriodicTaskNamesParams{ + HTTPClient: client, + } +} + +/* +GetPeriodicTaskNamesParams contains all the parameters to send to the API endpoint + + for the get periodic task names operation. + + Typically these are written to a http.Request. +*/ +type GetPeriodicTaskNamesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get periodic task names params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPeriodicTaskNamesParams) WithDefaults() *GetPeriodicTaskNamesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get periodic task names params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPeriodicTaskNamesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get periodic task names params +func (o *GetPeriodicTaskNamesParams) WithTimeout(timeout time.Duration) *GetPeriodicTaskNamesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get periodic task names params +func (o *GetPeriodicTaskNamesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get periodic task names params +func (o *GetPeriodicTaskNamesParams) WithContext(ctx context.Context) *GetPeriodicTaskNamesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get periodic task names params +func (o *GetPeriodicTaskNamesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get periodic task names params +func (o *GetPeriodicTaskNamesParams) WithHTTPClient(client *http.Client) *GetPeriodicTaskNamesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get periodic task names params +func (o *GetPeriodicTaskNamesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPeriodicTaskNamesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/periodic_task/get_periodic_task_names_responses.go b/src/client/periodic_task/get_periodic_task_names_responses.go new file mode 100644 index 0000000..20f4e01 --- /dev/null +++ b/src/client/periodic_task/get_periodic_task_names_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package periodic_task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetPeriodicTaskNamesReader is a Reader for the GetPeriodicTaskNames structure. +type GetPeriodicTaskNamesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPeriodicTaskNamesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPeriodicTaskNamesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetPeriodicTaskNamesOK creates a GetPeriodicTaskNamesOK with default headers values +func NewGetPeriodicTaskNamesOK() *GetPeriodicTaskNamesOK { + return &GetPeriodicTaskNamesOK{} +} + +/* +GetPeriodicTaskNamesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetPeriodicTaskNamesOK struct { + Payload []string +} + +// IsSuccess returns true when this get periodic task names o k response has a 2xx status code +func (o *GetPeriodicTaskNamesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get periodic task names o k response has a 3xx status code +func (o *GetPeriodicTaskNamesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get periodic task names o k response has a 4xx status code +func (o *GetPeriodicTaskNamesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get periodic task names o k response has a 5xx status code +func (o *GetPeriodicTaskNamesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get periodic task names o k response a status code equal to that given +func (o *GetPeriodicTaskNamesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get periodic task names o k response +func (o *GetPeriodicTaskNamesOK) Code() int { + return 200 +} + +func (o *GetPeriodicTaskNamesOK) Error() string { + return fmt.Sprintf("[GET /periodictask/names][%d] getPeriodicTaskNamesOK %+v", 200, o.Payload) +} + +func (o *GetPeriodicTaskNamesOK) String() string { + return fmt.Sprintf("[GET /periodictask/names][%d] getPeriodicTaskNamesOK %+v", 200, o.Payload) +} + +func (o *GetPeriodicTaskNamesOK) GetPayload() []string { + return o.Payload +} + +func (o *GetPeriodicTaskNamesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/periodic_task/periodic_task_client.go b/src/client/periodic_task/periodic_task_client.go new file mode 100644 index 0000000..92cecf5 --- /dev/null +++ b/src/client/periodic_task/periodic_task_client.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package periodic_task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new periodic task API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for periodic task API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetPeriodicTaskNames(params *GetPeriodicTaskNamesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPeriodicTaskNamesOK, error) + + RunPeriodicTask(params *RunPeriodicTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetPeriodicTaskNames gets comma delimited list of all available periodic task names +*/ +func (a *Client) GetPeriodicTaskNames(params *GetPeriodicTaskNamesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPeriodicTaskNamesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPeriodicTaskNamesParams() + } + op := &runtime.ClientOperation{ + ID: "getPeriodicTaskNames", + Method: "GET", + PathPattern: "/periodictask/names", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetPeriodicTaskNamesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetPeriodicTaskNamesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getPeriodicTaskNames: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RunPeriodicTask runs periodic task against table if table name is missing task will run against all tables +*/ +func (a *Client) RunPeriodicTask(params *RunPeriodicTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewRunPeriodicTaskParams() + } + op := &runtime.ClientOperation{ + ID: "runPeriodicTask", + Method: "GET", + PathPattern: "/periodictask/run", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RunPeriodicTaskReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/periodic_task/run_periodic_task_parameters.go b/src/client/periodic_task/run_periodic_task_parameters.go new file mode 100644 index 0000000..9609b16 --- /dev/null +++ b/src/client/periodic_task/run_periodic_task_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package periodic_task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRunPeriodicTaskParams creates a new RunPeriodicTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRunPeriodicTaskParams() *RunPeriodicTaskParams { + return &RunPeriodicTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRunPeriodicTaskParamsWithTimeout creates a new RunPeriodicTaskParams object +// with the ability to set a timeout on a request. +func NewRunPeriodicTaskParamsWithTimeout(timeout time.Duration) *RunPeriodicTaskParams { + return &RunPeriodicTaskParams{ + timeout: timeout, + } +} + +// NewRunPeriodicTaskParamsWithContext creates a new RunPeriodicTaskParams object +// with the ability to set a context for a request. +func NewRunPeriodicTaskParamsWithContext(ctx context.Context) *RunPeriodicTaskParams { + return &RunPeriodicTaskParams{ + Context: ctx, + } +} + +// NewRunPeriodicTaskParamsWithHTTPClient creates a new RunPeriodicTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewRunPeriodicTaskParamsWithHTTPClient(client *http.Client) *RunPeriodicTaskParams { + return &RunPeriodicTaskParams{ + HTTPClient: client, + } +} + +/* +RunPeriodicTaskParams contains all the parameters to send to the API endpoint + + for the run periodic task operation. + + Typically these are written to a http.Request. +*/ +type RunPeriodicTaskParams struct { + + /* TableName. + + Name of the table + */ + TableName *string + + /* Taskname. + + Periodic task name + */ + Taskname string + + /* Type. + + OFFLINE | REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the run periodic task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RunPeriodicTaskParams) WithDefaults() *RunPeriodicTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the run periodic task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RunPeriodicTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the run periodic task params +func (o *RunPeriodicTaskParams) WithTimeout(timeout time.Duration) *RunPeriodicTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the run periodic task params +func (o *RunPeriodicTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the run periodic task params +func (o *RunPeriodicTaskParams) WithContext(ctx context.Context) *RunPeriodicTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the run periodic task params +func (o *RunPeriodicTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the run periodic task params +func (o *RunPeriodicTaskParams) WithHTTPClient(client *http.Client) *RunPeriodicTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the run periodic task params +func (o *RunPeriodicTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the run periodic task params +func (o *RunPeriodicTaskParams) WithTableName(tableName *string) *RunPeriodicTaskParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the run periodic task params +func (o *RunPeriodicTaskParams) SetTableName(tableName *string) { + o.TableName = tableName +} + +// WithTaskname adds the taskname to the run periodic task params +func (o *RunPeriodicTaskParams) WithTaskname(taskname string) *RunPeriodicTaskParams { + o.SetTaskname(taskname) + return o +} + +// SetTaskname adds the taskname to the run periodic task params +func (o *RunPeriodicTaskParams) SetTaskname(taskname string) { + o.Taskname = taskname +} + +// WithType adds the typeVar to the run periodic task params +func (o *RunPeriodicTaskParams) WithType(typeVar *string) *RunPeriodicTaskParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the run periodic task params +func (o *RunPeriodicTaskParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *RunPeriodicTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TableName != nil { + + // query param tableName + var qrTableName string + + if o.TableName != nil { + qrTableName = *o.TableName + } + qTableName := qrTableName + if qTableName != "" { + + if err := r.SetQueryParam("tableName", qTableName); err != nil { + return err + } + } + } + + // query param taskname + qrTaskname := o.Taskname + qTaskname := qrTaskname + if qTaskname != "" { + + if err := r.SetQueryParam("taskname", qTaskname); err != nil { + return err + } + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/periodic_task/run_periodic_task_responses.go b/src/client/periodic_task/run_periodic_task_responses.go new file mode 100644 index 0000000..1f97f15 --- /dev/null +++ b/src/client/periodic_task/run_periodic_task_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package periodic_task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RunPeriodicTaskReader is a Reader for the RunPeriodicTask structure. +type RunPeriodicTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RunPeriodicTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewRunPeriodicTaskDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewRunPeriodicTaskDefault creates a RunPeriodicTaskDefault with default headers values +func NewRunPeriodicTaskDefault(code int) *RunPeriodicTaskDefault { + return &RunPeriodicTaskDefault{ + _statusCode: code, + } +} + +/* +RunPeriodicTaskDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type RunPeriodicTaskDefault struct { + _statusCode int +} + +// IsSuccess returns true when this run periodic task default response has a 2xx status code +func (o *RunPeriodicTaskDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this run periodic task default response has a 3xx status code +func (o *RunPeriodicTaskDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this run periodic task default response has a 4xx status code +func (o *RunPeriodicTaskDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this run periodic task default response has a 5xx status code +func (o *RunPeriodicTaskDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this run periodic task default response a status code equal to that given +func (o *RunPeriodicTaskDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the run periodic task default response +func (o *RunPeriodicTaskDefault) Code() int { + return o._statusCode +} + +func (o *RunPeriodicTaskDefault) Error() string { + return fmt.Sprintf("[GET /periodictask/run][%d] runPeriodicTask default ", o._statusCode) +} + +func (o *RunPeriodicTaskDefault) String() string { + return fmt.Sprintf("[GET /periodictask/run][%d] runPeriodicTask default ", o._statusCode) +} + +func (o *RunPeriodicTaskDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/pinot_controller_api_client.go b/src/client/pinot_controller_api_client.go new file mode 100644 index 0000000..f4f9106 --- /dev/null +++ b/src/client/pinot_controller_api_client.go @@ -0,0 +1,222 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/client/app_configs" + "startree.ai/cli/client/atomic_ingestion" + "startree.ai/cli/client/auth" + "startree.ai/cli/client/broker" + "startree.ai/cli/client/cluster" + "startree.ai/cli/client/cluster_health" + "startree.ai/cli/client/health" + "startree.ai/cli/client/instance" + "startree.ai/cli/client/leader" + "startree.ai/cli/client/logger" + "startree.ai/cli/client/periodic_task" + "startree.ai/cli/client/query" + "startree.ai/cli/client/schema" + "startree.ai/cli/client/segment" + "startree.ai/cli/client/table" + "startree.ai/cli/client/task" + "startree.ai/cli/client/tenant" + "startree.ai/cli/client/tuner" + "startree.ai/cli/client/upsert" + "startree.ai/cli/client/user" + "startree.ai/cli/client/version" + "startree.ai/cli/client/write_api" + "startree.ai/cli/client/zookeeper" +) + +// Default pinot controller API HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"https"} + +// NewHTTPClient creates a new pinot controller API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *PinotControllerAPI { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new pinot controller API HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PinotControllerAPI { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new pinot controller API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *PinotControllerAPI { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(PinotControllerAPI) + cli.Transport = transport + cli.AppConfigs = app_configs.New(transport, formats) + cli.AtomicIngestion = atomic_ingestion.New(transport, formats) + cli.Auth = auth.New(transport, formats) + cli.Broker = broker.New(transport, formats) + cli.Cluster = cluster.New(transport, formats) + cli.ClusterHealth = cluster_health.New(transport, formats) + cli.Health = health.New(transport, formats) + cli.Instance = instance.New(transport, formats) + cli.Leader = leader.New(transport, formats) + cli.Logger = logger.New(transport, formats) + cli.PeriodicTask = periodic_task.New(transport, formats) + cli.Query = query.New(transport, formats) + cli.Schema = schema.New(transport, formats) + cli.Segment = segment.New(transport, formats) + cli.Table = table.New(transport, formats) + cli.Task = task.New(transport, formats) + cli.Tenant = tenant.New(transport, formats) + cli.Tuner = tuner.New(transport, formats) + cli.Upsert = upsert.New(transport, formats) + cli.User = user.New(transport, formats) + cli.Version = version.New(transport, formats) + cli.WriteAPI = write_api.New(transport, formats) + cli.Zookeeper = zookeeper.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// PinotControllerAPI is a client for pinot controller API +type PinotControllerAPI struct { + AppConfigs app_configs.ClientService + + AtomicIngestion atomic_ingestion.ClientService + + Auth auth.ClientService + + Broker broker.ClientService + + Cluster cluster.ClientService + + ClusterHealth cluster_health.ClientService + + Health health.ClientService + + Instance instance.ClientService + + Leader leader.ClientService + + Logger logger.ClientService + + PeriodicTask periodic_task.ClientService + + Query query.ClientService + + Schema schema.ClientService + + Segment segment.ClientService + + Table table.ClientService + + Task task.ClientService + + Tenant tenant.ClientService + + Tuner tuner.ClientService + + Upsert upsert.ClientService + + User user.ClientService + + Version version.ClientService + + WriteAPI write_api.ClientService + + Zookeeper zookeeper.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *PinotControllerAPI) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.AppConfigs.SetTransport(transport) + c.AtomicIngestion.SetTransport(transport) + c.Auth.SetTransport(transport) + c.Broker.SetTransport(transport) + c.Cluster.SetTransport(transport) + c.ClusterHealth.SetTransport(transport) + c.Health.SetTransport(transport) + c.Instance.SetTransport(transport) + c.Leader.SetTransport(transport) + c.Logger.SetTransport(transport) + c.PeriodicTask.SetTransport(transport) + c.Query.SetTransport(transport) + c.Schema.SetTransport(transport) + c.Segment.SetTransport(transport) + c.Table.SetTransport(transport) + c.Task.SetTransport(transport) + c.Tenant.SetTransport(transport) + c.Tuner.SetTransport(transport) + c.Upsert.SetTransport(transport) + c.User.SetTransport(transport) + c.Version.SetTransport(transport) + c.WriteAPI.SetTransport(transport) + c.Zookeeper.SetTransport(transport) +} diff --git a/src/client/query/cancel_query_parameters.go b/src/client/query/cancel_query_parameters.go new file mode 100644 index 0000000..2b8acd5 --- /dev/null +++ b/src/client/query/cancel_query_parameters.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package query + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCancelQueryParams creates a new CancelQueryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCancelQueryParams() *CancelQueryParams { + return &CancelQueryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCancelQueryParamsWithTimeout creates a new CancelQueryParams object +// with the ability to set a timeout on a request. +func NewCancelQueryParamsWithTimeout(timeout time.Duration) *CancelQueryParams { + return &CancelQueryParams{ + timeout: timeout, + } +} + +// NewCancelQueryParamsWithContext creates a new CancelQueryParams object +// with the ability to set a context for a request. +func NewCancelQueryParamsWithContext(ctx context.Context) *CancelQueryParams { + return &CancelQueryParams{ + Context: ctx, + } +} + +// NewCancelQueryParamsWithHTTPClient creates a new CancelQueryParams object +// with the ability to set a custom HTTPClient for a request. +func NewCancelQueryParamsWithHTTPClient(client *http.Client) *CancelQueryParams { + return &CancelQueryParams{ + HTTPClient: client, + } +} + +/* +CancelQueryParams contains all the parameters to send to the API endpoint + + for the cancel query operation. + + Typically these are written to a http.Request. +*/ +type CancelQueryParams struct { + + /* BrokerID. + + Broker that's running the query + */ + BrokerID string + + /* QueryID. + + QueryId as assigned by the broker + + Format: int64 + */ + QueryID int64 + + /* TimeoutMs. + + Timeout for servers to respond the cancel request + + Format: int32 + Default: 3000 + */ + TimeoutMs *int32 + + /* Verbose. + + Return verbose responses for troubleshooting + */ + Verbose *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the cancel query params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CancelQueryParams) WithDefaults() *CancelQueryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the cancel query params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CancelQueryParams) SetDefaults() { + var ( + timeoutMsDefault = int32(3000) + + verboseDefault = bool(false) + ) + + val := CancelQueryParams{ + TimeoutMs: &timeoutMsDefault, + Verbose: &verboseDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the cancel query params +func (o *CancelQueryParams) WithTimeout(timeout time.Duration) *CancelQueryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cancel query params +func (o *CancelQueryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cancel query params +func (o *CancelQueryParams) WithContext(ctx context.Context) *CancelQueryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cancel query params +func (o *CancelQueryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cancel query params +func (o *CancelQueryParams) WithHTTPClient(client *http.Client) *CancelQueryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cancel query params +func (o *CancelQueryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBrokerID adds the brokerID to the cancel query params +func (o *CancelQueryParams) WithBrokerID(brokerID string) *CancelQueryParams { + o.SetBrokerID(brokerID) + return o +} + +// SetBrokerID adds the brokerId to the cancel query params +func (o *CancelQueryParams) SetBrokerID(brokerID string) { + o.BrokerID = brokerID +} + +// WithQueryID adds the queryID to the cancel query params +func (o *CancelQueryParams) WithQueryID(queryID int64) *CancelQueryParams { + o.SetQueryID(queryID) + return o +} + +// SetQueryID adds the queryId to the cancel query params +func (o *CancelQueryParams) SetQueryID(queryID int64) { + o.QueryID = queryID +} + +// WithTimeoutMs adds the timeoutMs to the cancel query params +func (o *CancelQueryParams) WithTimeoutMs(timeoutMs *int32) *CancelQueryParams { + o.SetTimeoutMs(timeoutMs) + return o +} + +// SetTimeoutMs adds the timeoutMs to the cancel query params +func (o *CancelQueryParams) SetTimeoutMs(timeoutMs *int32) { + o.TimeoutMs = timeoutMs +} + +// WithVerbose adds the verbose to the cancel query params +func (o *CancelQueryParams) WithVerbose(verbose *bool) *CancelQueryParams { + o.SetVerbose(verbose) + return o +} + +// SetVerbose adds the verbose to the cancel query params +func (o *CancelQueryParams) SetVerbose(verbose *bool) { + o.Verbose = verbose +} + +// WriteToRequest writes these params to a swagger request +func (o *CancelQueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param brokerId + if err := r.SetPathParam("brokerId", o.BrokerID); err != nil { + return err + } + + // path param queryId + if err := r.SetPathParam("queryId", swag.FormatInt64(o.QueryID)); err != nil { + return err + } + + if o.TimeoutMs != nil { + + // query param timeoutMs + var qrTimeoutMs int32 + + if o.TimeoutMs != nil { + qrTimeoutMs = *o.TimeoutMs + } + qTimeoutMs := swag.FormatInt32(qrTimeoutMs) + if qTimeoutMs != "" { + + if err := r.SetQueryParam("timeoutMs", qTimeoutMs); err != nil { + return err + } + } + } + + if o.Verbose != nil { + + // query param verbose + var qrVerbose bool + + if o.Verbose != nil { + qrVerbose = *o.Verbose + } + qVerbose := swag.FormatBool(qrVerbose) + if qVerbose != "" { + + if err := r.SetQueryParam("verbose", qVerbose); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/query/cancel_query_responses.go b/src/client/query/cancel_query_responses.go new file mode 100644 index 0000000..2844d35 --- /dev/null +++ b/src/client/query/cancel_query_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package query + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CancelQueryReader is a Reader for the CancelQuery structure. +type CancelQueryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CancelQueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCancelQueryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewCancelQueryNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCancelQueryInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCancelQueryOK creates a CancelQueryOK with default headers values +func NewCancelQueryOK() *CancelQueryOK { + return &CancelQueryOK{} +} + +/* +CancelQueryOK describes a response with status code 200, with default header values. + +Success +*/ +type CancelQueryOK struct { +} + +// IsSuccess returns true when this cancel query o k response has a 2xx status code +func (o *CancelQueryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this cancel query o k response has a 3xx status code +func (o *CancelQueryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this cancel query o k response has a 4xx status code +func (o *CancelQueryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this cancel query o k response has a 5xx status code +func (o *CancelQueryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this cancel query o k response a status code equal to that given +func (o *CancelQueryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the cancel query o k response +func (o *CancelQueryOK) Code() int { + return 200 +} + +func (o *CancelQueryOK) Error() string { + return fmt.Sprintf("[DELETE /query/{brokerId}/{queryId}][%d] cancelQueryOK ", 200) +} + +func (o *CancelQueryOK) String() string { + return fmt.Sprintf("[DELETE /query/{brokerId}/{queryId}][%d] cancelQueryOK ", 200) +} + +func (o *CancelQueryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCancelQueryNotFound creates a CancelQueryNotFound with default headers values +func NewCancelQueryNotFound() *CancelQueryNotFound { + return &CancelQueryNotFound{} +} + +/* +CancelQueryNotFound describes a response with status code 404, with default header values. + +Query not found on the requested broker +*/ +type CancelQueryNotFound struct { +} + +// IsSuccess returns true when this cancel query not found response has a 2xx status code +func (o *CancelQueryNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this cancel query not found response has a 3xx status code +func (o *CancelQueryNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this cancel query not found response has a 4xx status code +func (o *CancelQueryNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this cancel query not found response has a 5xx status code +func (o *CancelQueryNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this cancel query not found response a status code equal to that given +func (o *CancelQueryNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the cancel query not found response +func (o *CancelQueryNotFound) Code() int { + return 404 +} + +func (o *CancelQueryNotFound) Error() string { + return fmt.Sprintf("[DELETE /query/{brokerId}/{queryId}][%d] cancelQueryNotFound ", 404) +} + +func (o *CancelQueryNotFound) String() string { + return fmt.Sprintf("[DELETE /query/{brokerId}/{queryId}][%d] cancelQueryNotFound ", 404) +} + +func (o *CancelQueryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCancelQueryInternalServerError creates a CancelQueryInternalServerError with default headers values +func NewCancelQueryInternalServerError() *CancelQueryInternalServerError { + return &CancelQueryInternalServerError{} +} + +/* +CancelQueryInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type CancelQueryInternalServerError struct { +} + +// IsSuccess returns true when this cancel query internal server error response has a 2xx status code +func (o *CancelQueryInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this cancel query internal server error response has a 3xx status code +func (o *CancelQueryInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this cancel query internal server error response has a 4xx status code +func (o *CancelQueryInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this cancel query internal server error response has a 5xx status code +func (o *CancelQueryInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this cancel query internal server error response a status code equal to that given +func (o *CancelQueryInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the cancel query internal server error response +func (o *CancelQueryInternalServerError) Code() int { + return 500 +} + +func (o *CancelQueryInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /query/{brokerId}/{queryId}][%d] cancelQueryInternalServerError ", 500) +} + +func (o *CancelQueryInternalServerError) String() string { + return fmt.Sprintf("[DELETE /query/{brokerId}/{queryId}][%d] cancelQueryInternalServerError ", 500) +} + +func (o *CancelQueryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/query/get_running_queries_parameters.go b/src/client/query/get_running_queries_parameters.go new file mode 100644 index 0000000..beab9c1 --- /dev/null +++ b/src/client/query/get_running_queries_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package query + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetRunningQueriesParams creates a new GetRunningQueriesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRunningQueriesParams() *GetRunningQueriesParams { + return &GetRunningQueriesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRunningQueriesParamsWithTimeout creates a new GetRunningQueriesParams object +// with the ability to set a timeout on a request. +func NewGetRunningQueriesParamsWithTimeout(timeout time.Duration) *GetRunningQueriesParams { + return &GetRunningQueriesParams{ + timeout: timeout, + } +} + +// NewGetRunningQueriesParamsWithContext creates a new GetRunningQueriesParams object +// with the ability to set a context for a request. +func NewGetRunningQueriesParamsWithContext(ctx context.Context) *GetRunningQueriesParams { + return &GetRunningQueriesParams{ + Context: ctx, + } +} + +// NewGetRunningQueriesParamsWithHTTPClient creates a new GetRunningQueriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRunningQueriesParamsWithHTTPClient(client *http.Client) *GetRunningQueriesParams { + return &GetRunningQueriesParams{ + HTTPClient: client, + } +} + +/* +GetRunningQueriesParams contains all the parameters to send to the API endpoint + + for the get running queries operation. + + Typically these are written to a http.Request. +*/ +type GetRunningQueriesParams struct { + + /* TimeoutMs. + + Timeout for brokers to return running queries + + Format: int32 + Default: 3000 + */ + TimeoutMs *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get running queries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunningQueriesParams) WithDefaults() *GetRunningQueriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get running queries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunningQueriesParams) SetDefaults() { + var ( + timeoutMsDefault = int32(3000) + ) + + val := GetRunningQueriesParams{ + TimeoutMs: &timeoutMsDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get running queries params +func (o *GetRunningQueriesParams) WithTimeout(timeout time.Duration) *GetRunningQueriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get running queries params +func (o *GetRunningQueriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get running queries params +func (o *GetRunningQueriesParams) WithContext(ctx context.Context) *GetRunningQueriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get running queries params +func (o *GetRunningQueriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get running queries params +func (o *GetRunningQueriesParams) WithHTTPClient(client *http.Client) *GetRunningQueriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get running queries params +func (o *GetRunningQueriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeoutMs adds the timeoutMs to the get running queries params +func (o *GetRunningQueriesParams) WithTimeoutMs(timeoutMs *int32) *GetRunningQueriesParams { + o.SetTimeoutMs(timeoutMs) + return o +} + +// SetTimeoutMs adds the timeoutMs to the get running queries params +func (o *GetRunningQueriesParams) SetTimeoutMs(timeoutMs *int32) { + o.TimeoutMs = timeoutMs +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRunningQueriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TimeoutMs != nil { + + // query param timeoutMs + var qrTimeoutMs int32 + + if o.TimeoutMs != nil { + qrTimeoutMs = *o.TimeoutMs + } + qTimeoutMs := swag.FormatInt32(qrTimeoutMs) + if qTimeoutMs != "" { + + if err := r.SetQueryParam("timeoutMs", qTimeoutMs); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/query/get_running_queries_responses.go b/src/client/query/get_running_queries_responses.go new file mode 100644 index 0000000..efd9879 --- /dev/null +++ b/src/client/query/get_running_queries_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package query + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetRunningQueriesReader is a Reader for the GetRunningQueries structure. +type GetRunningQueriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRunningQueriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRunningQueriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetRunningQueriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRunningQueriesOK creates a GetRunningQueriesOK with default headers values +func NewGetRunningQueriesOK() *GetRunningQueriesOK { + return &GetRunningQueriesOK{} +} + +/* +GetRunningQueriesOK describes a response with status code 200, with default header values. + +Success +*/ +type GetRunningQueriesOK struct { +} + +// IsSuccess returns true when this get running queries o k response has a 2xx status code +func (o *GetRunningQueriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get running queries o k response has a 3xx status code +func (o *GetRunningQueriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get running queries o k response has a 4xx status code +func (o *GetRunningQueriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get running queries o k response has a 5xx status code +func (o *GetRunningQueriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get running queries o k response a status code equal to that given +func (o *GetRunningQueriesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get running queries o k response +func (o *GetRunningQueriesOK) Code() int { + return 200 +} + +func (o *GetRunningQueriesOK) Error() string { + return fmt.Sprintf("[GET /queries][%d] getRunningQueriesOK ", 200) +} + +func (o *GetRunningQueriesOK) String() string { + return fmt.Sprintf("[GET /queries][%d] getRunningQueriesOK ", 200) +} + +func (o *GetRunningQueriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetRunningQueriesInternalServerError creates a GetRunningQueriesInternalServerError with default headers values +func NewGetRunningQueriesInternalServerError() *GetRunningQueriesInternalServerError { + return &GetRunningQueriesInternalServerError{} +} + +/* +GetRunningQueriesInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetRunningQueriesInternalServerError struct { +} + +// IsSuccess returns true when this get running queries internal server error response has a 2xx status code +func (o *GetRunningQueriesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get running queries internal server error response has a 3xx status code +func (o *GetRunningQueriesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get running queries internal server error response has a 4xx status code +func (o *GetRunningQueriesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get running queries internal server error response has a 5xx status code +func (o *GetRunningQueriesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get running queries internal server error response a status code equal to that given +func (o *GetRunningQueriesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get running queries internal server error response +func (o *GetRunningQueriesInternalServerError) Code() int { + return 500 +} + +func (o *GetRunningQueriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /queries][%d] getRunningQueriesInternalServerError ", 500) +} + +func (o *GetRunningQueriesInternalServerError) String() string { + return fmt.Sprintf("[GET /queries][%d] getRunningQueriesInternalServerError ", 500) +} + +func (o *GetRunningQueriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/query/query_client.go b/src/client/query/query_client.go new file mode 100644 index 0000000..d1ea9ca --- /dev/null +++ b/src/client/query/query_client.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package query + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new query API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for query API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CancelQuery(params *CancelQueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CancelQueryOK, error) + + GetRunningQueries(params *GetRunningQueriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunningQueriesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CancelQuery cancels a query as identified by the query Id + +No effect if no query exists for the given queryId on the requested broker. Query may continue to run for a short while after calling cancel as it's done in a non-blocking manner. The cancel method can be called multiple times. +*/ +func (a *Client) CancelQuery(params *CancelQueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CancelQueryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCancelQueryParams() + } + op := &runtime.ClientOperation{ + ID: "cancelQuery", + Method: "DELETE", + PathPattern: "/query/{brokerId}/{queryId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CancelQueryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CancelQueryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for cancelQuery: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetRunningQueries gets running queries from all brokers + +The queries are returned with brokers running them +*/ +func (a *Client) GetRunningQueries(params *GetRunningQueriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunningQueriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRunningQueriesParams() + } + op := &runtime.ClientOperation{ + ID: "getRunningQueries", + Method: "GET", + PathPattern: "/queries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetRunningQueriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetRunningQueriesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getRunningQueries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/schema/add_schema1_parameters.go b/src/client/schema/add_schema1_parameters.go new file mode 100644 index 0000000..006c45f --- /dev/null +++ b/src/client/schema/add_schema1_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewAddSchema1Params creates a new AddSchema1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddSchema1Params() *AddSchema1Params { + return &AddSchema1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddSchema1ParamsWithTimeout creates a new AddSchema1Params object +// with the ability to set a timeout on a request. +func NewAddSchema1ParamsWithTimeout(timeout time.Duration) *AddSchema1Params { + return &AddSchema1Params{ + timeout: timeout, + } +} + +// NewAddSchema1ParamsWithContext creates a new AddSchema1Params object +// with the ability to set a context for a request. +func NewAddSchema1ParamsWithContext(ctx context.Context) *AddSchema1Params { + return &AddSchema1Params{ + Context: ctx, + } +} + +// NewAddSchema1ParamsWithHTTPClient creates a new AddSchema1Params object +// with the ability to set a custom HTTPClient for a request. +func NewAddSchema1ParamsWithHTTPClient(client *http.Client) *AddSchema1Params { + return &AddSchema1Params{ + HTTPClient: client, + } +} + +/* +AddSchema1Params contains all the parameters to send to the API endpoint + + for the add schema 1 operation. + + Typically these are written to a http.Request. +*/ +type AddSchema1Params struct { + + // Body. + Body string + + /* Force. + + Whether to force overriding the schema if the schema exists + */ + Force *bool + + /* Override. + + Whether to override the schema if the schema exists + + Default: true + */ + Override *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add schema 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddSchema1Params) WithDefaults() *AddSchema1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add schema 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddSchema1Params) SetDefaults() { + var ( + forceDefault = bool(false) + + overrideDefault = bool(true) + ) + + val := AddSchema1Params{ + Force: &forceDefault, + Override: &overrideDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the add schema 1 params +func (o *AddSchema1Params) WithTimeout(timeout time.Duration) *AddSchema1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add schema 1 params +func (o *AddSchema1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add schema 1 params +func (o *AddSchema1Params) WithContext(ctx context.Context) *AddSchema1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add schema 1 params +func (o *AddSchema1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add schema 1 params +func (o *AddSchema1Params) WithHTTPClient(client *http.Client) *AddSchema1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add schema 1 params +func (o *AddSchema1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add schema 1 params +func (o *AddSchema1Params) WithBody(body string) *AddSchema1Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add schema 1 params +func (o *AddSchema1Params) SetBody(body string) { + o.Body = body +} + +// WithForce adds the force to the add schema 1 params +func (o *AddSchema1Params) WithForce(force *bool) *AddSchema1Params { + o.SetForce(force) + return o +} + +// SetForce adds the force to the add schema 1 params +func (o *AddSchema1Params) SetForce(force *bool) { + o.Force = force +} + +// WithOverride adds the override to the add schema 1 params +func (o *AddSchema1Params) WithOverride(override *bool) *AddSchema1Params { + o.SetOverride(override) + return o +} + +// SetOverride adds the override to the add schema 1 params +func (o *AddSchema1Params) SetOverride(override *bool) { + o.Override = override +} + +// WriteToRequest writes these params to a swagger request +func (o *AddSchema1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.Force != nil { + + // query param force + var qrForce bool + + if o.Force != nil { + qrForce = *o.Force + } + qForce := swag.FormatBool(qrForce) + if qForce != "" { + + if err := r.SetQueryParam("force", qForce); err != nil { + return err + } + } + } + + if o.Override != nil { + + // query param override + var qrOverride bool + + if o.Override != nil { + qrOverride = *o.Override + } + qOverride := swag.FormatBool(qrOverride) + if qOverride != "" { + + if err := r.SetQueryParam("override", qOverride); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/add_schema1_responses.go b/src/client/schema/add_schema1_responses.go new file mode 100644 index 0000000..96c82d5 --- /dev/null +++ b/src/client/schema/add_schema1_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// AddSchema1Reader is a Reader for the AddSchema1 structure. +type AddSchema1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddSchema1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddSchema1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAddSchema1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewAddSchema1Conflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAddSchema1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAddSchema1OK creates a AddSchema1OK with default headers values +func NewAddSchema1OK() *AddSchema1OK { + return &AddSchema1OK{} +} + +/* +AddSchema1OK describes a response with status code 200, with default header values. + +Successfully created schema +*/ +type AddSchema1OK struct { +} + +// IsSuccess returns true when this add schema1 o k response has a 2xx status code +func (o *AddSchema1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this add schema1 o k response has a 3xx status code +func (o *AddSchema1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add schema1 o k response has a 4xx status code +func (o *AddSchema1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this add schema1 o k response has a 5xx status code +func (o *AddSchema1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this add schema1 o k response a status code equal to that given +func (o *AddSchema1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the add schema1 o k response +func (o *AddSchema1OK) Code() int { + return 200 +} + +func (o *AddSchema1OK) Error() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1OK ", 200) +} + +func (o *AddSchema1OK) String() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1OK ", 200) +} + +func (o *AddSchema1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAddSchema1BadRequest creates a AddSchema1BadRequest with default headers values +func NewAddSchema1BadRequest() *AddSchema1BadRequest { + return &AddSchema1BadRequest{} +} + +/* +AddSchema1BadRequest describes a response with status code 400, with default header values. + +Missing or invalid request body +*/ +type AddSchema1BadRequest struct { +} + +// IsSuccess returns true when this add schema1 bad request response has a 2xx status code +func (o *AddSchema1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this add schema1 bad request response has a 3xx status code +func (o *AddSchema1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add schema1 bad request response has a 4xx status code +func (o *AddSchema1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this add schema1 bad request response has a 5xx status code +func (o *AddSchema1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this add schema1 bad request response a status code equal to that given +func (o *AddSchema1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the add schema1 bad request response +func (o *AddSchema1BadRequest) Code() int { + return 400 +} + +func (o *AddSchema1BadRequest) Error() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1BadRequest ", 400) +} + +func (o *AddSchema1BadRequest) String() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1BadRequest ", 400) +} + +func (o *AddSchema1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAddSchema1Conflict creates a AddSchema1Conflict with default headers values +func NewAddSchema1Conflict() *AddSchema1Conflict { + return &AddSchema1Conflict{} +} + +/* +AddSchema1Conflict describes a response with status code 409, with default header values. + +Schema already exists +*/ +type AddSchema1Conflict struct { +} + +// IsSuccess returns true when this add schema1 conflict response has a 2xx status code +func (o *AddSchema1Conflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this add schema1 conflict response has a 3xx status code +func (o *AddSchema1Conflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add schema1 conflict response has a 4xx status code +func (o *AddSchema1Conflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this add schema1 conflict response has a 5xx status code +func (o *AddSchema1Conflict) IsServerError() bool { + return false +} + +// IsCode returns true when this add schema1 conflict response a status code equal to that given +func (o *AddSchema1Conflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the add schema1 conflict response +func (o *AddSchema1Conflict) Code() int { + return 409 +} + +func (o *AddSchema1Conflict) Error() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1Conflict ", 409) +} + +func (o *AddSchema1Conflict) String() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1Conflict ", 409) +} + +func (o *AddSchema1Conflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAddSchema1InternalServerError creates a AddSchema1InternalServerError with default headers values +func NewAddSchema1InternalServerError() *AddSchema1InternalServerError { + return &AddSchema1InternalServerError{} +} + +/* +AddSchema1InternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type AddSchema1InternalServerError struct { +} + +// IsSuccess returns true when this add schema1 internal server error response has a 2xx status code +func (o *AddSchema1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this add schema1 internal server error response has a 3xx status code +func (o *AddSchema1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add schema1 internal server error response has a 4xx status code +func (o *AddSchema1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this add schema1 internal server error response has a 5xx status code +func (o *AddSchema1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this add schema1 internal server error response a status code equal to that given +func (o *AddSchema1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the add schema1 internal server error response +func (o *AddSchema1InternalServerError) Code() int { + return 500 +} + +func (o *AddSchema1InternalServerError) Error() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1InternalServerError ", 500) +} + +func (o *AddSchema1InternalServerError) String() string { + return fmt.Sprintf("[POST /schemas][%d] addSchema1InternalServerError ", 500) +} + +func (o *AddSchema1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/schema/delete_schema_parameters.go b/src/client/schema/delete_schema_parameters.go new file mode 100644 index 0000000..72f6465 --- /dev/null +++ b/src/client/schema/delete_schema_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSchemaParams creates a new DeleteSchemaParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSchemaParams() *DeleteSchemaParams { + return &DeleteSchemaParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSchemaParamsWithTimeout creates a new DeleteSchemaParams object +// with the ability to set a timeout on a request. +func NewDeleteSchemaParamsWithTimeout(timeout time.Duration) *DeleteSchemaParams { + return &DeleteSchemaParams{ + timeout: timeout, + } +} + +// NewDeleteSchemaParamsWithContext creates a new DeleteSchemaParams object +// with the ability to set a context for a request. +func NewDeleteSchemaParamsWithContext(ctx context.Context) *DeleteSchemaParams { + return &DeleteSchemaParams{ + Context: ctx, + } +} + +// NewDeleteSchemaParamsWithHTTPClient creates a new DeleteSchemaParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSchemaParamsWithHTTPClient(client *http.Client) *DeleteSchemaParams { + return &DeleteSchemaParams{ + HTTPClient: client, + } +} + +/* +DeleteSchemaParams contains all the parameters to send to the API endpoint + + for the delete schema operation. + + Typically these are written to a http.Request. +*/ +type DeleteSchemaParams struct { + + /* SchemaName. + + Schema name + */ + SchemaName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSchemaParams) WithDefaults() *DeleteSchemaParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSchemaParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete schema params +func (o *DeleteSchemaParams) WithTimeout(timeout time.Duration) *DeleteSchemaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete schema params +func (o *DeleteSchemaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete schema params +func (o *DeleteSchemaParams) WithContext(ctx context.Context) *DeleteSchemaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete schema params +func (o *DeleteSchemaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete schema params +func (o *DeleteSchemaParams) WithHTTPClient(client *http.Client) *DeleteSchemaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete schema params +func (o *DeleteSchemaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSchemaName adds the schemaName to the delete schema params +func (o *DeleteSchemaParams) WithSchemaName(schemaName string) *DeleteSchemaParams { + o.SetSchemaName(schemaName) + return o +} + +// SetSchemaName adds the schemaName to the delete schema params +func (o *DeleteSchemaParams) SetSchemaName(schemaName string) { + o.SchemaName = schemaName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSchemaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param schemaName + if err := r.SetPathParam("schemaName", o.SchemaName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/delete_schema_responses.go b/src/client/schema/delete_schema_responses.go new file mode 100644 index 0000000..e89f354 --- /dev/null +++ b/src/client/schema/delete_schema_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteSchemaReader is a Reader for the DeleteSchema structure. +type DeleteSchemaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSchemaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSchemaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDeleteSchemaNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewDeleteSchemaConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteSchemaInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSchemaOK creates a DeleteSchemaOK with default headers values +func NewDeleteSchemaOK() *DeleteSchemaOK { + return &DeleteSchemaOK{} +} + +/* +DeleteSchemaOK describes a response with status code 200, with default header values. + +Successfully deleted schema +*/ +type DeleteSchemaOK struct { +} + +// IsSuccess returns true when this delete schema o k response has a 2xx status code +func (o *DeleteSchemaOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete schema o k response has a 3xx status code +func (o *DeleteSchemaOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete schema o k response has a 4xx status code +func (o *DeleteSchemaOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete schema o k response has a 5xx status code +func (o *DeleteSchemaOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete schema o k response a status code equal to that given +func (o *DeleteSchemaOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete schema o k response +func (o *DeleteSchemaOK) Code() int { + return 200 +} + +func (o *DeleteSchemaOK) Error() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaOK ", 200) +} + +func (o *DeleteSchemaOK) String() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaOK ", 200) +} + +func (o *DeleteSchemaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteSchemaNotFound creates a DeleteSchemaNotFound with default headers values +func NewDeleteSchemaNotFound() *DeleteSchemaNotFound { + return &DeleteSchemaNotFound{} +} + +/* +DeleteSchemaNotFound describes a response with status code 404, with default header values. + +Schema not found +*/ +type DeleteSchemaNotFound struct { +} + +// IsSuccess returns true when this delete schema not found response has a 2xx status code +func (o *DeleteSchemaNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete schema not found response has a 3xx status code +func (o *DeleteSchemaNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete schema not found response has a 4xx status code +func (o *DeleteSchemaNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete schema not found response has a 5xx status code +func (o *DeleteSchemaNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete schema not found response a status code equal to that given +func (o *DeleteSchemaNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete schema not found response +func (o *DeleteSchemaNotFound) Code() int { + return 404 +} + +func (o *DeleteSchemaNotFound) Error() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaNotFound ", 404) +} + +func (o *DeleteSchemaNotFound) String() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaNotFound ", 404) +} + +func (o *DeleteSchemaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteSchemaConflict creates a DeleteSchemaConflict with default headers values +func NewDeleteSchemaConflict() *DeleteSchemaConflict { + return &DeleteSchemaConflict{} +} + +/* +DeleteSchemaConflict describes a response with status code 409, with default header values. + +Schema is in use +*/ +type DeleteSchemaConflict struct { +} + +// IsSuccess returns true when this delete schema conflict response has a 2xx status code +func (o *DeleteSchemaConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete schema conflict response has a 3xx status code +func (o *DeleteSchemaConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete schema conflict response has a 4xx status code +func (o *DeleteSchemaConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete schema conflict response has a 5xx status code +func (o *DeleteSchemaConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this delete schema conflict response a status code equal to that given +func (o *DeleteSchemaConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the delete schema conflict response +func (o *DeleteSchemaConflict) Code() int { + return 409 +} + +func (o *DeleteSchemaConflict) Error() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaConflict ", 409) +} + +func (o *DeleteSchemaConflict) String() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaConflict ", 409) +} + +func (o *DeleteSchemaConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteSchemaInternalServerError creates a DeleteSchemaInternalServerError with default headers values +func NewDeleteSchemaInternalServerError() *DeleteSchemaInternalServerError { + return &DeleteSchemaInternalServerError{} +} + +/* +DeleteSchemaInternalServerError describes a response with status code 500, with default header values. + +Error deleting schema +*/ +type DeleteSchemaInternalServerError struct { +} + +// IsSuccess returns true when this delete schema internal server error response has a 2xx status code +func (o *DeleteSchemaInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete schema internal server error response has a 3xx status code +func (o *DeleteSchemaInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete schema internal server error response has a 4xx status code +func (o *DeleteSchemaInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete schema internal server error response has a 5xx status code +func (o *DeleteSchemaInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete schema internal server error response a status code equal to that given +func (o *DeleteSchemaInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete schema internal server error response +func (o *DeleteSchemaInternalServerError) Code() int { + return 500 +} + +func (o *DeleteSchemaInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaInternalServerError ", 500) +} + +func (o *DeleteSchemaInternalServerError) String() string { + return fmt.Sprintf("[DELETE /schemas/{schemaName}][%d] deleteSchemaInternalServerError ", 500) +} + +func (o *DeleteSchemaInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/schema/get_schema_parameters.go b/src/client/schema/get_schema_parameters.go new file mode 100644 index 0000000..64d9c62 --- /dev/null +++ b/src/client/schema/get_schema_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSchemaParams creates a new GetSchemaParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSchemaParams() *GetSchemaParams { + return &GetSchemaParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSchemaParamsWithTimeout creates a new GetSchemaParams object +// with the ability to set a timeout on a request. +func NewGetSchemaParamsWithTimeout(timeout time.Duration) *GetSchemaParams { + return &GetSchemaParams{ + timeout: timeout, + } +} + +// NewGetSchemaParamsWithContext creates a new GetSchemaParams object +// with the ability to set a context for a request. +func NewGetSchemaParamsWithContext(ctx context.Context) *GetSchemaParams { + return &GetSchemaParams{ + Context: ctx, + } +} + +// NewGetSchemaParamsWithHTTPClient creates a new GetSchemaParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSchemaParamsWithHTTPClient(client *http.Client) *GetSchemaParams { + return &GetSchemaParams{ + HTTPClient: client, + } +} + +/* +GetSchemaParams contains all the parameters to send to the API endpoint + + for the get schema operation. + + Typically these are written to a http.Request. +*/ +type GetSchemaParams struct { + + /* SchemaName. + + Schema name + */ + SchemaName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSchemaParams) WithDefaults() *GetSchemaParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSchemaParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get schema params +func (o *GetSchemaParams) WithTimeout(timeout time.Duration) *GetSchemaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get schema params +func (o *GetSchemaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get schema params +func (o *GetSchemaParams) WithContext(ctx context.Context) *GetSchemaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get schema params +func (o *GetSchemaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get schema params +func (o *GetSchemaParams) WithHTTPClient(client *http.Client) *GetSchemaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get schema params +func (o *GetSchemaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSchemaName adds the schemaName to the get schema params +func (o *GetSchemaParams) WithSchemaName(schemaName string) *GetSchemaParams { + o.SetSchemaName(schemaName) + return o +} + +// SetSchemaName adds the schemaName to the get schema params +func (o *GetSchemaParams) SetSchemaName(schemaName string) { + o.SchemaName = schemaName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSchemaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param schemaName + if err := r.SetPathParam("schemaName", o.SchemaName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/get_schema_responses.go b/src/client/schema/get_schema_responses.go new file mode 100644 index 0000000..4f7ad95 --- /dev/null +++ b/src/client/schema/get_schema_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSchemaReader is a Reader for the GetSchema structure. +type GetSchemaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSchemaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSchemaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetSchemaNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSchemaInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSchemaOK creates a GetSchemaOK with default headers values +func NewGetSchemaOK() *GetSchemaOK { + return &GetSchemaOK{} +} + +/* +GetSchemaOK describes a response with status code 200, with default header values. + +Success +*/ +type GetSchemaOK struct { +} + +// IsSuccess returns true when this get schema o k response has a 2xx status code +func (o *GetSchemaOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get schema o k response has a 3xx status code +func (o *GetSchemaOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get schema o k response has a 4xx status code +func (o *GetSchemaOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get schema o k response has a 5xx status code +func (o *GetSchemaOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get schema o k response a status code equal to that given +func (o *GetSchemaOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get schema o k response +func (o *GetSchemaOK) Code() int { + return 200 +} + +func (o *GetSchemaOK) Error() string { + return fmt.Sprintf("[GET /schemas/{schemaName}][%d] getSchemaOK ", 200) +} + +func (o *GetSchemaOK) String() string { + return fmt.Sprintf("[GET /schemas/{schemaName}][%d] getSchemaOK ", 200) +} + +func (o *GetSchemaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSchemaNotFound creates a GetSchemaNotFound with default headers values +func NewGetSchemaNotFound() *GetSchemaNotFound { + return &GetSchemaNotFound{} +} + +/* +GetSchemaNotFound describes a response with status code 404, with default header values. + +Schema not found +*/ +type GetSchemaNotFound struct { +} + +// IsSuccess returns true when this get schema not found response has a 2xx status code +func (o *GetSchemaNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get schema not found response has a 3xx status code +func (o *GetSchemaNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get schema not found response has a 4xx status code +func (o *GetSchemaNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get schema not found response has a 5xx status code +func (o *GetSchemaNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get schema not found response a status code equal to that given +func (o *GetSchemaNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get schema not found response +func (o *GetSchemaNotFound) Code() int { + return 404 +} + +func (o *GetSchemaNotFound) Error() string { + return fmt.Sprintf("[GET /schemas/{schemaName}][%d] getSchemaNotFound ", 404) +} + +func (o *GetSchemaNotFound) String() string { + return fmt.Sprintf("[GET /schemas/{schemaName}][%d] getSchemaNotFound ", 404) +} + +func (o *GetSchemaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSchemaInternalServerError creates a GetSchemaInternalServerError with default headers values +func NewGetSchemaInternalServerError() *GetSchemaInternalServerError { + return &GetSchemaInternalServerError{} +} + +/* +GetSchemaInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type GetSchemaInternalServerError struct { +} + +// IsSuccess returns true when this get schema internal server error response has a 2xx status code +func (o *GetSchemaInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get schema internal server error response has a 3xx status code +func (o *GetSchemaInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get schema internal server error response has a 4xx status code +func (o *GetSchemaInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get schema internal server error response has a 5xx status code +func (o *GetSchemaInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get schema internal server error response a status code equal to that given +func (o *GetSchemaInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get schema internal server error response +func (o *GetSchemaInternalServerError) Code() int { + return 500 +} + +func (o *GetSchemaInternalServerError) Error() string { + return fmt.Sprintf("[GET /schemas/{schemaName}][%d] getSchemaInternalServerError ", 500) +} + +func (o *GetSchemaInternalServerError) String() string { + return fmt.Sprintf("[GET /schemas/{schemaName}][%d] getSchemaInternalServerError ", 500) +} + +func (o *GetSchemaInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/schema/get_table_schema_parameters.go b/src/client/schema/get_table_schema_parameters.go new file mode 100644 index 0000000..4cdd074 --- /dev/null +++ b/src/client/schema/get_table_schema_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTableSchemaParams creates a new GetTableSchemaParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableSchemaParams() *GetTableSchemaParams { + return &GetTableSchemaParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableSchemaParamsWithTimeout creates a new GetTableSchemaParams object +// with the ability to set a timeout on a request. +func NewGetTableSchemaParamsWithTimeout(timeout time.Duration) *GetTableSchemaParams { + return &GetTableSchemaParams{ + timeout: timeout, + } +} + +// NewGetTableSchemaParamsWithContext creates a new GetTableSchemaParams object +// with the ability to set a context for a request. +func NewGetTableSchemaParamsWithContext(ctx context.Context) *GetTableSchemaParams { + return &GetTableSchemaParams{ + Context: ctx, + } +} + +// NewGetTableSchemaParamsWithHTTPClient creates a new GetTableSchemaParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableSchemaParamsWithHTTPClient(client *http.Client) *GetTableSchemaParams { + return &GetTableSchemaParams{ + HTTPClient: client, + } +} + +/* +GetTableSchemaParams contains all the parameters to send to the API endpoint + + for the get table schema operation. + + Typically these are written to a http.Request. +*/ +type GetTableSchemaParams struct { + + /* TableName. + + Table name (without type) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableSchemaParams) WithDefaults() *GetTableSchemaParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableSchemaParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table schema params +func (o *GetTableSchemaParams) WithTimeout(timeout time.Duration) *GetTableSchemaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table schema params +func (o *GetTableSchemaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table schema params +func (o *GetTableSchemaParams) WithContext(ctx context.Context) *GetTableSchemaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table schema params +func (o *GetTableSchemaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table schema params +func (o *GetTableSchemaParams) WithHTTPClient(client *http.Client) *GetTableSchemaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table schema params +func (o *GetTableSchemaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table schema params +func (o *GetTableSchemaParams) WithTableName(tableName string) *GetTableSchemaParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table schema params +func (o *GetTableSchemaParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableSchemaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/get_table_schema_responses.go b/src/client/schema/get_table_schema_responses.go new file mode 100644 index 0000000..7ef9c8f --- /dev/null +++ b/src/client/schema/get_table_schema_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableSchemaReader is a Reader for the GetTableSchema structure. +type GetTableSchemaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableSchemaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableSchemaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetTableSchemaNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableSchemaOK creates a GetTableSchemaOK with default headers values +func NewGetTableSchemaOK() *GetTableSchemaOK { + return &GetTableSchemaOK{} +} + +/* +GetTableSchemaOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTableSchemaOK struct { +} + +// IsSuccess returns true when this get table schema o k response has a 2xx status code +func (o *GetTableSchemaOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table schema o k response has a 3xx status code +func (o *GetTableSchemaOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table schema o k response has a 4xx status code +func (o *GetTableSchemaOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table schema o k response has a 5xx status code +func (o *GetTableSchemaOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table schema o k response a status code equal to that given +func (o *GetTableSchemaOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table schema o k response +func (o *GetTableSchemaOK) Code() int { + return 200 +} + +func (o *GetTableSchemaOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/schema][%d] getTableSchemaOK ", 200) +} + +func (o *GetTableSchemaOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/schema][%d] getTableSchemaOK ", 200) +} + +func (o *GetTableSchemaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableSchemaNotFound creates a GetTableSchemaNotFound with default headers values +func NewGetTableSchemaNotFound() *GetTableSchemaNotFound { + return &GetTableSchemaNotFound{} +} + +/* +GetTableSchemaNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetTableSchemaNotFound struct { +} + +// IsSuccess returns true when this get table schema not found response has a 2xx status code +func (o *GetTableSchemaNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table schema not found response has a 3xx status code +func (o *GetTableSchemaNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table schema not found response has a 4xx status code +func (o *GetTableSchemaNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get table schema not found response has a 5xx status code +func (o *GetTableSchemaNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get table schema not found response a status code equal to that given +func (o *GetTableSchemaNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get table schema not found response +func (o *GetTableSchemaNotFound) Code() int { + return 404 +} + +func (o *GetTableSchemaNotFound) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/schema][%d] getTableSchemaNotFound ", 404) +} + +func (o *GetTableSchemaNotFound) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/schema][%d] getTableSchemaNotFound ", 404) +} + +func (o *GetTableSchemaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/schema/list_schema_names_parameters.go b/src/client/schema/list_schema_names_parameters.go new file mode 100644 index 0000000..d7d4bcb --- /dev/null +++ b/src/client/schema/list_schema_names_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSchemaNamesParams creates a new ListSchemaNamesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSchemaNamesParams() *ListSchemaNamesParams { + return &ListSchemaNamesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSchemaNamesParamsWithTimeout creates a new ListSchemaNamesParams object +// with the ability to set a timeout on a request. +func NewListSchemaNamesParamsWithTimeout(timeout time.Duration) *ListSchemaNamesParams { + return &ListSchemaNamesParams{ + timeout: timeout, + } +} + +// NewListSchemaNamesParamsWithContext creates a new ListSchemaNamesParams object +// with the ability to set a context for a request. +func NewListSchemaNamesParamsWithContext(ctx context.Context) *ListSchemaNamesParams { + return &ListSchemaNamesParams{ + Context: ctx, + } +} + +// NewListSchemaNamesParamsWithHTTPClient creates a new ListSchemaNamesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSchemaNamesParamsWithHTTPClient(client *http.Client) *ListSchemaNamesParams { + return &ListSchemaNamesParams{ + HTTPClient: client, + } +} + +/* +ListSchemaNamesParams contains all the parameters to send to the API endpoint + + for the list schema names operation. + + Typically these are written to a http.Request. +*/ +type ListSchemaNamesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list schema names params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSchemaNamesParams) WithDefaults() *ListSchemaNamesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list schema names params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSchemaNamesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list schema names params +func (o *ListSchemaNamesParams) WithTimeout(timeout time.Duration) *ListSchemaNamesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list schema names params +func (o *ListSchemaNamesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list schema names params +func (o *ListSchemaNamesParams) WithContext(ctx context.Context) *ListSchemaNamesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list schema names params +func (o *ListSchemaNamesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list schema names params +func (o *ListSchemaNamesParams) WithHTTPClient(client *http.Client) *ListSchemaNamesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list schema names params +func (o *ListSchemaNamesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSchemaNamesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/list_schema_names_responses.go b/src/client/schema/list_schema_names_responses.go new file mode 100644 index 0000000..34b5750 --- /dev/null +++ b/src/client/schema/list_schema_names_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListSchemaNamesReader is a Reader for the ListSchemaNames structure. +type ListSchemaNamesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSchemaNamesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSchemaNamesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSchemaNamesOK creates a ListSchemaNamesOK with default headers values +func NewListSchemaNamesOK() *ListSchemaNamesOK { + return &ListSchemaNamesOK{} +} + +/* +ListSchemaNamesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListSchemaNamesOK struct { + Payload string +} + +// IsSuccess returns true when this list schema names o k response has a 2xx status code +func (o *ListSchemaNamesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list schema names o k response has a 3xx status code +func (o *ListSchemaNamesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list schema names o k response has a 4xx status code +func (o *ListSchemaNamesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list schema names o k response has a 5xx status code +func (o *ListSchemaNamesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list schema names o k response a status code equal to that given +func (o *ListSchemaNamesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list schema names o k response +func (o *ListSchemaNamesOK) Code() int { + return 200 +} + +func (o *ListSchemaNamesOK) Error() string { + return fmt.Sprintf("[GET /schemas][%d] listSchemaNamesOK %+v", 200, o.Payload) +} + +func (o *ListSchemaNamesOK) String() string { + return fmt.Sprintf("[GET /schemas][%d] listSchemaNamesOK %+v", 200, o.Payload) +} + +func (o *ListSchemaNamesOK) GetPayload() string { + return o.Payload +} + +func (o *ListSchemaNamesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/schema/schema_client.go b/src/client/schema/schema_client.go new file mode 100644 index 0000000..f798a69 --- /dev/null +++ b/src/client/schema/schema_client.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new schema API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for schema API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + AddSchema1(params *AddSchema1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddSchema1OK, error) + + DeleteSchema(params *DeleteSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSchemaOK, error) + + GetSchema(params *GetSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSchemaOK, error) + + GetTableSchema(params *GetTableSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableSchemaOK, error) + + ListSchemaNames(params *ListSchemaNamesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSchemaNamesOK, error) + + UpdateSchema1(params *UpdateSchema1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSchema1OK, error) + + ValidateSchema1(params *ValidateSchema1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateSchema1OK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AddSchema1 adds a new schema + +Adds a new schema +*/ +func (a *Client) AddSchema1(params *AddSchema1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddSchema1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddSchema1Params() + } + op := &runtime.ClientOperation{ + ID: "addSchema_1", + Method: "POST", + PathPattern: "/schemas", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AddSchema1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddSchema1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for addSchema_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteSchema deletes a schema + +Deletes a schema by name +*/ +func (a *Client) DeleteSchema(params *DeleteSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSchemaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSchemaParams() + } + op := &runtime.ClientOperation{ + ID: "deleteSchema", + Method: "DELETE", + PathPattern: "/schemas/{schemaName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteSchemaReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSchemaOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteSchema: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSchema gets a schema + +Gets a schema by name +*/ +func (a *Client) GetSchema(params *GetSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSchemaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSchemaParams() + } + op := &runtime.ClientOperation{ + ID: "getSchema", + Method: "GET", + PathPattern: "/schemas/{schemaName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSchemaReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSchemaOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSchema: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableSchema gets table schema + +Read table schema +*/ +func (a *Client) GetTableSchema(params *GetTableSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableSchemaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableSchemaParams() + } + op := &runtime.ClientOperation{ + ID: "getTableSchema", + Method: "GET", + PathPattern: "/tables/{tableName}/schema", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableSchemaReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableSchemaOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableSchema: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListSchemaNames lists all schema names + +Lists all schema names +*/ +func (a *Client) ListSchemaNames(params *ListSchemaNamesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSchemaNamesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListSchemaNamesParams() + } + op := &runtime.ClientOperation{ + ID: "listSchemaNames", + Method: "GET", + PathPattern: "/schemas", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListSchemaNamesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListSchemaNamesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listSchemaNames: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateSchema1 updates a schema + +Updates a schema +*/ +func (a *Client) UpdateSchema1(params *UpdateSchema1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSchema1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateSchema1Params() + } + op := &runtime.ClientOperation{ + ID: "updateSchema_1", + Method: "PUT", + PathPattern: "/schemas/{schemaName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateSchema1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateSchema1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateSchema_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ValidateSchema1 validates schema + +This API returns the schema that matches the one you get from 'GET /schema/{schemaName}'. This allows us to validate schema before apply. +*/ +func (a *Client) ValidateSchema1(params *ValidateSchema1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateSchema1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateSchema1Params() + } + op := &runtime.ClientOperation{ + ID: "validateSchema_1", + Method: "POST", + PathPattern: "/schemas/validate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateSchema1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ValidateSchema1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for validateSchema_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/schema/update_schema1_parameters.go b/src/client/schema/update_schema1_parameters.go new file mode 100644 index 0000000..17f092c --- /dev/null +++ b/src/client/schema/update_schema1_parameters.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "startree.ai/cli/models" +) + +// NewUpdateSchema1Params creates a new UpdateSchema1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSchema1Params() *UpdateSchema1Params { + return &UpdateSchema1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSchema1ParamsWithTimeout creates a new UpdateSchema1Params object +// with the ability to set a timeout on a request. +func NewUpdateSchema1ParamsWithTimeout(timeout time.Duration) *UpdateSchema1Params { + return &UpdateSchema1Params{ + timeout: timeout, + } +} + +// NewUpdateSchema1ParamsWithContext creates a new UpdateSchema1Params object +// with the ability to set a context for a request. +func NewUpdateSchema1ParamsWithContext(ctx context.Context) *UpdateSchema1Params { + return &UpdateSchema1Params{ + Context: ctx, + } +} + +// NewUpdateSchema1ParamsWithHTTPClient creates a new UpdateSchema1Params object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSchema1ParamsWithHTTPClient(client *http.Client) *UpdateSchema1Params { + return &UpdateSchema1Params{ + HTTPClient: client, + } +} + +/* +UpdateSchema1Params contains all the parameters to send to the API endpoint + + for the update schema 1 operation. + + Typically these are written to a http.Request. +*/ +type UpdateSchema1Params struct { + + // Body. + Body *models.FormDataMultiPart + + /* Reload. + + Whether to reload the table if the new schema is backward compatible + */ + Reload *bool + + /* SchemaName. + + Name of the schema + */ + SchemaName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update schema 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSchema1Params) WithDefaults() *UpdateSchema1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update schema 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSchema1Params) SetDefaults() { + var ( + reloadDefault = bool(false) + ) + + val := UpdateSchema1Params{ + Reload: &reloadDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the update schema 1 params +func (o *UpdateSchema1Params) WithTimeout(timeout time.Duration) *UpdateSchema1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update schema 1 params +func (o *UpdateSchema1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update schema 1 params +func (o *UpdateSchema1Params) WithContext(ctx context.Context) *UpdateSchema1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update schema 1 params +func (o *UpdateSchema1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update schema 1 params +func (o *UpdateSchema1Params) WithHTTPClient(client *http.Client) *UpdateSchema1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update schema 1 params +func (o *UpdateSchema1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update schema 1 params +func (o *UpdateSchema1Params) WithBody(body *models.FormDataMultiPart) *UpdateSchema1Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update schema 1 params +func (o *UpdateSchema1Params) SetBody(body *models.FormDataMultiPart) { + o.Body = body +} + +// WithReload adds the reload to the update schema 1 params +func (o *UpdateSchema1Params) WithReload(reload *bool) *UpdateSchema1Params { + o.SetReload(reload) + return o +} + +// SetReload adds the reload to the update schema 1 params +func (o *UpdateSchema1Params) SetReload(reload *bool) { + o.Reload = reload +} + +// WithSchemaName adds the schemaName to the update schema 1 params +func (o *UpdateSchema1Params) WithSchemaName(schemaName string) *UpdateSchema1Params { + o.SetSchemaName(schemaName) + return o +} + +// SetSchemaName adds the schemaName to the update schema 1 params +func (o *UpdateSchema1Params) SetSchemaName(schemaName string) { + o.SchemaName = schemaName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSchema1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.Reload != nil { + + // query param reload + var qrReload bool + + if o.Reload != nil { + qrReload = *o.Reload + } + qReload := swag.FormatBool(qrReload) + if qReload != "" { + + if err := r.SetQueryParam("reload", qReload); err != nil { + return err + } + } + } + + // path param schemaName + if err := r.SetPathParam("schemaName", o.SchemaName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/update_schema1_responses.go b/src/client/schema/update_schema1_responses.go new file mode 100644 index 0000000..eff265e --- /dev/null +++ b/src/client/schema/update_schema1_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateSchema1Reader is a Reader for the UpdateSchema1 structure. +type UpdateSchema1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSchema1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSchema1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateSchema1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateSchema1NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateSchema1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSchema1OK creates a UpdateSchema1OK with default headers values +func NewUpdateSchema1OK() *UpdateSchema1OK { + return &UpdateSchema1OK{} +} + +/* +UpdateSchema1OK describes a response with status code 200, with default header values. + +Successfully updated schema +*/ +type UpdateSchema1OK struct { +} + +// IsSuccess returns true when this update schema1 o k response has a 2xx status code +func (o *UpdateSchema1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update schema1 o k response has a 3xx status code +func (o *UpdateSchema1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update schema1 o k response has a 4xx status code +func (o *UpdateSchema1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update schema1 o k response has a 5xx status code +func (o *UpdateSchema1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this update schema1 o k response a status code equal to that given +func (o *UpdateSchema1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update schema1 o k response +func (o *UpdateSchema1OK) Code() int { + return 200 +} + +func (o *UpdateSchema1OK) Error() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1OK ", 200) +} + +func (o *UpdateSchema1OK) String() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1OK ", 200) +} + +func (o *UpdateSchema1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateSchema1BadRequest creates a UpdateSchema1BadRequest with default headers values +func NewUpdateSchema1BadRequest() *UpdateSchema1BadRequest { + return &UpdateSchema1BadRequest{} +} + +/* +UpdateSchema1BadRequest describes a response with status code 400, with default header values. + +Missing or invalid request body +*/ +type UpdateSchema1BadRequest struct { +} + +// IsSuccess returns true when this update schema1 bad request response has a 2xx status code +func (o *UpdateSchema1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update schema1 bad request response has a 3xx status code +func (o *UpdateSchema1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update schema1 bad request response has a 4xx status code +func (o *UpdateSchema1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update schema1 bad request response has a 5xx status code +func (o *UpdateSchema1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update schema1 bad request response a status code equal to that given +func (o *UpdateSchema1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update schema1 bad request response +func (o *UpdateSchema1BadRequest) Code() int { + return 400 +} + +func (o *UpdateSchema1BadRequest) Error() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1BadRequest ", 400) +} + +func (o *UpdateSchema1BadRequest) String() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1BadRequest ", 400) +} + +func (o *UpdateSchema1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateSchema1NotFound creates a UpdateSchema1NotFound with default headers values +func NewUpdateSchema1NotFound() *UpdateSchema1NotFound { + return &UpdateSchema1NotFound{} +} + +/* +UpdateSchema1NotFound describes a response with status code 404, with default header values. + +Schema not found +*/ +type UpdateSchema1NotFound struct { +} + +// IsSuccess returns true when this update schema1 not found response has a 2xx status code +func (o *UpdateSchema1NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update schema1 not found response has a 3xx status code +func (o *UpdateSchema1NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update schema1 not found response has a 4xx status code +func (o *UpdateSchema1NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update schema1 not found response has a 5xx status code +func (o *UpdateSchema1NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update schema1 not found response a status code equal to that given +func (o *UpdateSchema1NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update schema1 not found response +func (o *UpdateSchema1NotFound) Code() int { + return 404 +} + +func (o *UpdateSchema1NotFound) Error() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1NotFound ", 404) +} + +func (o *UpdateSchema1NotFound) String() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1NotFound ", 404) +} + +func (o *UpdateSchema1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateSchema1InternalServerError creates a UpdateSchema1InternalServerError with default headers values +func NewUpdateSchema1InternalServerError() *UpdateSchema1InternalServerError { + return &UpdateSchema1InternalServerError{} +} + +/* +UpdateSchema1InternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type UpdateSchema1InternalServerError struct { +} + +// IsSuccess returns true when this update schema1 internal server error response has a 2xx status code +func (o *UpdateSchema1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update schema1 internal server error response has a 3xx status code +func (o *UpdateSchema1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update schema1 internal server error response has a 4xx status code +func (o *UpdateSchema1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update schema1 internal server error response has a 5xx status code +func (o *UpdateSchema1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update schema1 internal server error response a status code equal to that given +func (o *UpdateSchema1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update schema1 internal server error response +func (o *UpdateSchema1InternalServerError) Code() int { + return 500 +} + +func (o *UpdateSchema1InternalServerError) Error() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1InternalServerError ", 500) +} + +func (o *UpdateSchema1InternalServerError) String() string { + return fmt.Sprintf("[PUT /schemas/{schemaName}][%d] updateSchema1InternalServerError ", 500) +} + +func (o *UpdateSchema1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/schema/validate_schema1_parameters.go b/src/client/schema/validate_schema1_parameters.go new file mode 100644 index 0000000..c5f90f2 --- /dev/null +++ b/src/client/schema/validate_schema1_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewValidateSchema1Params creates a new ValidateSchema1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewValidateSchema1Params() *ValidateSchema1Params { + return &ValidateSchema1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateSchema1ParamsWithTimeout creates a new ValidateSchema1Params object +// with the ability to set a timeout on a request. +func NewValidateSchema1ParamsWithTimeout(timeout time.Duration) *ValidateSchema1Params { + return &ValidateSchema1Params{ + timeout: timeout, + } +} + +// NewValidateSchema1ParamsWithContext creates a new ValidateSchema1Params object +// with the ability to set a context for a request. +func NewValidateSchema1ParamsWithContext(ctx context.Context) *ValidateSchema1Params { + return &ValidateSchema1Params{ + Context: ctx, + } +} + +// NewValidateSchema1ParamsWithHTTPClient creates a new ValidateSchema1Params object +// with the ability to set a custom HTTPClient for a request. +func NewValidateSchema1ParamsWithHTTPClient(client *http.Client) *ValidateSchema1Params { + return &ValidateSchema1Params{ + HTTPClient: client, + } +} + +/* +ValidateSchema1Params contains all the parameters to send to the API endpoint + + for the validate schema 1 operation. + + Typically these are written to a http.Request. +*/ +type ValidateSchema1Params struct { + + // Body. + Body string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate schema 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateSchema1Params) WithDefaults() *ValidateSchema1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate schema 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateSchema1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate schema 1 params +func (o *ValidateSchema1Params) WithTimeout(timeout time.Duration) *ValidateSchema1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate schema 1 params +func (o *ValidateSchema1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate schema 1 params +func (o *ValidateSchema1Params) WithContext(ctx context.Context) *ValidateSchema1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate schema 1 params +func (o *ValidateSchema1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate schema 1 params +func (o *ValidateSchema1Params) WithHTTPClient(client *http.Client) *ValidateSchema1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate schema 1 params +func (o *ValidateSchema1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the validate schema 1 params +func (o *ValidateSchema1Params) WithBody(body string) *ValidateSchema1Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the validate schema 1 params +func (o *ValidateSchema1Params) SetBody(body string) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateSchema1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/schema/validate_schema1_responses.go b/src/client/schema/validate_schema1_responses.go new file mode 100644 index 0000000..e8490ac --- /dev/null +++ b/src/client/schema/validate_schema1_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package schema + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ValidateSchema1Reader is a Reader for the ValidateSchema1 structure. +type ValidateSchema1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateSchema1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateSchema1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewValidateSchema1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewValidateSchema1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewValidateSchema1OK creates a ValidateSchema1OK with default headers values +func NewValidateSchema1OK() *ValidateSchema1OK { + return &ValidateSchema1OK{} +} + +/* +ValidateSchema1OK describes a response with status code 200, with default header values. + +Successfully validated schema +*/ +type ValidateSchema1OK struct { +} + +// IsSuccess returns true when this validate schema1 o k response has a 2xx status code +func (o *ValidateSchema1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate schema1 o k response has a 3xx status code +func (o *ValidateSchema1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate schema1 o k response has a 4xx status code +func (o *ValidateSchema1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate schema1 o k response has a 5xx status code +func (o *ValidateSchema1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate schema1 o k response a status code equal to that given +func (o *ValidateSchema1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate schema1 o k response +func (o *ValidateSchema1OK) Code() int { + return 200 +} + +func (o *ValidateSchema1OK) Error() string { + return fmt.Sprintf("[POST /schemas/validate][%d] validateSchema1OK ", 200) +} + +func (o *ValidateSchema1OK) String() string { + return fmt.Sprintf("[POST /schemas/validate][%d] validateSchema1OK ", 200) +} + +func (o *ValidateSchema1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewValidateSchema1BadRequest creates a ValidateSchema1BadRequest with default headers values +func NewValidateSchema1BadRequest() *ValidateSchema1BadRequest { + return &ValidateSchema1BadRequest{} +} + +/* +ValidateSchema1BadRequest describes a response with status code 400, with default header values. + +Missing or invalid request body +*/ +type ValidateSchema1BadRequest struct { +} + +// IsSuccess returns true when this validate schema1 bad request response has a 2xx status code +func (o *ValidateSchema1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate schema1 bad request response has a 3xx status code +func (o *ValidateSchema1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate schema1 bad request response has a 4xx status code +func (o *ValidateSchema1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this validate schema1 bad request response has a 5xx status code +func (o *ValidateSchema1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this validate schema1 bad request response a status code equal to that given +func (o *ValidateSchema1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the validate schema1 bad request response +func (o *ValidateSchema1BadRequest) Code() int { + return 400 +} + +func (o *ValidateSchema1BadRequest) Error() string { + return fmt.Sprintf("[POST /schemas/validate][%d] validateSchema1BadRequest ", 400) +} + +func (o *ValidateSchema1BadRequest) String() string { + return fmt.Sprintf("[POST /schemas/validate][%d] validateSchema1BadRequest ", 400) +} + +func (o *ValidateSchema1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewValidateSchema1InternalServerError creates a ValidateSchema1InternalServerError with default headers values +func NewValidateSchema1InternalServerError() *ValidateSchema1InternalServerError { + return &ValidateSchema1InternalServerError{} +} + +/* +ValidateSchema1InternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type ValidateSchema1InternalServerError struct { +} + +// IsSuccess returns true when this validate schema1 internal server error response has a 2xx status code +func (o *ValidateSchema1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate schema1 internal server error response has a 3xx status code +func (o *ValidateSchema1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate schema1 internal server error response has a 4xx status code +func (o *ValidateSchema1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate schema1 internal server error response has a 5xx status code +func (o *ValidateSchema1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this validate schema1 internal server error response a status code equal to that given +func (o *ValidateSchema1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the validate schema1 internal server error response +func (o *ValidateSchema1InternalServerError) Code() int { + return 500 +} + +func (o *ValidateSchema1InternalServerError) Error() string { + return fmt.Sprintf("[POST /schemas/validate][%d] validateSchema1InternalServerError ", 500) +} + +func (o *ValidateSchema1InternalServerError) String() string { + return fmt.Sprintf("[POST /schemas/validate][%d] validateSchema1InternalServerError ", 500) +} + +func (o *ValidateSchema1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/delete_all_segments_parameters.go b/src/client/segment/delete_all_segments_parameters.go new file mode 100644 index 0000000..0082169 --- /dev/null +++ b/src/client/segment/delete_all_segments_parameters.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteAllSegmentsParams creates a new DeleteAllSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteAllSegmentsParams() *DeleteAllSegmentsParams { + return &DeleteAllSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAllSegmentsParamsWithTimeout creates a new DeleteAllSegmentsParams object +// with the ability to set a timeout on a request. +func NewDeleteAllSegmentsParamsWithTimeout(timeout time.Duration) *DeleteAllSegmentsParams { + return &DeleteAllSegmentsParams{ + timeout: timeout, + } +} + +// NewDeleteAllSegmentsParamsWithContext creates a new DeleteAllSegmentsParams object +// with the ability to set a context for a request. +func NewDeleteAllSegmentsParamsWithContext(ctx context.Context) *DeleteAllSegmentsParams { + return &DeleteAllSegmentsParams{ + Context: ctx, + } +} + +// NewDeleteAllSegmentsParamsWithHTTPClient creates a new DeleteAllSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteAllSegmentsParamsWithHTTPClient(client *http.Client) *DeleteAllSegmentsParams { + return &DeleteAllSegmentsParams{ + HTTPClient: client, + } +} + +/* +DeleteAllSegmentsParams contains all the parameters to send to the API endpoint + + for the delete all segments operation. + + Typically these are written to a http.Request. +*/ +type DeleteAllSegmentsParams struct { + + /* Retention. + + Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention + */ + Retention *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete all segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAllSegmentsParams) WithDefaults() *DeleteAllSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete all segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAllSegmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete all segments params +func (o *DeleteAllSegmentsParams) WithTimeout(timeout time.Duration) *DeleteAllSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete all segments params +func (o *DeleteAllSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete all segments params +func (o *DeleteAllSegmentsParams) WithContext(ctx context.Context) *DeleteAllSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete all segments params +func (o *DeleteAllSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete all segments params +func (o *DeleteAllSegmentsParams) WithHTTPClient(client *http.Client) *DeleteAllSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete all segments params +func (o *DeleteAllSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRetention adds the retention to the delete all segments params +func (o *DeleteAllSegmentsParams) WithRetention(retention *string) *DeleteAllSegmentsParams { + o.SetRetention(retention) + return o +} + +// SetRetention adds the retention to the delete all segments params +func (o *DeleteAllSegmentsParams) SetRetention(retention *string) { + o.Retention = retention +} + +// WithTableName adds the tableName to the delete all segments params +func (o *DeleteAllSegmentsParams) WithTableName(tableName string) *DeleteAllSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the delete all segments params +func (o *DeleteAllSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the delete all segments params +func (o *DeleteAllSegmentsParams) WithType(typeVar string) *DeleteAllSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the delete all segments params +func (o *DeleteAllSegmentsParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAllSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Retention != nil { + + // query param retention + var qrRetention string + + if o.Retention != nil { + qrRetention = *o.Retention + } + qRetention := qrRetention + if qRetention != "" { + + if err := r.SetQueryParam("retention", qRetention); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/delete_all_segments_responses.go b/src/client/segment/delete_all_segments_responses.go new file mode 100644 index 0000000..f727646 --- /dev/null +++ b/src/client/segment/delete_all_segments_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteAllSegmentsReader is a Reader for the DeleteAllSegments structure. +type DeleteAllSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAllSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteAllSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteAllSegmentsOK creates a DeleteAllSegmentsOK with default headers values +func NewDeleteAllSegmentsOK() *DeleteAllSegmentsOK { + return &DeleteAllSegmentsOK{} +} + +/* +DeleteAllSegmentsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteAllSegmentsOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete all segments o k response has a 2xx status code +func (o *DeleteAllSegmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete all segments o k response has a 3xx status code +func (o *DeleteAllSegmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete all segments o k response has a 4xx status code +func (o *DeleteAllSegmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete all segments o k response has a 5xx status code +func (o *DeleteAllSegmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete all segments o k response a status code equal to that given +func (o *DeleteAllSegmentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete all segments o k response +func (o *DeleteAllSegmentsOK) Code() int { + return 200 +} + +func (o *DeleteAllSegmentsOK) Error() string { + return fmt.Sprintf("[DELETE /segments/{tableName}][%d] deleteAllSegmentsOK %+v", 200, o.Payload) +} + +func (o *DeleteAllSegmentsOK) String() string { + return fmt.Sprintf("[DELETE /segments/{tableName}][%d] deleteAllSegmentsOK %+v", 200, o.Payload) +} + +func (o *DeleteAllSegmentsOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteAllSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/delete_segment_parameters.go b/src/client/segment/delete_segment_parameters.go new file mode 100644 index 0000000..a5b9dcc --- /dev/null +++ b/src/client/segment/delete_segment_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSegmentParams creates a new DeleteSegmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSegmentParams() *DeleteSegmentParams { + return &DeleteSegmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSegmentParamsWithTimeout creates a new DeleteSegmentParams object +// with the ability to set a timeout on a request. +func NewDeleteSegmentParamsWithTimeout(timeout time.Duration) *DeleteSegmentParams { + return &DeleteSegmentParams{ + timeout: timeout, + } +} + +// NewDeleteSegmentParamsWithContext creates a new DeleteSegmentParams object +// with the ability to set a context for a request. +func NewDeleteSegmentParamsWithContext(ctx context.Context) *DeleteSegmentParams { + return &DeleteSegmentParams{ + Context: ctx, + } +} + +// NewDeleteSegmentParamsWithHTTPClient creates a new DeleteSegmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSegmentParamsWithHTTPClient(client *http.Client) *DeleteSegmentParams { + return &DeleteSegmentParams{ + HTTPClient: client, + } +} + +/* +DeleteSegmentParams contains all the parameters to send to the API endpoint + + for the delete segment operation. + + Typically these are written to a http.Request. +*/ +type DeleteSegmentParams struct { + + /* Retention. + + Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention + */ + Retention *string + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSegmentParams) WithDefaults() *DeleteSegmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSegmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete segment params +func (o *DeleteSegmentParams) WithTimeout(timeout time.Duration) *DeleteSegmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete segment params +func (o *DeleteSegmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete segment params +func (o *DeleteSegmentParams) WithContext(ctx context.Context) *DeleteSegmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete segment params +func (o *DeleteSegmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete segment params +func (o *DeleteSegmentParams) WithHTTPClient(client *http.Client) *DeleteSegmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete segment params +func (o *DeleteSegmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRetention adds the retention to the delete segment params +func (o *DeleteSegmentParams) WithRetention(retention *string) *DeleteSegmentParams { + o.SetRetention(retention) + return o +} + +// SetRetention adds the retention to the delete segment params +func (o *DeleteSegmentParams) SetRetention(retention *string) { + o.Retention = retention +} + +// WithSegmentName adds the segmentName to the delete segment params +func (o *DeleteSegmentParams) WithSegmentName(segmentName string) *DeleteSegmentParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the delete segment params +func (o *DeleteSegmentParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the delete segment params +func (o *DeleteSegmentParams) WithTableName(tableName string) *DeleteSegmentParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the delete segment params +func (o *DeleteSegmentParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSegmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Retention != nil { + + // query param retention + var qrRetention string + + if o.Retention != nil { + qrRetention = *o.Retention + } + qRetention := qrRetention + if qRetention != "" { + + if err := r.SetQueryParam("retention", qRetention); err != nil { + return err + } + } + } + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/delete_segment_responses.go b/src/client/segment/delete_segment_responses.go new file mode 100644 index 0000000..d47b895 --- /dev/null +++ b/src/client/segment/delete_segment_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteSegmentReader is a Reader for the DeleteSegment structure. +type DeleteSegmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSegmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSegmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSegmentOK creates a DeleteSegmentOK with default headers values +func NewDeleteSegmentOK() *DeleteSegmentOK { + return &DeleteSegmentOK{} +} + +/* +DeleteSegmentOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteSegmentOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete segment o k response has a 2xx status code +func (o *DeleteSegmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete segment o k response has a 3xx status code +func (o *DeleteSegmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete segment o k response has a 4xx status code +func (o *DeleteSegmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete segment o k response has a 5xx status code +func (o *DeleteSegmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete segment o k response a status code equal to that given +func (o *DeleteSegmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete segment o k response +func (o *DeleteSegmentOK) Code() int { + return 200 +} + +func (o *DeleteSegmentOK) Error() string { + return fmt.Sprintf("[DELETE /segments/{tableName}/{segmentName}][%d] deleteSegmentOK %+v", 200, o.Payload) +} + +func (o *DeleteSegmentOK) String() string { + return fmt.Sprintf("[DELETE /segments/{tableName}/{segmentName}][%d] deleteSegmentOK %+v", 200, o.Payload) +} + +func (o *DeleteSegmentOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteSegmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/delete_segments_parameters.go b/src/client/segment/delete_segments_parameters.go new file mode 100644 index 0000000..1d561f4 --- /dev/null +++ b/src/client/segment/delete_segments_parameters.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSegmentsParams creates a new DeleteSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSegmentsParams() *DeleteSegmentsParams { + return &DeleteSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSegmentsParamsWithTimeout creates a new DeleteSegmentsParams object +// with the ability to set a timeout on a request. +func NewDeleteSegmentsParamsWithTimeout(timeout time.Duration) *DeleteSegmentsParams { + return &DeleteSegmentsParams{ + timeout: timeout, + } +} + +// NewDeleteSegmentsParamsWithContext creates a new DeleteSegmentsParams object +// with the ability to set a context for a request. +func NewDeleteSegmentsParamsWithContext(ctx context.Context) *DeleteSegmentsParams { + return &DeleteSegmentsParams{ + Context: ctx, + } +} + +// NewDeleteSegmentsParamsWithHTTPClient creates a new DeleteSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSegmentsParamsWithHTTPClient(client *http.Client) *DeleteSegmentsParams { + return &DeleteSegmentsParams{ + HTTPClient: client, + } +} + +/* +DeleteSegmentsParams contains all the parameters to send to the API endpoint + + for the delete segments operation. + + Typically these are written to a http.Request. +*/ +type DeleteSegmentsParams struct { + + // Body. + Body []string + + /* Retention. + + Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention + */ + Retention *string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSegmentsParams) WithDefaults() *DeleteSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSegmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete segments params +func (o *DeleteSegmentsParams) WithTimeout(timeout time.Duration) *DeleteSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete segments params +func (o *DeleteSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete segments params +func (o *DeleteSegmentsParams) WithContext(ctx context.Context) *DeleteSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete segments params +func (o *DeleteSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete segments params +func (o *DeleteSegmentsParams) WithHTTPClient(client *http.Client) *DeleteSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete segments params +func (o *DeleteSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the delete segments params +func (o *DeleteSegmentsParams) WithBody(body []string) *DeleteSegmentsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the delete segments params +func (o *DeleteSegmentsParams) SetBody(body []string) { + o.Body = body +} + +// WithRetention adds the retention to the delete segments params +func (o *DeleteSegmentsParams) WithRetention(retention *string) *DeleteSegmentsParams { + o.SetRetention(retention) + return o +} + +// SetRetention adds the retention to the delete segments params +func (o *DeleteSegmentsParams) SetRetention(retention *string) { + o.Retention = retention +} + +// WithTableName adds the tableName to the delete segments params +func (o *DeleteSegmentsParams) WithTableName(tableName string) *DeleteSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the delete segments params +func (o *DeleteSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.Retention != nil { + + // query param retention + var qrRetention string + + if o.Retention != nil { + qrRetention = *o.Retention + } + qRetention := qrRetention + if qRetention != "" { + + if err := r.SetQueryParam("retention", qRetention); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/delete_segments_responses.go b/src/client/segment/delete_segments_responses.go new file mode 100644 index 0000000..2ca0005 --- /dev/null +++ b/src/client/segment/delete_segments_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteSegmentsReader is a Reader for the DeleteSegments structure. +type DeleteSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSegmentsOK creates a DeleteSegmentsOK with default headers values +func NewDeleteSegmentsOK() *DeleteSegmentsOK { + return &DeleteSegmentsOK{} +} + +/* +DeleteSegmentsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteSegmentsOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete segments o k response has a 2xx status code +func (o *DeleteSegmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete segments o k response has a 3xx status code +func (o *DeleteSegmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete segments o k response has a 4xx status code +func (o *DeleteSegmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete segments o k response has a 5xx status code +func (o *DeleteSegmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete segments o k response a status code equal to that given +func (o *DeleteSegmentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete segments o k response +func (o *DeleteSegmentsOK) Code() int { + return 200 +} + +func (o *DeleteSegmentsOK) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/delete][%d] deleteSegmentsOK %+v", 200, o.Payload) +} + +func (o *DeleteSegmentsOK) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/delete][%d] deleteSegmentsOK %+v", 200, o.Payload) +} + +func (o *DeleteSegmentsOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/download_segment_parameters.go b/src/client/segment/download_segment_parameters.go new file mode 100644 index 0000000..807640e --- /dev/null +++ b/src/client/segment/download_segment_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDownloadSegmentParams creates a new DownloadSegmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDownloadSegmentParams() *DownloadSegmentParams { + return &DownloadSegmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadSegmentParamsWithTimeout creates a new DownloadSegmentParams object +// with the ability to set a timeout on a request. +func NewDownloadSegmentParamsWithTimeout(timeout time.Duration) *DownloadSegmentParams { + return &DownloadSegmentParams{ + timeout: timeout, + } +} + +// NewDownloadSegmentParamsWithContext creates a new DownloadSegmentParams object +// with the ability to set a context for a request. +func NewDownloadSegmentParamsWithContext(ctx context.Context) *DownloadSegmentParams { + return &DownloadSegmentParams{ + Context: ctx, + } +} + +// NewDownloadSegmentParamsWithHTTPClient creates a new DownloadSegmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDownloadSegmentParamsWithHTTPClient(client *http.Client) *DownloadSegmentParams { + return &DownloadSegmentParams{ + HTTPClient: client, + } +} + +/* +DownloadSegmentParams contains all the parameters to send to the API endpoint + + for the download segment operation. + + Typically these are written to a http.Request. +*/ +type DownloadSegmentParams struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the download segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadSegmentParams) WithDefaults() *DownloadSegmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadSegmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the download segment params +func (o *DownloadSegmentParams) WithTimeout(timeout time.Duration) *DownloadSegmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download segment params +func (o *DownloadSegmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download segment params +func (o *DownloadSegmentParams) WithContext(ctx context.Context) *DownloadSegmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download segment params +func (o *DownloadSegmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download segment params +func (o *DownloadSegmentParams) WithHTTPClient(client *http.Client) *DownloadSegmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download segment params +func (o *DownloadSegmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the download segment params +func (o *DownloadSegmentParams) WithSegmentName(segmentName string) *DownloadSegmentParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the download segment params +func (o *DownloadSegmentParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the download segment params +func (o *DownloadSegmentParams) WithTableName(tableName string) *DownloadSegmentParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the download segment params +func (o *DownloadSegmentParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadSegmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/download_segment_responses.go b/src/client/segment/download_segment_responses.go new file mode 100644 index 0000000..c53a4bb --- /dev/null +++ b/src/client/segment/download_segment_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DownloadSegmentReader is a Reader for the DownloadSegment structure. +type DownloadSegmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadSegmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewDownloadSegmentDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewDownloadSegmentDefault creates a DownloadSegmentDefault with default headers values +func NewDownloadSegmentDefault(code int) *DownloadSegmentDefault { + return &DownloadSegmentDefault{ + _statusCode: code, + } +} + +/* +DownloadSegmentDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type DownloadSegmentDefault struct { + _statusCode int +} + +// IsSuccess returns true when this download segment default response has a 2xx status code +func (o *DownloadSegmentDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this download segment default response has a 3xx status code +func (o *DownloadSegmentDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this download segment default response has a 4xx status code +func (o *DownloadSegmentDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this download segment default response has a 5xx status code +func (o *DownloadSegmentDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this download segment default response a status code equal to that given +func (o *DownloadSegmentDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the download segment default response +func (o *DownloadSegmentDefault) Code() int { + return o._statusCode +} + +func (o *DownloadSegmentDefault) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}][%d] downloadSegment default ", o._statusCode) +} + +func (o *DownloadSegmentDefault) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}][%d] downloadSegment default ", o._statusCode) +} + +func (o *DownloadSegmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/end_replace_segments_parameters.go b/src/client/segment/end_replace_segments_parameters.go new file mode 100644 index 0000000..578fdf5 --- /dev/null +++ b/src/client/segment/end_replace_segments_parameters.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewEndReplaceSegmentsParams creates a new EndReplaceSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewEndReplaceSegmentsParams() *EndReplaceSegmentsParams { + return &EndReplaceSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEndReplaceSegmentsParamsWithTimeout creates a new EndReplaceSegmentsParams object +// with the ability to set a timeout on a request. +func NewEndReplaceSegmentsParamsWithTimeout(timeout time.Duration) *EndReplaceSegmentsParams { + return &EndReplaceSegmentsParams{ + timeout: timeout, + } +} + +// NewEndReplaceSegmentsParamsWithContext creates a new EndReplaceSegmentsParams object +// with the ability to set a context for a request. +func NewEndReplaceSegmentsParamsWithContext(ctx context.Context) *EndReplaceSegmentsParams { + return &EndReplaceSegmentsParams{ + Context: ctx, + } +} + +// NewEndReplaceSegmentsParamsWithHTTPClient creates a new EndReplaceSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewEndReplaceSegmentsParamsWithHTTPClient(client *http.Client) *EndReplaceSegmentsParams { + return &EndReplaceSegmentsParams{ + HTTPClient: client, + } +} + +/* +EndReplaceSegmentsParams contains all the parameters to send to the API endpoint + + for the end replace segments operation. + + Typically these are written to a http.Request. +*/ +type EndReplaceSegmentsParams struct { + + /* SegmentLineageEntryID. + + Segment lineage entry id returned by startReplaceSegments API + */ + SegmentLineageEntryID string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the end replace segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EndReplaceSegmentsParams) WithDefaults() *EndReplaceSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the end replace segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EndReplaceSegmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the end replace segments params +func (o *EndReplaceSegmentsParams) WithTimeout(timeout time.Duration) *EndReplaceSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the end replace segments params +func (o *EndReplaceSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the end replace segments params +func (o *EndReplaceSegmentsParams) WithContext(ctx context.Context) *EndReplaceSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the end replace segments params +func (o *EndReplaceSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the end replace segments params +func (o *EndReplaceSegmentsParams) WithHTTPClient(client *http.Client) *EndReplaceSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the end replace segments params +func (o *EndReplaceSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentLineageEntryID adds the segmentLineageEntryID to the end replace segments params +func (o *EndReplaceSegmentsParams) WithSegmentLineageEntryID(segmentLineageEntryID string) *EndReplaceSegmentsParams { + o.SetSegmentLineageEntryID(segmentLineageEntryID) + return o +} + +// SetSegmentLineageEntryID adds the segmentLineageEntryId to the end replace segments params +func (o *EndReplaceSegmentsParams) SetSegmentLineageEntryID(segmentLineageEntryID string) { + o.SegmentLineageEntryID = segmentLineageEntryID +} + +// WithTableName adds the tableName to the end replace segments params +func (o *EndReplaceSegmentsParams) WithTableName(tableName string) *EndReplaceSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the end replace segments params +func (o *EndReplaceSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the end replace segments params +func (o *EndReplaceSegmentsParams) WithType(typeVar string) *EndReplaceSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the end replace segments params +func (o *EndReplaceSegmentsParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *EndReplaceSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param segmentLineageEntryId + qrSegmentLineageEntryID := o.SegmentLineageEntryID + qSegmentLineageEntryID := qrSegmentLineageEntryID + if qSegmentLineageEntryID != "" { + + if err := r.SetQueryParam("segmentLineageEntryId", qSegmentLineageEntryID); err != nil { + return err + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/end_replace_segments_responses.go b/src/client/segment/end_replace_segments_responses.go new file mode 100644 index 0000000..7441652 --- /dev/null +++ b/src/client/segment/end_replace_segments_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// EndReplaceSegmentsReader is a Reader for the EndReplaceSegments structure. +type EndReplaceSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EndReplaceSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewEndReplaceSegmentsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewEndReplaceSegmentsDefault creates a EndReplaceSegmentsDefault with default headers values +func NewEndReplaceSegmentsDefault(code int) *EndReplaceSegmentsDefault { + return &EndReplaceSegmentsDefault{ + _statusCode: code, + } +} + +/* +EndReplaceSegmentsDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type EndReplaceSegmentsDefault struct { + _statusCode int +} + +// IsSuccess returns true when this end replace segments default response has a 2xx status code +func (o *EndReplaceSegmentsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this end replace segments default response has a 3xx status code +func (o *EndReplaceSegmentsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this end replace segments default response has a 4xx status code +func (o *EndReplaceSegmentsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this end replace segments default response has a 5xx status code +func (o *EndReplaceSegmentsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this end replace segments default response a status code equal to that given +func (o *EndReplaceSegmentsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the end replace segments default response +func (o *EndReplaceSegmentsDefault) Code() int { + return o._statusCode +} + +func (o *EndReplaceSegmentsDefault) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/endReplaceSegments][%d] endReplaceSegments default ", o._statusCode) +} + +func (o *EndReplaceSegmentsDefault) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/endReplaceSegments][%d] endReplaceSegments default ", o._statusCode) +} + +func (o *EndReplaceSegmentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/get_reload_job_status_parameters.go b/src/client/segment/get_reload_job_status_parameters.go new file mode 100644 index 0000000..77d642a --- /dev/null +++ b/src/client/segment/get_reload_job_status_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetReloadJobStatusParams creates a new GetReloadJobStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetReloadJobStatusParams() *GetReloadJobStatusParams { + return &GetReloadJobStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetReloadJobStatusParamsWithTimeout creates a new GetReloadJobStatusParams object +// with the ability to set a timeout on a request. +func NewGetReloadJobStatusParamsWithTimeout(timeout time.Duration) *GetReloadJobStatusParams { + return &GetReloadJobStatusParams{ + timeout: timeout, + } +} + +// NewGetReloadJobStatusParamsWithContext creates a new GetReloadJobStatusParams object +// with the ability to set a context for a request. +func NewGetReloadJobStatusParamsWithContext(ctx context.Context) *GetReloadJobStatusParams { + return &GetReloadJobStatusParams{ + Context: ctx, + } +} + +// NewGetReloadJobStatusParamsWithHTTPClient creates a new GetReloadJobStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetReloadJobStatusParamsWithHTTPClient(client *http.Client) *GetReloadJobStatusParams { + return &GetReloadJobStatusParams{ + HTTPClient: client, + } +} + +/* +GetReloadJobStatusParams contains all the parameters to send to the API endpoint + + for the get reload job status operation. + + Typically these are written to a http.Request. +*/ +type GetReloadJobStatusParams struct { + + /* JobID. + + Reload job id + */ + JobID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get reload job status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetReloadJobStatusParams) WithDefaults() *GetReloadJobStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get reload job status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetReloadJobStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get reload job status params +func (o *GetReloadJobStatusParams) WithTimeout(timeout time.Duration) *GetReloadJobStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get reload job status params +func (o *GetReloadJobStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get reload job status params +func (o *GetReloadJobStatusParams) WithContext(ctx context.Context) *GetReloadJobStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get reload job status params +func (o *GetReloadJobStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get reload job status params +func (o *GetReloadJobStatusParams) WithHTTPClient(client *http.Client) *GetReloadJobStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get reload job status params +func (o *GetReloadJobStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobID adds the jobID to the get reload job status params +func (o *GetReloadJobStatusParams) WithJobID(jobID string) *GetReloadJobStatusParams { + o.SetJobID(jobID) + return o +} + +// SetJobID adds the jobId to the get reload job status params +func (o *GetReloadJobStatusParams) SetJobID(jobID string) { + o.JobID = jobID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetReloadJobStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param jobId + if err := r.SetPathParam("jobId", o.JobID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_reload_job_status_responses.go b/src/client/segment/get_reload_job_status_responses.go new file mode 100644 index 0000000..c971e3b --- /dev/null +++ b/src/client/segment/get_reload_job_status_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetReloadJobStatusReader is a Reader for the GetReloadJobStatus structure. +type GetReloadJobStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetReloadJobStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetReloadJobStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetReloadJobStatusOK creates a GetReloadJobStatusOK with default headers values +func NewGetReloadJobStatusOK() *GetReloadJobStatusOK { + return &GetReloadJobStatusOK{} +} + +/* +GetReloadJobStatusOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetReloadJobStatusOK struct { + Payload *models.ServerReloadControllerJobStatusResponse +} + +// IsSuccess returns true when this get reload job status o k response has a 2xx status code +func (o *GetReloadJobStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get reload job status o k response has a 3xx status code +func (o *GetReloadJobStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get reload job status o k response has a 4xx status code +func (o *GetReloadJobStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get reload job status o k response has a 5xx status code +func (o *GetReloadJobStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get reload job status o k response a status code equal to that given +func (o *GetReloadJobStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get reload job status o k response +func (o *GetReloadJobStatusOK) Code() int { + return 200 +} + +func (o *GetReloadJobStatusOK) Error() string { + return fmt.Sprintf("[GET /segments/segmentReloadStatus/{jobId}][%d] getReloadJobStatusOK %+v", 200, o.Payload) +} + +func (o *GetReloadJobStatusOK) String() string { + return fmt.Sprintf("[GET /segments/segmentReloadStatus/{jobId}][%d] getReloadJobStatusOK %+v", 200, o.Payload) +} + +func (o *GetReloadJobStatusOK) GetPayload() *models.ServerReloadControllerJobStatusResponse { + return o.Payload +} + +func (o *GetReloadJobStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServerReloadControllerJobStatusResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_segment_metadata_deprecated1_parameters.go b/src/client/segment/get_segment_metadata_deprecated1_parameters.go new file mode 100644 index 0000000..29a8b0d --- /dev/null +++ b/src/client/segment/get_segment_metadata_deprecated1_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentMetadataDeprecated1Params creates a new GetSegmentMetadataDeprecated1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentMetadataDeprecated1Params() *GetSegmentMetadataDeprecated1Params { + return &GetSegmentMetadataDeprecated1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentMetadataDeprecated1ParamsWithTimeout creates a new GetSegmentMetadataDeprecated1Params object +// with the ability to set a timeout on a request. +func NewGetSegmentMetadataDeprecated1ParamsWithTimeout(timeout time.Duration) *GetSegmentMetadataDeprecated1Params { + return &GetSegmentMetadataDeprecated1Params{ + timeout: timeout, + } +} + +// NewGetSegmentMetadataDeprecated1ParamsWithContext creates a new GetSegmentMetadataDeprecated1Params object +// with the ability to set a context for a request. +func NewGetSegmentMetadataDeprecated1ParamsWithContext(ctx context.Context) *GetSegmentMetadataDeprecated1Params { + return &GetSegmentMetadataDeprecated1Params{ + Context: ctx, + } +} + +// NewGetSegmentMetadataDeprecated1ParamsWithHTTPClient creates a new GetSegmentMetadataDeprecated1Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentMetadataDeprecated1ParamsWithHTTPClient(client *http.Client) *GetSegmentMetadataDeprecated1Params { + return &GetSegmentMetadataDeprecated1Params{ + HTTPClient: client, + } +} + +/* +GetSegmentMetadataDeprecated1Params contains all the parameters to send to the API endpoint + + for the get segment metadata deprecated1 operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentMetadataDeprecated1Params struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment metadata deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentMetadataDeprecated1Params) WithDefaults() *GetSegmentMetadataDeprecated1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment metadata deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentMetadataDeprecated1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) WithTimeout(timeout time.Duration) *GetSegmentMetadataDeprecated1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) WithContext(ctx context.Context) *GetSegmentMetadataDeprecated1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) WithHTTPClient(client *http.Client) *GetSegmentMetadataDeprecated1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) WithSegmentName(segmentName string) *GetSegmentMetadataDeprecated1Params { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) WithTableName(tableName string) *GetSegmentMetadataDeprecated1Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) WithType(typeVar *string) *GetSegmentMetadataDeprecated1Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get segment metadata deprecated1 params +func (o *GetSegmentMetadataDeprecated1Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentMetadataDeprecated1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_segment_metadata_deprecated1_responses.go b/src/client/segment/get_segment_metadata_deprecated1_responses.go new file mode 100644 index 0000000..bcb1960 --- /dev/null +++ b/src/client/segment/get_segment_metadata_deprecated1_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentMetadataDeprecated1Reader is a Reader for the GetSegmentMetadataDeprecated1 structure. +type GetSegmentMetadataDeprecated1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentMetadataDeprecated1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentMetadataDeprecated1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentMetadataDeprecated1OK creates a GetSegmentMetadataDeprecated1OK with default headers values +func NewGetSegmentMetadataDeprecated1OK() *GetSegmentMetadataDeprecated1OK { + return &GetSegmentMetadataDeprecated1OK{} +} + +/* +GetSegmentMetadataDeprecated1OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSegmentMetadataDeprecated1OK struct { + Payload [][]map[string]interface{} +} + +// IsSuccess returns true when this get segment metadata deprecated1 o k response has a 2xx status code +func (o *GetSegmentMetadataDeprecated1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment metadata deprecated1 o k response has a 3xx status code +func (o *GetSegmentMetadataDeprecated1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment metadata deprecated1 o k response has a 4xx status code +func (o *GetSegmentMetadataDeprecated1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment metadata deprecated1 o k response has a 5xx status code +func (o *GetSegmentMetadataDeprecated1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment metadata deprecated1 o k response a status code equal to that given +func (o *GetSegmentMetadataDeprecated1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment metadata deprecated1 o k response +func (o *GetSegmentMetadataDeprecated1OK) Code() int { + return 200 +} + +func (o *GetSegmentMetadataDeprecated1OK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/{segmentName}/metadata][%d] getSegmentMetadataDeprecated1OK %+v", 200, o.Payload) +} + +func (o *GetSegmentMetadataDeprecated1OK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/{segmentName}/metadata][%d] getSegmentMetadataDeprecated1OK %+v", 200, o.Payload) +} + +func (o *GetSegmentMetadataDeprecated1OK) GetPayload() [][]map[string]interface{} { + return o.Payload +} + +func (o *GetSegmentMetadataDeprecated1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_segment_metadata_deprecated2_parameters.go b/src/client/segment/get_segment_metadata_deprecated2_parameters.go new file mode 100644 index 0000000..66841c8 --- /dev/null +++ b/src/client/segment/get_segment_metadata_deprecated2_parameters.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentMetadataDeprecated2Params creates a new GetSegmentMetadataDeprecated2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentMetadataDeprecated2Params() *GetSegmentMetadataDeprecated2Params { + return &GetSegmentMetadataDeprecated2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentMetadataDeprecated2ParamsWithTimeout creates a new GetSegmentMetadataDeprecated2Params object +// with the ability to set a timeout on a request. +func NewGetSegmentMetadataDeprecated2ParamsWithTimeout(timeout time.Duration) *GetSegmentMetadataDeprecated2Params { + return &GetSegmentMetadataDeprecated2Params{ + timeout: timeout, + } +} + +// NewGetSegmentMetadataDeprecated2ParamsWithContext creates a new GetSegmentMetadataDeprecated2Params object +// with the ability to set a context for a request. +func NewGetSegmentMetadataDeprecated2ParamsWithContext(ctx context.Context) *GetSegmentMetadataDeprecated2Params { + return &GetSegmentMetadataDeprecated2Params{ + Context: ctx, + } +} + +// NewGetSegmentMetadataDeprecated2ParamsWithHTTPClient creates a new GetSegmentMetadataDeprecated2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentMetadataDeprecated2ParamsWithHTTPClient(client *http.Client) *GetSegmentMetadataDeprecated2Params { + return &GetSegmentMetadataDeprecated2Params{ + HTTPClient: client, + } +} + +/* +GetSegmentMetadataDeprecated2Params contains all the parameters to send to the API endpoint + + for the get segment metadata deprecated2 operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentMetadataDeprecated2Params struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* State. + + MUST be null + */ + State *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment metadata deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentMetadataDeprecated2Params) WithDefaults() *GetSegmentMetadataDeprecated2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment metadata deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentMetadataDeprecated2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithTimeout(timeout time.Duration) *GetSegmentMetadataDeprecated2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithContext(ctx context.Context) *GetSegmentMetadataDeprecated2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithHTTPClient(client *http.Client) *GetSegmentMetadataDeprecated2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithSegmentName(segmentName string) *GetSegmentMetadataDeprecated2Params { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithState adds the state to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithState(state *string) *GetSegmentMetadataDeprecated2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetState(state *string) { + o.State = state +} + +// WithTableName adds the tableName to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithTableName(tableName string) *GetSegmentMetadataDeprecated2Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) WithType(typeVar *string) *GetSegmentMetadataDeprecated2Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get segment metadata deprecated2 params +func (o *GetSegmentMetadataDeprecated2Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentMetadataDeprecated2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_segment_metadata_deprecated2_responses.go b/src/client/segment/get_segment_metadata_deprecated2_responses.go new file mode 100644 index 0000000..797670c --- /dev/null +++ b/src/client/segment/get_segment_metadata_deprecated2_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentMetadataDeprecated2Reader is a Reader for the GetSegmentMetadataDeprecated2 structure. +type GetSegmentMetadataDeprecated2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentMetadataDeprecated2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentMetadataDeprecated2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentMetadataDeprecated2OK creates a GetSegmentMetadataDeprecated2OK with default headers values +func NewGetSegmentMetadataDeprecated2OK() *GetSegmentMetadataDeprecated2OK { + return &GetSegmentMetadataDeprecated2OK{} +} + +/* +GetSegmentMetadataDeprecated2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSegmentMetadataDeprecated2OK struct { + Payload [][]map[string]interface{} +} + +// IsSuccess returns true when this get segment metadata deprecated2 o k response has a 2xx status code +func (o *GetSegmentMetadataDeprecated2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment metadata deprecated2 o k response has a 3xx status code +func (o *GetSegmentMetadataDeprecated2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment metadata deprecated2 o k response has a 4xx status code +func (o *GetSegmentMetadataDeprecated2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment metadata deprecated2 o k response has a 5xx status code +func (o *GetSegmentMetadataDeprecated2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment metadata deprecated2 o k response a status code equal to that given +func (o *GetSegmentMetadataDeprecated2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment metadata deprecated2 o k response +func (o *GetSegmentMetadataDeprecated2OK) Code() int { + return 200 +} + +func (o *GetSegmentMetadataDeprecated2OK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/{segmentName}][%d] getSegmentMetadataDeprecated2OK %+v", 200, o.Payload) +} + +func (o *GetSegmentMetadataDeprecated2OK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/{segmentName}][%d] getSegmentMetadataDeprecated2OK %+v", 200, o.Payload) +} + +func (o *GetSegmentMetadataDeprecated2OK) GetPayload() [][]map[string]interface{} { + return o.Payload +} + +func (o *GetSegmentMetadataDeprecated2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_segment_metadata_parameters.go b/src/client/segment/get_segment_metadata_parameters.go new file mode 100644 index 0000000..f690761 --- /dev/null +++ b/src/client/segment/get_segment_metadata_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetSegmentMetadataParams creates a new GetSegmentMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentMetadataParams() *GetSegmentMetadataParams { + return &GetSegmentMetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentMetadataParamsWithTimeout creates a new GetSegmentMetadataParams object +// with the ability to set a timeout on a request. +func NewGetSegmentMetadataParamsWithTimeout(timeout time.Duration) *GetSegmentMetadataParams { + return &GetSegmentMetadataParams{ + timeout: timeout, + } +} + +// NewGetSegmentMetadataParamsWithContext creates a new GetSegmentMetadataParams object +// with the ability to set a context for a request. +func NewGetSegmentMetadataParamsWithContext(ctx context.Context) *GetSegmentMetadataParams { + return &GetSegmentMetadataParams{ + Context: ctx, + } +} + +// NewGetSegmentMetadataParamsWithHTTPClient creates a new GetSegmentMetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentMetadataParamsWithHTTPClient(client *http.Client) *GetSegmentMetadataParams { + return &GetSegmentMetadataParams{ + HTTPClient: client, + } +} + +/* +GetSegmentMetadataParams contains all the parameters to send to the API endpoint + + for the get segment metadata operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentMetadataParams struct { + + /* Columns. + + Columns name + */ + Columns []string + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentMetadataParams) WithDefaults() *GetSegmentMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment metadata params +func (o *GetSegmentMetadataParams) WithTimeout(timeout time.Duration) *GetSegmentMetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment metadata params +func (o *GetSegmentMetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment metadata params +func (o *GetSegmentMetadataParams) WithContext(ctx context.Context) *GetSegmentMetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment metadata params +func (o *GetSegmentMetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment metadata params +func (o *GetSegmentMetadataParams) WithHTTPClient(client *http.Client) *GetSegmentMetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment metadata params +func (o *GetSegmentMetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColumns adds the columns to the get segment metadata params +func (o *GetSegmentMetadataParams) WithColumns(columns []string) *GetSegmentMetadataParams { + o.SetColumns(columns) + return o +} + +// SetColumns adds the columns to the get segment metadata params +func (o *GetSegmentMetadataParams) SetColumns(columns []string) { + o.Columns = columns +} + +// WithSegmentName adds the segmentName to the get segment metadata params +func (o *GetSegmentMetadataParams) WithSegmentName(segmentName string) *GetSegmentMetadataParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the get segment metadata params +func (o *GetSegmentMetadataParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the get segment metadata params +func (o *GetSegmentMetadataParams) WithTableName(tableName string) *GetSegmentMetadataParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment metadata params +func (o *GetSegmentMetadataParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Columns != nil { + + // binding items for columns + joinedColumns := o.bindParamColumns(reg) + + // query array param columns + if err := r.SetQueryParam("columns", joinedColumns...); err != nil { + return err + } + } + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetSegmentMetadata binds the parameter columns +func (o *GetSegmentMetadataParams) bindParamColumns(formats strfmt.Registry) []string { + columnsIR := o.Columns + + var columnsIC []string + for _, columnsIIR := range columnsIR { // explode []string + + columnsIIV := columnsIIR // string as string + columnsIC = append(columnsIC, columnsIIV) + } + + // items.CollectionFormat: "multi" + columnsIS := swag.JoinByFormat(columnsIC, "multi") + + return columnsIS +} diff --git a/src/client/segment/get_segment_metadata_responses.go b/src/client/segment/get_segment_metadata_responses.go new file mode 100644 index 0000000..790dc2d --- /dev/null +++ b/src/client/segment/get_segment_metadata_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentMetadataReader is a Reader for the GetSegmentMetadata structure. +type GetSegmentMetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentMetadataOK creates a GetSegmentMetadataOK with default headers values +func NewGetSegmentMetadataOK() *GetSegmentMetadataOK { + return &GetSegmentMetadataOK{} +} + +/* +GetSegmentMetadataOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSegmentMetadataOK struct { + Payload map[string]interface{} +} + +// IsSuccess returns true when this get segment metadata o k response has a 2xx status code +func (o *GetSegmentMetadataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment metadata o k response has a 3xx status code +func (o *GetSegmentMetadataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment metadata o k response has a 4xx status code +func (o *GetSegmentMetadataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment metadata o k response has a 5xx status code +func (o *GetSegmentMetadataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment metadata o k response a status code equal to that given +func (o *GetSegmentMetadataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment metadata o k response +func (o *GetSegmentMetadataOK) Code() int { + return 200 +} + +func (o *GetSegmentMetadataOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/metadata][%d] getSegmentMetadataOK %+v", 200, o.Payload) +} + +func (o *GetSegmentMetadataOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/metadata][%d] getSegmentMetadataOK %+v", 200, o.Payload) +} + +func (o *GetSegmentMetadataOK) GetPayload() map[string]interface{} { + return o.Payload +} + +func (o *GetSegmentMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_segment_tiers_parameters.go b/src/client/segment/get_segment_tiers_parameters.go new file mode 100644 index 0000000..34d19f5 --- /dev/null +++ b/src/client/segment/get_segment_tiers_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentTiersParams creates a new GetSegmentTiersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentTiersParams() *GetSegmentTiersParams { + return &GetSegmentTiersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentTiersParamsWithTimeout creates a new GetSegmentTiersParams object +// with the ability to set a timeout on a request. +func NewGetSegmentTiersParamsWithTimeout(timeout time.Duration) *GetSegmentTiersParams { + return &GetSegmentTiersParams{ + timeout: timeout, + } +} + +// NewGetSegmentTiersParamsWithContext creates a new GetSegmentTiersParams object +// with the ability to set a context for a request. +func NewGetSegmentTiersParamsWithContext(ctx context.Context) *GetSegmentTiersParams { + return &GetSegmentTiersParams{ + Context: ctx, + } +} + +// NewGetSegmentTiersParamsWithHTTPClient creates a new GetSegmentTiersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentTiersParamsWithHTTPClient(client *http.Client) *GetSegmentTiersParams { + return &GetSegmentTiersParams{ + HTTPClient: client, + } +} + +/* +GetSegmentTiersParams contains all the parameters to send to the API endpoint + + for the get segment tiers operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentTiersParams struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment tiers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentTiersParams) WithDefaults() *GetSegmentTiersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment tiers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentTiersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment tiers params +func (o *GetSegmentTiersParams) WithTimeout(timeout time.Duration) *GetSegmentTiersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment tiers params +func (o *GetSegmentTiersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment tiers params +func (o *GetSegmentTiersParams) WithContext(ctx context.Context) *GetSegmentTiersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment tiers params +func (o *GetSegmentTiersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment tiers params +func (o *GetSegmentTiersParams) WithHTTPClient(client *http.Client) *GetSegmentTiersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment tiers params +func (o *GetSegmentTiersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the get segment tiers params +func (o *GetSegmentTiersParams) WithSegmentName(segmentName string) *GetSegmentTiersParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the get segment tiers params +func (o *GetSegmentTiersParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the get segment tiers params +func (o *GetSegmentTiersParams) WithTableName(tableName string) *GetSegmentTiersParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment tiers params +func (o *GetSegmentTiersParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get segment tiers params +func (o *GetSegmentTiersParams) WithType(typeVar string) *GetSegmentTiersParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get segment tiers params +func (o *GetSegmentTiersParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentTiersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_segment_tiers_responses.go b/src/client/segment/get_segment_tiers_responses.go new file mode 100644 index 0000000..d521b10 --- /dev/null +++ b/src/client/segment/get_segment_tiers_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentTiersReader is a Reader for the GetSegmentTiers structure. +type GetSegmentTiersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentTiersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentTiersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetSegmentTiersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSegmentTiersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentTiersOK creates a GetSegmentTiersOK with default headers values +func NewGetSegmentTiersOK() *GetSegmentTiersOK { + return &GetSegmentTiersOK{} +} + +/* +GetSegmentTiersOK describes a response with status code 200, with default header values. + +Success +*/ +type GetSegmentTiersOK struct { +} + +// IsSuccess returns true when this get segment tiers o k response has a 2xx status code +func (o *GetSegmentTiersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment tiers o k response has a 3xx status code +func (o *GetSegmentTiersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment tiers o k response has a 4xx status code +func (o *GetSegmentTiersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment tiers o k response has a 5xx status code +func (o *GetSegmentTiersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment tiers o k response a status code equal to that given +func (o *GetSegmentTiersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment tiers o k response +func (o *GetSegmentTiersOK) Code() int { + return 200 +} + +func (o *GetSegmentTiersOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/tiers][%d] getSegmentTiersOK ", 200) +} + +func (o *GetSegmentTiersOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/tiers][%d] getSegmentTiersOK ", 200) +} + +func (o *GetSegmentTiersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSegmentTiersNotFound creates a GetSegmentTiersNotFound with default headers values +func NewGetSegmentTiersNotFound() *GetSegmentTiersNotFound { + return &GetSegmentTiersNotFound{} +} + +/* +GetSegmentTiersNotFound describes a response with status code 404, with default header values. + +Table or segment not found +*/ +type GetSegmentTiersNotFound struct { +} + +// IsSuccess returns true when this get segment tiers not found response has a 2xx status code +func (o *GetSegmentTiersNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get segment tiers not found response has a 3xx status code +func (o *GetSegmentTiersNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment tiers not found response has a 4xx status code +func (o *GetSegmentTiersNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get segment tiers not found response has a 5xx status code +func (o *GetSegmentTiersNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment tiers not found response a status code equal to that given +func (o *GetSegmentTiersNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get segment tiers not found response +func (o *GetSegmentTiersNotFound) Code() int { + return 404 +} + +func (o *GetSegmentTiersNotFound) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/tiers][%d] getSegmentTiersNotFound ", 404) +} + +func (o *GetSegmentTiersNotFound) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/tiers][%d] getSegmentTiersNotFound ", 404) +} + +func (o *GetSegmentTiersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSegmentTiersInternalServerError creates a GetSegmentTiersInternalServerError with default headers values +func NewGetSegmentTiersInternalServerError() *GetSegmentTiersInternalServerError { + return &GetSegmentTiersInternalServerError{} +} + +/* +GetSegmentTiersInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetSegmentTiersInternalServerError struct { +} + +// IsSuccess returns true when this get segment tiers internal server error response has a 2xx status code +func (o *GetSegmentTiersInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get segment tiers internal server error response has a 3xx status code +func (o *GetSegmentTiersInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment tiers internal server error response has a 4xx status code +func (o *GetSegmentTiersInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment tiers internal server error response has a 5xx status code +func (o *GetSegmentTiersInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get segment tiers internal server error response a status code equal to that given +func (o *GetSegmentTiersInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get segment tiers internal server error response +func (o *GetSegmentTiersInternalServerError) Code() int { + return 500 +} + +func (o *GetSegmentTiersInternalServerError) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/tiers][%d] getSegmentTiersInternalServerError ", 500) +} + +func (o *GetSegmentTiersInternalServerError) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/{segmentName}/tiers][%d] getSegmentTiersInternalServerError ", 500) +} + +func (o *GetSegmentTiersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/get_segment_to_crc_map_deprecated_parameters.go b/src/client/segment/get_segment_to_crc_map_deprecated_parameters.go new file mode 100644 index 0000000..2c32ebf --- /dev/null +++ b/src/client/segment/get_segment_to_crc_map_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentToCrcMapDeprecatedParams creates a new GetSegmentToCrcMapDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentToCrcMapDeprecatedParams() *GetSegmentToCrcMapDeprecatedParams { + return &GetSegmentToCrcMapDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentToCrcMapDeprecatedParamsWithTimeout creates a new GetSegmentToCrcMapDeprecatedParams object +// with the ability to set a timeout on a request. +func NewGetSegmentToCrcMapDeprecatedParamsWithTimeout(timeout time.Duration) *GetSegmentToCrcMapDeprecatedParams { + return &GetSegmentToCrcMapDeprecatedParams{ + timeout: timeout, + } +} + +// NewGetSegmentToCrcMapDeprecatedParamsWithContext creates a new GetSegmentToCrcMapDeprecatedParams object +// with the ability to set a context for a request. +func NewGetSegmentToCrcMapDeprecatedParamsWithContext(ctx context.Context) *GetSegmentToCrcMapDeprecatedParams { + return &GetSegmentToCrcMapDeprecatedParams{ + Context: ctx, + } +} + +// NewGetSegmentToCrcMapDeprecatedParamsWithHTTPClient creates a new GetSegmentToCrcMapDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentToCrcMapDeprecatedParamsWithHTTPClient(client *http.Client) *GetSegmentToCrcMapDeprecatedParams { + return &GetSegmentToCrcMapDeprecatedParams{ + HTTPClient: client, + } +} + +/* +GetSegmentToCrcMapDeprecatedParams contains all the parameters to send to the API endpoint + + for the get segment to crc map deprecated operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentToCrcMapDeprecatedParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment to crc map deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentToCrcMapDeprecatedParams) WithDefaults() *GetSegmentToCrcMapDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment to crc map deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentToCrcMapDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) WithTimeout(timeout time.Duration) *GetSegmentToCrcMapDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) WithContext(ctx context.Context) *GetSegmentToCrcMapDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) WithHTTPClient(client *http.Client) *GetSegmentToCrcMapDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) WithTableName(tableName string) *GetSegmentToCrcMapDeprecatedParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment to crc map deprecated params +func (o *GetSegmentToCrcMapDeprecatedParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentToCrcMapDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_segment_to_crc_map_deprecated_responses.go b/src/client/segment/get_segment_to_crc_map_deprecated_responses.go new file mode 100644 index 0000000..d52d764 --- /dev/null +++ b/src/client/segment/get_segment_to_crc_map_deprecated_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentToCrcMapDeprecatedReader is a Reader for the GetSegmentToCrcMapDeprecated structure. +type GetSegmentToCrcMapDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentToCrcMapDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentToCrcMapDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentToCrcMapDeprecatedOK creates a GetSegmentToCrcMapDeprecatedOK with default headers values +func NewGetSegmentToCrcMapDeprecatedOK() *GetSegmentToCrcMapDeprecatedOK { + return &GetSegmentToCrcMapDeprecatedOK{} +} + +/* +GetSegmentToCrcMapDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSegmentToCrcMapDeprecatedOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get segment to crc map deprecated o k response has a 2xx status code +func (o *GetSegmentToCrcMapDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment to crc map deprecated o k response has a 3xx status code +func (o *GetSegmentToCrcMapDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment to crc map deprecated o k response has a 4xx status code +func (o *GetSegmentToCrcMapDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment to crc map deprecated o k response has a 5xx status code +func (o *GetSegmentToCrcMapDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment to crc map deprecated o k response a status code equal to that given +func (o *GetSegmentToCrcMapDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment to crc map deprecated o k response +func (o *GetSegmentToCrcMapDeprecatedOK) Code() int { + return 200 +} + +func (o *GetSegmentToCrcMapDeprecatedOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/crc][%d] getSegmentToCrcMapDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetSegmentToCrcMapDeprecatedOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/crc][%d] getSegmentToCrcMapDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetSegmentToCrcMapDeprecatedOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetSegmentToCrcMapDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_segment_to_crc_map_parameters.go b/src/client/segment/get_segment_to_crc_map_parameters.go new file mode 100644 index 0000000..0999270 --- /dev/null +++ b/src/client/segment/get_segment_to_crc_map_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentToCrcMapParams creates a new GetSegmentToCrcMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentToCrcMapParams() *GetSegmentToCrcMapParams { + return &GetSegmentToCrcMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentToCrcMapParamsWithTimeout creates a new GetSegmentToCrcMapParams object +// with the ability to set a timeout on a request. +func NewGetSegmentToCrcMapParamsWithTimeout(timeout time.Duration) *GetSegmentToCrcMapParams { + return &GetSegmentToCrcMapParams{ + timeout: timeout, + } +} + +// NewGetSegmentToCrcMapParamsWithContext creates a new GetSegmentToCrcMapParams object +// with the ability to set a context for a request. +func NewGetSegmentToCrcMapParamsWithContext(ctx context.Context) *GetSegmentToCrcMapParams { + return &GetSegmentToCrcMapParams{ + Context: ctx, + } +} + +// NewGetSegmentToCrcMapParamsWithHTTPClient creates a new GetSegmentToCrcMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentToCrcMapParamsWithHTTPClient(client *http.Client) *GetSegmentToCrcMapParams { + return &GetSegmentToCrcMapParams{ + HTTPClient: client, + } +} + +/* +GetSegmentToCrcMapParams contains all the parameters to send to the API endpoint + + for the get segment to crc map operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentToCrcMapParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segment to crc map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentToCrcMapParams) WithDefaults() *GetSegmentToCrcMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segment to crc map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentToCrcMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) WithTimeout(timeout time.Duration) *GetSegmentToCrcMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) WithContext(ctx context.Context) *GetSegmentToCrcMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) WithHTTPClient(client *http.Client) *GetSegmentToCrcMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) WithTableName(tableName string) *GetSegmentToCrcMapParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segment to crc map params +func (o *GetSegmentToCrcMapParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentToCrcMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_segment_to_crc_map_responses.go b/src/client/segment/get_segment_to_crc_map_responses.go new file mode 100644 index 0000000..249c057 --- /dev/null +++ b/src/client/segment/get_segment_to_crc_map_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentToCrcMapReader is a Reader for the GetSegmentToCrcMap structure. +type GetSegmentToCrcMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentToCrcMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentToCrcMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentToCrcMapOK creates a GetSegmentToCrcMapOK with default headers values +func NewGetSegmentToCrcMapOK() *GetSegmentToCrcMapOK { + return &GetSegmentToCrcMapOK{} +} + +/* +GetSegmentToCrcMapOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSegmentToCrcMapOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get segment to crc map o k response has a 2xx status code +func (o *GetSegmentToCrcMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segment to crc map o k response has a 3xx status code +func (o *GetSegmentToCrcMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segment to crc map o k response has a 4xx status code +func (o *GetSegmentToCrcMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segment to crc map o k response has a 5xx status code +func (o *GetSegmentToCrcMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segment to crc map o k response a status code equal to that given +func (o *GetSegmentToCrcMapOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segment to crc map o k response +func (o *GetSegmentToCrcMapOK) Code() int { + return 200 +} + +func (o *GetSegmentToCrcMapOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/crc][%d] getSegmentToCrcMapOK %+v", 200, o.Payload) +} + +func (o *GetSegmentToCrcMapOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/crc][%d] getSegmentToCrcMapOK %+v", 200, o.Payload) +} + +func (o *GetSegmentToCrcMapOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetSegmentToCrcMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_segments_parameters.go b/src/client/segment/get_segments_parameters.go new file mode 100644 index 0000000..870a5d4 --- /dev/null +++ b/src/client/segment/get_segments_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSegmentsParams creates a new GetSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSegmentsParams() *GetSegmentsParams { + return &GetSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSegmentsParamsWithTimeout creates a new GetSegmentsParams object +// with the ability to set a timeout on a request. +func NewGetSegmentsParamsWithTimeout(timeout time.Duration) *GetSegmentsParams { + return &GetSegmentsParams{ + timeout: timeout, + } +} + +// NewGetSegmentsParamsWithContext creates a new GetSegmentsParams object +// with the ability to set a context for a request. +func NewGetSegmentsParamsWithContext(ctx context.Context) *GetSegmentsParams { + return &GetSegmentsParams{ + Context: ctx, + } +} + +// NewGetSegmentsParamsWithHTTPClient creates a new GetSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSegmentsParamsWithHTTPClient(client *http.Client) *GetSegmentsParams { + return &GetSegmentsParams{ + HTTPClient: client, + } +} + +/* +GetSegmentsParams contains all the parameters to send to the API endpoint + + for the get segments operation. + + Typically these are written to a http.Request. +*/ +type GetSegmentsParams struct { + + /* ExcludeReplacedSegments. + + Whether to exclude replaced segments in the response, which have been replaced specified in the segment lineage entries and cannot be queried from the table + */ + ExcludeReplacedSegments *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentsParams) WithDefaults() *GetSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSegmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get segments params +func (o *GetSegmentsParams) WithTimeout(timeout time.Duration) *GetSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get segments params +func (o *GetSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get segments params +func (o *GetSegmentsParams) WithContext(ctx context.Context) *GetSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get segments params +func (o *GetSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get segments params +func (o *GetSegmentsParams) WithHTTPClient(client *http.Client) *GetSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get segments params +func (o *GetSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExcludeReplacedSegments adds the excludeReplacedSegments to the get segments params +func (o *GetSegmentsParams) WithExcludeReplacedSegments(excludeReplacedSegments *string) *GetSegmentsParams { + o.SetExcludeReplacedSegments(excludeReplacedSegments) + return o +} + +// SetExcludeReplacedSegments adds the excludeReplacedSegments to the get segments params +func (o *GetSegmentsParams) SetExcludeReplacedSegments(excludeReplacedSegments *string) { + o.ExcludeReplacedSegments = excludeReplacedSegments +} + +// WithTableName adds the tableName to the get segments params +func (o *GetSegmentsParams) WithTableName(tableName string) *GetSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get segments params +func (o *GetSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get segments params +func (o *GetSegmentsParams) WithType(typeVar *string) *GetSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get segments params +func (o *GetSegmentsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ExcludeReplacedSegments != nil { + + // query param excludeReplacedSegments + var qrExcludeReplacedSegments string + + if o.ExcludeReplacedSegments != nil { + qrExcludeReplacedSegments = *o.ExcludeReplacedSegments + } + qExcludeReplacedSegments := qrExcludeReplacedSegments + if qExcludeReplacedSegments != "" { + + if err := r.SetQueryParam("excludeReplacedSegments", qExcludeReplacedSegments); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_segments_responses.go b/src/client/segment/get_segments_responses.go new file mode 100644 index 0000000..937bc22 --- /dev/null +++ b/src/client/segment/get_segments_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSegmentsReader is a Reader for the GetSegments structure. +type GetSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSegmentsOK creates a GetSegmentsOK with default headers values +func NewGetSegmentsOK() *GetSegmentsOK { + return &GetSegmentsOK{} +} + +/* +GetSegmentsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSegmentsOK struct { + Payload []map[string][]string +} + +// IsSuccess returns true when this get segments o k response has a 2xx status code +func (o *GetSegmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get segments o k response has a 3xx status code +func (o *GetSegmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get segments o k response has a 4xx status code +func (o *GetSegmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get segments o k response has a 5xx status code +func (o *GetSegmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get segments o k response a status code equal to that given +func (o *GetSegmentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get segments o k response +func (o *GetSegmentsOK) Code() int { + return 200 +} + +func (o *GetSegmentsOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}][%d] getSegmentsOK %+v", 200, o.Payload) +} + +func (o *GetSegmentsOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}][%d] getSegmentsOK %+v", 200, o.Payload) +} + +func (o *GetSegmentsOK) GetPayload() []map[string][]string { + return o.Payload +} + +func (o *GetSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_selected_segments_parameters.go b/src/client/segment/get_selected_segments_parameters.go new file mode 100644 index 0000000..c0c6d15 --- /dev/null +++ b/src/client/segment/get_selected_segments_parameters.go @@ -0,0 +1,299 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetSelectedSegmentsParams creates a new GetSelectedSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSelectedSegmentsParams() *GetSelectedSegmentsParams { + return &GetSelectedSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSelectedSegmentsParamsWithTimeout creates a new GetSelectedSegmentsParams object +// with the ability to set a timeout on a request. +func NewGetSelectedSegmentsParamsWithTimeout(timeout time.Duration) *GetSelectedSegmentsParams { + return &GetSelectedSegmentsParams{ + timeout: timeout, + } +} + +// NewGetSelectedSegmentsParamsWithContext creates a new GetSelectedSegmentsParams object +// with the ability to set a context for a request. +func NewGetSelectedSegmentsParamsWithContext(ctx context.Context) *GetSelectedSegmentsParams { + return &GetSelectedSegmentsParams{ + Context: ctx, + } +} + +// NewGetSelectedSegmentsParamsWithHTTPClient creates a new GetSelectedSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSelectedSegmentsParamsWithHTTPClient(client *http.Client) *GetSelectedSegmentsParams { + return &GetSelectedSegmentsParams{ + HTTPClient: client, + } +} + +/* +GetSelectedSegmentsParams contains all the parameters to send to the API endpoint + + for the get selected segments operation. + + Typically these are written to a http.Request. +*/ +type GetSelectedSegmentsParams struct { + + /* EndTimestamp. + + End timestamp (exclusive) + */ + EndTimestamp *string + + /* ExcludeOverlapping. + + Whether to exclude the segments overlapping with the timestamps, false by default + */ + ExcludeOverlapping *bool + + /* StartTimestamp. + + Start timestamp (inclusive) + */ + StartTimestamp *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get selected segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSelectedSegmentsParams) WithDefaults() *GetSelectedSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get selected segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSelectedSegmentsParams) SetDefaults() { + var ( + excludeOverlappingDefault = bool(false) + ) + + val := GetSelectedSegmentsParams{ + ExcludeOverlapping: &excludeOverlappingDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get selected segments params +func (o *GetSelectedSegmentsParams) WithTimeout(timeout time.Duration) *GetSelectedSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get selected segments params +func (o *GetSelectedSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get selected segments params +func (o *GetSelectedSegmentsParams) WithContext(ctx context.Context) *GetSelectedSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get selected segments params +func (o *GetSelectedSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get selected segments params +func (o *GetSelectedSegmentsParams) WithHTTPClient(client *http.Client) *GetSelectedSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get selected segments params +func (o *GetSelectedSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndTimestamp adds the endTimestamp to the get selected segments params +func (o *GetSelectedSegmentsParams) WithEndTimestamp(endTimestamp *string) *GetSelectedSegmentsParams { + o.SetEndTimestamp(endTimestamp) + return o +} + +// SetEndTimestamp adds the endTimestamp to the get selected segments params +func (o *GetSelectedSegmentsParams) SetEndTimestamp(endTimestamp *string) { + o.EndTimestamp = endTimestamp +} + +// WithExcludeOverlapping adds the excludeOverlapping to the get selected segments params +func (o *GetSelectedSegmentsParams) WithExcludeOverlapping(excludeOverlapping *bool) *GetSelectedSegmentsParams { + o.SetExcludeOverlapping(excludeOverlapping) + return o +} + +// SetExcludeOverlapping adds the excludeOverlapping to the get selected segments params +func (o *GetSelectedSegmentsParams) SetExcludeOverlapping(excludeOverlapping *bool) { + o.ExcludeOverlapping = excludeOverlapping +} + +// WithStartTimestamp adds the startTimestamp to the get selected segments params +func (o *GetSelectedSegmentsParams) WithStartTimestamp(startTimestamp *string) *GetSelectedSegmentsParams { + o.SetStartTimestamp(startTimestamp) + return o +} + +// SetStartTimestamp adds the startTimestamp to the get selected segments params +func (o *GetSelectedSegmentsParams) SetStartTimestamp(startTimestamp *string) { + o.StartTimestamp = startTimestamp +} + +// WithTableName adds the tableName to the get selected segments params +func (o *GetSelectedSegmentsParams) WithTableName(tableName string) *GetSelectedSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get selected segments params +func (o *GetSelectedSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get selected segments params +func (o *GetSelectedSegmentsParams) WithType(typeVar *string) *GetSelectedSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get selected segments params +func (o *GetSelectedSegmentsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSelectedSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndTimestamp != nil { + + // query param endTimestamp + var qrEndTimestamp string + + if o.EndTimestamp != nil { + qrEndTimestamp = *o.EndTimestamp + } + qEndTimestamp := qrEndTimestamp + if qEndTimestamp != "" { + + if err := r.SetQueryParam("endTimestamp", qEndTimestamp); err != nil { + return err + } + } + } + + if o.ExcludeOverlapping != nil { + + // query param excludeOverlapping + var qrExcludeOverlapping bool + + if o.ExcludeOverlapping != nil { + qrExcludeOverlapping = *o.ExcludeOverlapping + } + qExcludeOverlapping := swag.FormatBool(qrExcludeOverlapping) + if qExcludeOverlapping != "" { + + if err := r.SetQueryParam("excludeOverlapping", qExcludeOverlapping); err != nil { + return err + } + } + } + + if o.StartTimestamp != nil { + + // query param startTimestamp + var qrStartTimestamp string + + if o.StartTimestamp != nil { + qrStartTimestamp = *o.StartTimestamp + } + qStartTimestamp := qrStartTimestamp + if qStartTimestamp != "" { + + if err := r.SetQueryParam("startTimestamp", qStartTimestamp); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_selected_segments_responses.go b/src/client/segment/get_selected_segments_responses.go new file mode 100644 index 0000000..90416da --- /dev/null +++ b/src/client/segment/get_selected_segments_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSelectedSegmentsReader is a Reader for the GetSelectedSegments structure. +type GetSelectedSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSelectedSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSelectedSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSelectedSegmentsOK creates a GetSelectedSegmentsOK with default headers values +func NewGetSelectedSegmentsOK() *GetSelectedSegmentsOK { + return &GetSelectedSegmentsOK{} +} + +/* +GetSelectedSegmentsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSelectedSegmentsOK struct { + Payload []map[string][]string +} + +// IsSuccess returns true when this get selected segments o k response has a 2xx status code +func (o *GetSelectedSegmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get selected segments o k response has a 3xx status code +func (o *GetSelectedSegmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get selected segments o k response has a 4xx status code +func (o *GetSelectedSegmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get selected segments o k response has a 5xx status code +func (o *GetSelectedSegmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get selected segments o k response a status code equal to that given +func (o *GetSelectedSegmentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get selected segments o k response +func (o *GetSelectedSegmentsOK) Code() int { + return 200 +} + +func (o *GetSelectedSegmentsOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/select][%d] getSelectedSegmentsOK %+v", 200, o.Payload) +} + +func (o *GetSelectedSegmentsOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/select][%d] getSelectedSegmentsOK %+v", 200, o.Payload) +} + +func (o *GetSelectedSegmentsOK) GetPayload() []map[string][]string { + return o.Payload +} + +func (o *GetSelectedSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_server_metadata_parameters.go b/src/client/segment/get_server_metadata_parameters.go new file mode 100644 index 0000000..e30a06f --- /dev/null +++ b/src/client/segment/get_server_metadata_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetServerMetadataParams creates a new GetServerMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServerMetadataParams() *GetServerMetadataParams { + return &GetServerMetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServerMetadataParamsWithTimeout creates a new GetServerMetadataParams object +// with the ability to set a timeout on a request. +func NewGetServerMetadataParamsWithTimeout(timeout time.Duration) *GetServerMetadataParams { + return &GetServerMetadataParams{ + timeout: timeout, + } +} + +// NewGetServerMetadataParamsWithContext creates a new GetServerMetadataParams object +// with the ability to set a context for a request. +func NewGetServerMetadataParamsWithContext(ctx context.Context) *GetServerMetadataParams { + return &GetServerMetadataParams{ + Context: ctx, + } +} + +// NewGetServerMetadataParamsWithHTTPClient creates a new GetServerMetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServerMetadataParamsWithHTTPClient(client *http.Client) *GetServerMetadataParams { + return &GetServerMetadataParams{ + HTTPClient: client, + } +} + +/* +GetServerMetadataParams contains all the parameters to send to the API endpoint + + for the get server metadata operation. + + Typically these are written to a http.Request. +*/ +type GetServerMetadataParams struct { + + /* Columns. + + Columns name + */ + Columns []string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get server metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerMetadataParams) WithDefaults() *GetServerMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get server metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get server metadata params +func (o *GetServerMetadataParams) WithTimeout(timeout time.Duration) *GetServerMetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get server metadata params +func (o *GetServerMetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get server metadata params +func (o *GetServerMetadataParams) WithContext(ctx context.Context) *GetServerMetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get server metadata params +func (o *GetServerMetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get server metadata params +func (o *GetServerMetadataParams) WithHTTPClient(client *http.Client) *GetServerMetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get server metadata params +func (o *GetServerMetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColumns adds the columns to the get server metadata params +func (o *GetServerMetadataParams) WithColumns(columns []string) *GetServerMetadataParams { + o.SetColumns(columns) + return o +} + +// SetColumns adds the columns to the get server metadata params +func (o *GetServerMetadataParams) SetColumns(columns []string) { + o.Columns = columns +} + +// WithTableName adds the tableName to the get server metadata params +func (o *GetServerMetadataParams) WithTableName(tableName string) *GetServerMetadataParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get server metadata params +func (o *GetServerMetadataParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get server metadata params +func (o *GetServerMetadataParams) WithType(typeVar *string) *GetServerMetadataParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get server metadata params +func (o *GetServerMetadataParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServerMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Columns != nil { + + // binding items for columns + joinedColumns := o.bindParamColumns(reg) + + // query array param columns + if err := r.SetQueryParam("columns", joinedColumns...); err != nil { + return err + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetServerMetadata binds the parameter columns +func (o *GetServerMetadataParams) bindParamColumns(formats strfmt.Registry) []string { + columnsIR := o.Columns + + var columnsIC []string + for _, columnsIIR := range columnsIR { // explode []string + + columnsIIV := columnsIIR // string as string + columnsIC = append(columnsIC, columnsIIV) + } + + // items.CollectionFormat: "multi" + columnsIS := swag.JoinByFormat(columnsIC, "multi") + + return columnsIS +} diff --git a/src/client/segment/get_server_metadata_responses.go b/src/client/segment/get_server_metadata_responses.go new file mode 100644 index 0000000..a1ff316 --- /dev/null +++ b/src/client/segment/get_server_metadata_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetServerMetadataReader is a Reader for the GetServerMetadata structure. +type GetServerMetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServerMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServerMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServerMetadataOK creates a GetServerMetadataOK with default headers values +func NewGetServerMetadataOK() *GetServerMetadataOK { + return &GetServerMetadataOK{} +} + +/* +GetServerMetadataOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetServerMetadataOK struct { + Payload string +} + +// IsSuccess returns true when this get server metadata o k response has a 2xx status code +func (o *GetServerMetadataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get server metadata o k response has a 3xx status code +func (o *GetServerMetadataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get server metadata o k response has a 4xx status code +func (o *GetServerMetadataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get server metadata o k response has a 5xx status code +func (o *GetServerMetadataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get server metadata o k response a status code equal to that given +func (o *GetServerMetadataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get server metadata o k response +func (o *GetServerMetadataOK) Code() int { + return 200 +} + +func (o *GetServerMetadataOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/metadata][%d] getServerMetadataOK %+v", 200, o.Payload) +} + +func (o *GetServerMetadataOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/metadata][%d] getServerMetadataOK %+v", 200, o.Payload) +} + +func (o *GetServerMetadataOK) GetPayload() string { + return o.Payload +} + +func (o *GetServerMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_server_to_segments_map_deprecated1_parameters.go b/src/client/segment/get_server_to_segments_map_deprecated1_parameters.go new file mode 100644 index 0000000..690c56c --- /dev/null +++ b/src/client/segment/get_server_to_segments_map_deprecated1_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetServerToSegmentsMapDeprecated1Params creates a new GetServerToSegmentsMapDeprecated1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServerToSegmentsMapDeprecated1Params() *GetServerToSegmentsMapDeprecated1Params { + return &GetServerToSegmentsMapDeprecated1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServerToSegmentsMapDeprecated1ParamsWithTimeout creates a new GetServerToSegmentsMapDeprecated1Params object +// with the ability to set a timeout on a request. +func NewGetServerToSegmentsMapDeprecated1ParamsWithTimeout(timeout time.Duration) *GetServerToSegmentsMapDeprecated1Params { + return &GetServerToSegmentsMapDeprecated1Params{ + timeout: timeout, + } +} + +// NewGetServerToSegmentsMapDeprecated1ParamsWithContext creates a new GetServerToSegmentsMapDeprecated1Params object +// with the ability to set a context for a request. +func NewGetServerToSegmentsMapDeprecated1ParamsWithContext(ctx context.Context) *GetServerToSegmentsMapDeprecated1Params { + return &GetServerToSegmentsMapDeprecated1Params{ + Context: ctx, + } +} + +// NewGetServerToSegmentsMapDeprecated1ParamsWithHTTPClient creates a new GetServerToSegmentsMapDeprecated1Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetServerToSegmentsMapDeprecated1ParamsWithHTTPClient(client *http.Client) *GetServerToSegmentsMapDeprecated1Params { + return &GetServerToSegmentsMapDeprecated1Params{ + HTTPClient: client, + } +} + +/* +GetServerToSegmentsMapDeprecated1Params contains all the parameters to send to the API endpoint + + for the get server to segments map deprecated1 operation. + + Typically these are written to a http.Request. +*/ +type GetServerToSegmentsMapDeprecated1Params struct { + + /* State. + + MUST be null + */ + State *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get server to segments map deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerToSegmentsMapDeprecated1Params) WithDefaults() *GetServerToSegmentsMapDeprecated1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get server to segments map deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerToSegmentsMapDeprecated1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) WithTimeout(timeout time.Duration) *GetServerToSegmentsMapDeprecated1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) WithContext(ctx context.Context) *GetServerToSegmentsMapDeprecated1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) WithHTTPClient(client *http.Client) *GetServerToSegmentsMapDeprecated1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) WithState(state *string) *GetServerToSegmentsMapDeprecated1Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) SetState(state *string) { + o.State = state +} + +// WithTableName adds the tableName to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) WithTableName(tableName string) *GetServerToSegmentsMapDeprecated1Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) WithType(typeVar *string) *GetServerToSegmentsMapDeprecated1Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get server to segments map deprecated1 params +func (o *GetServerToSegmentsMapDeprecated1Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServerToSegmentsMapDeprecated1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_server_to_segments_map_deprecated1_responses.go b/src/client/segment/get_server_to_segments_map_deprecated1_responses.go new file mode 100644 index 0000000..e71ade2 --- /dev/null +++ b/src/client/segment/get_server_to_segments_map_deprecated1_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetServerToSegmentsMapDeprecated1Reader is a Reader for the GetServerToSegmentsMapDeprecated1 structure. +type GetServerToSegmentsMapDeprecated1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServerToSegmentsMapDeprecated1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServerToSegmentsMapDeprecated1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServerToSegmentsMapDeprecated1OK creates a GetServerToSegmentsMapDeprecated1OK with default headers values +func NewGetServerToSegmentsMapDeprecated1OK() *GetServerToSegmentsMapDeprecated1OK { + return &GetServerToSegmentsMapDeprecated1OK{} +} + +/* +GetServerToSegmentsMapDeprecated1OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetServerToSegmentsMapDeprecated1OK struct { + Payload []map[string]string +} + +// IsSuccess returns true when this get server to segments map deprecated1 o k response has a 2xx status code +func (o *GetServerToSegmentsMapDeprecated1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get server to segments map deprecated1 o k response has a 3xx status code +func (o *GetServerToSegmentsMapDeprecated1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get server to segments map deprecated1 o k response has a 4xx status code +func (o *GetServerToSegmentsMapDeprecated1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get server to segments map deprecated1 o k response has a 5xx status code +func (o *GetServerToSegmentsMapDeprecated1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get server to segments map deprecated1 o k response a status code equal to that given +func (o *GetServerToSegmentsMapDeprecated1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get server to segments map deprecated1 o k response +func (o *GetServerToSegmentsMapDeprecated1OK) Code() int { + return 200 +} + +func (o *GetServerToSegmentsMapDeprecated1OK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments][%d] getServerToSegmentsMapDeprecated1OK %+v", 200, o.Payload) +} + +func (o *GetServerToSegmentsMapDeprecated1OK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments][%d] getServerToSegmentsMapDeprecated1OK %+v", 200, o.Payload) +} + +func (o *GetServerToSegmentsMapDeprecated1OK) GetPayload() []map[string]string { + return o.Payload +} + +func (o *GetServerToSegmentsMapDeprecated1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_server_to_segments_map_deprecated2_parameters.go b/src/client/segment/get_server_to_segments_map_deprecated2_parameters.go new file mode 100644 index 0000000..4befed8 --- /dev/null +++ b/src/client/segment/get_server_to_segments_map_deprecated2_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetServerToSegmentsMapDeprecated2Params creates a new GetServerToSegmentsMapDeprecated2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServerToSegmentsMapDeprecated2Params() *GetServerToSegmentsMapDeprecated2Params { + return &GetServerToSegmentsMapDeprecated2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServerToSegmentsMapDeprecated2ParamsWithTimeout creates a new GetServerToSegmentsMapDeprecated2Params object +// with the ability to set a timeout on a request. +func NewGetServerToSegmentsMapDeprecated2ParamsWithTimeout(timeout time.Duration) *GetServerToSegmentsMapDeprecated2Params { + return &GetServerToSegmentsMapDeprecated2Params{ + timeout: timeout, + } +} + +// NewGetServerToSegmentsMapDeprecated2ParamsWithContext creates a new GetServerToSegmentsMapDeprecated2Params object +// with the ability to set a context for a request. +func NewGetServerToSegmentsMapDeprecated2ParamsWithContext(ctx context.Context) *GetServerToSegmentsMapDeprecated2Params { + return &GetServerToSegmentsMapDeprecated2Params{ + Context: ctx, + } +} + +// NewGetServerToSegmentsMapDeprecated2ParamsWithHTTPClient creates a new GetServerToSegmentsMapDeprecated2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetServerToSegmentsMapDeprecated2ParamsWithHTTPClient(client *http.Client) *GetServerToSegmentsMapDeprecated2Params { + return &GetServerToSegmentsMapDeprecated2Params{ + HTTPClient: client, + } +} + +/* +GetServerToSegmentsMapDeprecated2Params contains all the parameters to send to the API endpoint + + for the get server to segments map deprecated2 operation. + + Typically these are written to a http.Request. +*/ +type GetServerToSegmentsMapDeprecated2Params struct { + + /* State. + + MUST be null + */ + State *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get server to segments map deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerToSegmentsMapDeprecated2Params) WithDefaults() *GetServerToSegmentsMapDeprecated2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get server to segments map deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerToSegmentsMapDeprecated2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) WithTimeout(timeout time.Duration) *GetServerToSegmentsMapDeprecated2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) WithContext(ctx context.Context) *GetServerToSegmentsMapDeprecated2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) WithHTTPClient(client *http.Client) *GetServerToSegmentsMapDeprecated2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) WithState(state *string) *GetServerToSegmentsMapDeprecated2Params { + o.SetState(state) + return o +} + +// SetState adds the state to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) SetState(state *string) { + o.State = state +} + +// WithTableName adds the tableName to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) WithTableName(tableName string) *GetServerToSegmentsMapDeprecated2Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) WithType(typeVar *string) *GetServerToSegmentsMapDeprecated2Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get server to segments map deprecated2 params +func (o *GetServerToSegmentsMapDeprecated2Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServerToSegmentsMapDeprecated2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_server_to_segments_map_deprecated2_responses.go b/src/client/segment/get_server_to_segments_map_deprecated2_responses.go new file mode 100644 index 0000000..50c640e --- /dev/null +++ b/src/client/segment/get_server_to_segments_map_deprecated2_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetServerToSegmentsMapDeprecated2Reader is a Reader for the GetServerToSegmentsMapDeprecated2 structure. +type GetServerToSegmentsMapDeprecated2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServerToSegmentsMapDeprecated2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServerToSegmentsMapDeprecated2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServerToSegmentsMapDeprecated2OK creates a GetServerToSegmentsMapDeprecated2OK with default headers values +func NewGetServerToSegmentsMapDeprecated2OK() *GetServerToSegmentsMapDeprecated2OK { + return &GetServerToSegmentsMapDeprecated2OK{} +} + +/* +GetServerToSegmentsMapDeprecated2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetServerToSegmentsMapDeprecated2OK struct { + Payload []map[string]string +} + +// IsSuccess returns true when this get server to segments map deprecated2 o k response has a 2xx status code +func (o *GetServerToSegmentsMapDeprecated2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get server to segments map deprecated2 o k response has a 3xx status code +func (o *GetServerToSegmentsMapDeprecated2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get server to segments map deprecated2 o k response has a 4xx status code +func (o *GetServerToSegmentsMapDeprecated2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get server to segments map deprecated2 o k response has a 5xx status code +func (o *GetServerToSegmentsMapDeprecated2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get server to segments map deprecated2 o k response a status code equal to that given +func (o *GetServerToSegmentsMapDeprecated2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get server to segments map deprecated2 o k response +func (o *GetServerToSegmentsMapDeprecated2OK) Code() int { + return 200 +} + +func (o *GetServerToSegmentsMapDeprecated2OK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/metadata][%d] getServerToSegmentsMapDeprecated2OK %+v", 200, o.Payload) +} + +func (o *GetServerToSegmentsMapDeprecated2OK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/metadata][%d] getServerToSegmentsMapDeprecated2OK %+v", 200, o.Payload) +} + +func (o *GetServerToSegmentsMapDeprecated2OK) GetPayload() []map[string]string { + return o.Payload +} + +func (o *GetServerToSegmentsMapDeprecated2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_server_to_segments_map_parameters.go b/src/client/segment/get_server_to_segments_map_parameters.go new file mode 100644 index 0000000..30298a6 --- /dev/null +++ b/src/client/segment/get_server_to_segments_map_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetServerToSegmentsMapParams creates a new GetServerToSegmentsMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServerToSegmentsMapParams() *GetServerToSegmentsMapParams { + return &GetServerToSegmentsMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServerToSegmentsMapParamsWithTimeout creates a new GetServerToSegmentsMapParams object +// with the ability to set a timeout on a request. +func NewGetServerToSegmentsMapParamsWithTimeout(timeout time.Duration) *GetServerToSegmentsMapParams { + return &GetServerToSegmentsMapParams{ + timeout: timeout, + } +} + +// NewGetServerToSegmentsMapParamsWithContext creates a new GetServerToSegmentsMapParams object +// with the ability to set a context for a request. +func NewGetServerToSegmentsMapParamsWithContext(ctx context.Context) *GetServerToSegmentsMapParams { + return &GetServerToSegmentsMapParams{ + Context: ctx, + } +} + +// NewGetServerToSegmentsMapParamsWithHTTPClient creates a new GetServerToSegmentsMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServerToSegmentsMapParamsWithHTTPClient(client *http.Client) *GetServerToSegmentsMapParams { + return &GetServerToSegmentsMapParams{ + HTTPClient: client, + } +} + +/* +GetServerToSegmentsMapParams contains all the parameters to send to the API endpoint + + for the get server to segments map operation. + + Typically these are written to a http.Request. +*/ +type GetServerToSegmentsMapParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get server to segments map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerToSegmentsMapParams) WithDefaults() *GetServerToSegmentsMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get server to segments map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServerToSegmentsMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get server to segments map params +func (o *GetServerToSegmentsMapParams) WithTimeout(timeout time.Duration) *GetServerToSegmentsMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get server to segments map params +func (o *GetServerToSegmentsMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get server to segments map params +func (o *GetServerToSegmentsMapParams) WithContext(ctx context.Context) *GetServerToSegmentsMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get server to segments map params +func (o *GetServerToSegmentsMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get server to segments map params +func (o *GetServerToSegmentsMapParams) WithHTTPClient(client *http.Client) *GetServerToSegmentsMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get server to segments map params +func (o *GetServerToSegmentsMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get server to segments map params +func (o *GetServerToSegmentsMapParams) WithTableName(tableName string) *GetServerToSegmentsMapParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get server to segments map params +func (o *GetServerToSegmentsMapParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get server to segments map params +func (o *GetServerToSegmentsMapParams) WithType(typeVar *string) *GetServerToSegmentsMapParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get server to segments map params +func (o *GetServerToSegmentsMapParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServerToSegmentsMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_server_to_segments_map_responses.go b/src/client/segment/get_server_to_segments_map_responses.go new file mode 100644 index 0000000..0ffae8e --- /dev/null +++ b/src/client/segment/get_server_to_segments_map_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetServerToSegmentsMapReader is a Reader for the GetServerToSegmentsMap structure. +type GetServerToSegmentsMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServerToSegmentsMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServerToSegmentsMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServerToSegmentsMapOK creates a GetServerToSegmentsMapOK with default headers values +func NewGetServerToSegmentsMapOK() *GetServerToSegmentsMapOK { + return &GetServerToSegmentsMapOK{} +} + +/* +GetServerToSegmentsMapOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetServerToSegmentsMapOK struct { + Payload []map[string]interface{} +} + +// IsSuccess returns true when this get server to segments map o k response has a 2xx status code +func (o *GetServerToSegmentsMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get server to segments map o k response has a 3xx status code +func (o *GetServerToSegmentsMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get server to segments map o k response has a 4xx status code +func (o *GetServerToSegmentsMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get server to segments map o k response has a 5xx status code +func (o *GetServerToSegmentsMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get server to segments map o k response a status code equal to that given +func (o *GetServerToSegmentsMapOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get server to segments map o k response +func (o *GetServerToSegmentsMapOK) Code() int { + return 200 +} + +func (o *GetServerToSegmentsMapOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/servers][%d] getServerToSegmentsMapOK %+v", 200, o.Payload) +} + +func (o *GetServerToSegmentsMapOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/servers][%d] getServerToSegmentsMapOK %+v", 200, o.Payload) +} + +func (o *GetServerToSegmentsMapOK) GetPayload() []map[string]interface{} { + return o.Payload +} + +func (o *GetServerToSegmentsMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/get_table_tiers_parameters.go b/src/client/segment/get_table_tiers_parameters.go new file mode 100644 index 0000000..0b69fa8 --- /dev/null +++ b/src/client/segment/get_table_tiers_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTableTiersParams creates a new GetTableTiersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableTiersParams() *GetTableTiersParams { + return &GetTableTiersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableTiersParamsWithTimeout creates a new GetTableTiersParams object +// with the ability to set a timeout on a request. +func NewGetTableTiersParamsWithTimeout(timeout time.Duration) *GetTableTiersParams { + return &GetTableTiersParams{ + timeout: timeout, + } +} + +// NewGetTableTiersParamsWithContext creates a new GetTableTiersParams object +// with the ability to set a context for a request. +func NewGetTableTiersParamsWithContext(ctx context.Context) *GetTableTiersParams { + return &GetTableTiersParams{ + Context: ctx, + } +} + +// NewGetTableTiersParamsWithHTTPClient creates a new GetTableTiersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableTiersParamsWithHTTPClient(client *http.Client) *GetTableTiersParams { + return &GetTableTiersParams{ + HTTPClient: client, + } +} + +/* +GetTableTiersParams contains all the parameters to send to the API endpoint + + for the get table tiers operation. + + Typically these are written to a http.Request. +*/ +type GetTableTiersParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table tiers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableTiersParams) WithDefaults() *GetTableTiersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table tiers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableTiersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table tiers params +func (o *GetTableTiersParams) WithTimeout(timeout time.Duration) *GetTableTiersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table tiers params +func (o *GetTableTiersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table tiers params +func (o *GetTableTiersParams) WithContext(ctx context.Context) *GetTableTiersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table tiers params +func (o *GetTableTiersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table tiers params +func (o *GetTableTiersParams) WithHTTPClient(client *http.Client) *GetTableTiersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table tiers params +func (o *GetTableTiersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table tiers params +func (o *GetTableTiersParams) WithTableName(tableName string) *GetTableTiersParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table tiers params +func (o *GetTableTiersParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table tiers params +func (o *GetTableTiersParams) WithType(typeVar string) *GetTableTiersParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table tiers params +func (o *GetTableTiersParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableTiersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/get_table_tiers_responses.go b/src/client/segment/get_table_tiers_responses.go new file mode 100644 index 0000000..0e840c3 --- /dev/null +++ b/src/client/segment/get_table_tiers_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableTiersReader is a Reader for the GetTableTiers structure. +type GetTableTiersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableTiersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableTiersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetTableTiersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTableTiersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableTiersOK creates a GetTableTiersOK with default headers values +func NewGetTableTiersOK() *GetTableTiersOK { + return &GetTableTiersOK{} +} + +/* +GetTableTiersOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTableTiersOK struct { +} + +// IsSuccess returns true when this get table tiers o k response has a 2xx status code +func (o *GetTableTiersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table tiers o k response has a 3xx status code +func (o *GetTableTiersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table tiers o k response has a 4xx status code +func (o *GetTableTiersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table tiers o k response has a 5xx status code +func (o *GetTableTiersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table tiers o k response a status code equal to that given +func (o *GetTableTiersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table tiers o k response +func (o *GetTableTiersOK) Code() int { + return 200 +} + +func (o *GetTableTiersOK) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/tiers][%d] getTableTiersOK ", 200) +} + +func (o *GetTableTiersOK) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/tiers][%d] getTableTiersOK ", 200) +} + +func (o *GetTableTiersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableTiersNotFound creates a GetTableTiersNotFound with default headers values +func NewGetTableTiersNotFound() *GetTableTiersNotFound { + return &GetTableTiersNotFound{} +} + +/* +GetTableTiersNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetTableTiersNotFound struct { +} + +// IsSuccess returns true when this get table tiers not found response has a 2xx status code +func (o *GetTableTiersNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table tiers not found response has a 3xx status code +func (o *GetTableTiersNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table tiers not found response has a 4xx status code +func (o *GetTableTiersNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get table tiers not found response has a 5xx status code +func (o *GetTableTiersNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get table tiers not found response a status code equal to that given +func (o *GetTableTiersNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get table tiers not found response +func (o *GetTableTiersNotFound) Code() int { + return 404 +} + +func (o *GetTableTiersNotFound) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/tiers][%d] getTableTiersNotFound ", 404) +} + +func (o *GetTableTiersNotFound) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/tiers][%d] getTableTiersNotFound ", 404) +} + +func (o *GetTableTiersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableTiersInternalServerError creates a GetTableTiersInternalServerError with default headers values +func NewGetTableTiersInternalServerError() *GetTableTiersInternalServerError { + return &GetTableTiersInternalServerError{} +} + +/* +GetTableTiersInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetTableTiersInternalServerError struct { +} + +// IsSuccess returns true when this get table tiers internal server error response has a 2xx status code +func (o *GetTableTiersInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table tiers internal server error response has a 3xx status code +func (o *GetTableTiersInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table tiers internal server error response has a 4xx status code +func (o *GetTableTiersInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table tiers internal server error response has a 5xx status code +func (o *GetTableTiersInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get table tiers internal server error response a status code equal to that given +func (o *GetTableTiersInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get table tiers internal server error response +func (o *GetTableTiersInternalServerError) Code() int { + return 500 +} + +func (o *GetTableTiersInternalServerError) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/tiers][%d] getTableTiersInternalServerError ", 500) +} + +func (o *GetTableTiersInternalServerError) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/tiers][%d] getTableTiersInternalServerError ", 500) +} + +func (o *GetTableTiersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/list_segment_lineage_parameters.go b/src/client/segment/list_segment_lineage_parameters.go new file mode 100644 index 0000000..5cb7d02 --- /dev/null +++ b/src/client/segment/list_segment_lineage_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSegmentLineageParams creates a new ListSegmentLineageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSegmentLineageParams() *ListSegmentLineageParams { + return &ListSegmentLineageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSegmentLineageParamsWithTimeout creates a new ListSegmentLineageParams object +// with the ability to set a timeout on a request. +func NewListSegmentLineageParamsWithTimeout(timeout time.Duration) *ListSegmentLineageParams { + return &ListSegmentLineageParams{ + timeout: timeout, + } +} + +// NewListSegmentLineageParamsWithContext creates a new ListSegmentLineageParams object +// with the ability to set a context for a request. +func NewListSegmentLineageParamsWithContext(ctx context.Context) *ListSegmentLineageParams { + return &ListSegmentLineageParams{ + Context: ctx, + } +} + +// NewListSegmentLineageParamsWithHTTPClient creates a new ListSegmentLineageParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSegmentLineageParamsWithHTTPClient(client *http.Client) *ListSegmentLineageParams { + return &ListSegmentLineageParams{ + HTTPClient: client, + } +} + +/* +ListSegmentLineageParams contains all the parameters to send to the API endpoint + + for the list segment lineage operation. + + Typically these are written to a http.Request. +*/ +type ListSegmentLineageParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list segment lineage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSegmentLineageParams) WithDefaults() *ListSegmentLineageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list segment lineage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSegmentLineageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list segment lineage params +func (o *ListSegmentLineageParams) WithTimeout(timeout time.Duration) *ListSegmentLineageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list segment lineage params +func (o *ListSegmentLineageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list segment lineage params +func (o *ListSegmentLineageParams) WithContext(ctx context.Context) *ListSegmentLineageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list segment lineage params +func (o *ListSegmentLineageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list segment lineage params +func (o *ListSegmentLineageParams) WithHTTPClient(client *http.Client) *ListSegmentLineageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list segment lineage params +func (o *ListSegmentLineageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the list segment lineage params +func (o *ListSegmentLineageParams) WithTableName(tableName string) *ListSegmentLineageParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the list segment lineage params +func (o *ListSegmentLineageParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the list segment lineage params +func (o *ListSegmentLineageParams) WithType(typeVar string) *ListSegmentLineageParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list segment lineage params +func (o *ListSegmentLineageParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSegmentLineageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/list_segment_lineage_responses.go b/src/client/segment/list_segment_lineage_responses.go new file mode 100644 index 0000000..7e1c5ff --- /dev/null +++ b/src/client/segment/list_segment_lineage_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListSegmentLineageReader is a Reader for the ListSegmentLineage structure. +type ListSegmentLineageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSegmentLineageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewListSegmentLineageDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewListSegmentLineageDefault creates a ListSegmentLineageDefault with default headers values +func NewListSegmentLineageDefault(code int) *ListSegmentLineageDefault { + return &ListSegmentLineageDefault{ + _statusCode: code, + } +} + +/* +ListSegmentLineageDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type ListSegmentLineageDefault struct { + _statusCode int +} + +// IsSuccess returns true when this list segment lineage default response has a 2xx status code +func (o *ListSegmentLineageDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list segment lineage default response has a 3xx status code +func (o *ListSegmentLineageDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list segment lineage default response has a 4xx status code +func (o *ListSegmentLineageDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list segment lineage default response has a 5xx status code +func (o *ListSegmentLineageDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list segment lineage default response a status code equal to that given +func (o *ListSegmentLineageDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the list segment lineage default response +func (o *ListSegmentLineageDefault) Code() int { + return o._statusCode +} + +func (o *ListSegmentLineageDefault) Error() string { + return fmt.Sprintf("[GET /segments/{tableName}/lineage][%d] listSegmentLineage default ", o._statusCode) +} + +func (o *ListSegmentLineageDefault) String() string { + return fmt.Sprintf("[GET /segments/{tableName}/lineage][%d] listSegmentLineage default ", o._statusCode) +} + +func (o *ListSegmentLineageDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/reload_all_segments_deprecated1_parameters.go b/src/client/segment/reload_all_segments_deprecated1_parameters.go new file mode 100644 index 0000000..d0b475f --- /dev/null +++ b/src/client/segment/reload_all_segments_deprecated1_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReloadAllSegmentsDeprecated1Params creates a new ReloadAllSegmentsDeprecated1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReloadAllSegmentsDeprecated1Params() *ReloadAllSegmentsDeprecated1Params { + return &ReloadAllSegmentsDeprecated1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewReloadAllSegmentsDeprecated1ParamsWithTimeout creates a new ReloadAllSegmentsDeprecated1Params object +// with the ability to set a timeout on a request. +func NewReloadAllSegmentsDeprecated1ParamsWithTimeout(timeout time.Duration) *ReloadAllSegmentsDeprecated1Params { + return &ReloadAllSegmentsDeprecated1Params{ + timeout: timeout, + } +} + +// NewReloadAllSegmentsDeprecated1ParamsWithContext creates a new ReloadAllSegmentsDeprecated1Params object +// with the ability to set a context for a request. +func NewReloadAllSegmentsDeprecated1ParamsWithContext(ctx context.Context) *ReloadAllSegmentsDeprecated1Params { + return &ReloadAllSegmentsDeprecated1Params{ + Context: ctx, + } +} + +// NewReloadAllSegmentsDeprecated1ParamsWithHTTPClient creates a new ReloadAllSegmentsDeprecated1Params object +// with the ability to set a custom HTTPClient for a request. +func NewReloadAllSegmentsDeprecated1ParamsWithHTTPClient(client *http.Client) *ReloadAllSegmentsDeprecated1Params { + return &ReloadAllSegmentsDeprecated1Params{ + HTTPClient: client, + } +} + +/* +ReloadAllSegmentsDeprecated1Params contains all the parameters to send to the API endpoint + + for the reload all segments deprecated1 operation. + + Typically these are written to a http.Request. +*/ +type ReloadAllSegmentsDeprecated1Params struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reload all segments deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadAllSegmentsDeprecated1Params) WithDefaults() *ReloadAllSegmentsDeprecated1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reload all segments deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadAllSegmentsDeprecated1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) WithTimeout(timeout time.Duration) *ReloadAllSegmentsDeprecated1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) WithContext(ctx context.Context) *ReloadAllSegmentsDeprecated1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) WithHTTPClient(client *http.Client) *ReloadAllSegmentsDeprecated1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) WithTableName(tableName string) *ReloadAllSegmentsDeprecated1Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) WithType(typeVar *string) *ReloadAllSegmentsDeprecated1Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the reload all segments deprecated1 params +func (o *ReloadAllSegmentsDeprecated1Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadAllSegmentsDeprecated1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reload_all_segments_deprecated1_responses.go b/src/client/segment/reload_all_segments_deprecated1_responses.go new file mode 100644 index 0000000..82fea05 --- /dev/null +++ b/src/client/segment/reload_all_segments_deprecated1_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReloadAllSegmentsDeprecated1Reader is a Reader for the ReloadAllSegmentsDeprecated1 structure. +type ReloadAllSegmentsDeprecated1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadAllSegmentsDeprecated1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadAllSegmentsDeprecated1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReloadAllSegmentsDeprecated1OK creates a ReloadAllSegmentsDeprecated1OK with default headers values +func NewReloadAllSegmentsDeprecated1OK() *ReloadAllSegmentsDeprecated1OK { + return &ReloadAllSegmentsDeprecated1OK{} +} + +/* +ReloadAllSegmentsDeprecated1OK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReloadAllSegmentsDeprecated1OK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reload all segments deprecated1 o k response has a 2xx status code +func (o *ReloadAllSegmentsDeprecated1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reload all segments deprecated1 o k response has a 3xx status code +func (o *ReloadAllSegmentsDeprecated1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reload all segments deprecated1 o k response has a 4xx status code +func (o *ReloadAllSegmentsDeprecated1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reload all segments deprecated1 o k response has a 5xx status code +func (o *ReloadAllSegmentsDeprecated1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this reload all segments deprecated1 o k response a status code equal to that given +func (o *ReloadAllSegmentsDeprecated1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reload all segments deprecated1 o k response +func (o *ReloadAllSegmentsDeprecated1OK) Code() int { + return 200 +} + +func (o *ReloadAllSegmentsDeprecated1OK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/segments/reload][%d] reloadAllSegmentsDeprecated1OK %+v", 200, o.Payload) +} + +func (o *ReloadAllSegmentsDeprecated1OK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/segments/reload][%d] reloadAllSegmentsDeprecated1OK %+v", 200, o.Payload) +} + +func (o *ReloadAllSegmentsDeprecated1OK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ReloadAllSegmentsDeprecated1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reload_all_segments_deprecated2_parameters.go b/src/client/segment/reload_all_segments_deprecated2_parameters.go new file mode 100644 index 0000000..963d267 --- /dev/null +++ b/src/client/segment/reload_all_segments_deprecated2_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReloadAllSegmentsDeprecated2Params creates a new ReloadAllSegmentsDeprecated2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReloadAllSegmentsDeprecated2Params() *ReloadAllSegmentsDeprecated2Params { + return &ReloadAllSegmentsDeprecated2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewReloadAllSegmentsDeprecated2ParamsWithTimeout creates a new ReloadAllSegmentsDeprecated2Params object +// with the ability to set a timeout on a request. +func NewReloadAllSegmentsDeprecated2ParamsWithTimeout(timeout time.Duration) *ReloadAllSegmentsDeprecated2Params { + return &ReloadAllSegmentsDeprecated2Params{ + timeout: timeout, + } +} + +// NewReloadAllSegmentsDeprecated2ParamsWithContext creates a new ReloadAllSegmentsDeprecated2Params object +// with the ability to set a context for a request. +func NewReloadAllSegmentsDeprecated2ParamsWithContext(ctx context.Context) *ReloadAllSegmentsDeprecated2Params { + return &ReloadAllSegmentsDeprecated2Params{ + Context: ctx, + } +} + +// NewReloadAllSegmentsDeprecated2ParamsWithHTTPClient creates a new ReloadAllSegmentsDeprecated2Params object +// with the ability to set a custom HTTPClient for a request. +func NewReloadAllSegmentsDeprecated2ParamsWithHTTPClient(client *http.Client) *ReloadAllSegmentsDeprecated2Params { + return &ReloadAllSegmentsDeprecated2Params{ + HTTPClient: client, + } +} + +/* +ReloadAllSegmentsDeprecated2Params contains all the parameters to send to the API endpoint + + for the reload all segments deprecated2 operation. + + Typically these are written to a http.Request. +*/ +type ReloadAllSegmentsDeprecated2Params struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reload all segments deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadAllSegmentsDeprecated2Params) WithDefaults() *ReloadAllSegmentsDeprecated2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reload all segments deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadAllSegmentsDeprecated2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) WithTimeout(timeout time.Duration) *ReloadAllSegmentsDeprecated2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) WithContext(ctx context.Context) *ReloadAllSegmentsDeprecated2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) WithHTTPClient(client *http.Client) *ReloadAllSegmentsDeprecated2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) WithTableName(tableName string) *ReloadAllSegmentsDeprecated2Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) WithType(typeVar *string) *ReloadAllSegmentsDeprecated2Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the reload all segments deprecated2 params +func (o *ReloadAllSegmentsDeprecated2Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadAllSegmentsDeprecated2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reload_all_segments_deprecated2_responses.go b/src/client/segment/reload_all_segments_deprecated2_responses.go new file mode 100644 index 0000000..72639d1 --- /dev/null +++ b/src/client/segment/reload_all_segments_deprecated2_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReloadAllSegmentsDeprecated2Reader is a Reader for the ReloadAllSegmentsDeprecated2 structure. +type ReloadAllSegmentsDeprecated2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadAllSegmentsDeprecated2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadAllSegmentsDeprecated2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReloadAllSegmentsDeprecated2OK creates a ReloadAllSegmentsDeprecated2OK with default headers values +func NewReloadAllSegmentsDeprecated2OK() *ReloadAllSegmentsDeprecated2OK { + return &ReloadAllSegmentsDeprecated2OK{} +} + +/* +ReloadAllSegmentsDeprecated2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReloadAllSegmentsDeprecated2OK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reload all segments deprecated2 o k response has a 2xx status code +func (o *ReloadAllSegmentsDeprecated2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reload all segments deprecated2 o k response has a 3xx status code +func (o *ReloadAllSegmentsDeprecated2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reload all segments deprecated2 o k response has a 4xx status code +func (o *ReloadAllSegmentsDeprecated2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reload all segments deprecated2 o k response has a 5xx status code +func (o *ReloadAllSegmentsDeprecated2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this reload all segments deprecated2 o k response a status code equal to that given +func (o *ReloadAllSegmentsDeprecated2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reload all segments deprecated2 o k response +func (o *ReloadAllSegmentsDeprecated2OK) Code() int { + return 200 +} + +func (o *ReloadAllSegmentsDeprecated2OK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/reload][%d] reloadAllSegmentsDeprecated2OK %+v", 200, o.Payload) +} + +func (o *ReloadAllSegmentsDeprecated2OK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/reload][%d] reloadAllSegmentsDeprecated2OK %+v", 200, o.Payload) +} + +func (o *ReloadAllSegmentsDeprecated2OK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ReloadAllSegmentsDeprecated2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reload_all_segments_parameters.go b/src/client/segment/reload_all_segments_parameters.go new file mode 100644 index 0000000..f517821 --- /dev/null +++ b/src/client/segment/reload_all_segments_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewReloadAllSegmentsParams creates a new ReloadAllSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReloadAllSegmentsParams() *ReloadAllSegmentsParams { + return &ReloadAllSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReloadAllSegmentsParamsWithTimeout creates a new ReloadAllSegmentsParams object +// with the ability to set a timeout on a request. +func NewReloadAllSegmentsParamsWithTimeout(timeout time.Duration) *ReloadAllSegmentsParams { + return &ReloadAllSegmentsParams{ + timeout: timeout, + } +} + +// NewReloadAllSegmentsParamsWithContext creates a new ReloadAllSegmentsParams object +// with the ability to set a context for a request. +func NewReloadAllSegmentsParamsWithContext(ctx context.Context) *ReloadAllSegmentsParams { + return &ReloadAllSegmentsParams{ + Context: ctx, + } +} + +// NewReloadAllSegmentsParamsWithHTTPClient creates a new ReloadAllSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewReloadAllSegmentsParamsWithHTTPClient(client *http.Client) *ReloadAllSegmentsParams { + return &ReloadAllSegmentsParams{ + HTTPClient: client, + } +} + +/* +ReloadAllSegmentsParams contains all the parameters to send to the API endpoint + + for the reload all segments operation. + + Typically these are written to a http.Request. +*/ +type ReloadAllSegmentsParams struct { + + /* ForceDownload. + + Whether to force server to download segment + */ + ForceDownload *bool + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reload all segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadAllSegmentsParams) WithDefaults() *ReloadAllSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reload all segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadAllSegmentsParams) SetDefaults() { + var ( + forceDownloadDefault = bool(false) + ) + + val := ReloadAllSegmentsParams{ + ForceDownload: &forceDownloadDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the reload all segments params +func (o *ReloadAllSegmentsParams) WithTimeout(timeout time.Duration) *ReloadAllSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload all segments params +func (o *ReloadAllSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload all segments params +func (o *ReloadAllSegmentsParams) WithContext(ctx context.Context) *ReloadAllSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload all segments params +func (o *ReloadAllSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload all segments params +func (o *ReloadAllSegmentsParams) WithHTTPClient(client *http.Client) *ReloadAllSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload all segments params +func (o *ReloadAllSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForceDownload adds the forceDownload to the reload all segments params +func (o *ReloadAllSegmentsParams) WithForceDownload(forceDownload *bool) *ReloadAllSegmentsParams { + o.SetForceDownload(forceDownload) + return o +} + +// SetForceDownload adds the forceDownload to the reload all segments params +func (o *ReloadAllSegmentsParams) SetForceDownload(forceDownload *bool) { + o.ForceDownload = forceDownload +} + +// WithTableName adds the tableName to the reload all segments params +func (o *ReloadAllSegmentsParams) WithTableName(tableName string) *ReloadAllSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the reload all segments params +func (o *ReloadAllSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the reload all segments params +func (o *ReloadAllSegmentsParams) WithType(typeVar *string) *ReloadAllSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the reload all segments params +func (o *ReloadAllSegmentsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadAllSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForceDownload != nil { + + // query param forceDownload + var qrForceDownload bool + + if o.ForceDownload != nil { + qrForceDownload = *o.ForceDownload + } + qForceDownload := swag.FormatBool(qrForceDownload) + if qForceDownload != "" { + + if err := r.SetQueryParam("forceDownload", qForceDownload); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reload_all_segments_responses.go b/src/client/segment/reload_all_segments_responses.go new file mode 100644 index 0000000..aa5f8f9 --- /dev/null +++ b/src/client/segment/reload_all_segments_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReloadAllSegmentsReader is a Reader for the ReloadAllSegments structure. +type ReloadAllSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadAllSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadAllSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReloadAllSegmentsOK creates a ReloadAllSegmentsOK with default headers values +func NewReloadAllSegmentsOK() *ReloadAllSegmentsOK { + return &ReloadAllSegmentsOK{} +} + +/* +ReloadAllSegmentsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReloadAllSegmentsOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reload all segments o k response has a 2xx status code +func (o *ReloadAllSegmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reload all segments o k response has a 3xx status code +func (o *ReloadAllSegmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reload all segments o k response has a 4xx status code +func (o *ReloadAllSegmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reload all segments o k response has a 5xx status code +func (o *ReloadAllSegmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this reload all segments o k response a status code equal to that given +func (o *ReloadAllSegmentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reload all segments o k response +func (o *ReloadAllSegmentsOK) Code() int { + return 200 +} + +func (o *ReloadAllSegmentsOK) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/reload][%d] reloadAllSegmentsOK %+v", 200, o.Payload) +} + +func (o *ReloadAllSegmentsOK) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/reload][%d] reloadAllSegmentsOK %+v", 200, o.Payload) +} + +func (o *ReloadAllSegmentsOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ReloadAllSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reload_segment_deprecated1_parameters.go b/src/client/segment/reload_segment_deprecated1_parameters.go new file mode 100644 index 0000000..1097d92 --- /dev/null +++ b/src/client/segment/reload_segment_deprecated1_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReloadSegmentDeprecated1Params creates a new ReloadSegmentDeprecated1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReloadSegmentDeprecated1Params() *ReloadSegmentDeprecated1Params { + return &ReloadSegmentDeprecated1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewReloadSegmentDeprecated1ParamsWithTimeout creates a new ReloadSegmentDeprecated1Params object +// with the ability to set a timeout on a request. +func NewReloadSegmentDeprecated1ParamsWithTimeout(timeout time.Duration) *ReloadSegmentDeprecated1Params { + return &ReloadSegmentDeprecated1Params{ + timeout: timeout, + } +} + +// NewReloadSegmentDeprecated1ParamsWithContext creates a new ReloadSegmentDeprecated1Params object +// with the ability to set a context for a request. +func NewReloadSegmentDeprecated1ParamsWithContext(ctx context.Context) *ReloadSegmentDeprecated1Params { + return &ReloadSegmentDeprecated1Params{ + Context: ctx, + } +} + +// NewReloadSegmentDeprecated1ParamsWithHTTPClient creates a new ReloadSegmentDeprecated1Params object +// with the ability to set a custom HTTPClient for a request. +func NewReloadSegmentDeprecated1ParamsWithHTTPClient(client *http.Client) *ReloadSegmentDeprecated1Params { + return &ReloadSegmentDeprecated1Params{ + HTTPClient: client, + } +} + +/* +ReloadSegmentDeprecated1Params contains all the parameters to send to the API endpoint + + for the reload segment deprecated1 operation. + + Typically these are written to a http.Request. +*/ +type ReloadSegmentDeprecated1Params struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reload segment deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadSegmentDeprecated1Params) WithDefaults() *ReloadSegmentDeprecated1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reload segment deprecated1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadSegmentDeprecated1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) WithTimeout(timeout time.Duration) *ReloadSegmentDeprecated1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) WithContext(ctx context.Context) *ReloadSegmentDeprecated1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) WithHTTPClient(client *http.Client) *ReloadSegmentDeprecated1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) WithSegmentName(segmentName string) *ReloadSegmentDeprecated1Params { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) WithTableName(tableName string) *ReloadSegmentDeprecated1Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) WithType(typeVar *string) *ReloadSegmentDeprecated1Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the reload segment deprecated1 params +func (o *ReloadSegmentDeprecated1Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadSegmentDeprecated1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reload_segment_deprecated1_responses.go b/src/client/segment/reload_segment_deprecated1_responses.go new file mode 100644 index 0000000..d471d6c --- /dev/null +++ b/src/client/segment/reload_segment_deprecated1_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReloadSegmentDeprecated1Reader is a Reader for the ReloadSegmentDeprecated1 structure. +type ReloadSegmentDeprecated1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadSegmentDeprecated1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadSegmentDeprecated1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReloadSegmentDeprecated1OK creates a ReloadSegmentDeprecated1OK with default headers values +func NewReloadSegmentDeprecated1OK() *ReloadSegmentDeprecated1OK { + return &ReloadSegmentDeprecated1OK{} +} + +/* +ReloadSegmentDeprecated1OK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReloadSegmentDeprecated1OK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reload segment deprecated1 o k response has a 2xx status code +func (o *ReloadSegmentDeprecated1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reload segment deprecated1 o k response has a 3xx status code +func (o *ReloadSegmentDeprecated1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reload segment deprecated1 o k response has a 4xx status code +func (o *ReloadSegmentDeprecated1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reload segment deprecated1 o k response has a 5xx status code +func (o *ReloadSegmentDeprecated1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this reload segment deprecated1 o k response a status code equal to that given +func (o *ReloadSegmentDeprecated1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reload segment deprecated1 o k response +func (o *ReloadSegmentDeprecated1OK) Code() int { + return 200 +} + +func (o *ReloadSegmentDeprecated1OK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/segments/{segmentName}/reload][%d] reloadSegmentDeprecated1OK %+v", 200, o.Payload) +} + +func (o *ReloadSegmentDeprecated1OK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/segments/{segmentName}/reload][%d] reloadSegmentDeprecated1OK %+v", 200, o.Payload) +} + +func (o *ReloadSegmentDeprecated1OK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ReloadSegmentDeprecated1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reload_segment_deprecated2_parameters.go b/src/client/segment/reload_segment_deprecated2_parameters.go new file mode 100644 index 0000000..824a631 --- /dev/null +++ b/src/client/segment/reload_segment_deprecated2_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReloadSegmentDeprecated2Params creates a new ReloadSegmentDeprecated2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReloadSegmentDeprecated2Params() *ReloadSegmentDeprecated2Params { + return &ReloadSegmentDeprecated2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewReloadSegmentDeprecated2ParamsWithTimeout creates a new ReloadSegmentDeprecated2Params object +// with the ability to set a timeout on a request. +func NewReloadSegmentDeprecated2ParamsWithTimeout(timeout time.Duration) *ReloadSegmentDeprecated2Params { + return &ReloadSegmentDeprecated2Params{ + timeout: timeout, + } +} + +// NewReloadSegmentDeprecated2ParamsWithContext creates a new ReloadSegmentDeprecated2Params object +// with the ability to set a context for a request. +func NewReloadSegmentDeprecated2ParamsWithContext(ctx context.Context) *ReloadSegmentDeprecated2Params { + return &ReloadSegmentDeprecated2Params{ + Context: ctx, + } +} + +// NewReloadSegmentDeprecated2ParamsWithHTTPClient creates a new ReloadSegmentDeprecated2Params object +// with the ability to set a custom HTTPClient for a request. +func NewReloadSegmentDeprecated2ParamsWithHTTPClient(client *http.Client) *ReloadSegmentDeprecated2Params { + return &ReloadSegmentDeprecated2Params{ + HTTPClient: client, + } +} + +/* +ReloadSegmentDeprecated2Params contains all the parameters to send to the API endpoint + + for the reload segment deprecated2 operation. + + Typically these are written to a http.Request. +*/ +type ReloadSegmentDeprecated2Params struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reload segment deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadSegmentDeprecated2Params) WithDefaults() *ReloadSegmentDeprecated2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reload segment deprecated2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadSegmentDeprecated2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) WithTimeout(timeout time.Duration) *ReloadSegmentDeprecated2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) WithContext(ctx context.Context) *ReloadSegmentDeprecated2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) WithHTTPClient(client *http.Client) *ReloadSegmentDeprecated2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) WithSegmentName(segmentName string) *ReloadSegmentDeprecated2Params { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) WithTableName(tableName string) *ReloadSegmentDeprecated2Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) WithType(typeVar *string) *ReloadSegmentDeprecated2Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the reload segment deprecated2 params +func (o *ReloadSegmentDeprecated2Params) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadSegmentDeprecated2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reload_segment_deprecated2_responses.go b/src/client/segment/reload_segment_deprecated2_responses.go new file mode 100644 index 0000000..f6ecb51 --- /dev/null +++ b/src/client/segment/reload_segment_deprecated2_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReloadSegmentDeprecated2Reader is a Reader for the ReloadSegmentDeprecated2 structure. +type ReloadSegmentDeprecated2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadSegmentDeprecated2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadSegmentDeprecated2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReloadSegmentDeprecated2OK creates a ReloadSegmentDeprecated2OK with default headers values +func NewReloadSegmentDeprecated2OK() *ReloadSegmentDeprecated2OK { + return &ReloadSegmentDeprecated2OK{} +} + +/* +ReloadSegmentDeprecated2OK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReloadSegmentDeprecated2OK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reload segment deprecated2 o k response has a 2xx status code +func (o *ReloadSegmentDeprecated2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reload segment deprecated2 o k response has a 3xx status code +func (o *ReloadSegmentDeprecated2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reload segment deprecated2 o k response has a 4xx status code +func (o *ReloadSegmentDeprecated2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reload segment deprecated2 o k response has a 5xx status code +func (o *ReloadSegmentDeprecated2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this reload segment deprecated2 o k response a status code equal to that given +func (o *ReloadSegmentDeprecated2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reload segment deprecated2 o k response +func (o *ReloadSegmentDeprecated2OK) Code() int { + return 200 +} + +func (o *ReloadSegmentDeprecated2OK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/{segmentName}/reload][%d] reloadSegmentDeprecated2OK %+v", 200, o.Payload) +} + +func (o *ReloadSegmentDeprecated2OK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/segments/{segmentName}/reload][%d] reloadSegmentDeprecated2OK %+v", 200, o.Payload) +} + +func (o *ReloadSegmentDeprecated2OK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ReloadSegmentDeprecated2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reload_segment_parameters.go b/src/client/segment/reload_segment_parameters.go new file mode 100644 index 0000000..95aa22a --- /dev/null +++ b/src/client/segment/reload_segment_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewReloadSegmentParams creates a new ReloadSegmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReloadSegmentParams() *ReloadSegmentParams { + return &ReloadSegmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReloadSegmentParamsWithTimeout creates a new ReloadSegmentParams object +// with the ability to set a timeout on a request. +func NewReloadSegmentParamsWithTimeout(timeout time.Duration) *ReloadSegmentParams { + return &ReloadSegmentParams{ + timeout: timeout, + } +} + +// NewReloadSegmentParamsWithContext creates a new ReloadSegmentParams object +// with the ability to set a context for a request. +func NewReloadSegmentParamsWithContext(ctx context.Context) *ReloadSegmentParams { + return &ReloadSegmentParams{ + Context: ctx, + } +} + +// NewReloadSegmentParamsWithHTTPClient creates a new ReloadSegmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewReloadSegmentParamsWithHTTPClient(client *http.Client) *ReloadSegmentParams { + return &ReloadSegmentParams{ + HTTPClient: client, + } +} + +/* +ReloadSegmentParams contains all the parameters to send to the API endpoint + + for the reload segment operation. + + Typically these are written to a http.Request. +*/ +type ReloadSegmentParams struct { + + /* ForceDownload. + + Whether to force server to download segment + */ + ForceDownload *bool + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reload segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadSegmentParams) WithDefaults() *ReloadSegmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reload segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReloadSegmentParams) SetDefaults() { + var ( + forceDownloadDefault = bool(false) + ) + + val := ReloadSegmentParams{ + ForceDownload: &forceDownloadDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the reload segment params +func (o *ReloadSegmentParams) WithTimeout(timeout time.Duration) *ReloadSegmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload segment params +func (o *ReloadSegmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload segment params +func (o *ReloadSegmentParams) WithContext(ctx context.Context) *ReloadSegmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload segment params +func (o *ReloadSegmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload segment params +func (o *ReloadSegmentParams) WithHTTPClient(client *http.Client) *ReloadSegmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload segment params +func (o *ReloadSegmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForceDownload adds the forceDownload to the reload segment params +func (o *ReloadSegmentParams) WithForceDownload(forceDownload *bool) *ReloadSegmentParams { + o.SetForceDownload(forceDownload) + return o +} + +// SetForceDownload adds the forceDownload to the reload segment params +func (o *ReloadSegmentParams) SetForceDownload(forceDownload *bool) { + o.ForceDownload = forceDownload +} + +// WithSegmentName adds the segmentName to the reload segment params +func (o *ReloadSegmentParams) WithSegmentName(segmentName string) *ReloadSegmentParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the reload segment params +func (o *ReloadSegmentParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableName adds the tableName to the reload segment params +func (o *ReloadSegmentParams) WithTableName(tableName string) *ReloadSegmentParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the reload segment params +func (o *ReloadSegmentParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadSegmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForceDownload != nil { + + // query param forceDownload + var qrForceDownload bool + + if o.ForceDownload != nil { + qrForceDownload = *o.ForceDownload + } + qForceDownload := swag.FormatBool(qrForceDownload) + if qForceDownload != "" { + + if err := r.SetQueryParam("forceDownload", qForceDownload); err != nil { + return err + } + } + } + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reload_segment_responses.go b/src/client/segment/reload_segment_responses.go new file mode 100644 index 0000000..2a6d391 --- /dev/null +++ b/src/client/segment/reload_segment_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReloadSegmentReader is a Reader for the ReloadSegment structure. +type ReloadSegmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadSegmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadSegmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReloadSegmentOK creates a ReloadSegmentOK with default headers values +func NewReloadSegmentOK() *ReloadSegmentOK { + return &ReloadSegmentOK{} +} + +/* +ReloadSegmentOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReloadSegmentOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reload segment o k response has a 2xx status code +func (o *ReloadSegmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reload segment o k response has a 3xx status code +func (o *ReloadSegmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reload segment o k response has a 4xx status code +func (o *ReloadSegmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reload segment o k response has a 5xx status code +func (o *ReloadSegmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this reload segment o k response a status code equal to that given +func (o *ReloadSegmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reload segment o k response +func (o *ReloadSegmentOK) Code() int { + return 200 +} + +func (o *ReloadSegmentOK) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/{segmentName}/reload][%d] reloadSegmentOK %+v", 200, o.Payload) +} + +func (o *ReloadSegmentOK) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/{segmentName}/reload][%d] reloadSegmentOK %+v", 200, o.Payload) +} + +func (o *ReloadSegmentOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ReloadSegmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reset_segment_parameters.go b/src/client/segment/reset_segment_parameters.go new file mode 100644 index 0000000..15e44ad --- /dev/null +++ b/src/client/segment/reset_segment_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewResetSegmentParams creates a new ResetSegmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResetSegmentParams() *ResetSegmentParams { + return &ResetSegmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResetSegmentParamsWithTimeout creates a new ResetSegmentParams object +// with the ability to set a timeout on a request. +func NewResetSegmentParamsWithTimeout(timeout time.Duration) *ResetSegmentParams { + return &ResetSegmentParams{ + timeout: timeout, + } +} + +// NewResetSegmentParamsWithContext creates a new ResetSegmentParams object +// with the ability to set a context for a request. +func NewResetSegmentParamsWithContext(ctx context.Context) *ResetSegmentParams { + return &ResetSegmentParams{ + Context: ctx, + } +} + +// NewResetSegmentParamsWithHTTPClient creates a new ResetSegmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewResetSegmentParamsWithHTTPClient(client *http.Client) *ResetSegmentParams { + return &ResetSegmentParams{ + HTTPClient: client, + } +} + +/* +ResetSegmentParams contains all the parameters to send to the API endpoint + + for the reset segment operation. + + Typically these are written to a http.Request. +*/ +type ResetSegmentParams struct { + + /* SegmentName. + + Name of the segment + */ + SegmentName string + + /* TableNameWithType. + + Name of the table with type + */ + TableNameWithType string + + /* TargetInstance. + + Name of the target instance to reset + */ + TargetInstance *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reset segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResetSegmentParams) WithDefaults() *ResetSegmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reset segment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResetSegmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reset segment params +func (o *ResetSegmentParams) WithTimeout(timeout time.Duration) *ResetSegmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reset segment params +func (o *ResetSegmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reset segment params +func (o *ResetSegmentParams) WithContext(ctx context.Context) *ResetSegmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reset segment params +func (o *ResetSegmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reset segment params +func (o *ResetSegmentParams) WithHTTPClient(client *http.Client) *ResetSegmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reset segment params +func (o *ResetSegmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSegmentName adds the segmentName to the reset segment params +func (o *ResetSegmentParams) WithSegmentName(segmentName string) *ResetSegmentParams { + o.SetSegmentName(segmentName) + return o +} + +// SetSegmentName adds the segmentName to the reset segment params +func (o *ResetSegmentParams) SetSegmentName(segmentName string) { + o.SegmentName = segmentName +} + +// WithTableNameWithType adds the tableNameWithType to the reset segment params +func (o *ResetSegmentParams) WithTableNameWithType(tableNameWithType string) *ResetSegmentParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the reset segment params +func (o *ResetSegmentParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTargetInstance adds the targetInstance to the reset segment params +func (o *ResetSegmentParams) WithTargetInstance(targetInstance *string) *ResetSegmentParams { + o.SetTargetInstance(targetInstance) + return o +} + +// SetTargetInstance adds the targetInstance to the reset segment params +func (o *ResetSegmentParams) SetTargetInstance(targetInstance *string) { + o.TargetInstance = targetInstance +} + +// WriteToRequest writes these params to a swagger request +func (o *ResetSegmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param segmentName + if err := r.SetPathParam("segmentName", o.SegmentName); err != nil { + return err + } + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + if o.TargetInstance != nil { + + // query param targetInstance + var qrTargetInstance string + + if o.TargetInstance != nil { + qrTargetInstance = *o.TargetInstance + } + qTargetInstance := qrTargetInstance + if qTargetInstance != "" { + + if err := r.SetQueryParam("targetInstance", qTargetInstance); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reset_segment_responses.go b/src/client/segment/reset_segment_responses.go new file mode 100644 index 0000000..3450ef0 --- /dev/null +++ b/src/client/segment/reset_segment_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ResetSegmentReader is a Reader for the ResetSegment structure. +type ResetSegmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResetSegmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResetSegmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewResetSegmentOK creates a ResetSegmentOK with default headers values +func NewResetSegmentOK() *ResetSegmentOK { + return &ResetSegmentOK{} +} + +/* +ResetSegmentOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ResetSegmentOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reset segment o k response has a 2xx status code +func (o *ResetSegmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reset segment o k response has a 3xx status code +func (o *ResetSegmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reset segment o k response has a 4xx status code +func (o *ResetSegmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reset segment o k response has a 5xx status code +func (o *ResetSegmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this reset segment o k response a status code equal to that given +func (o *ResetSegmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reset segment o k response +func (o *ResetSegmentOK) Code() int { + return 200 +} + +func (o *ResetSegmentOK) Error() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/{segmentName}/reset][%d] resetSegmentOK %+v", 200, o.Payload) +} + +func (o *ResetSegmentOK) String() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/{segmentName}/reset][%d] resetSegmentOK %+v", 200, o.Payload) +} + +func (o *ResetSegmentOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ResetSegmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/reset_segments_parameters.go b/src/client/segment/reset_segments_parameters.go new file mode 100644 index 0000000..5d1574d --- /dev/null +++ b/src/client/segment/reset_segments_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewResetSegmentsParams creates a new ResetSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResetSegmentsParams() *ResetSegmentsParams { + return &ResetSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResetSegmentsParamsWithTimeout creates a new ResetSegmentsParams object +// with the ability to set a timeout on a request. +func NewResetSegmentsParamsWithTimeout(timeout time.Duration) *ResetSegmentsParams { + return &ResetSegmentsParams{ + timeout: timeout, + } +} + +// NewResetSegmentsParamsWithContext creates a new ResetSegmentsParams object +// with the ability to set a context for a request. +func NewResetSegmentsParamsWithContext(ctx context.Context) *ResetSegmentsParams { + return &ResetSegmentsParams{ + Context: ctx, + } +} + +// NewResetSegmentsParamsWithHTTPClient creates a new ResetSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewResetSegmentsParamsWithHTTPClient(client *http.Client) *ResetSegmentsParams { + return &ResetSegmentsParams{ + HTTPClient: client, + } +} + +/* +ResetSegmentsParams contains all the parameters to send to the API endpoint + + for the reset segments operation. + + Typically these are written to a http.Request. +*/ +type ResetSegmentsParams struct { + + /* ErrorSegmentsOnly. + + Whether to reset only segments with error state + */ + ErrorSegmentsOnly *bool + + /* TableNameWithType. + + Name of the table with type + */ + TableNameWithType string + + /* TargetInstance. + + Name of the target instance to reset + */ + TargetInstance *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reset segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResetSegmentsParams) WithDefaults() *ResetSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reset segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResetSegmentsParams) SetDefaults() { + var ( + errorSegmentsOnlyDefault = bool(false) + ) + + val := ResetSegmentsParams{ + ErrorSegmentsOnly: &errorSegmentsOnlyDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the reset segments params +func (o *ResetSegmentsParams) WithTimeout(timeout time.Duration) *ResetSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reset segments params +func (o *ResetSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reset segments params +func (o *ResetSegmentsParams) WithContext(ctx context.Context) *ResetSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reset segments params +func (o *ResetSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reset segments params +func (o *ResetSegmentsParams) WithHTTPClient(client *http.Client) *ResetSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reset segments params +func (o *ResetSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithErrorSegmentsOnly adds the errorSegmentsOnly to the reset segments params +func (o *ResetSegmentsParams) WithErrorSegmentsOnly(errorSegmentsOnly *bool) *ResetSegmentsParams { + o.SetErrorSegmentsOnly(errorSegmentsOnly) + return o +} + +// SetErrorSegmentsOnly adds the errorSegmentsOnly to the reset segments params +func (o *ResetSegmentsParams) SetErrorSegmentsOnly(errorSegmentsOnly *bool) { + o.ErrorSegmentsOnly = errorSegmentsOnly +} + +// WithTableNameWithType adds the tableNameWithType to the reset segments params +func (o *ResetSegmentsParams) WithTableNameWithType(tableNameWithType string) *ResetSegmentsParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the reset segments params +func (o *ResetSegmentsParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTargetInstance adds the targetInstance to the reset segments params +func (o *ResetSegmentsParams) WithTargetInstance(targetInstance *string) *ResetSegmentsParams { + o.SetTargetInstance(targetInstance) + return o +} + +// SetTargetInstance adds the targetInstance to the reset segments params +func (o *ResetSegmentsParams) SetTargetInstance(targetInstance *string) { + o.TargetInstance = targetInstance +} + +// WriteToRequest writes these params to a swagger request +func (o *ResetSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ErrorSegmentsOnly != nil { + + // query param errorSegmentsOnly + var qrErrorSegmentsOnly bool + + if o.ErrorSegmentsOnly != nil { + qrErrorSegmentsOnly = *o.ErrorSegmentsOnly + } + qErrorSegmentsOnly := swag.FormatBool(qrErrorSegmentsOnly) + if qErrorSegmentsOnly != "" { + + if err := r.SetQueryParam("errorSegmentsOnly", qErrorSegmentsOnly); err != nil { + return err + } + } + } + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + if o.TargetInstance != nil { + + // query param targetInstance + var qrTargetInstance string + + if o.TargetInstance != nil { + qrTargetInstance = *o.TargetInstance + } + qTargetInstance := qrTargetInstance + if qTargetInstance != "" { + + if err := r.SetQueryParam("targetInstance", qTargetInstance); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/reset_segments_responses.go b/src/client/segment/reset_segments_responses.go new file mode 100644 index 0000000..f7e92b0 --- /dev/null +++ b/src/client/segment/reset_segments_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ResetSegmentsReader is a Reader for the ResetSegments structure. +type ResetSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResetSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResetSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewResetSegmentsOK creates a ResetSegmentsOK with default headers values +func NewResetSegmentsOK() *ResetSegmentsOK { + return &ResetSegmentsOK{} +} + +/* +ResetSegmentsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ResetSegmentsOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this reset segments o k response has a 2xx status code +func (o *ResetSegmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reset segments o k response has a 3xx status code +func (o *ResetSegmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reset segments o k response has a 4xx status code +func (o *ResetSegmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reset segments o k response has a 5xx status code +func (o *ResetSegmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this reset segments o k response a status code equal to that given +func (o *ResetSegmentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the reset segments o k response +func (o *ResetSegmentsOK) Code() int { + return 200 +} + +func (o *ResetSegmentsOK) Error() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/reset][%d] resetSegmentsOK %+v", 200, o.Payload) +} + +func (o *ResetSegmentsOK) String() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/reset][%d] resetSegmentsOK %+v", 200, o.Payload) +} + +func (o *ResetSegmentsOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ResetSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/segment/revert_replace_segments_parameters.go b/src/client/segment/revert_replace_segments_parameters.go new file mode 100644 index 0000000..535efd6 --- /dev/null +++ b/src/client/segment/revert_replace_segments_parameters.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRevertReplaceSegmentsParams creates a new RevertReplaceSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRevertReplaceSegmentsParams() *RevertReplaceSegmentsParams { + return &RevertReplaceSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRevertReplaceSegmentsParamsWithTimeout creates a new RevertReplaceSegmentsParams object +// with the ability to set a timeout on a request. +func NewRevertReplaceSegmentsParamsWithTimeout(timeout time.Duration) *RevertReplaceSegmentsParams { + return &RevertReplaceSegmentsParams{ + timeout: timeout, + } +} + +// NewRevertReplaceSegmentsParamsWithContext creates a new RevertReplaceSegmentsParams object +// with the ability to set a context for a request. +func NewRevertReplaceSegmentsParamsWithContext(ctx context.Context) *RevertReplaceSegmentsParams { + return &RevertReplaceSegmentsParams{ + Context: ctx, + } +} + +// NewRevertReplaceSegmentsParamsWithHTTPClient creates a new RevertReplaceSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewRevertReplaceSegmentsParamsWithHTTPClient(client *http.Client) *RevertReplaceSegmentsParams { + return &RevertReplaceSegmentsParams{ + HTTPClient: client, + } +} + +/* +RevertReplaceSegmentsParams contains all the parameters to send to the API endpoint + + for the revert replace segments operation. + + Typically these are written to a http.Request. +*/ +type RevertReplaceSegmentsParams struct { + + /* ForceRevert. + + Force revert in case the user knows that the lineage entry is interrupted + */ + ForceRevert *bool + + /* SegmentLineageEntryID. + + Segment lineage entry id to revert + */ + SegmentLineageEntryID string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the revert replace segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevertReplaceSegmentsParams) WithDefaults() *RevertReplaceSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revert replace segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevertReplaceSegmentsParams) SetDefaults() { + var ( + forceRevertDefault = bool(false) + ) + + val := RevertReplaceSegmentsParams{ + ForceRevert: &forceRevertDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithTimeout(timeout time.Duration) *RevertReplaceSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithContext(ctx context.Context) *RevertReplaceSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithHTTPClient(client *http.Client) *RevertReplaceSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForceRevert adds the forceRevert to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithForceRevert(forceRevert *bool) *RevertReplaceSegmentsParams { + o.SetForceRevert(forceRevert) + return o +} + +// SetForceRevert adds the forceRevert to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetForceRevert(forceRevert *bool) { + o.ForceRevert = forceRevert +} + +// WithSegmentLineageEntryID adds the segmentLineageEntryID to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithSegmentLineageEntryID(segmentLineageEntryID string) *RevertReplaceSegmentsParams { + o.SetSegmentLineageEntryID(segmentLineageEntryID) + return o +} + +// SetSegmentLineageEntryID adds the segmentLineageEntryId to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetSegmentLineageEntryID(segmentLineageEntryID string) { + o.SegmentLineageEntryID = segmentLineageEntryID +} + +// WithTableName adds the tableName to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithTableName(tableName string) *RevertReplaceSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the revert replace segments params +func (o *RevertReplaceSegmentsParams) WithType(typeVar string) *RevertReplaceSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the revert replace segments params +func (o *RevertReplaceSegmentsParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *RevertReplaceSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForceRevert != nil { + + // query param forceRevert + var qrForceRevert bool + + if o.ForceRevert != nil { + qrForceRevert = *o.ForceRevert + } + qForceRevert := swag.FormatBool(qrForceRevert) + if qForceRevert != "" { + + if err := r.SetQueryParam("forceRevert", qForceRevert); err != nil { + return err + } + } + } + + // query param segmentLineageEntryId + qrSegmentLineageEntryID := o.SegmentLineageEntryID + qSegmentLineageEntryID := qrSegmentLineageEntryID + if qSegmentLineageEntryID != "" { + + if err := r.SetQueryParam("segmentLineageEntryId", qSegmentLineageEntryID); err != nil { + return err + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/revert_replace_segments_responses.go b/src/client/segment/revert_replace_segments_responses.go new file mode 100644 index 0000000..f6d2f5a --- /dev/null +++ b/src/client/segment/revert_replace_segments_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RevertReplaceSegmentsReader is a Reader for the RevertReplaceSegments structure. +type RevertReplaceSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RevertReplaceSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewRevertReplaceSegmentsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewRevertReplaceSegmentsDefault creates a RevertReplaceSegmentsDefault with default headers values +func NewRevertReplaceSegmentsDefault(code int) *RevertReplaceSegmentsDefault { + return &RevertReplaceSegmentsDefault{ + _statusCode: code, + } +} + +/* +RevertReplaceSegmentsDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type RevertReplaceSegmentsDefault struct { + _statusCode int +} + +// IsSuccess returns true when this revert replace segments default response has a 2xx status code +func (o *RevertReplaceSegmentsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this revert replace segments default response has a 3xx status code +func (o *RevertReplaceSegmentsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this revert replace segments default response has a 4xx status code +func (o *RevertReplaceSegmentsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this revert replace segments default response has a 5xx status code +func (o *RevertReplaceSegmentsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this revert replace segments default response a status code equal to that given +func (o *RevertReplaceSegmentsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the revert replace segments default response +func (o *RevertReplaceSegmentsDefault) Code() int { + return o._statusCode +} + +func (o *RevertReplaceSegmentsDefault) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/revertReplaceSegments][%d] revertReplaceSegments default ", o._statusCode) +} + +func (o *RevertReplaceSegmentsDefault) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/revertReplaceSegments][%d] revertReplaceSegments default ", o._statusCode) +} + +func (o *RevertReplaceSegmentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/segment_client.go b/src/client/segment/segment_client.go new file mode 100644 index 0000000..aef94f4 --- /dev/null +++ b/src/client/segment/segment_client.go @@ -0,0 +1,1423 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new segment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for segment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteAllSegments(params *DeleteAllSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAllSegmentsOK, error) + + DeleteSegment(params *DeleteSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSegmentOK, error) + + DeleteSegments(params *DeleteSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSegmentsOK, error) + + DownloadSegment(params *DownloadSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + EndReplaceSegments(params *EndReplaceSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + GetReloadJobStatus(params *GetReloadJobStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetReloadJobStatusOK, error) + + GetSegmentMetadata(params *GetSegmentMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentMetadataOK, error) + + GetSegmentMetadataDeprecated1(params *GetSegmentMetadataDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentMetadataDeprecated1OK, error) + + GetSegmentMetadataDeprecated2(params *GetSegmentMetadataDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentMetadataDeprecated2OK, error) + + GetSegmentTiers(params *GetSegmentTiersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentTiersOK, error) + + GetSegmentToCrcMap(params *GetSegmentToCrcMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentToCrcMapOK, error) + + GetSegmentToCrcMapDeprecated(params *GetSegmentToCrcMapDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentToCrcMapDeprecatedOK, error) + + GetSegments(params *GetSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentsOK, error) + + GetSelectedSegments(params *GetSelectedSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSelectedSegmentsOK, error) + + GetServerMetadata(params *GetServerMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerMetadataOK, error) + + GetServerToSegmentsMap(params *GetServerToSegmentsMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerToSegmentsMapOK, error) + + GetServerToSegmentsMapDeprecated1(params *GetServerToSegmentsMapDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerToSegmentsMapDeprecated1OK, error) + + GetServerToSegmentsMapDeprecated2(params *GetServerToSegmentsMapDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerToSegmentsMapDeprecated2OK, error) + + GetTableTiers(params *GetTableTiersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableTiersOK, error) + + ListSegmentLineage(params *ListSegmentLineageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + ReloadAllSegments(params *ReloadAllSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadAllSegmentsOK, error) + + ReloadAllSegmentsDeprecated1(params *ReloadAllSegmentsDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadAllSegmentsDeprecated1OK, error) + + ReloadAllSegmentsDeprecated2(params *ReloadAllSegmentsDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadAllSegmentsDeprecated2OK, error) + + ReloadSegment(params *ReloadSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadSegmentOK, error) + + ReloadSegmentDeprecated1(params *ReloadSegmentDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadSegmentDeprecated1OK, error) + + ReloadSegmentDeprecated2(params *ReloadSegmentDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadSegmentDeprecated2OK, error) + + ResetSegment(params *ResetSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResetSegmentOK, error) + + ResetSegments(params *ResetSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResetSegmentsOK, error) + + RevertReplaceSegments(params *RevertReplaceSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + StartReplaceSegments(params *StartReplaceSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + UpdateTimeIntervalZK(params *UpdateTimeIntervalZKParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTimeIntervalZKOK, error) + + UploadSegmentAsMultiPart(params *UploadSegmentAsMultiPartParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UploadSegmentAsMultiPartOK, error) + + UploadSegmentAsMultiPartV2(params *UploadSegmentAsMultiPartV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UploadSegmentAsMultiPartV2OK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +DeleteAllSegments deletes all segments + +Delete all segments +*/ +func (a *Client) DeleteAllSegments(params *DeleteAllSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAllSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAllSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "deleteAllSegments", + Method: "DELETE", + PathPattern: "/segments/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteAllSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteAllSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteAllSegments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteSegment deletes a segment + +Delete a segment +*/ +func (a *Client) DeleteSegment(params *DeleteSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSegmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSegmentParams() + } + op := &runtime.ClientOperation{ + ID: "deleteSegment", + Method: "DELETE", + PathPattern: "/segments/{tableName}/{segmentName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteSegmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSegmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteSegment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteSegments deletes the segments in the JSON array payload + +Delete the segments in the JSON array payload +*/ +func (a *Client) DeleteSegments(params *DeleteSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "deleteSegments", + Method: "POST", + PathPattern: "/segments/{tableName}/delete", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteSegments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DownloadSegment downloads a segment + +Download a segment +*/ +func (a *Client) DownloadSegment(params *DownloadSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadSegmentParams() + } + op := &runtime.ClientOperation{ + ID: "downloadSegment", + Method: "GET", + PathPattern: "/segments/{tableName}/{segmentName}", + ProducesMediaTypes: []string{"application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DownloadSegmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +EndReplaceSegments ends to replace segments + +End to replace segments +*/ +func (a *Client) EndReplaceSegments(params *EndReplaceSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewEndReplaceSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "endReplaceSegments", + Method: "POST", + PathPattern: "/segments/{tableName}/endReplaceSegments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &EndReplaceSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +GetReloadJobStatus gets status for a submitted reload operation + +Get status for a submitted reload operation +*/ +func (a *Client) GetReloadJobStatus(params *GetReloadJobStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetReloadJobStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetReloadJobStatusParams() + } + op := &runtime.ClientOperation{ + ID: "getReloadJobStatus", + Method: "GET", + PathPattern: "/segments/segmentReloadStatus/{jobId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetReloadJobStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetReloadJobStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getReloadJobStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentMetadata gets the metadata for a segment + +Get the metadata for a segment +*/ +func (a *Client) GetSegmentMetadata(params *GetSegmentMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentMetadataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentMetadataParams() + } + op := &runtime.ClientOperation{ + ID: "getSegmentMetadata", + Method: "GET", + PathPattern: "/segments/{tableName}/{segmentName}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentMetadataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentMetadataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentMetadataDeprecated1 gets the metadata for a segment deprecated use g e t segments table name segment name metadata instead + +Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead) +*/ +func (a *Client) GetSegmentMetadataDeprecated1(params *GetSegmentMetadataDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentMetadataDeprecated1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentMetadataDeprecated1Params() + } + op := &runtime.ClientOperation{ + ID: "getSegmentMetadataDeprecated1", + Method: "GET", + PathPattern: "/tables/{tableName}/segments/{segmentName}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentMetadataDeprecated1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentMetadataDeprecated1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentMetadataDeprecated1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentMetadataDeprecated2 gets the metadata for a segment deprecated use g e t segments table name segment name metadata instead + +Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead) +*/ +func (a *Client) GetSegmentMetadataDeprecated2(params *GetSegmentMetadataDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentMetadataDeprecated2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentMetadataDeprecated2Params() + } + op := &runtime.ClientOperation{ + ID: "getSegmentMetadataDeprecated2", + Method: "GET", + PathPattern: "/tables/{tableName}/segments/{segmentName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentMetadataDeprecated2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentMetadataDeprecated2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentMetadataDeprecated2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentTiers gets storage tiers for the given segment + +Get storage tiers for the given segment +*/ +func (a *Client) GetSegmentTiers(params *GetSegmentTiersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentTiersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentTiersParams() + } + op := &runtime.ClientOperation{ + ID: "getSegmentTiers", + Method: "GET", + PathPattern: "/segments/{tableName}/{segmentName}/tiers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentTiersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentTiersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentTiers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentToCrcMap gets a map from segment to c r c of the segment only apply to o f f l i n e table + +Get a map from segment to CRC of the segment (only apply to OFFLINE table) +*/ +func (a *Client) GetSegmentToCrcMap(params *GetSegmentToCrcMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentToCrcMapOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentToCrcMapParams() + } + op := &runtime.ClientOperation{ + ID: "getSegmentToCrcMap", + Method: "GET", + PathPattern: "/segments/{tableName}/crc", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentToCrcMapReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentToCrcMapOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentToCrcMap: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegmentToCrcMapDeprecated gets a map from segment to c r c of the segment deprecated use g e t segments table name crc instead + +Get a map from segment to CRC of the segment (deprecated, use 'GET /segments/{tableName}/crc' instead) +*/ +func (a *Client) GetSegmentToCrcMapDeprecated(params *GetSegmentToCrcMapDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentToCrcMapDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentToCrcMapDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "getSegmentToCrcMapDeprecated", + Method: "GET", + PathPattern: "/tables/{tableName}/segments/crc", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentToCrcMapDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentToCrcMapDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegmentToCrcMapDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSegments lists all segments an optional exclude replaced segments parameter is used to get the list of segments which has not yet been replaced determined by segment lineage entries and can be queried from the table the value is false by default + +List all segments +*/ +func (a *Client) GetSegments(params *GetSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "getSegments", + Method: "GET", + PathPattern: "/segments/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSegments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSelectedSegments gets the selected segments given the inclusive start and exclusive end timestamps in milliseconds these timestamps will be compared against the minmax values of the time column in each segment if the table is a refresh use case the value of start and end timestamp is voided since there is no time column for refresh use case instead the whole qualified segments will be returned if no timestamps are provided all the qualified segments will be returned for the segments that partially belong to the time range the boolean flag exclude overlapping is introduced in order for user to determine whether to exclude this kind of segments in the response + +Get the selected segments given the start and end timestamps in milliseconds +*/ +func (a *Client) GetSelectedSegments(params *GetSelectedSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSelectedSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelectedSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "getSelectedSegments", + Method: "GET", + PathPattern: "/segments/{tableName}/select", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSelectedSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelectedSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSelectedSegments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetServerMetadata gets the server metadata for all table segments + +Get the server metadata for all table segments +*/ +func (a *Client) GetServerMetadata(params *GetServerMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerMetadataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServerMetadataParams() + } + op := &runtime.ClientOperation{ + ID: "getServerMetadata", + Method: "GET", + PathPattern: "/segments/{tableName}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServerMetadataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServerMetadataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getServerMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetServerToSegmentsMap gets a map from server to segments hosted by the server + +Get a map from server to segments hosted by the server +*/ +func (a *Client) GetServerToSegmentsMap(params *GetServerToSegmentsMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerToSegmentsMapOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServerToSegmentsMapParams() + } + op := &runtime.ClientOperation{ + ID: "getServerToSegmentsMap", + Method: "GET", + PathPattern: "/segments/{tableName}/servers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServerToSegmentsMapReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServerToSegmentsMapOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getServerToSegmentsMap: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetServerToSegmentsMapDeprecated1 gets a map from server to segments hosted by the server deprecated use g e t segments table name servers instead + +Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead) +*/ +func (a *Client) GetServerToSegmentsMapDeprecated1(params *GetServerToSegmentsMapDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerToSegmentsMapDeprecated1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServerToSegmentsMapDeprecated1Params() + } + op := &runtime.ClientOperation{ + ID: "getServerToSegmentsMapDeprecated1", + Method: "GET", + PathPattern: "/tables/{tableName}/segments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServerToSegmentsMapDeprecated1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServerToSegmentsMapDeprecated1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getServerToSegmentsMapDeprecated1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetServerToSegmentsMapDeprecated2 gets a map from server to segments hosted by the server deprecated use g e t segments table name servers instead + +Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead) +*/ +func (a *Client) GetServerToSegmentsMapDeprecated2(params *GetServerToSegmentsMapDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServerToSegmentsMapDeprecated2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServerToSegmentsMapDeprecated2Params() + } + op := &runtime.ClientOperation{ + ID: "getServerToSegmentsMapDeprecated2", + Method: "GET", + PathPattern: "/tables/{tableName}/segments/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServerToSegmentsMapDeprecated2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServerToSegmentsMapDeprecated2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getServerToSegmentsMapDeprecated2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableTiers gets storage tier for all segments in the given table + +Get storage tier for all segments in the given table +*/ +func (a *Client) GetTableTiers(params *GetTableTiersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableTiersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableTiersParams() + } + op := &runtime.ClientOperation{ + ID: "getTableTiers", + Method: "GET", + PathPattern: "/segments/{tableName}/tiers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableTiersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableTiersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableTiers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListSegmentLineage lists segment lineage + +List segment lineage in chronologically sorted order +*/ +func (a *Client) ListSegmentLineage(params *ListSegmentLineageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewListSegmentLineageParams() + } + op := &runtime.ClientOperation{ + ID: "listSegmentLineage", + Method: "GET", + PathPattern: "/segments/{tableName}/lineage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListSegmentLineageReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +ReloadAllSegments reloads all segments + +Reload all segments +*/ +func (a *Client) ReloadAllSegments(params *ReloadAllSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadAllSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadAllSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "reloadAllSegments", + Method: "POST", + PathPattern: "/segments/{tableName}/reload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReloadAllSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadAllSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reloadAllSegments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReloadAllSegmentsDeprecated1 reloads all segments deprecated use p o s t segments table name reload instead + +Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead) +*/ +func (a *Client) ReloadAllSegmentsDeprecated1(params *ReloadAllSegmentsDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadAllSegmentsDeprecated1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadAllSegmentsDeprecated1Params() + } + op := &runtime.ClientOperation{ + ID: "reloadAllSegmentsDeprecated1", + Method: "POST", + PathPattern: "/tables/{tableName}/segments/reload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReloadAllSegmentsDeprecated1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadAllSegmentsDeprecated1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reloadAllSegmentsDeprecated1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReloadAllSegmentsDeprecated2 reloads all segments deprecated use p o s t segments table name reload instead + +Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead) +*/ +func (a *Client) ReloadAllSegmentsDeprecated2(params *ReloadAllSegmentsDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadAllSegmentsDeprecated2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadAllSegmentsDeprecated2Params() + } + op := &runtime.ClientOperation{ + ID: "reloadAllSegmentsDeprecated2", + Method: "GET", + PathPattern: "/tables/{tableName}/segments/reload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReloadAllSegmentsDeprecated2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadAllSegmentsDeprecated2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reloadAllSegmentsDeprecated2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReloadSegment reloads a segment + +Reload a segment +*/ +func (a *Client) ReloadSegment(params *ReloadSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadSegmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadSegmentParams() + } + op := &runtime.ClientOperation{ + ID: "reloadSegment", + Method: "POST", + PathPattern: "/segments/{tableName}/{segmentName}/reload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReloadSegmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadSegmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reloadSegment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReloadSegmentDeprecated1 reloads a segment deprecated use p o s t segments table name segment name reload instead + +Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead) +*/ +func (a *Client) ReloadSegmentDeprecated1(params *ReloadSegmentDeprecated1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadSegmentDeprecated1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadSegmentDeprecated1Params() + } + op := &runtime.ClientOperation{ + ID: "reloadSegmentDeprecated1", + Method: "POST", + PathPattern: "/tables/{tableName}/segments/{segmentName}/reload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReloadSegmentDeprecated1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadSegmentDeprecated1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reloadSegmentDeprecated1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReloadSegmentDeprecated2 reloads a segment deprecated use p o s t segments table name segment name reload instead + +Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead) +*/ +func (a *Client) ReloadSegmentDeprecated2(params *ReloadSegmentDeprecated2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReloadSegmentDeprecated2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadSegmentDeprecated2Params() + } + op := &runtime.ClientOperation{ + ID: "reloadSegmentDeprecated2", + Method: "GET", + PathPattern: "/tables/{tableName}/segments/{segmentName}/reload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReloadSegmentDeprecated2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadSegmentDeprecated2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reloadSegmentDeprecated2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ResetSegment resets a segment by first disabling it waiting for external view to stabilize and finally enabling it again + +Resets a segment by disabling and then enabling it +*/ +func (a *Client) ResetSegment(params *ResetSegmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResetSegmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResetSegmentParams() + } + op := &runtime.ClientOperation{ + ID: "resetSegment", + Method: "POST", + PathPattern: "/segments/{tableNameWithType}/{segmentName}/reset", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ResetSegmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ResetSegmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for resetSegment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ResetSegments resets all segments when error segments only false or segments with error state when error segments only true of the table by first disabling them waiting for external view to stabilize and finally enabling them + +Resets segments by disabling and then enabling them +*/ +func (a *Client) ResetSegments(params *ResetSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResetSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResetSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "resetSegments", + Method: "POST", + PathPattern: "/segments/{tableNameWithType}/reset", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ResetSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ResetSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for resetSegments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RevertReplaceSegments reverts segments replacement + +Revert segments replacement +*/ +func (a *Client) RevertReplaceSegments(params *RevertReplaceSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewRevertReplaceSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "revertReplaceSegments", + Method: "POST", + PathPattern: "/segments/{tableName}/revertReplaceSegments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RevertReplaceSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +StartReplaceSegments starts to replace segments + +Start to replace segments +*/ +func (a *Client) StartReplaceSegments(params *StartReplaceSegmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewStartReplaceSegmentsParams() + } + op := &runtime.ClientOperation{ + ID: "startReplaceSegments", + Method: "POST", + PathPattern: "/segments/{tableName}/startReplaceSegments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &StartReplaceSegmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +UpdateTimeIntervalZK updates the start and end time of the segments based on latest schema + +Update the start and end time of the segments based on latest schema +*/ +func (a *Client) UpdateTimeIntervalZK(params *UpdateTimeIntervalZKParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTimeIntervalZKOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateTimeIntervalZKParams() + } + op := &runtime.ClientOperation{ + ID: "updateTimeIntervalZK", + Method: "POST", + PathPattern: "/segments/{tableNameWithType}/updateZKTimeInterval", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateTimeIntervalZKReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateTimeIntervalZKOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateTimeIntervalZK: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UploadSegmentAsMultiPart uploads a segment + +Upload a segment as binary +*/ +func (a *Client) UploadSegmentAsMultiPart(params *UploadSegmentAsMultiPartParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UploadSegmentAsMultiPartOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUploadSegmentAsMultiPartParams() + } + op := &runtime.ClientOperation{ + ID: "uploadSegmentAsMultiPart", + Method: "POST", + PathPattern: "/segments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UploadSegmentAsMultiPartReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UploadSegmentAsMultiPartOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for uploadSegmentAsMultiPart: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UploadSegmentAsMultiPartV2 uploads a segment + +Upload a segment as binary +*/ +func (a *Client) UploadSegmentAsMultiPartV2(params *UploadSegmentAsMultiPartV2Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UploadSegmentAsMultiPartV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUploadSegmentAsMultiPartV2Params() + } + op := &runtime.ClientOperation{ + ID: "uploadSegmentAsMultiPartV2", + Method: "POST", + PathPattern: "/v2/segments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UploadSegmentAsMultiPartV2Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UploadSegmentAsMultiPartV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for uploadSegmentAsMultiPartV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/segment/start_replace_segments_parameters.go b/src/client/segment/start_replace_segments_parameters.go new file mode 100644 index 0000000..8c9562e --- /dev/null +++ b/src/client/segment/start_replace_segments_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "startree.ai/cli/models" +) + +// NewStartReplaceSegmentsParams creates a new StartReplaceSegmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStartReplaceSegmentsParams() *StartReplaceSegmentsParams { + return &StartReplaceSegmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStartReplaceSegmentsParamsWithTimeout creates a new StartReplaceSegmentsParams object +// with the ability to set a timeout on a request. +func NewStartReplaceSegmentsParamsWithTimeout(timeout time.Duration) *StartReplaceSegmentsParams { + return &StartReplaceSegmentsParams{ + timeout: timeout, + } +} + +// NewStartReplaceSegmentsParamsWithContext creates a new StartReplaceSegmentsParams object +// with the ability to set a context for a request. +func NewStartReplaceSegmentsParamsWithContext(ctx context.Context) *StartReplaceSegmentsParams { + return &StartReplaceSegmentsParams{ + Context: ctx, + } +} + +// NewStartReplaceSegmentsParamsWithHTTPClient creates a new StartReplaceSegmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewStartReplaceSegmentsParamsWithHTTPClient(client *http.Client) *StartReplaceSegmentsParams { + return &StartReplaceSegmentsParams{ + HTTPClient: client, + } +} + +/* +StartReplaceSegmentsParams contains all the parameters to send to the API endpoint + + for the start replace segments operation. + + Typically these are written to a http.Request. +*/ +type StartReplaceSegmentsParams struct { + + /* Body. + + Fields belonging to start replace segment request + */ + Body *models.StartReplaceSegmentsRequest + + /* ForceCleanup. + + Force cleanup + */ + ForceCleanup *bool + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the start replace segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartReplaceSegmentsParams) WithDefaults() *StartReplaceSegmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start replace segments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartReplaceSegmentsParams) SetDefaults() { + var ( + forceCleanupDefault = bool(false) + ) + + val := StartReplaceSegmentsParams{ + ForceCleanup: &forceCleanupDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the start replace segments params +func (o *StartReplaceSegmentsParams) WithTimeout(timeout time.Duration) *StartReplaceSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the start replace segments params +func (o *StartReplaceSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the start replace segments params +func (o *StartReplaceSegmentsParams) WithContext(ctx context.Context) *StartReplaceSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the start replace segments params +func (o *StartReplaceSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the start replace segments params +func (o *StartReplaceSegmentsParams) WithHTTPClient(client *http.Client) *StartReplaceSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the start replace segments params +func (o *StartReplaceSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the start replace segments params +func (o *StartReplaceSegmentsParams) WithBody(body *models.StartReplaceSegmentsRequest) *StartReplaceSegmentsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the start replace segments params +func (o *StartReplaceSegmentsParams) SetBody(body *models.StartReplaceSegmentsRequest) { + o.Body = body +} + +// WithForceCleanup adds the forceCleanup to the start replace segments params +func (o *StartReplaceSegmentsParams) WithForceCleanup(forceCleanup *bool) *StartReplaceSegmentsParams { + o.SetForceCleanup(forceCleanup) + return o +} + +// SetForceCleanup adds the forceCleanup to the start replace segments params +func (o *StartReplaceSegmentsParams) SetForceCleanup(forceCleanup *bool) { + o.ForceCleanup = forceCleanup +} + +// WithTableName adds the tableName to the start replace segments params +func (o *StartReplaceSegmentsParams) WithTableName(tableName string) *StartReplaceSegmentsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the start replace segments params +func (o *StartReplaceSegmentsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the start replace segments params +func (o *StartReplaceSegmentsParams) WithType(typeVar string) *StartReplaceSegmentsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the start replace segments params +func (o *StartReplaceSegmentsParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *StartReplaceSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.ForceCleanup != nil { + + // query param forceCleanup + var qrForceCleanup bool + + if o.ForceCleanup != nil { + qrForceCleanup = *o.ForceCleanup + } + qForceCleanup := swag.FormatBool(qrForceCleanup) + if qForceCleanup != "" { + + if err := r.SetQueryParam("forceCleanup", qForceCleanup); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/start_replace_segments_responses.go b/src/client/segment/start_replace_segments_responses.go new file mode 100644 index 0000000..b838d1e --- /dev/null +++ b/src/client/segment/start_replace_segments_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StartReplaceSegmentsReader is a Reader for the StartReplaceSegments structure. +type StartReplaceSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StartReplaceSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewStartReplaceSegmentsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewStartReplaceSegmentsDefault creates a StartReplaceSegmentsDefault with default headers values +func NewStartReplaceSegmentsDefault(code int) *StartReplaceSegmentsDefault { + return &StartReplaceSegmentsDefault{ + _statusCode: code, + } +} + +/* +StartReplaceSegmentsDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type StartReplaceSegmentsDefault struct { + _statusCode int +} + +// IsSuccess returns true when this start replace segments default response has a 2xx status code +func (o *StartReplaceSegmentsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this start replace segments default response has a 3xx status code +func (o *StartReplaceSegmentsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this start replace segments default response has a 4xx status code +func (o *StartReplaceSegmentsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this start replace segments default response has a 5xx status code +func (o *StartReplaceSegmentsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this start replace segments default response a status code equal to that given +func (o *StartReplaceSegmentsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the start replace segments default response +func (o *StartReplaceSegmentsDefault) Code() int { + return o._statusCode +} + +func (o *StartReplaceSegmentsDefault) Error() string { + return fmt.Sprintf("[POST /segments/{tableName}/startReplaceSegments][%d] startReplaceSegments default ", o._statusCode) +} + +func (o *StartReplaceSegmentsDefault) String() string { + return fmt.Sprintf("[POST /segments/{tableName}/startReplaceSegments][%d] startReplaceSegments default ", o._statusCode) +} + +func (o *StartReplaceSegmentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/update_time_interval_z_k_parameters.go b/src/client/segment/update_time_interval_z_k_parameters.go new file mode 100644 index 0000000..2408b65 --- /dev/null +++ b/src/client/segment/update_time_interval_z_k_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateTimeIntervalZKParams creates a new UpdateTimeIntervalZKParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTimeIntervalZKParams() *UpdateTimeIntervalZKParams { + return &UpdateTimeIntervalZKParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTimeIntervalZKParamsWithTimeout creates a new UpdateTimeIntervalZKParams object +// with the ability to set a timeout on a request. +func NewUpdateTimeIntervalZKParamsWithTimeout(timeout time.Duration) *UpdateTimeIntervalZKParams { + return &UpdateTimeIntervalZKParams{ + timeout: timeout, + } +} + +// NewUpdateTimeIntervalZKParamsWithContext creates a new UpdateTimeIntervalZKParams object +// with the ability to set a context for a request. +func NewUpdateTimeIntervalZKParamsWithContext(ctx context.Context) *UpdateTimeIntervalZKParams { + return &UpdateTimeIntervalZKParams{ + Context: ctx, + } +} + +// NewUpdateTimeIntervalZKParamsWithHTTPClient creates a new UpdateTimeIntervalZKParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTimeIntervalZKParamsWithHTTPClient(client *http.Client) *UpdateTimeIntervalZKParams { + return &UpdateTimeIntervalZKParams{ + HTTPClient: client, + } +} + +/* +UpdateTimeIntervalZKParams contains all the parameters to send to the API endpoint + + for the update time interval z k operation. + + Typically these are written to a http.Request. +*/ +type UpdateTimeIntervalZKParams struct { + + /* TableNameWithType. + + Table name with type + */ + TableNameWithType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update time interval z k params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTimeIntervalZKParams) WithDefaults() *UpdateTimeIntervalZKParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update time interval z k params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTimeIntervalZKParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) WithTimeout(timeout time.Duration) *UpdateTimeIntervalZKParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) WithContext(ctx context.Context) *UpdateTimeIntervalZKParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) WithHTTPClient(client *http.Client) *UpdateTimeIntervalZKParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableNameWithType adds the tableNameWithType to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) WithTableNameWithType(tableNameWithType string) *UpdateTimeIntervalZKParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the update time interval z k params +func (o *UpdateTimeIntervalZKParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTimeIntervalZKParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/update_time_interval_z_k_responses.go b/src/client/segment/update_time_interval_z_k_responses.go new file mode 100644 index 0000000..aabe4e3 --- /dev/null +++ b/src/client/segment/update_time_interval_z_k_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTimeIntervalZKReader is a Reader for the UpdateTimeIntervalZK structure. +type UpdateTimeIntervalZKReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTimeIntervalZKReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTimeIntervalZKOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewUpdateTimeIntervalZKNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateTimeIntervalZKInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTimeIntervalZKOK creates a UpdateTimeIntervalZKOK with default headers values +func NewUpdateTimeIntervalZKOK() *UpdateTimeIntervalZKOK { + return &UpdateTimeIntervalZKOK{} +} + +/* +UpdateTimeIntervalZKOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateTimeIntervalZKOK struct { +} + +// IsSuccess returns true when this update time interval z k o k response has a 2xx status code +func (o *UpdateTimeIntervalZKOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update time interval z k o k response has a 3xx status code +func (o *UpdateTimeIntervalZKOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update time interval z k o k response has a 4xx status code +func (o *UpdateTimeIntervalZKOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update time interval z k o k response has a 5xx status code +func (o *UpdateTimeIntervalZKOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update time interval z k o k response a status code equal to that given +func (o *UpdateTimeIntervalZKOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update time interval z k o k response +func (o *UpdateTimeIntervalZKOK) Code() int { + return 200 +} + +func (o *UpdateTimeIntervalZKOK) Error() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/updateZKTimeInterval][%d] updateTimeIntervalZKOK ", 200) +} + +func (o *UpdateTimeIntervalZKOK) String() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/updateZKTimeInterval][%d] updateTimeIntervalZKOK ", 200) +} + +func (o *UpdateTimeIntervalZKOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateTimeIntervalZKNotFound creates a UpdateTimeIntervalZKNotFound with default headers values +func NewUpdateTimeIntervalZKNotFound() *UpdateTimeIntervalZKNotFound { + return &UpdateTimeIntervalZKNotFound{} +} + +/* +UpdateTimeIntervalZKNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type UpdateTimeIntervalZKNotFound struct { +} + +// IsSuccess returns true when this update time interval z k not found response has a 2xx status code +func (o *UpdateTimeIntervalZKNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update time interval z k not found response has a 3xx status code +func (o *UpdateTimeIntervalZKNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update time interval z k not found response has a 4xx status code +func (o *UpdateTimeIntervalZKNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update time interval z k not found response has a 5xx status code +func (o *UpdateTimeIntervalZKNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update time interval z k not found response a status code equal to that given +func (o *UpdateTimeIntervalZKNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update time interval z k not found response +func (o *UpdateTimeIntervalZKNotFound) Code() int { + return 404 +} + +func (o *UpdateTimeIntervalZKNotFound) Error() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/updateZKTimeInterval][%d] updateTimeIntervalZKNotFound ", 404) +} + +func (o *UpdateTimeIntervalZKNotFound) String() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/updateZKTimeInterval][%d] updateTimeIntervalZKNotFound ", 404) +} + +func (o *UpdateTimeIntervalZKNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateTimeIntervalZKInternalServerError creates a UpdateTimeIntervalZKInternalServerError with default headers values +func NewUpdateTimeIntervalZKInternalServerError() *UpdateTimeIntervalZKInternalServerError { + return &UpdateTimeIntervalZKInternalServerError{} +} + +/* +UpdateTimeIntervalZKInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type UpdateTimeIntervalZKInternalServerError struct { +} + +// IsSuccess returns true when this update time interval z k internal server error response has a 2xx status code +func (o *UpdateTimeIntervalZKInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update time interval z k internal server error response has a 3xx status code +func (o *UpdateTimeIntervalZKInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update time interval z k internal server error response has a 4xx status code +func (o *UpdateTimeIntervalZKInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update time interval z k internal server error response has a 5xx status code +func (o *UpdateTimeIntervalZKInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update time interval z k internal server error response a status code equal to that given +func (o *UpdateTimeIntervalZKInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update time interval z k internal server error response +func (o *UpdateTimeIntervalZKInternalServerError) Code() int { + return 500 +} + +func (o *UpdateTimeIntervalZKInternalServerError) Error() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/updateZKTimeInterval][%d] updateTimeIntervalZKInternalServerError ", 500) +} + +func (o *UpdateTimeIntervalZKInternalServerError) String() string { + return fmt.Sprintf("[POST /segments/{tableNameWithType}/updateZKTimeInterval][%d] updateTimeIntervalZKInternalServerError ", 500) +} + +func (o *UpdateTimeIntervalZKInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/upload_segment_as_multi_part_parameters.go b/src/client/segment/upload_segment_as_multi_part_parameters.go new file mode 100644 index 0000000..3ad842d --- /dev/null +++ b/src/client/segment/upload_segment_as_multi_part_parameters.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "startree.ai/cli/models" +) + +// NewUploadSegmentAsMultiPartParams creates a new UploadSegmentAsMultiPartParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUploadSegmentAsMultiPartParams() *UploadSegmentAsMultiPartParams { + return &UploadSegmentAsMultiPartParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUploadSegmentAsMultiPartParamsWithTimeout creates a new UploadSegmentAsMultiPartParams object +// with the ability to set a timeout on a request. +func NewUploadSegmentAsMultiPartParamsWithTimeout(timeout time.Duration) *UploadSegmentAsMultiPartParams { + return &UploadSegmentAsMultiPartParams{ + timeout: timeout, + } +} + +// NewUploadSegmentAsMultiPartParamsWithContext creates a new UploadSegmentAsMultiPartParams object +// with the ability to set a context for a request. +func NewUploadSegmentAsMultiPartParamsWithContext(ctx context.Context) *UploadSegmentAsMultiPartParams { + return &UploadSegmentAsMultiPartParams{ + Context: ctx, + } +} + +// NewUploadSegmentAsMultiPartParamsWithHTTPClient creates a new UploadSegmentAsMultiPartParams object +// with the ability to set a custom HTTPClient for a request. +func NewUploadSegmentAsMultiPartParamsWithHTTPClient(client *http.Client) *UploadSegmentAsMultiPartParams { + return &UploadSegmentAsMultiPartParams{ + HTTPClient: client, + } +} + +/* +UploadSegmentAsMultiPartParams contains all the parameters to send to the API endpoint + + for the upload segment as multi part operation. + + Typically these are written to a http.Request. +*/ +type UploadSegmentAsMultiPartParams struct { + + /* AllowRefresh. + + Whether to refresh if the segment already exists + + Default: true + */ + AllowRefresh *bool + + // Body. + Body *models.FormDataMultiPart + + /* EnableParallelPushProtection. + + Whether to enable parallel push protection + */ + EnableParallelPushProtection *bool + + /* TableName. + + Name of the table + */ + TableName *string + + /* TableType. + + Type of the table + + Default: "OFFLINE" + */ + TableType *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the upload segment as multi part params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadSegmentAsMultiPartParams) WithDefaults() *UploadSegmentAsMultiPartParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the upload segment as multi part params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadSegmentAsMultiPartParams) SetDefaults() { + var ( + allowRefreshDefault = bool(true) + + enableParallelPushProtectionDefault = bool(false) + + tableTypeDefault = string("OFFLINE") + ) + + val := UploadSegmentAsMultiPartParams{ + AllowRefresh: &allowRefreshDefault, + EnableParallelPushProtection: &enableParallelPushProtectionDefault, + TableType: &tableTypeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithTimeout(timeout time.Duration) *UploadSegmentAsMultiPartParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithContext(ctx context.Context) *UploadSegmentAsMultiPartParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithHTTPClient(client *http.Client) *UploadSegmentAsMultiPartParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAllowRefresh adds the allowRefresh to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithAllowRefresh(allowRefresh *bool) *UploadSegmentAsMultiPartParams { + o.SetAllowRefresh(allowRefresh) + return o +} + +// SetAllowRefresh adds the allowRefresh to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetAllowRefresh(allowRefresh *bool) { + o.AllowRefresh = allowRefresh +} + +// WithBody adds the body to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithBody(body *models.FormDataMultiPart) *UploadSegmentAsMultiPartParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetBody(body *models.FormDataMultiPart) { + o.Body = body +} + +// WithEnableParallelPushProtection adds the enableParallelPushProtection to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithEnableParallelPushProtection(enableParallelPushProtection *bool) *UploadSegmentAsMultiPartParams { + o.SetEnableParallelPushProtection(enableParallelPushProtection) + return o +} + +// SetEnableParallelPushProtection adds the enableParallelPushProtection to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetEnableParallelPushProtection(enableParallelPushProtection *bool) { + o.EnableParallelPushProtection = enableParallelPushProtection +} + +// WithTableName adds the tableName to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithTableName(tableName *string) *UploadSegmentAsMultiPartParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetTableName(tableName *string) { + o.TableName = tableName +} + +// WithTableType adds the tableType to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) WithTableType(tableType *string) *UploadSegmentAsMultiPartParams { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the upload segment as multi part params +func (o *UploadSegmentAsMultiPartParams) SetTableType(tableType *string) { + o.TableType = tableType +} + +// WriteToRequest writes these params to a swagger request +func (o *UploadSegmentAsMultiPartParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AllowRefresh != nil { + + // query param allowRefresh + var qrAllowRefresh bool + + if o.AllowRefresh != nil { + qrAllowRefresh = *o.AllowRefresh + } + qAllowRefresh := swag.FormatBool(qrAllowRefresh) + if qAllowRefresh != "" { + + if err := r.SetQueryParam("allowRefresh", qAllowRefresh); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.EnableParallelPushProtection != nil { + + // query param enableParallelPushProtection + var qrEnableParallelPushProtection bool + + if o.EnableParallelPushProtection != nil { + qrEnableParallelPushProtection = *o.EnableParallelPushProtection + } + qEnableParallelPushProtection := swag.FormatBool(qrEnableParallelPushProtection) + if qEnableParallelPushProtection != "" { + + if err := r.SetQueryParam("enableParallelPushProtection", qEnableParallelPushProtection); err != nil { + return err + } + } + } + + if o.TableName != nil { + + // query param tableName + var qrTableName string + + if o.TableName != nil { + qrTableName = *o.TableName + } + qTableName := qrTableName + if qTableName != "" { + + if err := r.SetQueryParam("tableName", qTableName); err != nil { + return err + } + } + } + + if o.TableType != nil { + + // query param tableType + var qrTableType string + + if o.TableType != nil { + qrTableType = *o.TableType + } + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/upload_segment_as_multi_part_responses.go b/src/client/segment/upload_segment_as_multi_part_responses.go new file mode 100644 index 0000000..20a3ada --- /dev/null +++ b/src/client/segment/upload_segment_as_multi_part_responses.go @@ -0,0 +1,460 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UploadSegmentAsMultiPartReader is a Reader for the UploadSegmentAsMultiPart structure. +type UploadSegmentAsMultiPartReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UploadSegmentAsMultiPartReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUploadSegmentAsMultiPartOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUploadSegmentAsMultiPartBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUploadSegmentAsMultiPartForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUploadSegmentAsMultiPartConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: + result := NewUploadSegmentAsMultiPartGone() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUploadSegmentAsMultiPartPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUploadSegmentAsMultiPartInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUploadSegmentAsMultiPartOK creates a UploadSegmentAsMultiPartOK with default headers values +func NewUploadSegmentAsMultiPartOK() *UploadSegmentAsMultiPartOK { + return &UploadSegmentAsMultiPartOK{} +} + +/* +UploadSegmentAsMultiPartOK describes a response with status code 200, with default header values. + +Successfully uploaded segment +*/ +type UploadSegmentAsMultiPartOK struct { +} + +// IsSuccess returns true when this upload segment as multi part o k response has a 2xx status code +func (o *UploadSegmentAsMultiPartOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this upload segment as multi part o k response has a 3xx status code +func (o *UploadSegmentAsMultiPartOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part o k response has a 4xx status code +func (o *UploadSegmentAsMultiPartOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this upload segment as multi part o k response has a 5xx status code +func (o *UploadSegmentAsMultiPartOK) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part o k response a status code equal to that given +func (o *UploadSegmentAsMultiPartOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the upload segment as multi part o k response +func (o *UploadSegmentAsMultiPartOK) Code() int { + return 200 +} + +func (o *UploadSegmentAsMultiPartOK) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartOK ", 200) +} + +func (o *UploadSegmentAsMultiPartOK) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartOK ", 200) +} + +func (o *UploadSegmentAsMultiPartOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartBadRequest creates a UploadSegmentAsMultiPartBadRequest with default headers values +func NewUploadSegmentAsMultiPartBadRequest() *UploadSegmentAsMultiPartBadRequest { + return &UploadSegmentAsMultiPartBadRequest{} +} + +/* +UploadSegmentAsMultiPartBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UploadSegmentAsMultiPartBadRequest struct { +} + +// IsSuccess returns true when this upload segment as multi part bad request response has a 2xx status code +func (o *UploadSegmentAsMultiPartBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part bad request response has a 3xx status code +func (o *UploadSegmentAsMultiPartBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part bad request response has a 4xx status code +func (o *UploadSegmentAsMultiPartBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part bad request response has a 5xx status code +func (o *UploadSegmentAsMultiPartBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part bad request response a status code equal to that given +func (o *UploadSegmentAsMultiPartBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the upload segment as multi part bad request response +func (o *UploadSegmentAsMultiPartBadRequest) Code() int { + return 400 +} + +func (o *UploadSegmentAsMultiPartBadRequest) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartBadRequest ", 400) +} + +func (o *UploadSegmentAsMultiPartBadRequest) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartBadRequest ", 400) +} + +func (o *UploadSegmentAsMultiPartBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartForbidden creates a UploadSegmentAsMultiPartForbidden with default headers values +func NewUploadSegmentAsMultiPartForbidden() *UploadSegmentAsMultiPartForbidden { + return &UploadSegmentAsMultiPartForbidden{} +} + +/* +UploadSegmentAsMultiPartForbidden describes a response with status code 403, with default header values. + +Segment validation fails +*/ +type UploadSegmentAsMultiPartForbidden struct { +} + +// IsSuccess returns true when this upload segment as multi part forbidden response has a 2xx status code +func (o *UploadSegmentAsMultiPartForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part forbidden response has a 3xx status code +func (o *UploadSegmentAsMultiPartForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part forbidden response has a 4xx status code +func (o *UploadSegmentAsMultiPartForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part forbidden response has a 5xx status code +func (o *UploadSegmentAsMultiPartForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part forbidden response a status code equal to that given +func (o *UploadSegmentAsMultiPartForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the upload segment as multi part forbidden response +func (o *UploadSegmentAsMultiPartForbidden) Code() int { + return 403 +} + +func (o *UploadSegmentAsMultiPartForbidden) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartForbidden ", 403) +} + +func (o *UploadSegmentAsMultiPartForbidden) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartForbidden ", 403) +} + +func (o *UploadSegmentAsMultiPartForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartConflict creates a UploadSegmentAsMultiPartConflict with default headers values +func NewUploadSegmentAsMultiPartConflict() *UploadSegmentAsMultiPartConflict { + return &UploadSegmentAsMultiPartConflict{} +} + +/* +UploadSegmentAsMultiPartConflict describes a response with status code 409, with default header values. + +Segment already exists or another parallel push in progress +*/ +type UploadSegmentAsMultiPartConflict struct { +} + +// IsSuccess returns true when this upload segment as multi part conflict response has a 2xx status code +func (o *UploadSegmentAsMultiPartConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part conflict response has a 3xx status code +func (o *UploadSegmentAsMultiPartConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part conflict response has a 4xx status code +func (o *UploadSegmentAsMultiPartConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part conflict response has a 5xx status code +func (o *UploadSegmentAsMultiPartConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part conflict response a status code equal to that given +func (o *UploadSegmentAsMultiPartConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the upload segment as multi part conflict response +func (o *UploadSegmentAsMultiPartConflict) Code() int { + return 409 +} + +func (o *UploadSegmentAsMultiPartConflict) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartConflict ", 409) +} + +func (o *UploadSegmentAsMultiPartConflict) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartConflict ", 409) +} + +func (o *UploadSegmentAsMultiPartConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartGone creates a UploadSegmentAsMultiPartGone with default headers values +func NewUploadSegmentAsMultiPartGone() *UploadSegmentAsMultiPartGone { + return &UploadSegmentAsMultiPartGone{} +} + +/* +UploadSegmentAsMultiPartGone describes a response with status code 410, with default header values. + +Segment to refresh does not exist +*/ +type UploadSegmentAsMultiPartGone struct { +} + +// IsSuccess returns true when this upload segment as multi part gone response has a 2xx status code +func (o *UploadSegmentAsMultiPartGone) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part gone response has a 3xx status code +func (o *UploadSegmentAsMultiPartGone) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part gone response has a 4xx status code +func (o *UploadSegmentAsMultiPartGone) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part gone response has a 5xx status code +func (o *UploadSegmentAsMultiPartGone) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part gone response a status code equal to that given +func (o *UploadSegmentAsMultiPartGone) IsCode(code int) bool { + return code == 410 +} + +// Code gets the status code for the upload segment as multi part gone response +func (o *UploadSegmentAsMultiPartGone) Code() int { + return 410 +} + +func (o *UploadSegmentAsMultiPartGone) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartGone ", 410) +} + +func (o *UploadSegmentAsMultiPartGone) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartGone ", 410) +} + +func (o *UploadSegmentAsMultiPartGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartPreconditionFailed creates a UploadSegmentAsMultiPartPreconditionFailed with default headers values +func NewUploadSegmentAsMultiPartPreconditionFailed() *UploadSegmentAsMultiPartPreconditionFailed { + return &UploadSegmentAsMultiPartPreconditionFailed{} +} + +/* +UploadSegmentAsMultiPartPreconditionFailed describes a response with status code 412, with default header values. + +CRC check fails +*/ +type UploadSegmentAsMultiPartPreconditionFailed struct { +} + +// IsSuccess returns true when this upload segment as multi part precondition failed response has a 2xx status code +func (o *UploadSegmentAsMultiPartPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part precondition failed response has a 3xx status code +func (o *UploadSegmentAsMultiPartPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part precondition failed response has a 4xx status code +func (o *UploadSegmentAsMultiPartPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part precondition failed response has a 5xx status code +func (o *UploadSegmentAsMultiPartPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part precondition failed response a status code equal to that given +func (o *UploadSegmentAsMultiPartPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the upload segment as multi part precondition failed response +func (o *UploadSegmentAsMultiPartPreconditionFailed) Code() int { + return 412 +} + +func (o *UploadSegmentAsMultiPartPreconditionFailed) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartPreconditionFailed ", 412) +} + +func (o *UploadSegmentAsMultiPartPreconditionFailed) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartPreconditionFailed ", 412) +} + +func (o *UploadSegmentAsMultiPartPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartInternalServerError creates a UploadSegmentAsMultiPartInternalServerError with default headers values +func NewUploadSegmentAsMultiPartInternalServerError() *UploadSegmentAsMultiPartInternalServerError { + return &UploadSegmentAsMultiPartInternalServerError{} +} + +/* +UploadSegmentAsMultiPartInternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type UploadSegmentAsMultiPartInternalServerError struct { +} + +// IsSuccess returns true when this upload segment as multi part internal server error response has a 2xx status code +func (o *UploadSegmentAsMultiPartInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part internal server error response has a 3xx status code +func (o *UploadSegmentAsMultiPartInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part internal server error response has a 4xx status code +func (o *UploadSegmentAsMultiPartInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this upload segment as multi part internal server error response has a 5xx status code +func (o *UploadSegmentAsMultiPartInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this upload segment as multi part internal server error response a status code equal to that given +func (o *UploadSegmentAsMultiPartInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the upload segment as multi part internal server error response +func (o *UploadSegmentAsMultiPartInternalServerError) Code() int { + return 500 +} + +func (o *UploadSegmentAsMultiPartInternalServerError) Error() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartInternalServerError ", 500) +} + +func (o *UploadSegmentAsMultiPartInternalServerError) String() string { + return fmt.Sprintf("[POST /segments][%d] uploadSegmentAsMultiPartInternalServerError ", 500) +} + +func (o *UploadSegmentAsMultiPartInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/segment/upload_segment_as_multi_part_v2_parameters.go b/src/client/segment/upload_segment_as_multi_part_v2_parameters.go new file mode 100644 index 0000000..e79e348 --- /dev/null +++ b/src/client/segment/upload_segment_as_multi_part_v2_parameters.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "startree.ai/cli/models" +) + +// NewUploadSegmentAsMultiPartV2Params creates a new UploadSegmentAsMultiPartV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUploadSegmentAsMultiPartV2Params() *UploadSegmentAsMultiPartV2Params { + return &UploadSegmentAsMultiPartV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewUploadSegmentAsMultiPartV2ParamsWithTimeout creates a new UploadSegmentAsMultiPartV2Params object +// with the ability to set a timeout on a request. +func NewUploadSegmentAsMultiPartV2ParamsWithTimeout(timeout time.Duration) *UploadSegmentAsMultiPartV2Params { + return &UploadSegmentAsMultiPartV2Params{ + timeout: timeout, + } +} + +// NewUploadSegmentAsMultiPartV2ParamsWithContext creates a new UploadSegmentAsMultiPartV2Params object +// with the ability to set a context for a request. +func NewUploadSegmentAsMultiPartV2ParamsWithContext(ctx context.Context) *UploadSegmentAsMultiPartV2Params { + return &UploadSegmentAsMultiPartV2Params{ + Context: ctx, + } +} + +// NewUploadSegmentAsMultiPartV2ParamsWithHTTPClient creates a new UploadSegmentAsMultiPartV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewUploadSegmentAsMultiPartV2ParamsWithHTTPClient(client *http.Client) *UploadSegmentAsMultiPartV2Params { + return &UploadSegmentAsMultiPartV2Params{ + HTTPClient: client, + } +} + +/* +UploadSegmentAsMultiPartV2Params contains all the parameters to send to the API endpoint + + for the upload segment as multi part v2 operation. + + Typically these are written to a http.Request. +*/ +type UploadSegmentAsMultiPartV2Params struct { + + /* AllowRefresh. + + Whether to refresh if the segment already exists + + Default: true + */ + AllowRefresh *bool + + // Body. + Body *models.FormDataMultiPart + + /* EnableParallelPushProtection. + + Whether to enable parallel push protection + */ + EnableParallelPushProtection *bool + + /* TableName. + + Name of the table + */ + TableName *string + + /* TableType. + + Type of the table + + Default: "OFFLINE" + */ + TableType *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the upload segment as multi part v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadSegmentAsMultiPartV2Params) WithDefaults() *UploadSegmentAsMultiPartV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the upload segment as multi part v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadSegmentAsMultiPartV2Params) SetDefaults() { + var ( + allowRefreshDefault = bool(true) + + enableParallelPushProtectionDefault = bool(false) + + tableTypeDefault = string("OFFLINE") + ) + + val := UploadSegmentAsMultiPartV2Params{ + AllowRefresh: &allowRefreshDefault, + EnableParallelPushProtection: &enableParallelPushProtectionDefault, + TableType: &tableTypeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithTimeout(timeout time.Duration) *UploadSegmentAsMultiPartV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithContext(ctx context.Context) *UploadSegmentAsMultiPartV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithHTTPClient(client *http.Client) *UploadSegmentAsMultiPartV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAllowRefresh adds the allowRefresh to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithAllowRefresh(allowRefresh *bool) *UploadSegmentAsMultiPartV2Params { + o.SetAllowRefresh(allowRefresh) + return o +} + +// SetAllowRefresh adds the allowRefresh to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetAllowRefresh(allowRefresh *bool) { + o.AllowRefresh = allowRefresh +} + +// WithBody adds the body to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithBody(body *models.FormDataMultiPart) *UploadSegmentAsMultiPartV2Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetBody(body *models.FormDataMultiPart) { + o.Body = body +} + +// WithEnableParallelPushProtection adds the enableParallelPushProtection to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithEnableParallelPushProtection(enableParallelPushProtection *bool) *UploadSegmentAsMultiPartV2Params { + o.SetEnableParallelPushProtection(enableParallelPushProtection) + return o +} + +// SetEnableParallelPushProtection adds the enableParallelPushProtection to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetEnableParallelPushProtection(enableParallelPushProtection *bool) { + o.EnableParallelPushProtection = enableParallelPushProtection +} + +// WithTableName adds the tableName to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithTableName(tableName *string) *UploadSegmentAsMultiPartV2Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetTableName(tableName *string) { + o.TableName = tableName +} + +// WithTableType adds the tableType to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) WithTableType(tableType *string) *UploadSegmentAsMultiPartV2Params { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the upload segment as multi part v2 params +func (o *UploadSegmentAsMultiPartV2Params) SetTableType(tableType *string) { + o.TableType = tableType +} + +// WriteToRequest writes these params to a swagger request +func (o *UploadSegmentAsMultiPartV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AllowRefresh != nil { + + // query param allowRefresh + var qrAllowRefresh bool + + if o.AllowRefresh != nil { + qrAllowRefresh = *o.AllowRefresh + } + qAllowRefresh := swag.FormatBool(qrAllowRefresh) + if qAllowRefresh != "" { + + if err := r.SetQueryParam("allowRefresh", qAllowRefresh); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.EnableParallelPushProtection != nil { + + // query param enableParallelPushProtection + var qrEnableParallelPushProtection bool + + if o.EnableParallelPushProtection != nil { + qrEnableParallelPushProtection = *o.EnableParallelPushProtection + } + qEnableParallelPushProtection := swag.FormatBool(qrEnableParallelPushProtection) + if qEnableParallelPushProtection != "" { + + if err := r.SetQueryParam("enableParallelPushProtection", qEnableParallelPushProtection); err != nil { + return err + } + } + } + + if o.TableName != nil { + + // query param tableName + var qrTableName string + + if o.TableName != nil { + qrTableName = *o.TableName + } + qTableName := qrTableName + if qTableName != "" { + + if err := r.SetQueryParam("tableName", qTableName); err != nil { + return err + } + } + } + + if o.TableType != nil { + + // query param tableType + var qrTableType string + + if o.TableType != nil { + qrTableType = *o.TableType + } + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/segment/upload_segment_as_multi_part_v2_responses.go b/src/client/segment/upload_segment_as_multi_part_v2_responses.go new file mode 100644 index 0000000..9b6a02b --- /dev/null +++ b/src/client/segment/upload_segment_as_multi_part_v2_responses.go @@ -0,0 +1,460 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package segment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UploadSegmentAsMultiPartV2Reader is a Reader for the UploadSegmentAsMultiPartV2 structure. +type UploadSegmentAsMultiPartV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UploadSegmentAsMultiPartV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUploadSegmentAsMultiPartV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUploadSegmentAsMultiPartV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUploadSegmentAsMultiPartV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUploadSegmentAsMultiPartV2Conflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: + result := NewUploadSegmentAsMultiPartV2Gone() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUploadSegmentAsMultiPartV2PreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUploadSegmentAsMultiPartV2InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUploadSegmentAsMultiPartV2OK creates a UploadSegmentAsMultiPartV2OK with default headers values +func NewUploadSegmentAsMultiPartV2OK() *UploadSegmentAsMultiPartV2OK { + return &UploadSegmentAsMultiPartV2OK{} +} + +/* +UploadSegmentAsMultiPartV2OK describes a response with status code 200, with default header values. + +Successfully uploaded segment +*/ +type UploadSegmentAsMultiPartV2OK struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 o k response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this upload segment as multi part v2 o k response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 o k response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this upload segment as multi part v2 o k response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part v2 o k response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the upload segment as multi part v2 o k response +func (o *UploadSegmentAsMultiPartV2OK) Code() int { + return 200 +} + +func (o *UploadSegmentAsMultiPartV2OK) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2OK ", 200) +} + +func (o *UploadSegmentAsMultiPartV2OK) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2OK ", 200) +} + +func (o *UploadSegmentAsMultiPartV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartV2BadRequest creates a UploadSegmentAsMultiPartV2BadRequest with default headers values +func NewUploadSegmentAsMultiPartV2BadRequest() *UploadSegmentAsMultiPartV2BadRequest { + return &UploadSegmentAsMultiPartV2BadRequest{} +} + +/* +UploadSegmentAsMultiPartV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UploadSegmentAsMultiPartV2BadRequest struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 bad request response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part v2 bad request response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 bad request response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part v2 bad request response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part v2 bad request response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the upload segment as multi part v2 bad request response +func (o *UploadSegmentAsMultiPartV2BadRequest) Code() int { + return 400 +} + +func (o *UploadSegmentAsMultiPartV2BadRequest) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2BadRequest ", 400) +} + +func (o *UploadSegmentAsMultiPartV2BadRequest) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2BadRequest ", 400) +} + +func (o *UploadSegmentAsMultiPartV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartV2Forbidden creates a UploadSegmentAsMultiPartV2Forbidden with default headers values +func NewUploadSegmentAsMultiPartV2Forbidden() *UploadSegmentAsMultiPartV2Forbidden { + return &UploadSegmentAsMultiPartV2Forbidden{} +} + +/* +UploadSegmentAsMultiPartV2Forbidden describes a response with status code 403, with default header values. + +Segment validation fails +*/ +type UploadSegmentAsMultiPartV2Forbidden struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 forbidden response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part v2 forbidden response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 forbidden response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part v2 forbidden response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part v2 forbidden response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the upload segment as multi part v2 forbidden response +func (o *UploadSegmentAsMultiPartV2Forbidden) Code() int { + return 403 +} + +func (o *UploadSegmentAsMultiPartV2Forbidden) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2Forbidden ", 403) +} + +func (o *UploadSegmentAsMultiPartV2Forbidden) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2Forbidden ", 403) +} + +func (o *UploadSegmentAsMultiPartV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartV2Conflict creates a UploadSegmentAsMultiPartV2Conflict with default headers values +func NewUploadSegmentAsMultiPartV2Conflict() *UploadSegmentAsMultiPartV2Conflict { + return &UploadSegmentAsMultiPartV2Conflict{} +} + +/* +UploadSegmentAsMultiPartV2Conflict describes a response with status code 409, with default header values. + +Segment already exists or another parallel push in progress +*/ +type UploadSegmentAsMultiPartV2Conflict struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 conflict response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2Conflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part v2 conflict response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2Conflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 conflict response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2Conflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part v2 conflict response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2Conflict) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part v2 conflict response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2Conflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the upload segment as multi part v2 conflict response +func (o *UploadSegmentAsMultiPartV2Conflict) Code() int { + return 409 +} + +func (o *UploadSegmentAsMultiPartV2Conflict) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2Conflict ", 409) +} + +func (o *UploadSegmentAsMultiPartV2Conflict) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2Conflict ", 409) +} + +func (o *UploadSegmentAsMultiPartV2Conflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartV2Gone creates a UploadSegmentAsMultiPartV2Gone with default headers values +func NewUploadSegmentAsMultiPartV2Gone() *UploadSegmentAsMultiPartV2Gone { + return &UploadSegmentAsMultiPartV2Gone{} +} + +/* +UploadSegmentAsMultiPartV2Gone describes a response with status code 410, with default header values. + +Segment to refresh does not exist +*/ +type UploadSegmentAsMultiPartV2Gone struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 gone response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2Gone) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part v2 gone response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2Gone) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 gone response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2Gone) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part v2 gone response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2Gone) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part v2 gone response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2Gone) IsCode(code int) bool { + return code == 410 +} + +// Code gets the status code for the upload segment as multi part v2 gone response +func (o *UploadSegmentAsMultiPartV2Gone) Code() int { + return 410 +} + +func (o *UploadSegmentAsMultiPartV2Gone) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2Gone ", 410) +} + +func (o *UploadSegmentAsMultiPartV2Gone) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2Gone ", 410) +} + +func (o *UploadSegmentAsMultiPartV2Gone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartV2PreconditionFailed creates a UploadSegmentAsMultiPartV2PreconditionFailed with default headers values +func NewUploadSegmentAsMultiPartV2PreconditionFailed() *UploadSegmentAsMultiPartV2PreconditionFailed { + return &UploadSegmentAsMultiPartV2PreconditionFailed{} +} + +/* +UploadSegmentAsMultiPartV2PreconditionFailed describes a response with status code 412, with default header values. + +CRC check fails +*/ +type UploadSegmentAsMultiPartV2PreconditionFailed struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 precondition failed response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part v2 precondition failed response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 precondition failed response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this upload segment as multi part v2 precondition failed response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this upload segment as multi part v2 precondition failed response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the upload segment as multi part v2 precondition failed response +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) Code() int { + return 412 +} + +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2PreconditionFailed ", 412) +} + +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2PreconditionFailed ", 412) +} + +func (o *UploadSegmentAsMultiPartV2PreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUploadSegmentAsMultiPartV2InternalServerError creates a UploadSegmentAsMultiPartV2InternalServerError with default headers values +func NewUploadSegmentAsMultiPartV2InternalServerError() *UploadSegmentAsMultiPartV2InternalServerError { + return &UploadSegmentAsMultiPartV2InternalServerError{} +} + +/* +UploadSegmentAsMultiPartV2InternalServerError describes a response with status code 500, with default header values. + +Internal error +*/ +type UploadSegmentAsMultiPartV2InternalServerError struct { +} + +// IsSuccess returns true when this upload segment as multi part v2 internal server error response has a 2xx status code +func (o *UploadSegmentAsMultiPartV2InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this upload segment as multi part v2 internal server error response has a 3xx status code +func (o *UploadSegmentAsMultiPartV2InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this upload segment as multi part v2 internal server error response has a 4xx status code +func (o *UploadSegmentAsMultiPartV2InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this upload segment as multi part v2 internal server error response has a 5xx status code +func (o *UploadSegmentAsMultiPartV2InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this upload segment as multi part v2 internal server error response a status code equal to that given +func (o *UploadSegmentAsMultiPartV2InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the upload segment as multi part v2 internal server error response +func (o *UploadSegmentAsMultiPartV2InternalServerError) Code() int { + return 500 +} + +func (o *UploadSegmentAsMultiPartV2InternalServerError) Error() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2InternalServerError ", 500) +} + +func (o *UploadSegmentAsMultiPartV2InternalServerError) String() string { + return fmt.Sprintf("[POST /v2/segments][%d] uploadSegmentAsMultiPartV2InternalServerError ", 500) +} + +func (o *UploadSegmentAsMultiPartV2InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/add_config_parameters.go b/src/client/table/add_config_parameters.go new file mode 100644 index 0000000..ae92e70 --- /dev/null +++ b/src/client/table/add_config_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddConfigParams creates a new AddConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddConfigParams() *AddConfigParams { + return &AddConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddConfigParamsWithTimeout creates a new AddConfigParams object +// with the ability to set a timeout on a request. +func NewAddConfigParamsWithTimeout(timeout time.Duration) *AddConfigParams { + return &AddConfigParams{ + timeout: timeout, + } +} + +// NewAddConfigParamsWithContext creates a new AddConfigParams object +// with the ability to set a context for a request. +func NewAddConfigParamsWithContext(ctx context.Context) *AddConfigParams { + return &AddConfigParams{ + Context: ctx, + } +} + +// NewAddConfigParamsWithHTTPClient creates a new AddConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddConfigParamsWithHTTPClient(client *http.Client) *AddConfigParams { + return &AddConfigParams{ + HTTPClient: client, + } +} + +/* +AddConfigParams contains all the parameters to send to the API endpoint + + for the add config operation. + + Typically these are written to a http.Request. +*/ +type AddConfigParams struct { + + // Body. + Body string + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddConfigParams) WithDefaults() *AddConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the add config params +func (o *AddConfigParams) WithTimeout(timeout time.Duration) *AddConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add config params +func (o *AddConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add config params +func (o *AddConfigParams) WithContext(ctx context.Context) *AddConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add config params +func (o *AddConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add config params +func (o *AddConfigParams) WithHTTPClient(client *http.Client) *AddConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add config params +func (o *AddConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add config params +func (o *AddConfigParams) WithBody(body string) *AddConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add config params +func (o *AddConfigParams) SetBody(body string) { + o.Body = body +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the add config params +func (o *AddConfigParams) WithValidationTypesToSkip(validationTypesToSkip *string) *AddConfigParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the add config params +func (o *AddConfigParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *AddConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/add_config_responses.go b/src/client/table/add_config_responses.go new file mode 100644 index 0000000..2ceba89 --- /dev/null +++ b/src/client/table/add_config_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// AddConfigReader is a Reader for the AddConfig structure. +type AddConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAddConfigOK creates a AddConfigOK with default headers values +func NewAddConfigOK() *AddConfigOK { + return &AddConfigOK{} +} + +/* +AddConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type AddConfigOK struct { + Payload *models.ConfigSuccessResponse +} + +// IsSuccess returns true when this add config o k response has a 2xx status code +func (o *AddConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this add config o k response has a 3xx status code +func (o *AddConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add config o k response has a 4xx status code +func (o *AddConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this add config o k response has a 5xx status code +func (o *AddConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this add config o k response a status code equal to that given +func (o *AddConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the add config o k response +func (o *AddConfigOK) Code() int { + return 200 +} + +func (o *AddConfigOK) Error() string { + return fmt.Sprintf("[POST /tableConfigs][%d] addConfigOK %+v", 200, o.Payload) +} + +func (o *AddConfigOK) String() string { + return fmt.Sprintf("[POST /tableConfigs][%d] addConfigOK %+v", 200, o.Payload) +} + +func (o *AddConfigOK) GetPayload() *models.ConfigSuccessResponse { + return o.Payload +} + +func (o *AddConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigSuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/add_table_parameters.go b/src/client/table/add_table_parameters.go new file mode 100644 index 0000000..a1e07f6 --- /dev/null +++ b/src/client/table/add_table_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddTableParams creates a new AddTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddTableParams() *AddTableParams { + return &AddTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddTableParamsWithTimeout creates a new AddTableParams object +// with the ability to set a timeout on a request. +func NewAddTableParamsWithTimeout(timeout time.Duration) *AddTableParams { + return &AddTableParams{ + timeout: timeout, + } +} + +// NewAddTableParamsWithContext creates a new AddTableParams object +// with the ability to set a context for a request. +func NewAddTableParamsWithContext(ctx context.Context) *AddTableParams { + return &AddTableParams{ + Context: ctx, + } +} + +// NewAddTableParamsWithHTTPClient creates a new AddTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddTableParamsWithHTTPClient(client *http.Client) *AddTableParams { + return &AddTableParams{ + HTTPClient: client, + } +} + +/* +AddTableParams contains all the parameters to send to the API endpoint + + for the add table operation. + + Typically these are written to a http.Request. +*/ +type AddTableParams struct { + + // Body. + Body string + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddTableParams) WithDefaults() *AddTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the add table params +func (o *AddTableParams) WithTimeout(timeout time.Duration) *AddTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add table params +func (o *AddTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add table params +func (o *AddTableParams) WithContext(ctx context.Context) *AddTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add table params +func (o *AddTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add table params +func (o *AddTableParams) WithHTTPClient(client *http.Client) *AddTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add table params +func (o *AddTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add table params +func (o *AddTableParams) WithBody(body string) *AddTableParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add table params +func (o *AddTableParams) SetBody(body string) { + o.Body = body +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the add table params +func (o *AddTableParams) WithValidationTypesToSkip(validationTypesToSkip *string) *AddTableParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the add table params +func (o *AddTableParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *AddTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/add_table_responses.go b/src/client/table/add_table_responses.go new file mode 100644 index 0000000..d25ad01 --- /dev/null +++ b/src/client/table/add_table_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// AddTableReader is a Reader for the AddTable structure. +type AddTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAddTableOK creates a AddTableOK with default headers values +func NewAddTableOK() *AddTableOK { + return &AddTableOK{} +} + +/* +AddTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type AddTableOK struct { + Payload *models.ConfigSuccessResponse +} + +// IsSuccess returns true when this add table o k response has a 2xx status code +func (o *AddTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this add table o k response has a 3xx status code +func (o *AddTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add table o k response has a 4xx status code +func (o *AddTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this add table o k response has a 5xx status code +func (o *AddTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this add table o k response a status code equal to that given +func (o *AddTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the add table o k response +func (o *AddTableOK) Code() int { + return 200 +} + +func (o *AddTableOK) Error() string { + return fmt.Sprintf("[POST /tables][%d] addTableOK %+v", 200, o.Payload) +} + +func (o *AddTableOK) String() string { + return fmt.Sprintf("[POST /tables][%d] addTableOK %+v", 200, o.Payload) +} + +func (o *AddTableOK) GetPayload() *models.ConfigSuccessResponse { + return o.Payload +} + +func (o *AddTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigSuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/alter_table_state_or_list_table_config_parameters.go b/src/client/table/alter_table_state_or_list_table_config_parameters.go new file mode 100644 index 0000000..c0c0c94 --- /dev/null +++ b/src/client/table/alter_table_state_or_list_table_config_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAlterTableStateOrListTableConfigParams creates a new AlterTableStateOrListTableConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAlterTableStateOrListTableConfigParams() *AlterTableStateOrListTableConfigParams { + return &AlterTableStateOrListTableConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAlterTableStateOrListTableConfigParamsWithTimeout creates a new AlterTableStateOrListTableConfigParams object +// with the ability to set a timeout on a request. +func NewAlterTableStateOrListTableConfigParamsWithTimeout(timeout time.Duration) *AlterTableStateOrListTableConfigParams { + return &AlterTableStateOrListTableConfigParams{ + timeout: timeout, + } +} + +// NewAlterTableStateOrListTableConfigParamsWithContext creates a new AlterTableStateOrListTableConfigParams object +// with the ability to set a context for a request. +func NewAlterTableStateOrListTableConfigParamsWithContext(ctx context.Context) *AlterTableStateOrListTableConfigParams { + return &AlterTableStateOrListTableConfigParams{ + Context: ctx, + } +} + +// NewAlterTableStateOrListTableConfigParamsWithHTTPClient creates a new AlterTableStateOrListTableConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewAlterTableStateOrListTableConfigParamsWithHTTPClient(client *http.Client) *AlterTableStateOrListTableConfigParams { + return &AlterTableStateOrListTableConfigParams{ + HTTPClient: client, + } +} + +/* +AlterTableStateOrListTableConfigParams contains all the parameters to send to the API endpoint + + for the alter table state or list table config operation. + + Typically these are written to a http.Request. +*/ +type AlterTableStateOrListTableConfigParams struct { + + /* State. + + enable|disable|drop + */ + State *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + realtime|offline + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the alter table state or list table config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AlterTableStateOrListTableConfigParams) WithDefaults() *AlterTableStateOrListTableConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the alter table state or list table config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AlterTableStateOrListTableConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) WithTimeout(timeout time.Duration) *AlterTableStateOrListTableConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) WithContext(ctx context.Context) *AlterTableStateOrListTableConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) WithHTTPClient(client *http.Client) *AlterTableStateOrListTableConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) WithState(state *string) *AlterTableStateOrListTableConfigParams { + o.SetState(state) + return o +} + +// SetState adds the state to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) SetState(state *string) { + o.State = state +} + +// WithTableName adds the tableName to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) WithTableName(tableName string) *AlterTableStateOrListTableConfigParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) WithType(typeVar *string) *AlterTableStateOrListTableConfigParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the alter table state or list table config params +func (o *AlterTableStateOrListTableConfigParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *AlterTableStateOrListTableConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/alter_table_state_or_list_table_config_responses.go b/src/client/table/alter_table_state_or_list_table_config_responses.go new file mode 100644 index 0000000..fb3a1ce --- /dev/null +++ b/src/client/table/alter_table_state_or_list_table_config_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// AlterTableStateOrListTableConfigReader is a Reader for the AlterTableStateOrListTableConfig structure. +type AlterTableStateOrListTableConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AlterTableStateOrListTableConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAlterTableStateOrListTableConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAlterTableStateOrListTableConfigOK creates a AlterTableStateOrListTableConfigOK with default headers values +func NewAlterTableStateOrListTableConfigOK() *AlterTableStateOrListTableConfigOK { + return &AlterTableStateOrListTableConfigOK{} +} + +/* +AlterTableStateOrListTableConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type AlterTableStateOrListTableConfigOK struct { + Payload string +} + +// IsSuccess returns true when this alter table state or list table config o k response has a 2xx status code +func (o *AlterTableStateOrListTableConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this alter table state or list table config o k response has a 3xx status code +func (o *AlterTableStateOrListTableConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this alter table state or list table config o k response has a 4xx status code +func (o *AlterTableStateOrListTableConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this alter table state or list table config o k response has a 5xx status code +func (o *AlterTableStateOrListTableConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this alter table state or list table config o k response a status code equal to that given +func (o *AlterTableStateOrListTableConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the alter table state or list table config o k response +func (o *AlterTableStateOrListTableConfigOK) Code() int { + return 200 +} + +func (o *AlterTableStateOrListTableConfigOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}][%d] alterTableStateOrListTableConfigOK %+v", 200, o.Payload) +} + +func (o *AlterTableStateOrListTableConfigOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}][%d] alterTableStateOrListTableConfigOK %+v", 200, o.Payload) +} + +func (o *AlterTableStateOrListTableConfigOK) GetPayload() string { + return o.Payload +} + +func (o *AlterTableStateOrListTableConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/assign_instances_parameters.go b/src/client/table/assign_instances_parameters.go new file mode 100644 index 0000000..aefa449 --- /dev/null +++ b/src/client/table/assign_instances_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewAssignInstancesParams creates a new AssignInstancesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAssignInstancesParams() *AssignInstancesParams { + return &AssignInstancesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAssignInstancesParamsWithTimeout creates a new AssignInstancesParams object +// with the ability to set a timeout on a request. +func NewAssignInstancesParamsWithTimeout(timeout time.Duration) *AssignInstancesParams { + return &AssignInstancesParams{ + timeout: timeout, + } +} + +// NewAssignInstancesParamsWithContext creates a new AssignInstancesParams object +// with the ability to set a context for a request. +func NewAssignInstancesParamsWithContext(ctx context.Context) *AssignInstancesParams { + return &AssignInstancesParams{ + Context: ctx, + } +} + +// NewAssignInstancesParamsWithHTTPClient creates a new AssignInstancesParams object +// with the ability to set a custom HTTPClient for a request. +func NewAssignInstancesParamsWithHTTPClient(client *http.Client) *AssignInstancesParams { + return &AssignInstancesParams{ + HTTPClient: client, + } +} + +/* +AssignInstancesParams contains all the parameters to send to the API endpoint + + for the assign instances operation. + + Typically these are written to a http.Request. +*/ +type AssignInstancesParams struct { + + /* DryRun. + + Whether to do dry-run + */ + DryRun *bool + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|CONSUMING|COMPLETED + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the assign instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AssignInstancesParams) WithDefaults() *AssignInstancesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the assign instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AssignInstancesParams) SetDefaults() { + var ( + dryRunDefault = bool(false) + ) + + val := AssignInstancesParams{ + DryRun: &dryRunDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the assign instances params +func (o *AssignInstancesParams) WithTimeout(timeout time.Duration) *AssignInstancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the assign instances params +func (o *AssignInstancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the assign instances params +func (o *AssignInstancesParams) WithContext(ctx context.Context) *AssignInstancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the assign instances params +func (o *AssignInstancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the assign instances params +func (o *AssignInstancesParams) WithHTTPClient(client *http.Client) *AssignInstancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the assign instances params +func (o *AssignInstancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDryRun adds the dryRun to the assign instances params +func (o *AssignInstancesParams) WithDryRun(dryRun *bool) *AssignInstancesParams { + o.SetDryRun(dryRun) + return o +} + +// SetDryRun adds the dryRun to the assign instances params +func (o *AssignInstancesParams) SetDryRun(dryRun *bool) { + o.DryRun = dryRun +} + +// WithTableName adds the tableName to the assign instances params +func (o *AssignInstancesParams) WithTableName(tableName string) *AssignInstancesParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the assign instances params +func (o *AssignInstancesParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the assign instances params +func (o *AssignInstancesParams) WithType(typeVar *string) *AssignInstancesParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the assign instances params +func (o *AssignInstancesParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *AssignInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DryRun != nil { + + // query param dryRun + var qrDryRun bool + + if o.DryRun != nil { + qrDryRun = *o.DryRun + } + qDryRun := swag.FormatBool(qrDryRun) + if qDryRun != "" { + + if err := r.SetQueryParam("dryRun", qDryRun); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/assign_instances_responses.go b/src/client/table/assign_instances_responses.go new file mode 100644 index 0000000..bd14e79 --- /dev/null +++ b/src/client/table/assign_instances_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// AssignInstancesReader is a Reader for the AssignInstances structure. +type AssignInstancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AssignInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAssignInstancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAssignInstancesOK creates a AssignInstancesOK with default headers values +func NewAssignInstancesOK() *AssignInstancesOK { + return &AssignInstancesOK{} +} + +/* +AssignInstancesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type AssignInstancesOK struct { + Payload map[string]models.InstancePartitions +} + +// IsSuccess returns true when this assign instances o k response has a 2xx status code +func (o *AssignInstancesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this assign instances o k response has a 3xx status code +func (o *AssignInstancesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this assign instances o k response has a 4xx status code +func (o *AssignInstancesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this assign instances o k response has a 5xx status code +func (o *AssignInstancesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this assign instances o k response a status code equal to that given +func (o *AssignInstancesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the assign instances o k response +func (o *AssignInstancesOK) Code() int { + return 200 +} + +func (o *AssignInstancesOK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/assignInstances][%d] assignInstancesOK %+v", 200, o.Payload) +} + +func (o *AssignInstancesOK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/assignInstances][%d] assignInstancesOK %+v", 200, o.Payload) +} + +func (o *AssignInstancesOK) GetPayload() map[string]models.InstancePartitions { + return o.Payload +} + +func (o *AssignInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/check_table_config_parameters.go b/src/client/table/check_table_config_parameters.go new file mode 100644 index 0000000..732af69 --- /dev/null +++ b/src/client/table/check_table_config_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCheckTableConfigParams creates a new CheckTableConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCheckTableConfigParams() *CheckTableConfigParams { + return &CheckTableConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCheckTableConfigParamsWithTimeout creates a new CheckTableConfigParams object +// with the ability to set a timeout on a request. +func NewCheckTableConfigParamsWithTimeout(timeout time.Duration) *CheckTableConfigParams { + return &CheckTableConfigParams{ + timeout: timeout, + } +} + +// NewCheckTableConfigParamsWithContext creates a new CheckTableConfigParams object +// with the ability to set a context for a request. +func NewCheckTableConfigParamsWithContext(ctx context.Context) *CheckTableConfigParams { + return &CheckTableConfigParams{ + Context: ctx, + } +} + +// NewCheckTableConfigParamsWithHTTPClient creates a new CheckTableConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewCheckTableConfigParamsWithHTTPClient(client *http.Client) *CheckTableConfigParams { + return &CheckTableConfigParams{ + HTTPClient: client, + } +} + +/* +CheckTableConfigParams contains all the parameters to send to the API endpoint + + for the check table config operation. + + Typically these are written to a http.Request. +*/ +type CheckTableConfigParams struct { + + // Body. + Body string + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the check table config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckTableConfigParams) WithDefaults() *CheckTableConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the check table config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckTableConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the check table config params +func (o *CheckTableConfigParams) WithTimeout(timeout time.Duration) *CheckTableConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the check table config params +func (o *CheckTableConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the check table config params +func (o *CheckTableConfigParams) WithContext(ctx context.Context) *CheckTableConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the check table config params +func (o *CheckTableConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the check table config params +func (o *CheckTableConfigParams) WithHTTPClient(client *http.Client) *CheckTableConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the check table config params +func (o *CheckTableConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the check table config params +func (o *CheckTableConfigParams) WithBody(body string) *CheckTableConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the check table config params +func (o *CheckTableConfigParams) SetBody(body string) { + o.Body = body +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the check table config params +func (o *CheckTableConfigParams) WithValidationTypesToSkip(validationTypesToSkip *string) *CheckTableConfigParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the check table config params +func (o *CheckTableConfigParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *CheckTableConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/check_table_config_responses.go b/src/client/table/check_table_config_responses.go new file mode 100644 index 0000000..74e677c --- /dev/null +++ b/src/client/table/check_table_config_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// CheckTableConfigReader is a Reader for the CheckTableConfig structure. +type CheckTableConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CheckTableConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCheckTableConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCheckTableConfigOK creates a CheckTableConfigOK with default headers values +func NewCheckTableConfigOK() *CheckTableConfigOK { + return &CheckTableConfigOK{} +} + +/* +CheckTableConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type CheckTableConfigOK struct { + Payload models.ObjectNode +} + +// IsSuccess returns true when this check table config o k response has a 2xx status code +func (o *CheckTableConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this check table config o k response has a 3xx status code +func (o *CheckTableConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this check table config o k response has a 4xx status code +func (o *CheckTableConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this check table config o k response has a 5xx status code +func (o *CheckTableConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this check table config o k response a status code equal to that given +func (o *CheckTableConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the check table config o k response +func (o *CheckTableConfigOK) Code() int { + return 200 +} + +func (o *CheckTableConfigOK) Error() string { + return fmt.Sprintf("[POST /tables/validate][%d] checkTableConfigOK %+v", 200, o.Payload) +} + +func (o *CheckTableConfigOK) String() string { + return fmt.Sprintf("[POST /tables/validate][%d] checkTableConfigOK %+v", 200, o.Payload) +} + +func (o *CheckTableConfigOK) GetPayload() models.ObjectNode { + return o.Payload +} + +func (o *CheckTableConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/delete_config_parameters.go b/src/client/table/delete_config_parameters.go new file mode 100644 index 0000000..4c0186e --- /dev/null +++ b/src/client/table/delete_config_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteConfigParams creates a new DeleteConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteConfigParams() *DeleteConfigParams { + return &DeleteConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteConfigParamsWithTimeout creates a new DeleteConfigParams object +// with the ability to set a timeout on a request. +func NewDeleteConfigParamsWithTimeout(timeout time.Duration) *DeleteConfigParams { + return &DeleteConfigParams{ + timeout: timeout, + } +} + +// NewDeleteConfigParamsWithContext creates a new DeleteConfigParams object +// with the ability to set a context for a request. +func NewDeleteConfigParamsWithContext(ctx context.Context) *DeleteConfigParams { + return &DeleteConfigParams{ + Context: ctx, + } +} + +// NewDeleteConfigParamsWithHTTPClient creates a new DeleteConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteConfigParamsWithHTTPClient(client *http.Client) *DeleteConfigParams { + return &DeleteConfigParams{ + HTTPClient: client, + } +} + +/* +DeleteConfigParams contains all the parameters to send to the API endpoint + + for the delete config operation. + + Typically these are written to a http.Request. +*/ +type DeleteConfigParams struct { + + /* TableName. + + TableConfigs name i.e. raw table name + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteConfigParams) WithDefaults() *DeleteConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete config params +func (o *DeleteConfigParams) WithTimeout(timeout time.Duration) *DeleteConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete config params +func (o *DeleteConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete config params +func (o *DeleteConfigParams) WithContext(ctx context.Context) *DeleteConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete config params +func (o *DeleteConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete config params +func (o *DeleteConfigParams) WithHTTPClient(client *http.Client) *DeleteConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete config params +func (o *DeleteConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the delete config params +func (o *DeleteConfigParams) WithTableName(tableName string) *DeleteConfigParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the delete config params +func (o *DeleteConfigParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/delete_config_responses.go b/src/client/table/delete_config_responses.go new file mode 100644 index 0000000..d5e1101 --- /dev/null +++ b/src/client/table/delete_config_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteConfigReader is a Reader for the DeleteConfig structure. +type DeleteConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteConfigOK creates a DeleteConfigOK with default headers values +func NewDeleteConfigOK() *DeleteConfigOK { + return &DeleteConfigOK{} +} + +/* +DeleteConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteConfigOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete config o k response has a 2xx status code +func (o *DeleteConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete config o k response has a 3xx status code +func (o *DeleteConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete config o k response has a 4xx status code +func (o *DeleteConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete config o k response has a 5xx status code +func (o *DeleteConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete config o k response a status code equal to that given +func (o *DeleteConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete config o k response +func (o *DeleteConfigOK) Code() int { + return 200 +} + +func (o *DeleteConfigOK) Error() string { + return fmt.Sprintf("[DELETE /tableConfigs/{tableName}][%d] deleteConfigOK %+v", 200, o.Payload) +} + +func (o *DeleteConfigOK) String() string { + return fmt.Sprintf("[DELETE /tableConfigs/{tableName}][%d] deleteConfigOK %+v", 200, o.Payload) +} + +func (o *DeleteConfigOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/delete_table_parameters.go b/src/client/table/delete_table_parameters.go new file mode 100644 index 0000000..48f6980 --- /dev/null +++ b/src/client/table/delete_table_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTableParams creates a new DeleteTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTableParams() *DeleteTableParams { + return &DeleteTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTableParamsWithTimeout creates a new DeleteTableParams object +// with the ability to set a timeout on a request. +func NewDeleteTableParamsWithTimeout(timeout time.Duration) *DeleteTableParams { + return &DeleteTableParams{ + timeout: timeout, + } +} + +// NewDeleteTableParamsWithContext creates a new DeleteTableParams object +// with the ability to set a context for a request. +func NewDeleteTableParamsWithContext(ctx context.Context) *DeleteTableParams { + return &DeleteTableParams{ + Context: ctx, + } +} + +// NewDeleteTableParamsWithHTTPClient creates a new DeleteTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTableParamsWithHTTPClient(client *http.Client) *DeleteTableParams { + return &DeleteTableParams{ + HTTPClient: client, + } +} + +/* +DeleteTableParams contains all the parameters to send to the API endpoint + + for the delete table operation. + + Typically these are written to a http.Request. +*/ +type DeleteTableParams struct { + + /* Retention. + + Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention + */ + Retention *string + + /* TableName. + + Name of the table to delete + */ + TableName string + + /* Type. + + realtime|offline + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTableParams) WithDefaults() *DeleteTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete table params +func (o *DeleteTableParams) WithTimeout(timeout time.Duration) *DeleteTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete table params +func (o *DeleteTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete table params +func (o *DeleteTableParams) WithContext(ctx context.Context) *DeleteTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete table params +func (o *DeleteTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete table params +func (o *DeleteTableParams) WithHTTPClient(client *http.Client) *DeleteTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete table params +func (o *DeleteTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRetention adds the retention to the delete table params +func (o *DeleteTableParams) WithRetention(retention *string) *DeleteTableParams { + o.SetRetention(retention) + return o +} + +// SetRetention adds the retention to the delete table params +func (o *DeleteTableParams) SetRetention(retention *string) { + o.Retention = retention +} + +// WithTableName adds the tableName to the delete table params +func (o *DeleteTableParams) WithTableName(tableName string) *DeleteTableParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the delete table params +func (o *DeleteTableParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the delete table params +func (o *DeleteTableParams) WithType(typeVar *string) *DeleteTableParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the delete table params +func (o *DeleteTableParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Retention != nil { + + // query param retention + var qrRetention string + + if o.Retention != nil { + qrRetention = *o.Retention + } + qRetention := qrRetention + if qRetention != "" { + + if err := r.SetQueryParam("retention", qRetention); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/delete_table_responses.go b/src/client/table/delete_table_responses.go new file mode 100644 index 0000000..17e4223 --- /dev/null +++ b/src/client/table/delete_table_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteTableReader is a Reader for the DeleteTable structure. +type DeleteTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTableOK creates a DeleteTableOK with default headers values +func NewDeleteTableOK() *DeleteTableOK { + return &DeleteTableOK{} +} + +/* +DeleteTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteTableOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete table o k response has a 2xx status code +func (o *DeleteTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete table o k response has a 3xx status code +func (o *DeleteTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete table o k response has a 4xx status code +func (o *DeleteTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete table o k response has a 5xx status code +func (o *DeleteTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete table o k response a status code equal to that given +func (o *DeleteTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete table o k response +func (o *DeleteTableOK) Code() int { + return 200 +} + +func (o *DeleteTableOK) Error() string { + return fmt.Sprintf("[DELETE /tables/{tableName}][%d] deleteTableOK %+v", 200, o.Payload) +} + +func (o *DeleteTableOK) String() string { + return fmt.Sprintf("[DELETE /tables/{tableName}][%d] deleteTableOK %+v", 200, o.Payload) +} + +func (o *DeleteTableOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/delete_time_boundary_parameters.go b/src/client/table/delete_time_boundary_parameters.go new file mode 100644 index 0000000..59e2c81 --- /dev/null +++ b/src/client/table/delete_time_boundary_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTimeBoundaryParams creates a new DeleteTimeBoundaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTimeBoundaryParams() *DeleteTimeBoundaryParams { + return &DeleteTimeBoundaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTimeBoundaryParamsWithTimeout creates a new DeleteTimeBoundaryParams object +// with the ability to set a timeout on a request. +func NewDeleteTimeBoundaryParamsWithTimeout(timeout time.Duration) *DeleteTimeBoundaryParams { + return &DeleteTimeBoundaryParams{ + timeout: timeout, + } +} + +// NewDeleteTimeBoundaryParamsWithContext creates a new DeleteTimeBoundaryParams object +// with the ability to set a context for a request. +func NewDeleteTimeBoundaryParamsWithContext(ctx context.Context) *DeleteTimeBoundaryParams { + return &DeleteTimeBoundaryParams{ + Context: ctx, + } +} + +// NewDeleteTimeBoundaryParamsWithHTTPClient creates a new DeleteTimeBoundaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTimeBoundaryParamsWithHTTPClient(client *http.Client) *DeleteTimeBoundaryParams { + return &DeleteTimeBoundaryParams{ + HTTPClient: client, + } +} + +/* +DeleteTimeBoundaryParams contains all the parameters to send to the API endpoint + + for the delete time boundary operation. + + Typically these are written to a http.Request. +*/ +type DeleteTimeBoundaryParams struct { + + /* TableName. + + Name of the hybrid table (without type suffix) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete time boundary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTimeBoundaryParams) WithDefaults() *DeleteTimeBoundaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete time boundary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTimeBoundaryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete time boundary params +func (o *DeleteTimeBoundaryParams) WithTimeout(timeout time.Duration) *DeleteTimeBoundaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete time boundary params +func (o *DeleteTimeBoundaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete time boundary params +func (o *DeleteTimeBoundaryParams) WithContext(ctx context.Context) *DeleteTimeBoundaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete time boundary params +func (o *DeleteTimeBoundaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete time boundary params +func (o *DeleteTimeBoundaryParams) WithHTTPClient(client *http.Client) *DeleteTimeBoundaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete time boundary params +func (o *DeleteTimeBoundaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the delete time boundary params +func (o *DeleteTimeBoundaryParams) WithTableName(tableName string) *DeleteTimeBoundaryParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the delete time boundary params +func (o *DeleteTimeBoundaryParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTimeBoundaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/delete_time_boundary_responses.go b/src/client/table/delete_time_boundary_responses.go new file mode 100644 index 0000000..be188fb --- /dev/null +++ b/src/client/table/delete_time_boundary_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteTimeBoundaryReader is a Reader for the DeleteTimeBoundary structure. +type DeleteTimeBoundaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTimeBoundaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTimeBoundaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTimeBoundaryOK creates a DeleteTimeBoundaryOK with default headers values +func NewDeleteTimeBoundaryOK() *DeleteTimeBoundaryOK { + return &DeleteTimeBoundaryOK{} +} + +/* +DeleteTimeBoundaryOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteTimeBoundaryOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete time boundary o k response has a 2xx status code +func (o *DeleteTimeBoundaryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete time boundary o k response has a 3xx status code +func (o *DeleteTimeBoundaryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete time boundary o k response has a 4xx status code +func (o *DeleteTimeBoundaryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete time boundary o k response has a 5xx status code +func (o *DeleteTimeBoundaryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete time boundary o k response a status code equal to that given +func (o *DeleteTimeBoundaryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete time boundary o k response +func (o *DeleteTimeBoundaryOK) Code() int { + return 200 +} + +func (o *DeleteTimeBoundaryOK) Error() string { + return fmt.Sprintf("[DELETE /tables/{tableName}/timeBoundary][%d] deleteTimeBoundaryOK %+v", 200, o.Payload) +} + +func (o *DeleteTimeBoundaryOK) String() string { + return fmt.Sprintf("[DELETE /tables/{tableName}/timeBoundary][%d] deleteTimeBoundaryOK %+v", 200, o.Payload) +} + +func (o *DeleteTimeBoundaryOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteTimeBoundaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/force_commit_parameters.go b/src/client/table/force_commit_parameters.go new file mode 100644 index 0000000..8061b5b --- /dev/null +++ b/src/client/table/force_commit_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewForceCommitParams creates a new ForceCommitParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewForceCommitParams() *ForceCommitParams { + return &ForceCommitParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewForceCommitParamsWithTimeout creates a new ForceCommitParams object +// with the ability to set a timeout on a request. +func NewForceCommitParamsWithTimeout(timeout time.Duration) *ForceCommitParams { + return &ForceCommitParams{ + timeout: timeout, + } +} + +// NewForceCommitParamsWithContext creates a new ForceCommitParams object +// with the ability to set a context for a request. +func NewForceCommitParamsWithContext(ctx context.Context) *ForceCommitParams { + return &ForceCommitParams{ + Context: ctx, + } +} + +// NewForceCommitParamsWithHTTPClient creates a new ForceCommitParams object +// with the ability to set a custom HTTPClient for a request. +func NewForceCommitParamsWithHTTPClient(client *http.Client) *ForceCommitParams { + return &ForceCommitParams{ + HTTPClient: client, + } +} + +/* +ForceCommitParams contains all the parameters to send to the API endpoint + + for the force commit operation. + + Typically these are written to a http.Request. +*/ +type ForceCommitParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the force commit params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ForceCommitParams) WithDefaults() *ForceCommitParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the force commit params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ForceCommitParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the force commit params +func (o *ForceCommitParams) WithTimeout(timeout time.Duration) *ForceCommitParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the force commit params +func (o *ForceCommitParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the force commit params +func (o *ForceCommitParams) WithContext(ctx context.Context) *ForceCommitParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the force commit params +func (o *ForceCommitParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the force commit params +func (o *ForceCommitParams) WithHTTPClient(client *http.Client) *ForceCommitParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the force commit params +func (o *ForceCommitParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the force commit params +func (o *ForceCommitParams) WithTableName(tableName string) *ForceCommitParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the force commit params +func (o *ForceCommitParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *ForceCommitParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/force_commit_responses.go b/src/client/table/force_commit_responses.go new file mode 100644 index 0000000..f0f301e --- /dev/null +++ b/src/client/table/force_commit_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ForceCommitReader is a Reader for the ForceCommit structure. +type ForceCommitReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ForceCommitReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewForceCommitOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewForceCommitOK creates a ForceCommitOK with default headers values +func NewForceCommitOK() *ForceCommitOK { + return &ForceCommitOK{} +} + +/* +ForceCommitOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ForceCommitOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this force commit o k response has a 2xx status code +func (o *ForceCommitOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this force commit o k response has a 3xx status code +func (o *ForceCommitOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this force commit o k response has a 4xx status code +func (o *ForceCommitOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this force commit o k response has a 5xx status code +func (o *ForceCommitOK) IsServerError() bool { + return false +} + +// IsCode returns true when this force commit o k response a status code equal to that given +func (o *ForceCommitOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the force commit o k response +func (o *ForceCommitOK) Code() int { + return 200 +} + +func (o *ForceCommitOK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/forceCommit][%d] forceCommitOK %+v", 200, o.Payload) +} + +func (o *ForceCommitOK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/forceCommit][%d] forceCommitOK %+v", 200, o.Payload) +} + +func (o *ForceCommitOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *ForceCommitOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_config_parameters.go b/src/client/table/get_config_parameters.go new file mode 100644 index 0000000..7894b94 --- /dev/null +++ b/src/client/table/get_config_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetConfigParams creates a new GetConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetConfigParams() *GetConfigParams { + return &GetConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetConfigParamsWithTimeout creates a new GetConfigParams object +// with the ability to set a timeout on a request. +func NewGetConfigParamsWithTimeout(timeout time.Duration) *GetConfigParams { + return &GetConfigParams{ + timeout: timeout, + } +} + +// NewGetConfigParamsWithContext creates a new GetConfigParams object +// with the ability to set a context for a request. +func NewGetConfigParamsWithContext(ctx context.Context) *GetConfigParams { + return &GetConfigParams{ + Context: ctx, + } +} + +// NewGetConfigParamsWithHTTPClient creates a new GetConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetConfigParamsWithHTTPClient(client *http.Client) *GetConfigParams { + return &GetConfigParams{ + HTTPClient: client, + } +} + +/* +GetConfigParams contains all the parameters to send to the API endpoint + + for the get config operation. + + Typically these are written to a http.Request. +*/ +type GetConfigParams struct { + + /* TableName. + + Raw table name + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConfigParams) WithDefaults() *GetConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get config params +func (o *GetConfigParams) WithTimeout(timeout time.Duration) *GetConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get config params +func (o *GetConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get config params +func (o *GetConfigParams) WithContext(ctx context.Context) *GetConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get config params +func (o *GetConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get config params +func (o *GetConfigParams) WithHTTPClient(client *http.Client) *GetConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get config params +func (o *GetConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get config params +func (o *GetConfigParams) WithTableName(tableName string) *GetConfigParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get config params +func (o *GetConfigParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_config_responses.go b/src/client/table/get_config_responses.go new file mode 100644 index 0000000..4b818b4 --- /dev/null +++ b/src/client/table/get_config_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetConfigReader is a Reader for the GetConfig structure. +type GetConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetConfigOK creates a GetConfigOK with default headers values +func NewGetConfigOK() *GetConfigOK { + return &GetConfigOK{} +} + +/* +GetConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetConfigOK struct { + Payload string +} + +// IsSuccess returns true when this get config o k response has a 2xx status code +func (o *GetConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get config o k response has a 3xx status code +func (o *GetConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get config o k response has a 4xx status code +func (o *GetConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get config o k response has a 5xx status code +func (o *GetConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get config o k response a status code equal to that given +func (o *GetConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get config o k response +func (o *GetConfigOK) Code() int { + return 200 +} + +func (o *GetConfigOK) Error() string { + return fmt.Sprintf("[GET /tableConfigs/{tableName}][%d] getConfigOK %+v", 200, o.Payload) +} + +func (o *GetConfigOK) String() string { + return fmt.Sprintf("[GET /tableConfigs/{tableName}][%d] getConfigOK %+v", 200, o.Payload) +} + +func (o *GetConfigOK) GetPayload() string { + return o.Payload +} + +func (o *GetConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_consuming_segments_info_parameters.go b/src/client/table/get_consuming_segments_info_parameters.go new file mode 100644 index 0000000..7aeb293 --- /dev/null +++ b/src/client/table/get_consuming_segments_info_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetConsumingSegmentsInfoParams creates a new GetConsumingSegmentsInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetConsumingSegmentsInfoParams() *GetConsumingSegmentsInfoParams { + return &GetConsumingSegmentsInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetConsumingSegmentsInfoParamsWithTimeout creates a new GetConsumingSegmentsInfoParams object +// with the ability to set a timeout on a request. +func NewGetConsumingSegmentsInfoParamsWithTimeout(timeout time.Duration) *GetConsumingSegmentsInfoParams { + return &GetConsumingSegmentsInfoParams{ + timeout: timeout, + } +} + +// NewGetConsumingSegmentsInfoParamsWithContext creates a new GetConsumingSegmentsInfoParams object +// with the ability to set a context for a request. +func NewGetConsumingSegmentsInfoParamsWithContext(ctx context.Context) *GetConsumingSegmentsInfoParams { + return &GetConsumingSegmentsInfoParams{ + Context: ctx, + } +} + +// NewGetConsumingSegmentsInfoParamsWithHTTPClient creates a new GetConsumingSegmentsInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetConsumingSegmentsInfoParamsWithHTTPClient(client *http.Client) *GetConsumingSegmentsInfoParams { + return &GetConsumingSegmentsInfoParams{ + HTTPClient: client, + } +} + +/* +GetConsumingSegmentsInfoParams contains all the parameters to send to the API endpoint + + for the get consuming segments info operation. + + Typically these are written to a http.Request. +*/ +type GetConsumingSegmentsInfoParams struct { + + /* TableName. + + Realtime table name with or without type + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get consuming segments info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConsumingSegmentsInfoParams) WithDefaults() *GetConsumingSegmentsInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get consuming segments info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConsumingSegmentsInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) WithTimeout(timeout time.Duration) *GetConsumingSegmentsInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) WithContext(ctx context.Context) *GetConsumingSegmentsInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) WithHTTPClient(client *http.Client) *GetConsumingSegmentsInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) WithTableName(tableName string) *GetConsumingSegmentsInfoParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get consuming segments info params +func (o *GetConsumingSegmentsInfoParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetConsumingSegmentsInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_consuming_segments_info_responses.go b/src/client/table/get_consuming_segments_info_responses.go new file mode 100644 index 0000000..1dab385 --- /dev/null +++ b/src/client/table/get_consuming_segments_info_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetConsumingSegmentsInfoReader is a Reader for the GetConsumingSegmentsInfo structure. +type GetConsumingSegmentsInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetConsumingSegmentsInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetConsumingSegmentsInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetConsumingSegmentsInfoNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetConsumingSegmentsInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetConsumingSegmentsInfoOK creates a GetConsumingSegmentsInfoOK with default headers values +func NewGetConsumingSegmentsInfoOK() *GetConsumingSegmentsInfoOK { + return &GetConsumingSegmentsInfoOK{} +} + +/* +GetConsumingSegmentsInfoOK describes a response with status code 200, with default header values. + +Success +*/ +type GetConsumingSegmentsInfoOK struct { +} + +// IsSuccess returns true when this get consuming segments info o k response has a 2xx status code +func (o *GetConsumingSegmentsInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get consuming segments info o k response has a 3xx status code +func (o *GetConsumingSegmentsInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get consuming segments info o k response has a 4xx status code +func (o *GetConsumingSegmentsInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get consuming segments info o k response has a 5xx status code +func (o *GetConsumingSegmentsInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get consuming segments info o k response a status code equal to that given +func (o *GetConsumingSegmentsInfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get consuming segments info o k response +func (o *GetConsumingSegmentsInfoOK) Code() int { + return 200 +} + +func (o *GetConsumingSegmentsInfoOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/consumingSegmentsInfo][%d] getConsumingSegmentsInfoOK ", 200) +} + +func (o *GetConsumingSegmentsInfoOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/consumingSegmentsInfo][%d] getConsumingSegmentsInfoOK ", 200) +} + +func (o *GetConsumingSegmentsInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetConsumingSegmentsInfoNotFound creates a GetConsumingSegmentsInfoNotFound with default headers values +func NewGetConsumingSegmentsInfoNotFound() *GetConsumingSegmentsInfoNotFound { + return &GetConsumingSegmentsInfoNotFound{} +} + +/* +GetConsumingSegmentsInfoNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetConsumingSegmentsInfoNotFound struct { +} + +// IsSuccess returns true when this get consuming segments info not found response has a 2xx status code +func (o *GetConsumingSegmentsInfoNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get consuming segments info not found response has a 3xx status code +func (o *GetConsumingSegmentsInfoNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get consuming segments info not found response has a 4xx status code +func (o *GetConsumingSegmentsInfoNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get consuming segments info not found response has a 5xx status code +func (o *GetConsumingSegmentsInfoNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get consuming segments info not found response a status code equal to that given +func (o *GetConsumingSegmentsInfoNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get consuming segments info not found response +func (o *GetConsumingSegmentsInfoNotFound) Code() int { + return 404 +} + +func (o *GetConsumingSegmentsInfoNotFound) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/consumingSegmentsInfo][%d] getConsumingSegmentsInfoNotFound ", 404) +} + +func (o *GetConsumingSegmentsInfoNotFound) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/consumingSegmentsInfo][%d] getConsumingSegmentsInfoNotFound ", 404) +} + +func (o *GetConsumingSegmentsInfoNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetConsumingSegmentsInfoInternalServerError creates a GetConsumingSegmentsInfoInternalServerError with default headers values +func NewGetConsumingSegmentsInfoInternalServerError() *GetConsumingSegmentsInfoInternalServerError { + return &GetConsumingSegmentsInfoInternalServerError{} +} + +/* +GetConsumingSegmentsInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetConsumingSegmentsInfoInternalServerError struct { +} + +// IsSuccess returns true when this get consuming segments info internal server error response has a 2xx status code +func (o *GetConsumingSegmentsInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get consuming segments info internal server error response has a 3xx status code +func (o *GetConsumingSegmentsInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get consuming segments info internal server error response has a 4xx status code +func (o *GetConsumingSegmentsInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get consuming segments info internal server error response has a 5xx status code +func (o *GetConsumingSegmentsInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get consuming segments info internal server error response a status code equal to that given +func (o *GetConsumingSegmentsInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get consuming segments info internal server error response +func (o *GetConsumingSegmentsInfoInternalServerError) Code() int { + return 500 +} + +func (o *GetConsumingSegmentsInfoInternalServerError) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/consumingSegmentsInfo][%d] getConsumingSegmentsInfoInternalServerError ", 500) +} + +func (o *GetConsumingSegmentsInfoInternalServerError) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/consumingSegmentsInfo][%d] getConsumingSegmentsInfoInternalServerError ", 500) +} + +func (o *GetConsumingSegmentsInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/get_controller_jobs_parameters.go b/src/client/table/get_controller_jobs_parameters.go new file mode 100644 index 0000000..17f7153 --- /dev/null +++ b/src/client/table/get_controller_jobs_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetControllerJobsParams creates a new GetControllerJobsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetControllerJobsParams() *GetControllerJobsParams { + return &GetControllerJobsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetControllerJobsParamsWithTimeout creates a new GetControllerJobsParams object +// with the ability to set a timeout on a request. +func NewGetControllerJobsParamsWithTimeout(timeout time.Duration) *GetControllerJobsParams { + return &GetControllerJobsParams{ + timeout: timeout, + } +} + +// NewGetControllerJobsParamsWithContext creates a new GetControllerJobsParams object +// with the ability to set a context for a request. +func NewGetControllerJobsParamsWithContext(ctx context.Context) *GetControllerJobsParams { + return &GetControllerJobsParams{ + Context: ctx, + } +} + +// NewGetControllerJobsParamsWithHTTPClient creates a new GetControllerJobsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetControllerJobsParamsWithHTTPClient(client *http.Client) *GetControllerJobsParams { + return &GetControllerJobsParams{ + HTTPClient: client, + } +} + +/* +GetControllerJobsParams contains all the parameters to send to the API endpoint + + for the get controller jobs operation. + + Typically these are written to a http.Request. +*/ +type GetControllerJobsParams struct { + + /* JobTypes. + + Comma separated list of job types + */ + JobTypes *string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get controller jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetControllerJobsParams) WithDefaults() *GetControllerJobsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get controller jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetControllerJobsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get controller jobs params +func (o *GetControllerJobsParams) WithTimeout(timeout time.Duration) *GetControllerJobsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get controller jobs params +func (o *GetControllerJobsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get controller jobs params +func (o *GetControllerJobsParams) WithContext(ctx context.Context) *GetControllerJobsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get controller jobs params +func (o *GetControllerJobsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get controller jobs params +func (o *GetControllerJobsParams) WithHTTPClient(client *http.Client) *GetControllerJobsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get controller jobs params +func (o *GetControllerJobsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobTypes adds the jobTypes to the get controller jobs params +func (o *GetControllerJobsParams) WithJobTypes(jobTypes *string) *GetControllerJobsParams { + o.SetJobTypes(jobTypes) + return o +} + +// SetJobTypes adds the jobTypes to the get controller jobs params +func (o *GetControllerJobsParams) SetJobTypes(jobTypes *string) { + o.JobTypes = jobTypes +} + +// WithTableName adds the tableName to the get controller jobs params +func (o *GetControllerJobsParams) WithTableName(tableName string) *GetControllerJobsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get controller jobs params +func (o *GetControllerJobsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get controller jobs params +func (o *GetControllerJobsParams) WithType(typeVar *string) *GetControllerJobsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get controller jobs params +func (o *GetControllerJobsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetControllerJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.JobTypes != nil { + + // query param jobTypes + var qrJobTypes string + + if o.JobTypes != nil { + qrJobTypes = *o.JobTypes + } + qJobTypes := qrJobTypes + if qJobTypes != "" { + + if err := r.SetQueryParam("jobTypes", qJobTypes); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_controller_jobs_responses.go b/src/client/table/get_controller_jobs_responses.go new file mode 100644 index 0000000..3525328 --- /dev/null +++ b/src/client/table/get_controller_jobs_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetControllerJobsReader is a Reader for the GetControllerJobs structure. +type GetControllerJobsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetControllerJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetControllerJobsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetControllerJobsOK creates a GetControllerJobsOK with default headers values +func NewGetControllerJobsOK() *GetControllerJobsOK { + return &GetControllerJobsOK{} +} + +/* +GetControllerJobsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetControllerJobsOK struct { + Payload map[string]map[string]string +} + +// IsSuccess returns true when this get controller jobs o k response has a 2xx status code +func (o *GetControllerJobsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get controller jobs o k response has a 3xx status code +func (o *GetControllerJobsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get controller jobs o k response has a 4xx status code +func (o *GetControllerJobsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get controller jobs o k response has a 5xx status code +func (o *GetControllerJobsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get controller jobs o k response a status code equal to that given +func (o *GetControllerJobsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get controller jobs o k response +func (o *GetControllerJobsOK) Code() int { + return 200 +} + +func (o *GetControllerJobsOK) Error() string { + return fmt.Sprintf("[GET /table/{tableName}/jobs][%d] getControllerJobsOK %+v", 200, o.Payload) +} + +func (o *GetControllerJobsOK) String() string { + return fmt.Sprintf("[GET /table/{tableName}/jobs][%d] getControllerJobsOK %+v", 200, o.Payload) +} + +func (o *GetControllerJobsOK) GetPayload() map[string]map[string]string { + return o.Payload +} + +func (o *GetControllerJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_external_view_parameters.go b/src/client/table/get_external_view_parameters.go new file mode 100644 index 0000000..0bba643 --- /dev/null +++ b/src/client/table/get_external_view_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetExternalViewParams creates a new GetExternalViewParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetExternalViewParams() *GetExternalViewParams { + return &GetExternalViewParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetExternalViewParamsWithTimeout creates a new GetExternalViewParams object +// with the ability to set a timeout on a request. +func NewGetExternalViewParamsWithTimeout(timeout time.Duration) *GetExternalViewParams { + return &GetExternalViewParams{ + timeout: timeout, + } +} + +// NewGetExternalViewParamsWithContext creates a new GetExternalViewParams object +// with the ability to set a context for a request. +func NewGetExternalViewParamsWithContext(ctx context.Context) *GetExternalViewParams { + return &GetExternalViewParams{ + Context: ctx, + } +} + +// NewGetExternalViewParamsWithHTTPClient creates a new GetExternalViewParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetExternalViewParamsWithHTTPClient(client *http.Client) *GetExternalViewParams { + return &GetExternalViewParams{ + HTTPClient: client, + } +} + +/* +GetExternalViewParams contains all the parameters to send to the API endpoint + + for the get external view operation. + + Typically these are written to a http.Request. +*/ +type GetExternalViewParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* TableType. + + realtime|offline + */ + TableType *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get external view params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalViewParams) WithDefaults() *GetExternalViewParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get external view params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalViewParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get external view params +func (o *GetExternalViewParams) WithTimeout(timeout time.Duration) *GetExternalViewParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get external view params +func (o *GetExternalViewParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get external view params +func (o *GetExternalViewParams) WithContext(ctx context.Context) *GetExternalViewParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get external view params +func (o *GetExternalViewParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get external view params +func (o *GetExternalViewParams) WithHTTPClient(client *http.Client) *GetExternalViewParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get external view params +func (o *GetExternalViewParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get external view params +func (o *GetExternalViewParams) WithTableName(tableName string) *GetExternalViewParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get external view params +func (o *GetExternalViewParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithTableType adds the tableType to the get external view params +func (o *GetExternalViewParams) WithTableType(tableType *string) *GetExternalViewParams { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the get external view params +func (o *GetExternalViewParams) SetTableType(tableType *string) { + o.TableType = tableType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetExternalViewParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.TableType != nil { + + // query param tableType + var qrTableType string + + if o.TableType != nil { + qrTableType = *o.TableType + } + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_external_view_responses.go b/src/client/table/get_external_view_responses.go new file mode 100644 index 0000000..b748050 --- /dev/null +++ b/src/client/table/get_external_view_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetExternalViewReader is a Reader for the GetExternalView structure. +type GetExternalViewReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetExternalViewReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetExternalViewOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetExternalViewOK creates a GetExternalViewOK with default headers values +func NewGetExternalViewOK() *GetExternalViewOK { + return &GetExternalViewOK{} +} + +/* +GetExternalViewOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetExternalViewOK struct { + Payload *models.TableView +} + +// IsSuccess returns true when this get external view o k response has a 2xx status code +func (o *GetExternalViewOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get external view o k response has a 3xx status code +func (o *GetExternalViewOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get external view o k response has a 4xx status code +func (o *GetExternalViewOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get external view o k response has a 5xx status code +func (o *GetExternalViewOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get external view o k response a status code equal to that given +func (o *GetExternalViewOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get external view o k response +func (o *GetExternalViewOK) Code() int { + return 200 +} + +func (o *GetExternalViewOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/externalview][%d] getExternalViewOK %+v", 200, o.Payload) +} + +func (o *GetExternalViewOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/externalview][%d] getExternalViewOK %+v", 200, o.Payload) +} + +func (o *GetExternalViewOK) GetPayload() *models.TableView { + return o.Payload +} + +func (o *GetExternalViewOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TableView) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_force_commit_job_status_parameters.go b/src/client/table/get_force_commit_job_status_parameters.go new file mode 100644 index 0000000..4226474 --- /dev/null +++ b/src/client/table/get_force_commit_job_status_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetForceCommitJobStatusParams creates a new GetForceCommitJobStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetForceCommitJobStatusParams() *GetForceCommitJobStatusParams { + return &GetForceCommitJobStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetForceCommitJobStatusParamsWithTimeout creates a new GetForceCommitJobStatusParams object +// with the ability to set a timeout on a request. +func NewGetForceCommitJobStatusParamsWithTimeout(timeout time.Duration) *GetForceCommitJobStatusParams { + return &GetForceCommitJobStatusParams{ + timeout: timeout, + } +} + +// NewGetForceCommitJobStatusParamsWithContext creates a new GetForceCommitJobStatusParams object +// with the ability to set a context for a request. +func NewGetForceCommitJobStatusParamsWithContext(ctx context.Context) *GetForceCommitJobStatusParams { + return &GetForceCommitJobStatusParams{ + Context: ctx, + } +} + +// NewGetForceCommitJobStatusParamsWithHTTPClient creates a new GetForceCommitJobStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetForceCommitJobStatusParamsWithHTTPClient(client *http.Client) *GetForceCommitJobStatusParams { + return &GetForceCommitJobStatusParams{ + HTTPClient: client, + } +} + +/* +GetForceCommitJobStatusParams contains all the parameters to send to the API endpoint + + for the get force commit job status operation. + + Typically these are written to a http.Request. +*/ +type GetForceCommitJobStatusParams struct { + + /* JobID. + + Force commit job id + */ + JobID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get force commit job status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetForceCommitJobStatusParams) WithDefaults() *GetForceCommitJobStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get force commit job status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetForceCommitJobStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get force commit job status params +func (o *GetForceCommitJobStatusParams) WithTimeout(timeout time.Duration) *GetForceCommitJobStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get force commit job status params +func (o *GetForceCommitJobStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get force commit job status params +func (o *GetForceCommitJobStatusParams) WithContext(ctx context.Context) *GetForceCommitJobStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get force commit job status params +func (o *GetForceCommitJobStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get force commit job status params +func (o *GetForceCommitJobStatusParams) WithHTTPClient(client *http.Client) *GetForceCommitJobStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get force commit job status params +func (o *GetForceCommitJobStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobID adds the jobID to the get force commit job status params +func (o *GetForceCommitJobStatusParams) WithJobID(jobID string) *GetForceCommitJobStatusParams { + o.SetJobID(jobID) + return o +} + +// SetJobID adds the jobId to the get force commit job status params +func (o *GetForceCommitJobStatusParams) SetJobID(jobID string) { + o.JobID = jobID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetForceCommitJobStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param jobId + if err := r.SetPathParam("jobId", o.JobID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_force_commit_job_status_responses.go b/src/client/table/get_force_commit_job_status_responses.go new file mode 100644 index 0000000..8a2a943 --- /dev/null +++ b/src/client/table/get_force_commit_job_status_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetForceCommitJobStatusReader is a Reader for the GetForceCommitJobStatus structure. +type GetForceCommitJobStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetForceCommitJobStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetForceCommitJobStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetForceCommitJobStatusOK creates a GetForceCommitJobStatusOK with default headers values +func NewGetForceCommitJobStatusOK() *GetForceCommitJobStatusOK { + return &GetForceCommitJobStatusOK{} +} + +/* +GetForceCommitJobStatusOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetForceCommitJobStatusOK struct { + Payload models.JSONNode +} + +// IsSuccess returns true when this get force commit job status o k response has a 2xx status code +func (o *GetForceCommitJobStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get force commit job status o k response has a 3xx status code +func (o *GetForceCommitJobStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get force commit job status o k response has a 4xx status code +func (o *GetForceCommitJobStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get force commit job status o k response has a 5xx status code +func (o *GetForceCommitJobStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get force commit job status o k response a status code equal to that given +func (o *GetForceCommitJobStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get force commit job status o k response +func (o *GetForceCommitJobStatusOK) Code() int { + return 200 +} + +func (o *GetForceCommitJobStatusOK) Error() string { + return fmt.Sprintf("[GET /tables/forceCommitStatus/{jobId}][%d] getForceCommitJobStatusOK %+v", 200, o.Payload) +} + +func (o *GetForceCommitJobStatusOK) String() string { + return fmt.Sprintf("[GET /tables/forceCommitStatus/{jobId}][%d] getForceCommitJobStatusOK %+v", 200, o.Payload) +} + +func (o *GetForceCommitJobStatusOK) GetPayload() models.JSONNode { + return o.Payload +} + +func (o *GetForceCommitJobStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_ideal_state_parameters.go b/src/client/table/get_ideal_state_parameters.go new file mode 100644 index 0000000..3ae75a0 --- /dev/null +++ b/src/client/table/get_ideal_state_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIdealStateParams creates a new GetIdealStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIdealStateParams() *GetIdealStateParams { + return &GetIdealStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIdealStateParamsWithTimeout creates a new GetIdealStateParams object +// with the ability to set a timeout on a request. +func NewGetIdealStateParamsWithTimeout(timeout time.Duration) *GetIdealStateParams { + return &GetIdealStateParams{ + timeout: timeout, + } +} + +// NewGetIdealStateParamsWithContext creates a new GetIdealStateParams object +// with the ability to set a context for a request. +func NewGetIdealStateParamsWithContext(ctx context.Context) *GetIdealStateParams { + return &GetIdealStateParams{ + Context: ctx, + } +} + +// NewGetIdealStateParamsWithHTTPClient creates a new GetIdealStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIdealStateParamsWithHTTPClient(client *http.Client) *GetIdealStateParams { + return &GetIdealStateParams{ + HTTPClient: client, + } +} + +/* +GetIdealStateParams contains all the parameters to send to the API endpoint + + for the get ideal state operation. + + Typically these are written to a http.Request. +*/ +type GetIdealStateParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* TableType. + + realtime|offline + */ + TableType *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ideal state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIdealStateParams) WithDefaults() *GetIdealStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ideal state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIdealStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ideal state params +func (o *GetIdealStateParams) WithTimeout(timeout time.Duration) *GetIdealStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ideal state params +func (o *GetIdealStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ideal state params +func (o *GetIdealStateParams) WithContext(ctx context.Context) *GetIdealStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ideal state params +func (o *GetIdealStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ideal state params +func (o *GetIdealStateParams) WithHTTPClient(client *http.Client) *GetIdealStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ideal state params +func (o *GetIdealStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get ideal state params +func (o *GetIdealStateParams) WithTableName(tableName string) *GetIdealStateParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get ideal state params +func (o *GetIdealStateParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithTableType adds the tableType to the get ideal state params +func (o *GetIdealStateParams) WithTableType(tableType *string) *GetIdealStateParams { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the get ideal state params +func (o *GetIdealStateParams) SetTableType(tableType *string) { + o.TableType = tableType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIdealStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.TableType != nil { + + // query param tableType + var qrTableType string + + if o.TableType != nil { + qrTableType = *o.TableType + } + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_ideal_state_responses.go b/src/client/table/get_ideal_state_responses.go new file mode 100644 index 0000000..7ba71ca --- /dev/null +++ b/src/client/table/get_ideal_state_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetIdealStateReader is a Reader for the GetIdealState structure. +type GetIdealStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIdealStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIdealStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIdealStateOK creates a GetIdealStateOK with default headers values +func NewGetIdealStateOK() *GetIdealStateOK { + return &GetIdealStateOK{} +} + +/* +GetIdealStateOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetIdealStateOK struct { + Payload *models.TableView +} + +// IsSuccess returns true when this get ideal state o k response has a 2xx status code +func (o *GetIdealStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ideal state o k response has a 3xx status code +func (o *GetIdealStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ideal state o k response has a 4xx status code +func (o *GetIdealStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ideal state o k response has a 5xx status code +func (o *GetIdealStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ideal state o k response a status code equal to that given +func (o *GetIdealStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get ideal state o k response +func (o *GetIdealStateOK) Code() int { + return 200 +} + +func (o *GetIdealStateOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/idealstate][%d] getIdealStateOK %+v", 200, o.Payload) +} + +func (o *GetIdealStateOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/idealstate][%d] getIdealStateOK %+v", 200, o.Payload) +} + +func (o *GetIdealStateOK) GetPayload() *models.TableView { + return o.Payload +} + +func (o *GetIdealStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TableView) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_instance_partitions_parameters.go b/src/client/table/get_instance_partitions_parameters.go new file mode 100644 index 0000000..cc958a2 --- /dev/null +++ b/src/client/table/get_instance_partitions_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetInstancePartitionsParams creates a new GetInstancePartitionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetInstancePartitionsParams() *GetInstancePartitionsParams { + return &GetInstancePartitionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetInstancePartitionsParamsWithTimeout creates a new GetInstancePartitionsParams object +// with the ability to set a timeout on a request. +func NewGetInstancePartitionsParamsWithTimeout(timeout time.Duration) *GetInstancePartitionsParams { + return &GetInstancePartitionsParams{ + timeout: timeout, + } +} + +// NewGetInstancePartitionsParamsWithContext creates a new GetInstancePartitionsParams object +// with the ability to set a context for a request. +func NewGetInstancePartitionsParamsWithContext(ctx context.Context) *GetInstancePartitionsParams { + return &GetInstancePartitionsParams{ + Context: ctx, + } +} + +// NewGetInstancePartitionsParamsWithHTTPClient creates a new GetInstancePartitionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetInstancePartitionsParamsWithHTTPClient(client *http.Client) *GetInstancePartitionsParams { + return &GetInstancePartitionsParams{ + HTTPClient: client, + } +} + +/* +GetInstancePartitionsParams contains all the parameters to send to the API endpoint + + for the get instance partitions operation. + + Typically these are written to a http.Request. +*/ +type GetInstancePartitionsParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|CONSUMING|COMPLETED + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get instance partitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInstancePartitionsParams) WithDefaults() *GetInstancePartitionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get instance partitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInstancePartitionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get instance partitions params +func (o *GetInstancePartitionsParams) WithTimeout(timeout time.Duration) *GetInstancePartitionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get instance partitions params +func (o *GetInstancePartitionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get instance partitions params +func (o *GetInstancePartitionsParams) WithContext(ctx context.Context) *GetInstancePartitionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get instance partitions params +func (o *GetInstancePartitionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get instance partitions params +func (o *GetInstancePartitionsParams) WithHTTPClient(client *http.Client) *GetInstancePartitionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get instance partitions params +func (o *GetInstancePartitionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get instance partitions params +func (o *GetInstancePartitionsParams) WithTableName(tableName string) *GetInstancePartitionsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get instance partitions params +func (o *GetInstancePartitionsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get instance partitions params +func (o *GetInstancePartitionsParams) WithType(typeVar *string) *GetInstancePartitionsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get instance partitions params +func (o *GetInstancePartitionsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInstancePartitionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_instance_partitions_responses.go b/src/client/table/get_instance_partitions_responses.go new file mode 100644 index 0000000..98ee310 --- /dev/null +++ b/src/client/table/get_instance_partitions_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetInstancePartitionsReader is a Reader for the GetInstancePartitions structure. +type GetInstancePartitionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInstancePartitionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInstancePartitionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetInstancePartitionsOK creates a GetInstancePartitionsOK with default headers values +func NewGetInstancePartitionsOK() *GetInstancePartitionsOK { + return &GetInstancePartitionsOK{} +} + +/* +GetInstancePartitionsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetInstancePartitionsOK struct { + Payload map[string]models.InstancePartitions +} + +// IsSuccess returns true when this get instance partitions o k response has a 2xx status code +func (o *GetInstancePartitionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get instance partitions o k response has a 3xx status code +func (o *GetInstancePartitionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get instance partitions o k response has a 4xx status code +func (o *GetInstancePartitionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get instance partitions o k response has a 5xx status code +func (o *GetInstancePartitionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get instance partitions o k response a status code equal to that given +func (o *GetInstancePartitionsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get instance partitions o k response +func (o *GetInstancePartitionsOK) Code() int { + return 200 +} + +func (o *GetInstancePartitionsOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/instancePartitions][%d] getInstancePartitionsOK %+v", 200, o.Payload) +} + +func (o *GetInstancePartitionsOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/instancePartitions][%d] getInstancePartitionsOK %+v", 200, o.Payload) +} + +func (o *GetInstancePartitionsOK) GetPayload() map[string]models.InstancePartitions { + return o.Payload +} + +func (o *GetInstancePartitionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_live_brokers_for_table_parameters.go b/src/client/table/get_live_brokers_for_table_parameters.go new file mode 100644 index 0000000..6704ee2 --- /dev/null +++ b/src/client/table/get_live_brokers_for_table_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLiveBrokersForTableParams creates a new GetLiveBrokersForTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLiveBrokersForTableParams() *GetLiveBrokersForTableParams { + return &GetLiveBrokersForTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLiveBrokersForTableParamsWithTimeout creates a new GetLiveBrokersForTableParams object +// with the ability to set a timeout on a request. +func NewGetLiveBrokersForTableParamsWithTimeout(timeout time.Duration) *GetLiveBrokersForTableParams { + return &GetLiveBrokersForTableParams{ + timeout: timeout, + } +} + +// NewGetLiveBrokersForTableParamsWithContext creates a new GetLiveBrokersForTableParams object +// with the ability to set a context for a request. +func NewGetLiveBrokersForTableParamsWithContext(ctx context.Context) *GetLiveBrokersForTableParams { + return &GetLiveBrokersForTableParams{ + Context: ctx, + } +} + +// NewGetLiveBrokersForTableParamsWithHTTPClient creates a new GetLiveBrokersForTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLiveBrokersForTableParamsWithHTTPClient(client *http.Client) *GetLiveBrokersForTableParams { + return &GetLiveBrokersForTableParams{ + HTTPClient: client, + } +} + +/* +GetLiveBrokersForTableParams contains all the parameters to send to the API endpoint + + for the get live brokers for table operation. + + Typically these are written to a http.Request. +*/ +type GetLiveBrokersForTableParams struct { + + /* TableName. + + Table name (with or without type) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get live brokers for table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLiveBrokersForTableParams) WithDefaults() *GetLiveBrokersForTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get live brokers for table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLiveBrokersForTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) WithTimeout(timeout time.Duration) *GetLiveBrokersForTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) WithContext(ctx context.Context) *GetLiveBrokersForTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) WithHTTPClient(client *http.Client) *GetLiveBrokersForTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) WithTableName(tableName string) *GetLiveBrokersForTableParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get live brokers for table params +func (o *GetLiveBrokersForTableParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLiveBrokersForTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_live_brokers_for_table_responses.go b/src/client/table/get_live_brokers_for_table_responses.go new file mode 100644 index 0000000..7f90247 --- /dev/null +++ b/src/client/table/get_live_brokers_for_table_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLiveBrokersForTableReader is a Reader for the GetLiveBrokersForTable structure. +type GetLiveBrokersForTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLiveBrokersForTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLiveBrokersForTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetLiveBrokersForTableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLiveBrokersForTableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLiveBrokersForTableOK creates a GetLiveBrokersForTableOK with default headers values +func NewGetLiveBrokersForTableOK() *GetLiveBrokersForTableOK { + return &GetLiveBrokersForTableOK{} +} + +/* +GetLiveBrokersForTableOK describes a response with status code 200, with default header values. + +Success +*/ +type GetLiveBrokersForTableOK struct { +} + +// IsSuccess returns true when this get live brokers for table o k response has a 2xx status code +func (o *GetLiveBrokersForTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get live brokers for table o k response has a 3xx status code +func (o *GetLiveBrokersForTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get live brokers for table o k response has a 4xx status code +func (o *GetLiveBrokersForTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get live brokers for table o k response has a 5xx status code +func (o *GetLiveBrokersForTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get live brokers for table o k response a status code equal to that given +func (o *GetLiveBrokersForTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get live brokers for table o k response +func (o *GetLiveBrokersForTableOK) Code() int { + return 200 +} + +func (o *GetLiveBrokersForTableOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/livebrokers][%d] getLiveBrokersForTableOK ", 200) +} + +func (o *GetLiveBrokersForTableOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/livebrokers][%d] getLiveBrokersForTableOK ", 200) +} + +func (o *GetLiveBrokersForTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetLiveBrokersForTableNotFound creates a GetLiveBrokersForTableNotFound with default headers values +func NewGetLiveBrokersForTableNotFound() *GetLiveBrokersForTableNotFound { + return &GetLiveBrokersForTableNotFound{} +} + +/* +GetLiveBrokersForTableNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetLiveBrokersForTableNotFound struct { +} + +// IsSuccess returns true when this get live brokers for table not found response has a 2xx status code +func (o *GetLiveBrokersForTableNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get live brokers for table not found response has a 3xx status code +func (o *GetLiveBrokersForTableNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get live brokers for table not found response has a 4xx status code +func (o *GetLiveBrokersForTableNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get live brokers for table not found response has a 5xx status code +func (o *GetLiveBrokersForTableNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get live brokers for table not found response a status code equal to that given +func (o *GetLiveBrokersForTableNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get live brokers for table not found response +func (o *GetLiveBrokersForTableNotFound) Code() int { + return 404 +} + +func (o *GetLiveBrokersForTableNotFound) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/livebrokers][%d] getLiveBrokersForTableNotFound ", 404) +} + +func (o *GetLiveBrokersForTableNotFound) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/livebrokers][%d] getLiveBrokersForTableNotFound ", 404) +} + +func (o *GetLiveBrokersForTableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetLiveBrokersForTableInternalServerError creates a GetLiveBrokersForTableInternalServerError with default headers values +func NewGetLiveBrokersForTableInternalServerError() *GetLiveBrokersForTableInternalServerError { + return &GetLiveBrokersForTableInternalServerError{} +} + +/* +GetLiveBrokersForTableInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetLiveBrokersForTableInternalServerError struct { +} + +// IsSuccess returns true when this get live brokers for table internal server error response has a 2xx status code +func (o *GetLiveBrokersForTableInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get live brokers for table internal server error response has a 3xx status code +func (o *GetLiveBrokersForTableInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get live brokers for table internal server error response has a 4xx status code +func (o *GetLiveBrokersForTableInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get live brokers for table internal server error response has a 5xx status code +func (o *GetLiveBrokersForTableInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get live brokers for table internal server error response a status code equal to that given +func (o *GetLiveBrokersForTableInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get live brokers for table internal server error response +func (o *GetLiveBrokersForTableInternalServerError) Code() int { + return 500 +} + +func (o *GetLiveBrokersForTableInternalServerError) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/livebrokers][%d] getLiveBrokersForTableInternalServerError ", 500) +} + +func (o *GetLiveBrokersForTableInternalServerError) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/livebrokers][%d] getLiveBrokersForTableInternalServerError ", 500) +} + +func (o *GetLiveBrokersForTableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/get_live_brokers_parameters.go b/src/client/table/get_live_brokers_parameters.go new file mode 100644 index 0000000..825b734 --- /dev/null +++ b/src/client/table/get_live_brokers_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLiveBrokersParams creates a new GetLiveBrokersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLiveBrokersParams() *GetLiveBrokersParams { + return &GetLiveBrokersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLiveBrokersParamsWithTimeout creates a new GetLiveBrokersParams object +// with the ability to set a timeout on a request. +func NewGetLiveBrokersParamsWithTimeout(timeout time.Duration) *GetLiveBrokersParams { + return &GetLiveBrokersParams{ + timeout: timeout, + } +} + +// NewGetLiveBrokersParamsWithContext creates a new GetLiveBrokersParams object +// with the ability to set a context for a request. +func NewGetLiveBrokersParamsWithContext(ctx context.Context) *GetLiveBrokersParams { + return &GetLiveBrokersParams{ + Context: ctx, + } +} + +// NewGetLiveBrokersParamsWithHTTPClient creates a new GetLiveBrokersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLiveBrokersParamsWithHTTPClient(client *http.Client) *GetLiveBrokersParams { + return &GetLiveBrokersParams{ + HTTPClient: client, + } +} + +/* +GetLiveBrokersParams contains all the parameters to send to the API endpoint + + for the get live brokers operation. + + Typically these are written to a http.Request. +*/ +type GetLiveBrokersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get live brokers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLiveBrokersParams) WithDefaults() *GetLiveBrokersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get live brokers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLiveBrokersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get live brokers params +func (o *GetLiveBrokersParams) WithTimeout(timeout time.Duration) *GetLiveBrokersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get live brokers params +func (o *GetLiveBrokersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get live brokers params +func (o *GetLiveBrokersParams) WithContext(ctx context.Context) *GetLiveBrokersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get live brokers params +func (o *GetLiveBrokersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get live brokers params +func (o *GetLiveBrokersParams) WithHTTPClient(client *http.Client) *GetLiveBrokersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get live brokers params +func (o *GetLiveBrokersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLiveBrokersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_live_brokers_responses.go b/src/client/table/get_live_brokers_responses.go new file mode 100644 index 0000000..e79572a --- /dev/null +++ b/src/client/table/get_live_brokers_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLiveBrokersReader is a Reader for the GetLiveBrokers structure. +type GetLiveBrokersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLiveBrokersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLiveBrokersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetLiveBrokersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLiveBrokersOK creates a GetLiveBrokersOK with default headers values +func NewGetLiveBrokersOK() *GetLiveBrokersOK { + return &GetLiveBrokersOK{} +} + +/* +GetLiveBrokersOK describes a response with status code 200, with default header values. + +Success +*/ +type GetLiveBrokersOK struct { +} + +// IsSuccess returns true when this get live brokers o k response has a 2xx status code +func (o *GetLiveBrokersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get live brokers o k response has a 3xx status code +func (o *GetLiveBrokersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get live brokers o k response has a 4xx status code +func (o *GetLiveBrokersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get live brokers o k response has a 5xx status code +func (o *GetLiveBrokersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get live brokers o k response a status code equal to that given +func (o *GetLiveBrokersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get live brokers o k response +func (o *GetLiveBrokersOK) Code() int { + return 200 +} + +func (o *GetLiveBrokersOK) Error() string { + return fmt.Sprintf("[GET /tables/livebrokers][%d] getLiveBrokersOK ", 200) +} + +func (o *GetLiveBrokersOK) String() string { + return fmt.Sprintf("[GET /tables/livebrokers][%d] getLiveBrokersOK ", 200) +} + +func (o *GetLiveBrokersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetLiveBrokersInternalServerError creates a GetLiveBrokersInternalServerError with default headers values +func NewGetLiveBrokersInternalServerError() *GetLiveBrokersInternalServerError { + return &GetLiveBrokersInternalServerError{} +} + +/* +GetLiveBrokersInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetLiveBrokersInternalServerError struct { +} + +// IsSuccess returns true when this get live brokers internal server error response has a 2xx status code +func (o *GetLiveBrokersInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get live brokers internal server error response has a 3xx status code +func (o *GetLiveBrokersInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get live brokers internal server error response has a 4xx status code +func (o *GetLiveBrokersInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get live brokers internal server error response has a 5xx status code +func (o *GetLiveBrokersInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get live brokers internal server error response a status code equal to that given +func (o *GetLiveBrokersInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get live brokers internal server error response +func (o *GetLiveBrokersInternalServerError) Code() int { + return 500 +} + +func (o *GetLiveBrokersInternalServerError) Error() string { + return fmt.Sprintf("[GET /tables/livebrokers][%d] getLiveBrokersInternalServerError ", 500) +} + +func (o *GetLiveBrokersInternalServerError) String() string { + return fmt.Sprintf("[GET /tables/livebrokers][%d] getLiveBrokersInternalServerError ", 500) +} + +func (o *GetLiveBrokersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/get_pause_status_parameters.go b/src/client/table/get_pause_status_parameters.go new file mode 100644 index 0000000..2be4058 --- /dev/null +++ b/src/client/table/get_pause_status_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetPauseStatusParams creates a new GetPauseStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPauseStatusParams() *GetPauseStatusParams { + return &GetPauseStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPauseStatusParamsWithTimeout creates a new GetPauseStatusParams object +// with the ability to set a timeout on a request. +func NewGetPauseStatusParamsWithTimeout(timeout time.Duration) *GetPauseStatusParams { + return &GetPauseStatusParams{ + timeout: timeout, + } +} + +// NewGetPauseStatusParamsWithContext creates a new GetPauseStatusParams object +// with the ability to set a context for a request. +func NewGetPauseStatusParamsWithContext(ctx context.Context) *GetPauseStatusParams { + return &GetPauseStatusParams{ + Context: ctx, + } +} + +// NewGetPauseStatusParamsWithHTTPClient creates a new GetPauseStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPauseStatusParamsWithHTTPClient(client *http.Client) *GetPauseStatusParams { + return &GetPauseStatusParams{ + HTTPClient: client, + } +} + +/* +GetPauseStatusParams contains all the parameters to send to the API endpoint + + for the get pause status operation. + + Typically these are written to a http.Request. +*/ +type GetPauseStatusParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get pause status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPauseStatusParams) WithDefaults() *GetPauseStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get pause status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPauseStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get pause status params +func (o *GetPauseStatusParams) WithTimeout(timeout time.Duration) *GetPauseStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get pause status params +func (o *GetPauseStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get pause status params +func (o *GetPauseStatusParams) WithContext(ctx context.Context) *GetPauseStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get pause status params +func (o *GetPauseStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get pause status params +func (o *GetPauseStatusParams) WithHTTPClient(client *http.Client) *GetPauseStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get pause status params +func (o *GetPauseStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get pause status params +func (o *GetPauseStatusParams) WithTableName(tableName string) *GetPauseStatusParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get pause status params +func (o *GetPauseStatusParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPauseStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_pause_status_responses.go b/src/client/table/get_pause_status_responses.go new file mode 100644 index 0000000..12745e7 --- /dev/null +++ b/src/client/table/get_pause_status_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetPauseStatusReader is a Reader for the GetPauseStatus structure. +type GetPauseStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPauseStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewGetPauseStatusDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewGetPauseStatusDefault creates a GetPauseStatusDefault with default headers values +func NewGetPauseStatusDefault(code int) *GetPauseStatusDefault { + return &GetPauseStatusDefault{ + _statusCode: code, + } +} + +/* +GetPauseStatusDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type GetPauseStatusDefault struct { + _statusCode int +} + +// IsSuccess returns true when this get pause status default response has a 2xx status code +func (o *GetPauseStatusDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get pause status default response has a 3xx status code +func (o *GetPauseStatusDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get pause status default response has a 4xx status code +func (o *GetPauseStatusDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get pause status default response has a 5xx status code +func (o *GetPauseStatusDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get pause status default response a status code equal to that given +func (o *GetPauseStatusDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get pause status default response +func (o *GetPauseStatusDefault) Code() int { + return o._statusCode +} + +func (o *GetPauseStatusDefault) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/pauseStatus][%d] getPauseStatus default ", o._statusCode) +} + +func (o *GetPauseStatusDefault) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/pauseStatus][%d] getPauseStatus default ", o._statusCode) +} + +func (o *GetPauseStatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/get_table_aggregate_metadata_parameters.go b/src/client/table/get_table_aggregate_metadata_parameters.go new file mode 100644 index 0000000..c186448 --- /dev/null +++ b/src/client/table/get_table_aggregate_metadata_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTableAggregateMetadataParams creates a new GetTableAggregateMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableAggregateMetadataParams() *GetTableAggregateMetadataParams { + return &GetTableAggregateMetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableAggregateMetadataParamsWithTimeout creates a new GetTableAggregateMetadataParams object +// with the ability to set a timeout on a request. +func NewGetTableAggregateMetadataParamsWithTimeout(timeout time.Duration) *GetTableAggregateMetadataParams { + return &GetTableAggregateMetadataParams{ + timeout: timeout, + } +} + +// NewGetTableAggregateMetadataParamsWithContext creates a new GetTableAggregateMetadataParams object +// with the ability to set a context for a request. +func NewGetTableAggregateMetadataParamsWithContext(ctx context.Context) *GetTableAggregateMetadataParams { + return &GetTableAggregateMetadataParams{ + Context: ctx, + } +} + +// NewGetTableAggregateMetadataParamsWithHTTPClient creates a new GetTableAggregateMetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableAggregateMetadataParamsWithHTTPClient(client *http.Client) *GetTableAggregateMetadataParams { + return &GetTableAggregateMetadataParams{ + HTTPClient: client, + } +} + +/* +GetTableAggregateMetadataParams contains all the parameters to send to the API endpoint + + for the get table aggregate metadata operation. + + Typically these are written to a http.Request. +*/ +type GetTableAggregateMetadataParams struct { + + /* Columns. + + Columns name + */ + Columns []string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table aggregate metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableAggregateMetadataParams) WithDefaults() *GetTableAggregateMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table aggregate metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableAggregateMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) WithTimeout(timeout time.Duration) *GetTableAggregateMetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) WithContext(ctx context.Context) *GetTableAggregateMetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) WithHTTPClient(client *http.Client) *GetTableAggregateMetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColumns adds the columns to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) WithColumns(columns []string) *GetTableAggregateMetadataParams { + o.SetColumns(columns) + return o +} + +// SetColumns adds the columns to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) SetColumns(columns []string) { + o.Columns = columns +} + +// WithTableName adds the tableName to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) WithTableName(tableName string) *GetTableAggregateMetadataParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) WithType(typeVar *string) *GetTableAggregateMetadataParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table aggregate metadata params +func (o *GetTableAggregateMetadataParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableAggregateMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Columns != nil { + + // binding items for columns + joinedColumns := o.bindParamColumns(reg) + + // query array param columns + if err := r.SetQueryParam("columns", joinedColumns...); err != nil { + return err + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetTableAggregateMetadata binds the parameter columns +func (o *GetTableAggregateMetadataParams) bindParamColumns(formats strfmt.Registry) []string { + columnsIR := o.Columns + + var columnsIC []string + for _, columnsIIR := range columnsIR { // explode []string + + columnsIIV := columnsIIR // string as string + columnsIC = append(columnsIC, columnsIIV) + } + + // items.CollectionFormat: "multi" + columnsIS := swag.JoinByFormat(columnsIC, "multi") + + return columnsIS +} diff --git a/src/client/table/get_table_aggregate_metadata_responses.go b/src/client/table/get_table_aggregate_metadata_responses.go new file mode 100644 index 0000000..7599644 --- /dev/null +++ b/src/client/table/get_table_aggregate_metadata_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableAggregateMetadataReader is a Reader for the GetTableAggregateMetadata structure. +type GetTableAggregateMetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableAggregateMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableAggregateMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableAggregateMetadataOK creates a GetTableAggregateMetadataOK with default headers values +func NewGetTableAggregateMetadataOK() *GetTableAggregateMetadataOK { + return &GetTableAggregateMetadataOK{} +} + +/* +GetTableAggregateMetadataOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTableAggregateMetadataOK struct { + Payload string +} + +// IsSuccess returns true when this get table aggregate metadata o k response has a 2xx status code +func (o *GetTableAggregateMetadataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table aggregate metadata o k response has a 3xx status code +func (o *GetTableAggregateMetadataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table aggregate metadata o k response has a 4xx status code +func (o *GetTableAggregateMetadataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table aggregate metadata o k response has a 5xx status code +func (o *GetTableAggregateMetadataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table aggregate metadata o k response a status code equal to that given +func (o *GetTableAggregateMetadataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table aggregate metadata o k response +func (o *GetTableAggregateMetadataOK) Code() int { + return 200 +} + +func (o *GetTableAggregateMetadataOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/metadata][%d] getTableAggregateMetadataOK %+v", 200, o.Payload) +} + +func (o *GetTableAggregateMetadataOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/metadata][%d] getTableAggregateMetadataOK %+v", 200, o.Payload) +} + +func (o *GetTableAggregateMetadataOK) GetPayload() string { + return o.Payload +} + +func (o *GetTableAggregateMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_table_instances_parameters.go b/src/client/table/get_table_instances_parameters.go new file mode 100644 index 0000000..702aa8e --- /dev/null +++ b/src/client/table/get_table_instances_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTableInstancesParams creates a new GetTableInstancesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableInstancesParams() *GetTableInstancesParams { + return &GetTableInstancesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableInstancesParamsWithTimeout creates a new GetTableInstancesParams object +// with the ability to set a timeout on a request. +func NewGetTableInstancesParamsWithTimeout(timeout time.Duration) *GetTableInstancesParams { + return &GetTableInstancesParams{ + timeout: timeout, + } +} + +// NewGetTableInstancesParamsWithContext creates a new GetTableInstancesParams object +// with the ability to set a context for a request. +func NewGetTableInstancesParamsWithContext(ctx context.Context) *GetTableInstancesParams { + return &GetTableInstancesParams{ + Context: ctx, + } +} + +// NewGetTableInstancesParamsWithHTTPClient creates a new GetTableInstancesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableInstancesParamsWithHTTPClient(client *http.Client) *GetTableInstancesParams { + return &GetTableInstancesParams{ + HTTPClient: client, + } +} + +/* +GetTableInstancesParams contains all the parameters to send to the API endpoint + + for the get table instances operation. + + Typically these are written to a http.Request. +*/ +type GetTableInstancesParams struct { + + /* TableName. + + Table name without type + */ + TableName string + + /* Type. + + Instance type + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableInstancesParams) WithDefaults() *GetTableInstancesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table instances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableInstancesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table instances params +func (o *GetTableInstancesParams) WithTimeout(timeout time.Duration) *GetTableInstancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table instances params +func (o *GetTableInstancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table instances params +func (o *GetTableInstancesParams) WithContext(ctx context.Context) *GetTableInstancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table instances params +func (o *GetTableInstancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table instances params +func (o *GetTableInstancesParams) WithHTTPClient(client *http.Client) *GetTableInstancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table instances params +func (o *GetTableInstancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table instances params +func (o *GetTableInstancesParams) WithTableName(tableName string) *GetTableInstancesParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table instances params +func (o *GetTableInstancesParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table instances params +func (o *GetTableInstancesParams) WithType(typeVar *string) *GetTableInstancesParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table instances params +func (o *GetTableInstancesParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_table_instances_responses.go b/src/client/table/get_table_instances_responses.go new file mode 100644 index 0000000..586b7e1 --- /dev/null +++ b/src/client/table/get_table_instances_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableInstancesReader is a Reader for the GetTableInstances structure. +type GetTableInstancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableInstancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetTableInstancesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTableInstancesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableInstancesOK creates a GetTableInstancesOK with default headers values +func NewGetTableInstancesOK() *GetTableInstancesOK { + return &GetTableInstancesOK{} +} + +/* +GetTableInstancesOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTableInstancesOK struct { +} + +// IsSuccess returns true when this get table instances o k response has a 2xx status code +func (o *GetTableInstancesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table instances o k response has a 3xx status code +func (o *GetTableInstancesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table instances o k response has a 4xx status code +func (o *GetTableInstancesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table instances o k response has a 5xx status code +func (o *GetTableInstancesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table instances o k response a status code equal to that given +func (o *GetTableInstancesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table instances o k response +func (o *GetTableInstancesOK) Code() int { + return 200 +} + +func (o *GetTableInstancesOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/instances][%d] getTableInstancesOK ", 200) +} + +func (o *GetTableInstancesOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/instances][%d] getTableInstancesOK ", 200) +} + +func (o *GetTableInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableInstancesNotFound creates a GetTableInstancesNotFound with default headers values +func NewGetTableInstancesNotFound() *GetTableInstancesNotFound { + return &GetTableInstancesNotFound{} +} + +/* +GetTableInstancesNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetTableInstancesNotFound struct { +} + +// IsSuccess returns true when this get table instances not found response has a 2xx status code +func (o *GetTableInstancesNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table instances not found response has a 3xx status code +func (o *GetTableInstancesNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table instances not found response has a 4xx status code +func (o *GetTableInstancesNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get table instances not found response has a 5xx status code +func (o *GetTableInstancesNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get table instances not found response a status code equal to that given +func (o *GetTableInstancesNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get table instances not found response +func (o *GetTableInstancesNotFound) Code() int { + return 404 +} + +func (o *GetTableInstancesNotFound) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/instances][%d] getTableInstancesNotFound ", 404) +} + +func (o *GetTableInstancesNotFound) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/instances][%d] getTableInstancesNotFound ", 404) +} + +func (o *GetTableInstancesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableInstancesInternalServerError creates a GetTableInstancesInternalServerError with default headers values +func NewGetTableInstancesInternalServerError() *GetTableInstancesInternalServerError { + return &GetTableInstancesInternalServerError{} +} + +/* +GetTableInstancesInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetTableInstancesInternalServerError struct { +} + +// IsSuccess returns true when this get table instances internal server error response has a 2xx status code +func (o *GetTableInstancesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table instances internal server error response has a 3xx status code +func (o *GetTableInstancesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table instances internal server error response has a 4xx status code +func (o *GetTableInstancesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table instances internal server error response has a 5xx status code +func (o *GetTableInstancesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get table instances internal server error response a status code equal to that given +func (o *GetTableInstancesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get table instances internal server error response +func (o *GetTableInstancesInternalServerError) Code() int { + return 500 +} + +func (o *GetTableInstancesInternalServerError) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/instances][%d] getTableInstancesInternalServerError ", 500) +} + +func (o *GetTableInstancesInternalServerError) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/instances][%d] getTableInstancesInternalServerError ", 500) +} + +func (o *GetTableInstancesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/get_table_size_parameters.go b/src/client/table/get_table_size_parameters.go new file mode 100644 index 0000000..33722d2 --- /dev/null +++ b/src/client/table/get_table_size_parameters.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTableSizeParams creates a new GetTableSizeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableSizeParams() *GetTableSizeParams { + return &GetTableSizeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableSizeParamsWithTimeout creates a new GetTableSizeParams object +// with the ability to set a timeout on a request. +func NewGetTableSizeParamsWithTimeout(timeout time.Duration) *GetTableSizeParams { + return &GetTableSizeParams{ + timeout: timeout, + } +} + +// NewGetTableSizeParamsWithContext creates a new GetTableSizeParams object +// with the ability to set a context for a request. +func NewGetTableSizeParamsWithContext(ctx context.Context) *GetTableSizeParams { + return &GetTableSizeParams{ + Context: ctx, + } +} + +// NewGetTableSizeParamsWithHTTPClient creates a new GetTableSizeParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableSizeParamsWithHTTPClient(client *http.Client) *GetTableSizeParams { + return &GetTableSizeParams{ + HTTPClient: client, + } +} + +/* +GetTableSizeParams contains all the parameters to send to the API endpoint + + for the get table size operation. + + Typically these are written to a http.Request. +*/ +type GetTableSizeParams struct { + + /* Detailed. + + Get detailed information + + Default: true + */ + Detailed *bool + + /* TableName. + + Table name without type + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table size params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableSizeParams) WithDefaults() *GetTableSizeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table size params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableSizeParams) SetDefaults() { + var ( + detailedDefault = bool(true) + ) + + val := GetTableSizeParams{ + Detailed: &detailedDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get table size params +func (o *GetTableSizeParams) WithTimeout(timeout time.Duration) *GetTableSizeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table size params +func (o *GetTableSizeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table size params +func (o *GetTableSizeParams) WithContext(ctx context.Context) *GetTableSizeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table size params +func (o *GetTableSizeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table size params +func (o *GetTableSizeParams) WithHTTPClient(client *http.Client) *GetTableSizeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table size params +func (o *GetTableSizeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDetailed adds the detailed to the get table size params +func (o *GetTableSizeParams) WithDetailed(detailed *bool) *GetTableSizeParams { + o.SetDetailed(detailed) + return o +} + +// SetDetailed adds the detailed to the get table size params +func (o *GetTableSizeParams) SetDetailed(detailed *bool) { + o.Detailed = detailed +} + +// WithTableName adds the tableName to the get table size params +func (o *GetTableSizeParams) WithTableName(tableName string) *GetTableSizeParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table size params +func (o *GetTableSizeParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableSizeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Detailed != nil { + + // query param detailed + var qrDetailed bool + + if o.Detailed != nil { + qrDetailed = *o.Detailed + } + qDetailed := swag.FormatBool(qrDetailed) + if qDetailed != "" { + + if err := r.SetQueryParam("detailed", qDetailed); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_table_size_responses.go b/src/client/table/get_table_size_responses.go new file mode 100644 index 0000000..791cd91 --- /dev/null +++ b/src/client/table/get_table_size_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableSizeReader is a Reader for the GetTableSize structure. +type GetTableSizeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableSizeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableSizeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetTableSizeNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTableSizeInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableSizeOK creates a GetTableSizeOK with default headers values +func NewGetTableSizeOK() *GetTableSizeOK { + return &GetTableSizeOK{} +} + +/* +GetTableSizeOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTableSizeOK struct { +} + +// IsSuccess returns true when this get table size o k response has a 2xx status code +func (o *GetTableSizeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table size o k response has a 3xx status code +func (o *GetTableSizeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table size o k response has a 4xx status code +func (o *GetTableSizeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table size o k response has a 5xx status code +func (o *GetTableSizeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table size o k response a status code equal to that given +func (o *GetTableSizeOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table size o k response +func (o *GetTableSizeOK) Code() int { + return 200 +} + +func (o *GetTableSizeOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/size][%d] getTableSizeOK ", 200) +} + +func (o *GetTableSizeOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/size][%d] getTableSizeOK ", 200) +} + +func (o *GetTableSizeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableSizeNotFound creates a GetTableSizeNotFound with default headers values +func NewGetTableSizeNotFound() *GetTableSizeNotFound { + return &GetTableSizeNotFound{} +} + +/* +GetTableSizeNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type GetTableSizeNotFound struct { +} + +// IsSuccess returns true when this get table size not found response has a 2xx status code +func (o *GetTableSizeNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table size not found response has a 3xx status code +func (o *GetTableSizeNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table size not found response has a 4xx status code +func (o *GetTableSizeNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get table size not found response has a 5xx status code +func (o *GetTableSizeNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get table size not found response a status code equal to that given +func (o *GetTableSizeNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get table size not found response +func (o *GetTableSizeNotFound) Code() int { + return 404 +} + +func (o *GetTableSizeNotFound) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/size][%d] getTableSizeNotFound ", 404) +} + +func (o *GetTableSizeNotFound) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/size][%d] getTableSizeNotFound ", 404) +} + +func (o *GetTableSizeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTableSizeInternalServerError creates a GetTableSizeInternalServerError with default headers values +func NewGetTableSizeInternalServerError() *GetTableSizeInternalServerError { + return &GetTableSizeInternalServerError{} +} + +/* +GetTableSizeInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetTableSizeInternalServerError struct { +} + +// IsSuccess returns true when this get table size internal server error response has a 2xx status code +func (o *GetTableSizeInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get table size internal server error response has a 3xx status code +func (o *GetTableSizeInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table size internal server error response has a 4xx status code +func (o *GetTableSizeInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table size internal server error response has a 5xx status code +func (o *GetTableSizeInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get table size internal server error response a status code equal to that given +func (o *GetTableSizeInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get table size internal server error response +func (o *GetTableSizeInternalServerError) Code() int { + return 500 +} + +func (o *GetTableSizeInternalServerError) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/size][%d] getTableSizeInternalServerError ", 500) +} + +func (o *GetTableSizeInternalServerError) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/size][%d] getTableSizeInternalServerError ", 500) +} + +func (o *GetTableSizeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/get_table_state_parameters.go b/src/client/table/get_table_state_parameters.go new file mode 100644 index 0000000..c25d7a1 --- /dev/null +++ b/src/client/table/get_table_state_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTableStateParams creates a new GetTableStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableStateParams() *GetTableStateParams { + return &GetTableStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableStateParamsWithTimeout creates a new GetTableStateParams object +// with the ability to set a timeout on a request. +func NewGetTableStateParamsWithTimeout(timeout time.Duration) *GetTableStateParams { + return &GetTableStateParams{ + timeout: timeout, + } +} + +// NewGetTableStateParamsWithContext creates a new GetTableStateParams object +// with the ability to set a context for a request. +func NewGetTableStateParamsWithContext(ctx context.Context) *GetTableStateParams { + return &GetTableStateParams{ + Context: ctx, + } +} + +// NewGetTableStateParamsWithHTTPClient creates a new GetTableStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableStateParamsWithHTTPClient(client *http.Client) *GetTableStateParams { + return &GetTableStateParams{ + HTTPClient: client, + } +} + +/* +GetTableStateParams contains all the parameters to send to the API endpoint + + for the get table state operation. + + Typically these are written to a http.Request. +*/ +type GetTableStateParams struct { + + /* TableName. + + Name of the table to get its state + */ + TableName string + + /* Type. + + realtime|offline + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableStateParams) WithDefaults() *GetTableStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table state params +func (o *GetTableStateParams) WithTimeout(timeout time.Duration) *GetTableStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table state params +func (o *GetTableStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table state params +func (o *GetTableStateParams) WithContext(ctx context.Context) *GetTableStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table state params +func (o *GetTableStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table state params +func (o *GetTableStateParams) WithHTTPClient(client *http.Client) *GetTableStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table state params +func (o *GetTableStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table state params +func (o *GetTableStateParams) WithTableName(tableName string) *GetTableStateParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table state params +func (o *GetTableStateParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table state params +func (o *GetTableStateParams) WithType(typeVar string) *GetTableStateParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table state params +func (o *GetTableStateParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_table_state_responses.go b/src/client/table/get_table_state_responses.go new file mode 100644 index 0000000..c0913e0 --- /dev/null +++ b/src/client/table/get_table_state_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableStateReader is a Reader for the GetTableState structure. +type GetTableStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableStateOK creates a GetTableStateOK with default headers values +func NewGetTableStateOK() *GetTableStateOK { + return &GetTableStateOK{} +} + +/* +GetTableStateOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTableStateOK struct { + Payload string +} + +// IsSuccess returns true when this get table state o k response has a 2xx status code +func (o *GetTableStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table state o k response has a 3xx status code +func (o *GetTableStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table state o k response has a 4xx status code +func (o *GetTableStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table state o k response has a 5xx status code +func (o *GetTableStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table state o k response a status code equal to that given +func (o *GetTableStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table state o k response +func (o *GetTableStateOK) Code() int { + return 200 +} + +func (o *GetTableStateOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/state][%d] getTableStateOK %+v", 200, o.Payload) +} + +func (o *GetTableStateOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/state][%d] getTableStateOK %+v", 200, o.Payload) +} + +func (o *GetTableStateOK) GetPayload() string { + return o.Payload +} + +func (o *GetTableStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_table_stats_parameters.go b/src/client/table/get_table_stats_parameters.go new file mode 100644 index 0000000..c9d36ff --- /dev/null +++ b/src/client/table/get_table_stats_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTableStatsParams creates a new GetTableStatsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableStatsParams() *GetTableStatsParams { + return &GetTableStatsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableStatsParamsWithTimeout creates a new GetTableStatsParams object +// with the ability to set a timeout on a request. +func NewGetTableStatsParamsWithTimeout(timeout time.Duration) *GetTableStatsParams { + return &GetTableStatsParams{ + timeout: timeout, + } +} + +// NewGetTableStatsParamsWithContext creates a new GetTableStatsParams object +// with the ability to set a context for a request. +func NewGetTableStatsParamsWithContext(ctx context.Context) *GetTableStatsParams { + return &GetTableStatsParams{ + Context: ctx, + } +} + +// NewGetTableStatsParamsWithHTTPClient creates a new GetTableStatsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableStatsParamsWithHTTPClient(client *http.Client) *GetTableStatsParams { + return &GetTableStatsParams{ + HTTPClient: client, + } +} + +/* +GetTableStatsParams contains all the parameters to send to the API endpoint + + for the get table stats operation. + + Typically these are written to a http.Request. +*/ +type GetTableStatsParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + realtime|offline + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table stats params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableStatsParams) WithDefaults() *GetTableStatsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table stats params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableStatsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table stats params +func (o *GetTableStatsParams) WithTimeout(timeout time.Duration) *GetTableStatsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table stats params +func (o *GetTableStatsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table stats params +func (o *GetTableStatsParams) WithContext(ctx context.Context) *GetTableStatsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table stats params +func (o *GetTableStatsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table stats params +func (o *GetTableStatsParams) WithHTTPClient(client *http.Client) *GetTableStatsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table stats params +func (o *GetTableStatsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table stats params +func (o *GetTableStatsParams) WithTableName(tableName string) *GetTableStatsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table stats params +func (o *GetTableStatsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table stats params +func (o *GetTableStatsParams) WithType(typeVar *string) *GetTableStatsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table stats params +func (o *GetTableStatsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableStatsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_table_stats_responses.go b/src/client/table/get_table_stats_responses.go new file mode 100644 index 0000000..7bac866 --- /dev/null +++ b/src/client/table/get_table_stats_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableStatsReader is a Reader for the GetTableStats structure. +type GetTableStatsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableStatsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableStatsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableStatsOK creates a GetTableStatsOK with default headers values +func NewGetTableStatsOK() *GetTableStatsOK { + return &GetTableStatsOK{} +} + +/* +GetTableStatsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTableStatsOK struct { + Payload string +} + +// IsSuccess returns true when this get table stats o k response has a 2xx status code +func (o *GetTableStatsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table stats o k response has a 3xx status code +func (o *GetTableStatsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table stats o k response has a 4xx status code +func (o *GetTableStatsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table stats o k response has a 5xx status code +func (o *GetTableStatsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table stats o k response a status code equal to that given +func (o *GetTableStatsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table stats o k response +func (o *GetTableStatsOK) Code() int { + return 200 +} + +func (o *GetTableStatsOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/stats][%d] getTableStatsOK %+v", 200, o.Payload) +} + +func (o *GetTableStatsOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/stats][%d] getTableStatsOK %+v", 200, o.Payload) +} + +func (o *GetTableStatsOK) GetPayload() string { + return o.Payload +} + +func (o *GetTableStatsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/get_table_status_parameters.go b/src/client/table/get_table_status_parameters.go new file mode 100644 index 0000000..2d83444 --- /dev/null +++ b/src/client/table/get_table_status_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTableStatusParams creates a new GetTableStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTableStatusParams() *GetTableStatusParams { + return &GetTableStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTableStatusParamsWithTimeout creates a new GetTableStatusParams object +// with the ability to set a timeout on a request. +func NewGetTableStatusParamsWithTimeout(timeout time.Duration) *GetTableStatusParams { + return &GetTableStatusParams{ + timeout: timeout, + } +} + +// NewGetTableStatusParamsWithContext creates a new GetTableStatusParams object +// with the ability to set a context for a request. +func NewGetTableStatusParamsWithContext(ctx context.Context) *GetTableStatusParams { + return &GetTableStatusParams{ + Context: ctx, + } +} + +// NewGetTableStatusParamsWithHTTPClient creates a new GetTableStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTableStatusParamsWithHTTPClient(client *http.Client) *GetTableStatusParams { + return &GetTableStatusParams{ + HTTPClient: client, + } +} + +/* +GetTableStatusParams contains all the parameters to send to the API endpoint + + for the get table status operation. + + Typically these are written to a http.Request. +*/ +type GetTableStatusParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + realtime|offline + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get table status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableStatusParams) WithDefaults() *GetTableStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get table status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTableStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get table status params +func (o *GetTableStatusParams) WithTimeout(timeout time.Duration) *GetTableStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get table status params +func (o *GetTableStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get table status params +func (o *GetTableStatusParams) WithContext(ctx context.Context) *GetTableStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get table status params +func (o *GetTableStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get table status params +func (o *GetTableStatusParams) WithHTTPClient(client *http.Client) *GetTableStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get table status params +func (o *GetTableStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get table status params +func (o *GetTableStatusParams) WithTableName(tableName string) *GetTableStatusParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get table status params +func (o *GetTableStatusParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the get table status params +func (o *GetTableStatusParams) WithType(typeVar *string) *GetTableStatusParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get table status params +func (o *GetTableStatusParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTableStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/get_table_status_responses.go b/src/client/table/get_table_status_responses.go new file mode 100644 index 0000000..48bb3ac --- /dev/null +++ b/src/client/table/get_table_status_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTableStatusReader is a Reader for the GetTableStatus structure. +type GetTableStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTableStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTableStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTableStatusOK creates a GetTableStatusOK with default headers values +func NewGetTableStatusOK() *GetTableStatusOK { + return &GetTableStatusOK{} +} + +/* +GetTableStatusOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTableStatusOK struct { + Payload string +} + +// IsSuccess returns true when this get table status o k response has a 2xx status code +func (o *GetTableStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get table status o k response has a 3xx status code +func (o *GetTableStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get table status o k response has a 4xx status code +func (o *GetTableStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get table status o k response has a 5xx status code +func (o *GetTableStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get table status o k response a status code equal to that given +func (o *GetTableStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get table status o k response +func (o *GetTableStatusOK) Code() int { + return 200 +} + +func (o *GetTableStatusOK) Error() string { + return fmt.Sprintf("[GET /tables/{tableName}/status][%d] getTableStatusOK %+v", 200, o.Payload) +} + +func (o *GetTableStatusOK) String() string { + return fmt.Sprintf("[GET /tables/{tableName}/status][%d] getTableStatusOK %+v", 200, o.Payload) +} + +func (o *GetTableStatusOK) GetPayload() string { + return o.Payload +} + +func (o *GetTableStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/ingest_from_file_parameters.go b/src/client/table/ingest_from_file_parameters.go new file mode 100644 index 0000000..fa08ea7 --- /dev/null +++ b/src/client/table/ingest_from_file_parameters.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewIngestFromFileParams creates a new IngestFromFileParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIngestFromFileParams() *IngestFromFileParams { + return &IngestFromFileParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestFromFileParamsWithTimeout creates a new IngestFromFileParams object +// with the ability to set a timeout on a request. +func NewIngestFromFileParamsWithTimeout(timeout time.Duration) *IngestFromFileParams { + return &IngestFromFileParams{ + timeout: timeout, + } +} + +// NewIngestFromFileParamsWithContext creates a new IngestFromFileParams object +// with the ability to set a context for a request. +func NewIngestFromFileParamsWithContext(ctx context.Context) *IngestFromFileParams { + return &IngestFromFileParams{ + Context: ctx, + } +} + +// NewIngestFromFileParamsWithHTTPClient creates a new IngestFromFileParams object +// with the ability to set a custom HTTPClient for a request. +func NewIngestFromFileParamsWithHTTPClient(client *http.Client) *IngestFromFileParams { + return &IngestFromFileParams{ + HTTPClient: client, + } +} + +/* +IngestFromFileParams contains all the parameters to send to the API endpoint + + for the ingest from file operation. + + Typically these are written to a http.Request. +*/ +type IngestFromFileParams struct { + + /* BatchConfigMapStr. + + Batch config Map as json string. Must pass inputFormat, and optionally record reader properties. e.g. {"inputFormat":"json"} + */ + BatchConfigMapStr string + + // Body. + Body *models.FormDataMultiPart + + /* TableNameWithType. + + Name of the table to upload the file to + */ + TableNameWithType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ingest from file params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestFromFileParams) WithDefaults() *IngestFromFileParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingest from file params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestFromFileParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ingest from file params +func (o *IngestFromFileParams) WithTimeout(timeout time.Duration) *IngestFromFileParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingest from file params +func (o *IngestFromFileParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingest from file params +func (o *IngestFromFileParams) WithContext(ctx context.Context) *IngestFromFileParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingest from file params +func (o *IngestFromFileParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingest from file params +func (o *IngestFromFileParams) WithHTTPClient(client *http.Client) *IngestFromFileParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingest from file params +func (o *IngestFromFileParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBatchConfigMapStr adds the batchConfigMapStr to the ingest from file params +func (o *IngestFromFileParams) WithBatchConfigMapStr(batchConfigMapStr string) *IngestFromFileParams { + o.SetBatchConfigMapStr(batchConfigMapStr) + return o +} + +// SetBatchConfigMapStr adds the batchConfigMapStr to the ingest from file params +func (o *IngestFromFileParams) SetBatchConfigMapStr(batchConfigMapStr string) { + o.BatchConfigMapStr = batchConfigMapStr +} + +// WithBody adds the body to the ingest from file params +func (o *IngestFromFileParams) WithBody(body *models.FormDataMultiPart) *IngestFromFileParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the ingest from file params +func (o *IngestFromFileParams) SetBody(body *models.FormDataMultiPart) { + o.Body = body +} + +// WithTableNameWithType adds the tableNameWithType to the ingest from file params +func (o *IngestFromFileParams) WithTableNameWithType(tableNameWithType string) *IngestFromFileParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the ingest from file params +func (o *IngestFromFileParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestFromFileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param batchConfigMapStr + qrBatchConfigMapStr := o.BatchConfigMapStr + qBatchConfigMapStr := qrBatchConfigMapStr + if qBatchConfigMapStr != "" { + + if err := r.SetQueryParam("batchConfigMapStr", qBatchConfigMapStr); err != nil { + return err + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // query param tableNameWithType + qrTableNameWithType := o.TableNameWithType + qTableNameWithType := qrTableNameWithType + if qTableNameWithType != "" { + + if err := r.SetQueryParam("tableNameWithType", qTableNameWithType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/ingest_from_file_responses.go b/src/client/table/ingest_from_file_responses.go new file mode 100644 index 0000000..d71c3f3 --- /dev/null +++ b/src/client/table/ingest_from_file_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IngestFromFileReader is a Reader for the IngestFromFile structure. +type IngestFromFileReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IngestFromFileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewIngestFromFileDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewIngestFromFileDefault creates a IngestFromFileDefault with default headers values +func NewIngestFromFileDefault(code int) *IngestFromFileDefault { + return &IngestFromFileDefault{ + _statusCode: code, + } +} + +/* +IngestFromFileDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type IngestFromFileDefault struct { + _statusCode int +} + +// IsSuccess returns true when this ingest from file default response has a 2xx status code +func (o *IngestFromFileDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this ingest from file default response has a 3xx status code +func (o *IngestFromFileDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this ingest from file default response has a 4xx status code +func (o *IngestFromFileDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this ingest from file default response has a 5xx status code +func (o *IngestFromFileDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this ingest from file default response a status code equal to that given +func (o *IngestFromFileDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the ingest from file default response +func (o *IngestFromFileDefault) Code() int { + return o._statusCode +} + +func (o *IngestFromFileDefault) Error() string { + return fmt.Sprintf("[POST /ingestFromFile][%d] ingestFromFile default ", o._statusCode) +} + +func (o *IngestFromFileDefault) String() string { + return fmt.Sprintf("[POST /ingestFromFile][%d] ingestFromFile default ", o._statusCode) +} + +func (o *IngestFromFileDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/ingest_from_uri_parameters.go b/src/client/table/ingest_from_uri_parameters.go new file mode 100644 index 0000000..41dbb3c --- /dev/null +++ b/src/client/table/ingest_from_uri_parameters.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewIngestFromURIParams creates a new IngestFromURIParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIngestFromURIParams() *IngestFromURIParams { + return &IngestFromURIParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestFromURIParamsWithTimeout creates a new IngestFromURIParams object +// with the ability to set a timeout on a request. +func NewIngestFromURIParamsWithTimeout(timeout time.Duration) *IngestFromURIParams { + return &IngestFromURIParams{ + timeout: timeout, + } +} + +// NewIngestFromURIParamsWithContext creates a new IngestFromURIParams object +// with the ability to set a context for a request. +func NewIngestFromURIParamsWithContext(ctx context.Context) *IngestFromURIParams { + return &IngestFromURIParams{ + Context: ctx, + } +} + +// NewIngestFromURIParamsWithHTTPClient creates a new IngestFromURIParams object +// with the ability to set a custom HTTPClient for a request. +func NewIngestFromURIParamsWithHTTPClient(client *http.Client) *IngestFromURIParams { + return &IngestFromURIParams{ + HTTPClient: client, + } +} + +/* +IngestFromURIParams contains all the parameters to send to the API endpoint + + for the ingest from URI operation. + + Typically these are written to a http.Request. +*/ +type IngestFromURIParams struct { + + /* BatchConfigMapStr. + + Batch config Map as json string. Must pass inputFormat, and optionally input FS properties. e.g. {"inputFormat":"json"} + */ + BatchConfigMapStr string + + /* SourceURIStr. + + URI of file to upload + */ + SourceURIStr string + + /* TableNameWithType. + + Name of the table to upload the file to + */ + TableNameWithType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ingest from URI params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestFromURIParams) WithDefaults() *IngestFromURIParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingest from URI params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestFromURIParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ingest from URI params +func (o *IngestFromURIParams) WithTimeout(timeout time.Duration) *IngestFromURIParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingest from URI params +func (o *IngestFromURIParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingest from URI params +func (o *IngestFromURIParams) WithContext(ctx context.Context) *IngestFromURIParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingest from URI params +func (o *IngestFromURIParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingest from URI params +func (o *IngestFromURIParams) WithHTTPClient(client *http.Client) *IngestFromURIParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingest from URI params +func (o *IngestFromURIParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBatchConfigMapStr adds the batchConfigMapStr to the ingest from URI params +func (o *IngestFromURIParams) WithBatchConfigMapStr(batchConfigMapStr string) *IngestFromURIParams { + o.SetBatchConfigMapStr(batchConfigMapStr) + return o +} + +// SetBatchConfigMapStr adds the batchConfigMapStr to the ingest from URI params +func (o *IngestFromURIParams) SetBatchConfigMapStr(batchConfigMapStr string) { + o.BatchConfigMapStr = batchConfigMapStr +} + +// WithSourceURIStr adds the sourceURIStr to the ingest from URI params +func (o *IngestFromURIParams) WithSourceURIStr(sourceURIStr string) *IngestFromURIParams { + o.SetSourceURIStr(sourceURIStr) + return o +} + +// SetSourceURIStr adds the sourceUriStr to the ingest from URI params +func (o *IngestFromURIParams) SetSourceURIStr(sourceURIStr string) { + o.SourceURIStr = sourceURIStr +} + +// WithTableNameWithType adds the tableNameWithType to the ingest from URI params +func (o *IngestFromURIParams) WithTableNameWithType(tableNameWithType string) *IngestFromURIParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the ingest from URI params +func (o *IngestFromURIParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestFromURIParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param batchConfigMapStr + qrBatchConfigMapStr := o.BatchConfigMapStr + qBatchConfigMapStr := qrBatchConfigMapStr + if qBatchConfigMapStr != "" { + + if err := r.SetQueryParam("batchConfigMapStr", qBatchConfigMapStr); err != nil { + return err + } + } + + // query param sourceURIStr + qrSourceURIStr := o.SourceURIStr + qSourceURIStr := qrSourceURIStr + if qSourceURIStr != "" { + + if err := r.SetQueryParam("sourceURIStr", qSourceURIStr); err != nil { + return err + } + } + + // query param tableNameWithType + qrTableNameWithType := o.TableNameWithType + qTableNameWithType := qrTableNameWithType + if qTableNameWithType != "" { + + if err := r.SetQueryParam("tableNameWithType", qTableNameWithType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/ingest_from_uri_responses.go b/src/client/table/ingest_from_uri_responses.go new file mode 100644 index 0000000..27184c3 --- /dev/null +++ b/src/client/table/ingest_from_uri_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IngestFromURIReader is a Reader for the IngestFromURI structure. +type IngestFromURIReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IngestFromURIReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewIngestFromURIDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewIngestFromURIDefault creates a IngestFromURIDefault with default headers values +func NewIngestFromURIDefault(code int) *IngestFromURIDefault { + return &IngestFromURIDefault{ + _statusCode: code, + } +} + +/* +IngestFromURIDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type IngestFromURIDefault struct { + _statusCode int +} + +// IsSuccess returns true when this ingest from URI default response has a 2xx status code +func (o *IngestFromURIDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this ingest from URI default response has a 3xx status code +func (o *IngestFromURIDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this ingest from URI default response has a 4xx status code +func (o *IngestFromURIDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this ingest from URI default response has a 5xx status code +func (o *IngestFromURIDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this ingest from URI default response a status code equal to that given +func (o *IngestFromURIDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the ingest from URI default response +func (o *IngestFromURIDefault) Code() int { + return o._statusCode +} + +func (o *IngestFromURIDefault) Error() string { + return fmt.Sprintf("[POST /ingestFromURI][%d] ingestFromURI default ", o._statusCode) +} + +func (o *IngestFromURIDefault) String() string { + return fmt.Sprintf("[POST /ingestFromURI][%d] ingestFromURI default ", o._statusCode) +} + +func (o *IngestFromURIDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/list_configs_parameters.go b/src/client/table/list_configs_parameters.go new file mode 100644 index 0000000..c0a63ba --- /dev/null +++ b/src/client/table/list_configs_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListConfigsParams creates a new ListConfigsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListConfigsParams() *ListConfigsParams { + return &ListConfigsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListConfigsParamsWithTimeout creates a new ListConfigsParams object +// with the ability to set a timeout on a request. +func NewListConfigsParamsWithTimeout(timeout time.Duration) *ListConfigsParams { + return &ListConfigsParams{ + timeout: timeout, + } +} + +// NewListConfigsParamsWithContext creates a new ListConfigsParams object +// with the ability to set a context for a request. +func NewListConfigsParamsWithContext(ctx context.Context) *ListConfigsParams { + return &ListConfigsParams{ + Context: ctx, + } +} + +// NewListConfigsParamsWithHTTPClient creates a new ListConfigsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListConfigsParamsWithHTTPClient(client *http.Client) *ListConfigsParams { + return &ListConfigsParams{ + HTTPClient: client, + } +} + +/* +ListConfigsParams contains all the parameters to send to the API endpoint + + for the list configs operation. + + Typically these are written to a http.Request. +*/ +type ListConfigsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConfigsParams) WithDefaults() *ListConfigsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConfigsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list configs params +func (o *ListConfigsParams) WithTimeout(timeout time.Duration) *ListConfigsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list configs params +func (o *ListConfigsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list configs params +func (o *ListConfigsParams) WithContext(ctx context.Context) *ListConfigsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list configs params +func (o *ListConfigsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list configs params +func (o *ListConfigsParams) WithHTTPClient(client *http.Client) *ListConfigsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list configs params +func (o *ListConfigsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/list_configs_responses.go b/src/client/table/list_configs_responses.go new file mode 100644 index 0000000..61f0db8 --- /dev/null +++ b/src/client/table/list_configs_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListConfigsReader is a Reader for the ListConfigs structure. +type ListConfigsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListConfigsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListConfigsOK creates a ListConfigsOK with default headers values +func NewListConfigsOK() *ListConfigsOK { + return &ListConfigsOK{} +} + +/* +ListConfigsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListConfigsOK struct { + Payload string +} + +// IsSuccess returns true when this list configs o k response has a 2xx status code +func (o *ListConfigsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list configs o k response has a 3xx status code +func (o *ListConfigsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list configs o k response has a 4xx status code +func (o *ListConfigsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list configs o k response has a 5xx status code +func (o *ListConfigsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list configs o k response a status code equal to that given +func (o *ListConfigsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list configs o k response +func (o *ListConfigsOK) Code() int { + return 200 +} + +func (o *ListConfigsOK) Error() string { + return fmt.Sprintf("[GET /tableConfigs][%d] listConfigsOK %+v", 200, o.Payload) +} + +func (o *ListConfigsOK) String() string { + return fmt.Sprintf("[GET /tableConfigs][%d] listConfigsOK %+v", 200, o.Payload) +} + +func (o *ListConfigsOK) GetPayload() string { + return o.Payload +} + +func (o *ListConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/list_tables_parameters.go b/src/client/table/list_tables_parameters.go new file mode 100644 index 0000000..1dab1de --- /dev/null +++ b/src/client/table/list_tables_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTablesParams creates a new ListTablesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTablesParams() *ListTablesParams { + return &ListTablesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTablesParamsWithTimeout creates a new ListTablesParams object +// with the ability to set a timeout on a request. +func NewListTablesParamsWithTimeout(timeout time.Duration) *ListTablesParams { + return &ListTablesParams{ + timeout: timeout, + } +} + +// NewListTablesParamsWithContext creates a new ListTablesParams object +// with the ability to set a context for a request. +func NewListTablesParamsWithContext(ctx context.Context) *ListTablesParams { + return &ListTablesParams{ + Context: ctx, + } +} + +// NewListTablesParamsWithHTTPClient creates a new ListTablesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTablesParamsWithHTTPClient(client *http.Client) *ListTablesParams { + return &ListTablesParams{ + HTTPClient: client, + } +} + +/* +ListTablesParams contains all the parameters to send to the API endpoint + + for the list tables operation. + + Typically these are written to a http.Request. +*/ +type ListTablesParams struct { + + /* SortAsc. + + true|false + + Default: true + */ + SortAsc *bool + + /* SortType. + + name|creationTime|lastModifiedTime + */ + SortType *string + + /* TaskType. + + Task type + */ + TaskType *string + + /* Type. + + realtime|offline + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list tables params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTablesParams) WithDefaults() *ListTablesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list tables params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTablesParams) SetDefaults() { + var ( + sortAscDefault = bool(true) + ) + + val := ListTablesParams{ + SortAsc: &sortAscDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the list tables params +func (o *ListTablesParams) WithTimeout(timeout time.Duration) *ListTablesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list tables params +func (o *ListTablesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list tables params +func (o *ListTablesParams) WithContext(ctx context.Context) *ListTablesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list tables params +func (o *ListTablesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list tables params +func (o *ListTablesParams) WithHTTPClient(client *http.Client) *ListTablesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list tables params +func (o *ListTablesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSortAsc adds the sortAsc to the list tables params +func (o *ListTablesParams) WithSortAsc(sortAsc *bool) *ListTablesParams { + o.SetSortAsc(sortAsc) + return o +} + +// SetSortAsc adds the sortAsc to the list tables params +func (o *ListTablesParams) SetSortAsc(sortAsc *bool) { + o.SortAsc = sortAsc +} + +// WithSortType adds the sortType to the list tables params +func (o *ListTablesParams) WithSortType(sortType *string) *ListTablesParams { + o.SetSortType(sortType) + return o +} + +// SetSortType adds the sortType to the list tables params +func (o *ListTablesParams) SetSortType(sortType *string) { + o.SortType = sortType +} + +// WithTaskType adds the taskType to the list tables params +func (o *ListTablesParams) WithTaskType(taskType *string) *ListTablesParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the list tables params +func (o *ListTablesParams) SetTaskType(taskType *string) { + o.TaskType = taskType +} + +// WithType adds the typeVar to the list tables params +func (o *ListTablesParams) WithType(typeVar *string) *ListTablesParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list tables params +func (o *ListTablesParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTablesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SortAsc != nil { + + // query param sortAsc + var qrSortAsc bool + + if o.SortAsc != nil { + qrSortAsc = *o.SortAsc + } + qSortAsc := swag.FormatBool(qrSortAsc) + if qSortAsc != "" { + + if err := r.SetQueryParam("sortAsc", qSortAsc); err != nil { + return err + } + } + } + + if o.SortType != nil { + + // query param sortType + var qrSortType string + + if o.SortType != nil { + qrSortType = *o.SortType + } + qSortType := qrSortType + if qSortType != "" { + + if err := r.SetQueryParam("sortType", qSortType); err != nil { + return err + } + } + } + + if o.TaskType != nil { + + // query param taskType + var qrTaskType string + + if o.TaskType != nil { + qrTaskType = *o.TaskType + } + qTaskType := qrTaskType + if qTaskType != "" { + + if err := r.SetQueryParam("taskType", qTaskType); err != nil { + return err + } + } + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/list_tables_responses.go b/src/client/table/list_tables_responses.go new file mode 100644 index 0000000..bdced89 --- /dev/null +++ b/src/client/table/list_tables_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListTablesReader is a Reader for the ListTables structure. +type ListTablesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTablesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTablesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTablesOK creates a ListTablesOK with default headers values +func NewListTablesOK() *ListTablesOK { + return &ListTablesOK{} +} + +/* +ListTablesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListTablesOK struct { + Payload string +} + +// IsSuccess returns true when this list tables o k response has a 2xx status code +func (o *ListTablesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list tables o k response has a 3xx status code +func (o *ListTablesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list tables o k response has a 4xx status code +func (o *ListTablesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list tables o k response has a 5xx status code +func (o *ListTablesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list tables o k response a status code equal to that given +func (o *ListTablesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list tables o k response +func (o *ListTablesOK) Code() int { + return 200 +} + +func (o *ListTablesOK) Error() string { + return fmt.Sprintf("[GET /tables][%d] listTablesOK %+v", 200, o.Payload) +} + +func (o *ListTablesOK) String() string { + return fmt.Sprintf("[GET /tables][%d] listTablesOK %+v", 200, o.Payload) +} + +func (o *ListTablesOK) GetPayload() string { + return o.Payload +} + +func (o *ListTablesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/pause_consumption_parameters.go b/src/client/table/pause_consumption_parameters.go new file mode 100644 index 0000000..0a8e0cc --- /dev/null +++ b/src/client/table/pause_consumption_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPauseConsumptionParams creates a new PauseConsumptionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPauseConsumptionParams() *PauseConsumptionParams { + return &PauseConsumptionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPauseConsumptionParamsWithTimeout creates a new PauseConsumptionParams object +// with the ability to set a timeout on a request. +func NewPauseConsumptionParamsWithTimeout(timeout time.Duration) *PauseConsumptionParams { + return &PauseConsumptionParams{ + timeout: timeout, + } +} + +// NewPauseConsumptionParamsWithContext creates a new PauseConsumptionParams object +// with the ability to set a context for a request. +func NewPauseConsumptionParamsWithContext(ctx context.Context) *PauseConsumptionParams { + return &PauseConsumptionParams{ + Context: ctx, + } +} + +// NewPauseConsumptionParamsWithHTTPClient creates a new PauseConsumptionParams object +// with the ability to set a custom HTTPClient for a request. +func NewPauseConsumptionParamsWithHTTPClient(client *http.Client) *PauseConsumptionParams { + return &PauseConsumptionParams{ + HTTPClient: client, + } +} + +/* +PauseConsumptionParams contains all the parameters to send to the API endpoint + + for the pause consumption operation. + + Typically these are written to a http.Request. +*/ +type PauseConsumptionParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pause consumption params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PauseConsumptionParams) WithDefaults() *PauseConsumptionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pause consumption params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PauseConsumptionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pause consumption params +func (o *PauseConsumptionParams) WithTimeout(timeout time.Duration) *PauseConsumptionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pause consumption params +func (o *PauseConsumptionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pause consumption params +func (o *PauseConsumptionParams) WithContext(ctx context.Context) *PauseConsumptionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pause consumption params +func (o *PauseConsumptionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pause consumption params +func (o *PauseConsumptionParams) WithHTTPClient(client *http.Client) *PauseConsumptionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pause consumption params +func (o *PauseConsumptionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the pause consumption params +func (o *PauseConsumptionParams) WithTableName(tableName string) *PauseConsumptionParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the pause consumption params +func (o *PauseConsumptionParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *PauseConsumptionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/pause_consumption_responses.go b/src/client/table/pause_consumption_responses.go new file mode 100644 index 0000000..d98146e --- /dev/null +++ b/src/client/table/pause_consumption_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PauseConsumptionReader is a Reader for the PauseConsumption structure. +type PauseConsumptionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PauseConsumptionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewPauseConsumptionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewPauseConsumptionDefault creates a PauseConsumptionDefault with default headers values +func NewPauseConsumptionDefault(code int) *PauseConsumptionDefault { + return &PauseConsumptionDefault{ + _statusCode: code, + } +} + +/* +PauseConsumptionDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type PauseConsumptionDefault struct { + _statusCode int +} + +// IsSuccess returns true when this pause consumption default response has a 2xx status code +func (o *PauseConsumptionDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this pause consumption default response has a 3xx status code +func (o *PauseConsumptionDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this pause consumption default response has a 4xx status code +func (o *PauseConsumptionDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this pause consumption default response has a 5xx status code +func (o *PauseConsumptionDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this pause consumption default response a status code equal to that given +func (o *PauseConsumptionDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the pause consumption default response +func (o *PauseConsumptionDefault) Code() int { + return o._statusCode +} + +func (o *PauseConsumptionDefault) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/pauseConsumption][%d] pauseConsumption default ", o._statusCode) +} + +func (o *PauseConsumptionDefault) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/pauseConsumption][%d] pauseConsumption default ", o._statusCode) +} + +func (o *PauseConsumptionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/put_parameters.go b/src/client/table/put_parameters.go new file mode 100644 index 0000000..e77cf8f --- /dev/null +++ b/src/client/table/put_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPutParams creates a new PutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPutParams() *PutParams { + return &PutParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutParamsWithTimeout creates a new PutParams object +// with the ability to set a timeout on a request. +func NewPutParamsWithTimeout(timeout time.Duration) *PutParams { + return &PutParams{ + timeout: timeout, + } +} + +// NewPutParamsWithContext creates a new PutParams object +// with the ability to set a context for a request. +func NewPutParamsWithContext(ctx context.Context) *PutParams { + return &PutParams{ + Context: ctx, + } +} + +// NewPutParamsWithHTTPClient creates a new PutParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutParamsWithHTTPClient(client *http.Client) *PutParams { + return &PutParams{ + HTTPClient: client, + } +} + +/* +PutParams contains all the parameters to send to the API endpoint + + for the put operation. + + Typically these are written to a http.Request. +*/ +type PutParams struct { + + // Body. + Body string + + /* TableName. + + Table name + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutParams) WithDefaults() *PutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put params +func (o *PutParams) WithTimeout(timeout time.Duration) *PutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put params +func (o *PutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put params +func (o *PutParams) WithContext(ctx context.Context) *PutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put params +func (o *PutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put params +func (o *PutParams) WithHTTPClient(client *http.Client) *PutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put params +func (o *PutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the put params +func (o *PutParams) WithBody(body string) *PutParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the put params +func (o *PutParams) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the put params +func (o *PutParams) WithTableName(tableName string) *PutParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the put params +func (o *PutParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *PutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/put_responses.go b/src/client/table/put_responses.go new file mode 100644 index 0000000..4d3b3b0 --- /dev/null +++ b/src/client/table/put_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PutReader is a Reader for the Put structure. +type PutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewPutNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutOK creates a PutOK with default headers values +func NewPutOK() *PutOK { + return &PutOK{} +} + +/* +PutOK describes a response with status code 200, with default header values. + +Success +*/ +type PutOK struct { +} + +// IsSuccess returns true when this put o k response has a 2xx status code +func (o *PutOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put o k response has a 3xx status code +func (o *PutOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put o k response has a 4xx status code +func (o *PutOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this put o k response has a 5xx status code +func (o *PutOK) IsServerError() bool { + return false +} + +// IsCode returns true when this put o k response a status code equal to that given +func (o *PutOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the put o k response +func (o *PutOK) Code() int { + return 200 +} + +func (o *PutOK) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/segmentConfigs][%d] putOK ", 200) +} + +func (o *PutOK) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/segmentConfigs][%d] putOK ", 200) +} + +func (o *PutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutNotFound creates a PutNotFound with default headers values +func NewPutNotFound() *PutNotFound { + return &PutNotFound{} +} + +/* +PutNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type PutNotFound struct { +} + +// IsSuccess returns true when this put not found response has a 2xx status code +func (o *PutNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put not found response has a 3xx status code +func (o *PutNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put not found response has a 4xx status code +func (o *PutNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this put not found response has a 5xx status code +func (o *PutNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this put not found response a status code equal to that given +func (o *PutNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the put not found response +func (o *PutNotFound) Code() int { + return 404 +} + +func (o *PutNotFound) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/segmentConfigs][%d] putNotFound ", 404) +} + +func (o *PutNotFound) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/segmentConfigs][%d] putNotFound ", 404) +} + +func (o *PutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutInternalServerError creates a PutInternalServerError with default headers values +func NewPutInternalServerError() *PutInternalServerError { + return &PutInternalServerError{} +} + +/* +PutInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type PutInternalServerError struct { +} + +// IsSuccess returns true when this put internal server error response has a 2xx status code +func (o *PutInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put internal server error response has a 3xx status code +func (o *PutInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put internal server error response has a 4xx status code +func (o *PutInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this put internal server error response has a 5xx status code +func (o *PutInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this put internal server error response a status code equal to that given +func (o *PutInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the put internal server error response +func (o *PutInternalServerError) Code() int { + return 500 +} + +func (o *PutInternalServerError) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/segmentConfigs][%d] putInternalServerError ", 500) +} + +func (o *PutInternalServerError) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/segmentConfigs][%d] putInternalServerError ", 500) +} + +func (o *PutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/rebalance_parameters.go b/src/client/table/rebalance_parameters.go new file mode 100644 index 0000000..21b3dff --- /dev/null +++ b/src/client/table/rebalance_parameters.go @@ -0,0 +1,529 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewRebalanceParams creates a new RebalanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRebalanceParams() *RebalanceParams { + return &RebalanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRebalanceParamsWithTimeout creates a new RebalanceParams object +// with the ability to set a timeout on a request. +func NewRebalanceParamsWithTimeout(timeout time.Duration) *RebalanceParams { + return &RebalanceParams{ + timeout: timeout, + } +} + +// NewRebalanceParamsWithContext creates a new RebalanceParams object +// with the ability to set a context for a request. +func NewRebalanceParamsWithContext(ctx context.Context) *RebalanceParams { + return &RebalanceParams{ + Context: ctx, + } +} + +// NewRebalanceParamsWithHTTPClient creates a new RebalanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewRebalanceParamsWithHTTPClient(client *http.Client) *RebalanceParams { + return &RebalanceParams{ + HTTPClient: client, + } +} + +/* +RebalanceParams contains all the parameters to send to the API endpoint + + for the rebalance operation. + + Typically these are written to a http.Request. +*/ +type RebalanceParams struct { + + /* BestEfforts. + + Whether to use best-efforts to rebalance (not fail the rebalance when the no-downtime contract cannot be achieved) + */ + BestEfforts *bool + + /* Bootstrap. + + Whether to rebalance table in bootstrap mode (regardless of minimum segment movement, reassign all segments in a round-robin fashion as if adding new segments to an empty table) + */ + Bootstrap *bool + + /* Downtime. + + Whether to allow downtime for the rebalance + */ + Downtime *bool + + /* DryRun. + + Whether to rebalance table in dry-run mode + */ + DryRun *bool + + /* ExternalViewCheckIntervalInMs. + + How often to check if external view converges with ideal states + + Format: int64 + Default: 1000 + */ + ExternalViewCheckIntervalInMs *int64 + + /* ExternalViewStabilizationTimeoutInMs. + + How long to wait till external view converges with ideal states + + Format: int64 + Default: 3600000 + */ + ExternalViewStabilizationTimeoutInMs *int64 + + /* IncludeConsuming. + + Whether to reassign CONSUMING segments for real-time table + */ + IncludeConsuming *bool + + /* MinAvailableReplicas. + + For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of replicas allowed to be unavailable if value is negative + + Format: int32 + Default: 1 + */ + MinAvailableReplicas *int32 + + /* ReassignInstances. + + Whether to reassign instances before reassigning segments + */ + ReassignInstances *bool + + /* TableName. + + Name of the table to rebalance + */ + TableName string + + /* Type. + + OFFLINE|REALTIME + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the rebalance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RebalanceParams) WithDefaults() *RebalanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the rebalance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RebalanceParams) SetDefaults() { + var ( + bestEffortsDefault = bool(false) + + bootstrapDefault = bool(false) + + downtimeDefault = bool(false) + + dryRunDefault = bool(false) + + externalViewCheckIntervalInMsDefault = int64(1000) + + externalViewStabilizationTimeoutInMsDefault = int64(3.6e+06) + + includeConsumingDefault = bool(false) + + minAvailableReplicasDefault = int32(1) + + reassignInstancesDefault = bool(false) + ) + + val := RebalanceParams{ + BestEfforts: &bestEffortsDefault, + Bootstrap: &bootstrapDefault, + Downtime: &downtimeDefault, + DryRun: &dryRunDefault, + ExternalViewCheckIntervalInMs: &externalViewCheckIntervalInMsDefault, + ExternalViewStabilizationTimeoutInMs: &externalViewStabilizationTimeoutInMsDefault, + IncludeConsuming: &includeConsumingDefault, + MinAvailableReplicas: &minAvailableReplicasDefault, + ReassignInstances: &reassignInstancesDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the rebalance params +func (o *RebalanceParams) WithTimeout(timeout time.Duration) *RebalanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the rebalance params +func (o *RebalanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the rebalance params +func (o *RebalanceParams) WithContext(ctx context.Context) *RebalanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the rebalance params +func (o *RebalanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the rebalance params +func (o *RebalanceParams) WithHTTPClient(client *http.Client) *RebalanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the rebalance params +func (o *RebalanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBestEfforts adds the bestEfforts to the rebalance params +func (o *RebalanceParams) WithBestEfforts(bestEfforts *bool) *RebalanceParams { + o.SetBestEfforts(bestEfforts) + return o +} + +// SetBestEfforts adds the bestEfforts to the rebalance params +func (o *RebalanceParams) SetBestEfforts(bestEfforts *bool) { + o.BestEfforts = bestEfforts +} + +// WithBootstrap adds the bootstrap to the rebalance params +func (o *RebalanceParams) WithBootstrap(bootstrap *bool) *RebalanceParams { + o.SetBootstrap(bootstrap) + return o +} + +// SetBootstrap adds the bootstrap to the rebalance params +func (o *RebalanceParams) SetBootstrap(bootstrap *bool) { + o.Bootstrap = bootstrap +} + +// WithDowntime adds the downtime to the rebalance params +func (o *RebalanceParams) WithDowntime(downtime *bool) *RebalanceParams { + o.SetDowntime(downtime) + return o +} + +// SetDowntime adds the downtime to the rebalance params +func (o *RebalanceParams) SetDowntime(downtime *bool) { + o.Downtime = downtime +} + +// WithDryRun adds the dryRun to the rebalance params +func (o *RebalanceParams) WithDryRun(dryRun *bool) *RebalanceParams { + o.SetDryRun(dryRun) + return o +} + +// SetDryRun adds the dryRun to the rebalance params +func (o *RebalanceParams) SetDryRun(dryRun *bool) { + o.DryRun = dryRun +} + +// WithExternalViewCheckIntervalInMs adds the externalViewCheckIntervalInMs to the rebalance params +func (o *RebalanceParams) WithExternalViewCheckIntervalInMs(externalViewCheckIntervalInMs *int64) *RebalanceParams { + o.SetExternalViewCheckIntervalInMs(externalViewCheckIntervalInMs) + return o +} + +// SetExternalViewCheckIntervalInMs adds the externalViewCheckIntervalInMs to the rebalance params +func (o *RebalanceParams) SetExternalViewCheckIntervalInMs(externalViewCheckIntervalInMs *int64) { + o.ExternalViewCheckIntervalInMs = externalViewCheckIntervalInMs +} + +// WithExternalViewStabilizationTimeoutInMs adds the externalViewStabilizationTimeoutInMs to the rebalance params +func (o *RebalanceParams) WithExternalViewStabilizationTimeoutInMs(externalViewStabilizationTimeoutInMs *int64) *RebalanceParams { + o.SetExternalViewStabilizationTimeoutInMs(externalViewStabilizationTimeoutInMs) + return o +} + +// SetExternalViewStabilizationTimeoutInMs adds the externalViewStabilizationTimeoutInMs to the rebalance params +func (o *RebalanceParams) SetExternalViewStabilizationTimeoutInMs(externalViewStabilizationTimeoutInMs *int64) { + o.ExternalViewStabilizationTimeoutInMs = externalViewStabilizationTimeoutInMs +} + +// WithIncludeConsuming adds the includeConsuming to the rebalance params +func (o *RebalanceParams) WithIncludeConsuming(includeConsuming *bool) *RebalanceParams { + o.SetIncludeConsuming(includeConsuming) + return o +} + +// SetIncludeConsuming adds the includeConsuming to the rebalance params +func (o *RebalanceParams) SetIncludeConsuming(includeConsuming *bool) { + o.IncludeConsuming = includeConsuming +} + +// WithMinAvailableReplicas adds the minAvailableReplicas to the rebalance params +func (o *RebalanceParams) WithMinAvailableReplicas(minAvailableReplicas *int32) *RebalanceParams { + o.SetMinAvailableReplicas(minAvailableReplicas) + return o +} + +// SetMinAvailableReplicas adds the minAvailableReplicas to the rebalance params +func (o *RebalanceParams) SetMinAvailableReplicas(minAvailableReplicas *int32) { + o.MinAvailableReplicas = minAvailableReplicas +} + +// WithReassignInstances adds the reassignInstances to the rebalance params +func (o *RebalanceParams) WithReassignInstances(reassignInstances *bool) *RebalanceParams { + o.SetReassignInstances(reassignInstances) + return o +} + +// SetReassignInstances adds the reassignInstances to the rebalance params +func (o *RebalanceParams) SetReassignInstances(reassignInstances *bool) { + o.ReassignInstances = reassignInstances +} + +// WithTableName adds the tableName to the rebalance params +func (o *RebalanceParams) WithTableName(tableName string) *RebalanceParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the rebalance params +func (o *RebalanceParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the rebalance params +func (o *RebalanceParams) WithType(typeVar string) *RebalanceParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the rebalance params +func (o *RebalanceParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *RebalanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BestEfforts != nil { + + // query param bestEfforts + var qrBestEfforts bool + + if o.BestEfforts != nil { + qrBestEfforts = *o.BestEfforts + } + qBestEfforts := swag.FormatBool(qrBestEfforts) + if qBestEfforts != "" { + + if err := r.SetQueryParam("bestEfforts", qBestEfforts); err != nil { + return err + } + } + } + + if o.Bootstrap != nil { + + // query param bootstrap + var qrBootstrap bool + + if o.Bootstrap != nil { + qrBootstrap = *o.Bootstrap + } + qBootstrap := swag.FormatBool(qrBootstrap) + if qBootstrap != "" { + + if err := r.SetQueryParam("bootstrap", qBootstrap); err != nil { + return err + } + } + } + + if o.Downtime != nil { + + // query param downtime + var qrDowntime bool + + if o.Downtime != nil { + qrDowntime = *o.Downtime + } + qDowntime := swag.FormatBool(qrDowntime) + if qDowntime != "" { + + if err := r.SetQueryParam("downtime", qDowntime); err != nil { + return err + } + } + } + + if o.DryRun != nil { + + // query param dryRun + var qrDryRun bool + + if o.DryRun != nil { + qrDryRun = *o.DryRun + } + qDryRun := swag.FormatBool(qrDryRun) + if qDryRun != "" { + + if err := r.SetQueryParam("dryRun", qDryRun); err != nil { + return err + } + } + } + + if o.ExternalViewCheckIntervalInMs != nil { + + // query param externalViewCheckIntervalInMs + var qrExternalViewCheckIntervalInMs int64 + + if o.ExternalViewCheckIntervalInMs != nil { + qrExternalViewCheckIntervalInMs = *o.ExternalViewCheckIntervalInMs + } + qExternalViewCheckIntervalInMs := swag.FormatInt64(qrExternalViewCheckIntervalInMs) + if qExternalViewCheckIntervalInMs != "" { + + if err := r.SetQueryParam("externalViewCheckIntervalInMs", qExternalViewCheckIntervalInMs); err != nil { + return err + } + } + } + + if o.ExternalViewStabilizationTimeoutInMs != nil { + + // query param externalViewStabilizationTimeoutInMs + var qrExternalViewStabilizationTimeoutInMs int64 + + if o.ExternalViewStabilizationTimeoutInMs != nil { + qrExternalViewStabilizationTimeoutInMs = *o.ExternalViewStabilizationTimeoutInMs + } + qExternalViewStabilizationTimeoutInMs := swag.FormatInt64(qrExternalViewStabilizationTimeoutInMs) + if qExternalViewStabilizationTimeoutInMs != "" { + + if err := r.SetQueryParam("externalViewStabilizationTimeoutInMs", qExternalViewStabilizationTimeoutInMs); err != nil { + return err + } + } + } + + if o.IncludeConsuming != nil { + + // query param includeConsuming + var qrIncludeConsuming bool + + if o.IncludeConsuming != nil { + qrIncludeConsuming = *o.IncludeConsuming + } + qIncludeConsuming := swag.FormatBool(qrIncludeConsuming) + if qIncludeConsuming != "" { + + if err := r.SetQueryParam("includeConsuming", qIncludeConsuming); err != nil { + return err + } + } + } + + if o.MinAvailableReplicas != nil { + + // query param minAvailableReplicas + var qrMinAvailableReplicas int32 + + if o.MinAvailableReplicas != nil { + qrMinAvailableReplicas = *o.MinAvailableReplicas + } + qMinAvailableReplicas := swag.FormatInt32(qrMinAvailableReplicas) + if qMinAvailableReplicas != "" { + + if err := r.SetQueryParam("minAvailableReplicas", qMinAvailableReplicas); err != nil { + return err + } + } + } + + if o.ReassignInstances != nil { + + // query param reassignInstances + var qrReassignInstances bool + + if o.ReassignInstances != nil { + qrReassignInstances = *o.ReassignInstances + } + qReassignInstances := swag.FormatBool(qrReassignInstances) + if qReassignInstances != "" { + + if err := r.SetQueryParam("reassignInstances", qReassignInstances); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/rebalance_responses.go b/src/client/table/rebalance_responses.go new file mode 100644 index 0000000..cab83d5 --- /dev/null +++ b/src/client/table/rebalance_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// RebalanceReader is a Reader for the Rebalance structure. +type RebalanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RebalanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRebalanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRebalanceOK creates a RebalanceOK with default headers values +func NewRebalanceOK() *RebalanceOK { + return &RebalanceOK{} +} + +/* +RebalanceOK describes a response with status code 200, with default header values. + +successful operation +*/ +type RebalanceOK struct { + Payload *models.RebalanceResult +} + +// IsSuccess returns true when this rebalance o k response has a 2xx status code +func (o *RebalanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this rebalance o k response has a 3xx status code +func (o *RebalanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this rebalance o k response has a 4xx status code +func (o *RebalanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this rebalance o k response has a 5xx status code +func (o *RebalanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this rebalance o k response a status code equal to that given +func (o *RebalanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the rebalance o k response +func (o *RebalanceOK) Code() int { + return 200 +} + +func (o *RebalanceOK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebalance][%d] rebalanceOK %+v", 200, o.Payload) +} + +func (o *RebalanceOK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebalance][%d] rebalanceOK %+v", 200, o.Payload) +} + +func (o *RebalanceOK) GetPayload() *models.RebalanceResult { + return o.Payload +} + +func (o *RebalanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RebalanceResult) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/rebuild_broker_resource_parameters.go b/src/client/table/rebuild_broker_resource_parameters.go new file mode 100644 index 0000000..2ef9f10 --- /dev/null +++ b/src/client/table/rebuild_broker_resource_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRebuildBrokerResourceParams creates a new RebuildBrokerResourceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRebuildBrokerResourceParams() *RebuildBrokerResourceParams { + return &RebuildBrokerResourceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRebuildBrokerResourceParamsWithTimeout creates a new RebuildBrokerResourceParams object +// with the ability to set a timeout on a request. +func NewRebuildBrokerResourceParamsWithTimeout(timeout time.Duration) *RebuildBrokerResourceParams { + return &RebuildBrokerResourceParams{ + timeout: timeout, + } +} + +// NewRebuildBrokerResourceParamsWithContext creates a new RebuildBrokerResourceParams object +// with the ability to set a context for a request. +func NewRebuildBrokerResourceParamsWithContext(ctx context.Context) *RebuildBrokerResourceParams { + return &RebuildBrokerResourceParams{ + Context: ctx, + } +} + +// NewRebuildBrokerResourceParamsWithHTTPClient creates a new RebuildBrokerResourceParams object +// with the ability to set a custom HTTPClient for a request. +func NewRebuildBrokerResourceParamsWithHTTPClient(client *http.Client) *RebuildBrokerResourceParams { + return &RebuildBrokerResourceParams{ + HTTPClient: client, + } +} + +/* +RebuildBrokerResourceParams contains all the parameters to send to the API endpoint + + for the rebuild broker resource operation. + + Typically these are written to a http.Request. +*/ +type RebuildBrokerResourceParams struct { + + /* TableName. + + Table name (with type) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the rebuild broker resource params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RebuildBrokerResourceParams) WithDefaults() *RebuildBrokerResourceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the rebuild broker resource params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RebuildBrokerResourceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) WithTimeout(timeout time.Duration) *RebuildBrokerResourceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) WithContext(ctx context.Context) *RebuildBrokerResourceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) WithHTTPClient(client *http.Client) *RebuildBrokerResourceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) WithTableName(tableName string) *RebuildBrokerResourceParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the rebuild broker resource params +func (o *RebuildBrokerResourceParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *RebuildBrokerResourceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/rebuild_broker_resource_responses.go b/src/client/table/rebuild_broker_resource_responses.go new file mode 100644 index 0000000..70fdc59 --- /dev/null +++ b/src/client/table/rebuild_broker_resource_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RebuildBrokerResourceReader is a Reader for the RebuildBrokerResource structure. +type RebuildBrokerResourceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RebuildBrokerResourceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRebuildBrokerResourceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewRebuildBrokerResourceBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewRebuildBrokerResourceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRebuildBrokerResourceOK creates a RebuildBrokerResourceOK with default headers values +func NewRebuildBrokerResourceOK() *RebuildBrokerResourceOK { + return &RebuildBrokerResourceOK{} +} + +/* +RebuildBrokerResourceOK describes a response with status code 200, with default header values. + +Success +*/ +type RebuildBrokerResourceOK struct { +} + +// IsSuccess returns true when this rebuild broker resource o k response has a 2xx status code +func (o *RebuildBrokerResourceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this rebuild broker resource o k response has a 3xx status code +func (o *RebuildBrokerResourceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this rebuild broker resource o k response has a 4xx status code +func (o *RebuildBrokerResourceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this rebuild broker resource o k response has a 5xx status code +func (o *RebuildBrokerResourceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this rebuild broker resource o k response a status code equal to that given +func (o *RebuildBrokerResourceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the rebuild broker resource o k response +func (o *RebuildBrokerResourceOK) Code() int { + return 200 +} + +func (o *RebuildBrokerResourceOK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebuildBrokerResourceFromHelixTags][%d] rebuildBrokerResourceOK ", 200) +} + +func (o *RebuildBrokerResourceOK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebuildBrokerResourceFromHelixTags][%d] rebuildBrokerResourceOK ", 200) +} + +func (o *RebuildBrokerResourceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRebuildBrokerResourceBadRequest creates a RebuildBrokerResourceBadRequest with default headers values +func NewRebuildBrokerResourceBadRequest() *RebuildBrokerResourceBadRequest { + return &RebuildBrokerResourceBadRequest{} +} + +/* +RebuildBrokerResourceBadRequest describes a response with status code 400, with default header values. + +Bad request: table name has to be with table type +*/ +type RebuildBrokerResourceBadRequest struct { +} + +// IsSuccess returns true when this rebuild broker resource bad request response has a 2xx status code +func (o *RebuildBrokerResourceBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this rebuild broker resource bad request response has a 3xx status code +func (o *RebuildBrokerResourceBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this rebuild broker resource bad request response has a 4xx status code +func (o *RebuildBrokerResourceBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this rebuild broker resource bad request response has a 5xx status code +func (o *RebuildBrokerResourceBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this rebuild broker resource bad request response a status code equal to that given +func (o *RebuildBrokerResourceBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the rebuild broker resource bad request response +func (o *RebuildBrokerResourceBadRequest) Code() int { + return 400 +} + +func (o *RebuildBrokerResourceBadRequest) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebuildBrokerResourceFromHelixTags][%d] rebuildBrokerResourceBadRequest ", 400) +} + +func (o *RebuildBrokerResourceBadRequest) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebuildBrokerResourceFromHelixTags][%d] rebuildBrokerResourceBadRequest ", 400) +} + +func (o *RebuildBrokerResourceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRebuildBrokerResourceInternalServerError creates a RebuildBrokerResourceInternalServerError with default headers values +func NewRebuildBrokerResourceInternalServerError() *RebuildBrokerResourceInternalServerError { + return &RebuildBrokerResourceInternalServerError{} +} + +/* +RebuildBrokerResourceInternalServerError describes a response with status code 500, with default header values. + +Internal error rebuilding broker resource or serializing response +*/ +type RebuildBrokerResourceInternalServerError struct { +} + +// IsSuccess returns true when this rebuild broker resource internal server error response has a 2xx status code +func (o *RebuildBrokerResourceInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this rebuild broker resource internal server error response has a 3xx status code +func (o *RebuildBrokerResourceInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this rebuild broker resource internal server error response has a 4xx status code +func (o *RebuildBrokerResourceInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this rebuild broker resource internal server error response has a 5xx status code +func (o *RebuildBrokerResourceInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this rebuild broker resource internal server error response a status code equal to that given +func (o *RebuildBrokerResourceInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the rebuild broker resource internal server error response +func (o *RebuildBrokerResourceInternalServerError) Code() int { + return 500 +} + +func (o *RebuildBrokerResourceInternalServerError) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebuildBrokerResourceFromHelixTags][%d] rebuildBrokerResourceInternalServerError ", 500) +} + +func (o *RebuildBrokerResourceInternalServerError) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/rebuildBrokerResourceFromHelixTags][%d] rebuildBrokerResourceInternalServerError ", 500) +} + +func (o *RebuildBrokerResourceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/recommend_config_parameters.go b/src/client/table/recommend_config_parameters.go new file mode 100644 index 0000000..8ae01db --- /dev/null +++ b/src/client/table/recommend_config_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRecommendConfigParams creates a new RecommendConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRecommendConfigParams() *RecommendConfigParams { + return &RecommendConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRecommendConfigParamsWithTimeout creates a new RecommendConfigParams object +// with the ability to set a timeout on a request. +func NewRecommendConfigParamsWithTimeout(timeout time.Duration) *RecommendConfigParams { + return &RecommendConfigParams{ + timeout: timeout, + } +} + +// NewRecommendConfigParamsWithContext creates a new RecommendConfigParams object +// with the ability to set a context for a request. +func NewRecommendConfigParamsWithContext(ctx context.Context) *RecommendConfigParams { + return &RecommendConfigParams{ + Context: ctx, + } +} + +// NewRecommendConfigParamsWithHTTPClient creates a new RecommendConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewRecommendConfigParamsWithHTTPClient(client *http.Client) *RecommendConfigParams { + return &RecommendConfigParams{ + HTTPClient: client, + } +} + +/* +RecommendConfigParams contains all the parameters to send to the API endpoint + + for the recommend config operation. + + Typically these are written to a http.Request. +*/ +type RecommendConfigParams struct { + + // Body. + Body string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the recommend config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RecommendConfigParams) WithDefaults() *RecommendConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the recommend config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RecommendConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the recommend config params +func (o *RecommendConfigParams) WithTimeout(timeout time.Duration) *RecommendConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the recommend config params +func (o *RecommendConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the recommend config params +func (o *RecommendConfigParams) WithContext(ctx context.Context) *RecommendConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the recommend config params +func (o *RecommendConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the recommend config params +func (o *RecommendConfigParams) WithHTTPClient(client *http.Client) *RecommendConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the recommend config params +func (o *RecommendConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the recommend config params +func (o *RecommendConfigParams) WithBody(body string) *RecommendConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the recommend config params +func (o *RecommendConfigParams) SetBody(body string) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RecommendConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/recommend_config_responses.go b/src/client/table/recommend_config_responses.go new file mode 100644 index 0000000..82f01bf --- /dev/null +++ b/src/client/table/recommend_config_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RecommendConfigReader is a Reader for the RecommendConfig structure. +type RecommendConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RecommendConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRecommendConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRecommendConfigOK creates a RecommendConfigOK with default headers values +func NewRecommendConfigOK() *RecommendConfigOK { + return &RecommendConfigOK{} +} + +/* +RecommendConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type RecommendConfigOK struct { + Payload string +} + +// IsSuccess returns true when this recommend config o k response has a 2xx status code +func (o *RecommendConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this recommend config o k response has a 3xx status code +func (o *RecommendConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recommend config o k response has a 4xx status code +func (o *RecommendConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this recommend config o k response has a 5xx status code +func (o *RecommendConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this recommend config o k response a status code equal to that given +func (o *RecommendConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the recommend config o k response +func (o *RecommendConfigOK) Code() int { + return 200 +} + +func (o *RecommendConfigOK) Error() string { + return fmt.Sprintf("[PUT /tables/recommender][%d] recommendConfigOK %+v", 200, o.Payload) +} + +func (o *RecommendConfigOK) String() string { + return fmt.Sprintf("[PUT /tables/recommender][%d] recommendConfigOK %+v", 200, o.Payload) +} + +func (o *RecommendConfigOK) GetPayload() string { + return o.Payload +} + +func (o *RecommendConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/remove_instance_partitions_parameters.go b/src/client/table/remove_instance_partitions_parameters.go new file mode 100644 index 0000000..a8e05f5 --- /dev/null +++ b/src/client/table/remove_instance_partitions_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRemoveInstancePartitionsParams creates a new RemoveInstancePartitionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRemoveInstancePartitionsParams() *RemoveInstancePartitionsParams { + return &RemoveInstancePartitionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRemoveInstancePartitionsParamsWithTimeout creates a new RemoveInstancePartitionsParams object +// with the ability to set a timeout on a request. +func NewRemoveInstancePartitionsParamsWithTimeout(timeout time.Duration) *RemoveInstancePartitionsParams { + return &RemoveInstancePartitionsParams{ + timeout: timeout, + } +} + +// NewRemoveInstancePartitionsParamsWithContext creates a new RemoveInstancePartitionsParams object +// with the ability to set a context for a request. +func NewRemoveInstancePartitionsParamsWithContext(ctx context.Context) *RemoveInstancePartitionsParams { + return &RemoveInstancePartitionsParams{ + Context: ctx, + } +} + +// NewRemoveInstancePartitionsParamsWithHTTPClient creates a new RemoveInstancePartitionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewRemoveInstancePartitionsParamsWithHTTPClient(client *http.Client) *RemoveInstancePartitionsParams { + return &RemoveInstancePartitionsParams{ + HTTPClient: client, + } +} + +/* +RemoveInstancePartitionsParams contains all the parameters to send to the API endpoint + + for the remove instance partitions operation. + + Typically these are written to a http.Request. +*/ +type RemoveInstancePartitionsParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|CONSUMING|COMPLETED + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the remove instance partitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RemoveInstancePartitionsParams) WithDefaults() *RemoveInstancePartitionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the remove instance partitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RemoveInstancePartitionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) WithTimeout(timeout time.Duration) *RemoveInstancePartitionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) WithContext(ctx context.Context) *RemoveInstancePartitionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) WithHTTPClient(client *http.Client) *RemoveInstancePartitionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) WithTableName(tableName string) *RemoveInstancePartitionsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) WithType(typeVar *string) *RemoveInstancePartitionsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the remove instance partitions params +func (o *RemoveInstancePartitionsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *RemoveInstancePartitionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/remove_instance_partitions_responses.go b/src/client/table/remove_instance_partitions_responses.go new file mode 100644 index 0000000..9be4ab1 --- /dev/null +++ b/src/client/table/remove_instance_partitions_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// RemoveInstancePartitionsReader is a Reader for the RemoveInstancePartitions structure. +type RemoveInstancePartitionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RemoveInstancePartitionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRemoveInstancePartitionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRemoveInstancePartitionsOK creates a RemoveInstancePartitionsOK with default headers values +func NewRemoveInstancePartitionsOK() *RemoveInstancePartitionsOK { + return &RemoveInstancePartitionsOK{} +} + +/* +RemoveInstancePartitionsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type RemoveInstancePartitionsOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this remove instance partitions o k response has a 2xx status code +func (o *RemoveInstancePartitionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this remove instance partitions o k response has a 3xx status code +func (o *RemoveInstancePartitionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this remove instance partitions o k response has a 4xx status code +func (o *RemoveInstancePartitionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this remove instance partitions o k response has a 5xx status code +func (o *RemoveInstancePartitionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this remove instance partitions o k response a status code equal to that given +func (o *RemoveInstancePartitionsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the remove instance partitions o k response +func (o *RemoveInstancePartitionsOK) Code() int { + return 200 +} + +func (o *RemoveInstancePartitionsOK) Error() string { + return fmt.Sprintf("[DELETE /tables/{tableName}/instancePartitions][%d] removeInstancePartitionsOK %+v", 200, o.Payload) +} + +func (o *RemoveInstancePartitionsOK) String() string { + return fmt.Sprintf("[DELETE /tables/{tableName}/instancePartitions][%d] removeInstancePartitionsOK %+v", 200, o.Payload) +} + +func (o *RemoveInstancePartitionsOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *RemoveInstancePartitionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/replace_instance_parameters.go b/src/client/table/replace_instance_parameters.go new file mode 100644 index 0000000..b50a4d1 --- /dev/null +++ b/src/client/table/replace_instance_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReplaceInstanceParams creates a new ReplaceInstanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReplaceInstanceParams() *ReplaceInstanceParams { + return &ReplaceInstanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReplaceInstanceParamsWithTimeout creates a new ReplaceInstanceParams object +// with the ability to set a timeout on a request. +func NewReplaceInstanceParamsWithTimeout(timeout time.Duration) *ReplaceInstanceParams { + return &ReplaceInstanceParams{ + timeout: timeout, + } +} + +// NewReplaceInstanceParamsWithContext creates a new ReplaceInstanceParams object +// with the ability to set a context for a request. +func NewReplaceInstanceParamsWithContext(ctx context.Context) *ReplaceInstanceParams { + return &ReplaceInstanceParams{ + Context: ctx, + } +} + +// NewReplaceInstanceParamsWithHTTPClient creates a new ReplaceInstanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewReplaceInstanceParamsWithHTTPClient(client *http.Client) *ReplaceInstanceParams { + return &ReplaceInstanceParams{ + HTTPClient: client, + } +} + +/* +ReplaceInstanceParams contains all the parameters to send to the API endpoint + + for the replace instance operation. + + Typically these are written to a http.Request. +*/ +type ReplaceInstanceParams struct { + + /* NewInstanceID. + + New instance to replace with + */ + NewInstanceID string + + /* OldInstanceID. + + Old instance to be replaced + */ + OldInstanceID string + + /* TableName. + + Name of the table + */ + TableName string + + /* Type. + + OFFLINE|CONSUMING|COMPLETED + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the replace instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplaceInstanceParams) WithDefaults() *ReplaceInstanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the replace instance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplaceInstanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the replace instance params +func (o *ReplaceInstanceParams) WithTimeout(timeout time.Duration) *ReplaceInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the replace instance params +func (o *ReplaceInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the replace instance params +func (o *ReplaceInstanceParams) WithContext(ctx context.Context) *ReplaceInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the replace instance params +func (o *ReplaceInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the replace instance params +func (o *ReplaceInstanceParams) WithHTTPClient(client *http.Client) *ReplaceInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the replace instance params +func (o *ReplaceInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNewInstanceID adds the newInstanceID to the replace instance params +func (o *ReplaceInstanceParams) WithNewInstanceID(newInstanceID string) *ReplaceInstanceParams { + o.SetNewInstanceID(newInstanceID) + return o +} + +// SetNewInstanceID adds the newInstanceId to the replace instance params +func (o *ReplaceInstanceParams) SetNewInstanceID(newInstanceID string) { + o.NewInstanceID = newInstanceID +} + +// WithOldInstanceID adds the oldInstanceID to the replace instance params +func (o *ReplaceInstanceParams) WithOldInstanceID(oldInstanceID string) *ReplaceInstanceParams { + o.SetOldInstanceID(oldInstanceID) + return o +} + +// SetOldInstanceID adds the oldInstanceId to the replace instance params +func (o *ReplaceInstanceParams) SetOldInstanceID(oldInstanceID string) { + o.OldInstanceID = oldInstanceID +} + +// WithTableName adds the tableName to the replace instance params +func (o *ReplaceInstanceParams) WithTableName(tableName string) *ReplaceInstanceParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the replace instance params +func (o *ReplaceInstanceParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithType adds the typeVar to the replace instance params +func (o *ReplaceInstanceParams) WithType(typeVar *string) *ReplaceInstanceParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the replace instance params +func (o *ReplaceInstanceParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ReplaceInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param newInstanceId + qrNewInstanceID := o.NewInstanceID + qNewInstanceID := qrNewInstanceID + if qNewInstanceID != "" { + + if err := r.SetQueryParam("newInstanceId", qNewInstanceID); err != nil { + return err + } + } + + // query param oldInstanceId + qrOldInstanceID := o.OldInstanceID + qOldInstanceID := qrOldInstanceID + if qOldInstanceID != "" { + + if err := r.SetQueryParam("oldInstanceId", qOldInstanceID); err != nil { + return err + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/replace_instance_responses.go b/src/client/table/replace_instance_responses.go new file mode 100644 index 0000000..7cd91b9 --- /dev/null +++ b/src/client/table/replace_instance_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ReplaceInstanceReader is a Reader for the ReplaceInstance structure. +type ReplaceInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReplaceInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReplaceInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReplaceInstanceOK creates a ReplaceInstanceOK with default headers values +func NewReplaceInstanceOK() *ReplaceInstanceOK { + return &ReplaceInstanceOK{} +} + +/* +ReplaceInstanceOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ReplaceInstanceOK struct { + Payload map[string]models.InstancePartitions +} + +// IsSuccess returns true when this replace instance o k response has a 2xx status code +func (o *ReplaceInstanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this replace instance o k response has a 3xx status code +func (o *ReplaceInstanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this replace instance o k response has a 4xx status code +func (o *ReplaceInstanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this replace instance o k response has a 5xx status code +func (o *ReplaceInstanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this replace instance o k response a status code equal to that given +func (o *ReplaceInstanceOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the replace instance o k response +func (o *ReplaceInstanceOK) Code() int { + return 200 +} + +func (o *ReplaceInstanceOK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/replaceInstance][%d] replaceInstanceOK %+v", 200, o.Payload) +} + +func (o *ReplaceInstanceOK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/replaceInstance][%d] replaceInstanceOK %+v", 200, o.Payload) +} + +func (o *ReplaceInstanceOK) GetPayload() map[string]models.InstancePartitions { + return o.Payload +} + +func (o *ReplaceInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/resume_consumption_parameters.go b/src/client/table/resume_consumption_parameters.go new file mode 100644 index 0000000..3b0b581 --- /dev/null +++ b/src/client/table/resume_consumption_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewResumeConsumptionParams creates a new ResumeConsumptionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResumeConsumptionParams() *ResumeConsumptionParams { + return &ResumeConsumptionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResumeConsumptionParamsWithTimeout creates a new ResumeConsumptionParams object +// with the ability to set a timeout on a request. +func NewResumeConsumptionParamsWithTimeout(timeout time.Duration) *ResumeConsumptionParams { + return &ResumeConsumptionParams{ + timeout: timeout, + } +} + +// NewResumeConsumptionParamsWithContext creates a new ResumeConsumptionParams object +// with the ability to set a context for a request. +func NewResumeConsumptionParamsWithContext(ctx context.Context) *ResumeConsumptionParams { + return &ResumeConsumptionParams{ + Context: ctx, + } +} + +// NewResumeConsumptionParamsWithHTTPClient creates a new ResumeConsumptionParams object +// with the ability to set a custom HTTPClient for a request. +func NewResumeConsumptionParamsWithHTTPClient(client *http.Client) *ResumeConsumptionParams { + return &ResumeConsumptionParams{ + HTTPClient: client, + } +} + +/* +ResumeConsumptionParams contains all the parameters to send to the API endpoint + + for the resume consumption operation. + + Typically these are written to a http.Request. +*/ +type ResumeConsumptionParams struct { + + /* ConsumeFrom. + + smallest | largest + */ + ConsumeFrom *string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resume consumption params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResumeConsumptionParams) WithDefaults() *ResumeConsumptionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resume consumption params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResumeConsumptionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resume consumption params +func (o *ResumeConsumptionParams) WithTimeout(timeout time.Duration) *ResumeConsumptionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resume consumption params +func (o *ResumeConsumptionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resume consumption params +func (o *ResumeConsumptionParams) WithContext(ctx context.Context) *ResumeConsumptionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resume consumption params +func (o *ResumeConsumptionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resume consumption params +func (o *ResumeConsumptionParams) WithHTTPClient(client *http.Client) *ResumeConsumptionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resume consumption params +func (o *ResumeConsumptionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConsumeFrom adds the consumeFrom to the resume consumption params +func (o *ResumeConsumptionParams) WithConsumeFrom(consumeFrom *string) *ResumeConsumptionParams { + o.SetConsumeFrom(consumeFrom) + return o +} + +// SetConsumeFrom adds the consumeFrom to the resume consumption params +func (o *ResumeConsumptionParams) SetConsumeFrom(consumeFrom *string) { + o.ConsumeFrom = consumeFrom +} + +// WithTableName adds the tableName to the resume consumption params +func (o *ResumeConsumptionParams) WithTableName(tableName string) *ResumeConsumptionParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the resume consumption params +func (o *ResumeConsumptionParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *ResumeConsumptionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConsumeFrom != nil { + + // query param consumeFrom + var qrConsumeFrom string + + if o.ConsumeFrom != nil { + qrConsumeFrom = *o.ConsumeFrom + } + qConsumeFrom := qrConsumeFrom + if qConsumeFrom != "" { + + if err := r.SetQueryParam("consumeFrom", qConsumeFrom); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/resume_consumption_responses.go b/src/client/table/resume_consumption_responses.go new file mode 100644 index 0000000..9121c9d --- /dev/null +++ b/src/client/table/resume_consumption_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ResumeConsumptionReader is a Reader for the ResumeConsumption structure. +type ResumeConsumptionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResumeConsumptionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewResumeConsumptionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewResumeConsumptionDefault creates a ResumeConsumptionDefault with default headers values +func NewResumeConsumptionDefault(code int) *ResumeConsumptionDefault { + return &ResumeConsumptionDefault{ + _statusCode: code, + } +} + +/* +ResumeConsumptionDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type ResumeConsumptionDefault struct { + _statusCode int +} + +// IsSuccess returns true when this resume consumption default response has a 2xx status code +func (o *ResumeConsumptionDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this resume consumption default response has a 3xx status code +func (o *ResumeConsumptionDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this resume consumption default response has a 4xx status code +func (o *ResumeConsumptionDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this resume consumption default response has a 5xx status code +func (o *ResumeConsumptionDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this resume consumption default response a status code equal to that given +func (o *ResumeConsumptionDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the resume consumption default response +func (o *ResumeConsumptionDefault) Code() int { + return o._statusCode +} + +func (o *ResumeConsumptionDefault) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/resumeConsumption][%d] resumeConsumption default ", o._statusCode) +} + +func (o *ResumeConsumptionDefault) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/resumeConsumption][%d] resumeConsumption default ", o._statusCode) +} + +func (o *ResumeConsumptionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/set_instance_partitions_parameters.go b/src/client/table/set_instance_partitions_parameters.go new file mode 100644 index 0000000..13fdb80 --- /dev/null +++ b/src/client/table/set_instance_partitions_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSetInstancePartitionsParams creates a new SetInstancePartitionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSetInstancePartitionsParams() *SetInstancePartitionsParams { + return &SetInstancePartitionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetInstancePartitionsParamsWithTimeout creates a new SetInstancePartitionsParams object +// with the ability to set a timeout on a request. +func NewSetInstancePartitionsParamsWithTimeout(timeout time.Duration) *SetInstancePartitionsParams { + return &SetInstancePartitionsParams{ + timeout: timeout, + } +} + +// NewSetInstancePartitionsParamsWithContext creates a new SetInstancePartitionsParams object +// with the ability to set a context for a request. +func NewSetInstancePartitionsParamsWithContext(ctx context.Context) *SetInstancePartitionsParams { + return &SetInstancePartitionsParams{ + Context: ctx, + } +} + +// NewSetInstancePartitionsParamsWithHTTPClient creates a new SetInstancePartitionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetInstancePartitionsParamsWithHTTPClient(client *http.Client) *SetInstancePartitionsParams { + return &SetInstancePartitionsParams{ + HTTPClient: client, + } +} + +/* +SetInstancePartitionsParams contains all the parameters to send to the API endpoint + + for the set instance partitions operation. + + Typically these are written to a http.Request. +*/ +type SetInstancePartitionsParams struct { + + // Body. + Body string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set instance partitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetInstancePartitionsParams) WithDefaults() *SetInstancePartitionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set instance partitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetInstancePartitionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set instance partitions params +func (o *SetInstancePartitionsParams) WithTimeout(timeout time.Duration) *SetInstancePartitionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set instance partitions params +func (o *SetInstancePartitionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set instance partitions params +func (o *SetInstancePartitionsParams) WithContext(ctx context.Context) *SetInstancePartitionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set instance partitions params +func (o *SetInstancePartitionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set instance partitions params +func (o *SetInstancePartitionsParams) WithHTTPClient(client *http.Client) *SetInstancePartitionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set instance partitions params +func (o *SetInstancePartitionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the set instance partitions params +func (o *SetInstancePartitionsParams) WithBody(body string) *SetInstancePartitionsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the set instance partitions params +func (o *SetInstancePartitionsParams) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the set instance partitions params +func (o *SetInstancePartitionsParams) WithTableName(tableName string) *SetInstancePartitionsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the set instance partitions params +func (o *SetInstancePartitionsParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *SetInstancePartitionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/set_instance_partitions_responses.go b/src/client/table/set_instance_partitions_responses.go new file mode 100644 index 0000000..c76b471 --- /dev/null +++ b/src/client/table/set_instance_partitions_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// SetInstancePartitionsReader is a Reader for the SetInstancePartitions structure. +type SetInstancePartitionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetInstancePartitionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetInstancePartitionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewSetInstancePartitionsOK creates a SetInstancePartitionsOK with default headers values +func NewSetInstancePartitionsOK() *SetInstancePartitionsOK { + return &SetInstancePartitionsOK{} +} + +/* +SetInstancePartitionsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type SetInstancePartitionsOK struct { + Payload map[string]models.InstancePartitions +} + +// IsSuccess returns true when this set instance partitions o k response has a 2xx status code +func (o *SetInstancePartitionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set instance partitions o k response has a 3xx status code +func (o *SetInstancePartitionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set instance partitions o k response has a 4xx status code +func (o *SetInstancePartitionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set instance partitions o k response has a 5xx status code +func (o *SetInstancePartitionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set instance partitions o k response a status code equal to that given +func (o *SetInstancePartitionsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the set instance partitions o k response +func (o *SetInstancePartitionsOK) Code() int { + return 200 +} + +func (o *SetInstancePartitionsOK) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/instancePartitions][%d] setInstancePartitionsOK %+v", 200, o.Payload) +} + +func (o *SetInstancePartitionsOK) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/instancePartitions][%d] setInstancePartitionsOK %+v", 200, o.Payload) +} + +func (o *SetInstancePartitionsOK) GetPayload() map[string]models.InstancePartitions { + return o.Payload +} + +func (o *SetInstancePartitionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/set_time_boundary_parameters.go b/src/client/table/set_time_boundary_parameters.go new file mode 100644 index 0000000..bbc14ca --- /dev/null +++ b/src/client/table/set_time_boundary_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSetTimeBoundaryParams creates a new SetTimeBoundaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSetTimeBoundaryParams() *SetTimeBoundaryParams { + return &SetTimeBoundaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetTimeBoundaryParamsWithTimeout creates a new SetTimeBoundaryParams object +// with the ability to set a timeout on a request. +func NewSetTimeBoundaryParamsWithTimeout(timeout time.Duration) *SetTimeBoundaryParams { + return &SetTimeBoundaryParams{ + timeout: timeout, + } +} + +// NewSetTimeBoundaryParamsWithContext creates a new SetTimeBoundaryParams object +// with the ability to set a context for a request. +func NewSetTimeBoundaryParamsWithContext(ctx context.Context) *SetTimeBoundaryParams { + return &SetTimeBoundaryParams{ + Context: ctx, + } +} + +// NewSetTimeBoundaryParamsWithHTTPClient creates a new SetTimeBoundaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetTimeBoundaryParamsWithHTTPClient(client *http.Client) *SetTimeBoundaryParams { + return &SetTimeBoundaryParams{ + HTTPClient: client, + } +} + +/* +SetTimeBoundaryParams contains all the parameters to send to the API endpoint + + for the set time boundary operation. + + Typically these are written to a http.Request. +*/ +type SetTimeBoundaryParams struct { + + /* TableName. + + Name of the hybrid table (without type suffix) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set time boundary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetTimeBoundaryParams) WithDefaults() *SetTimeBoundaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set time boundary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetTimeBoundaryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set time boundary params +func (o *SetTimeBoundaryParams) WithTimeout(timeout time.Duration) *SetTimeBoundaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set time boundary params +func (o *SetTimeBoundaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set time boundary params +func (o *SetTimeBoundaryParams) WithContext(ctx context.Context) *SetTimeBoundaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set time boundary params +func (o *SetTimeBoundaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set time boundary params +func (o *SetTimeBoundaryParams) WithHTTPClient(client *http.Client) *SetTimeBoundaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set time boundary params +func (o *SetTimeBoundaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the set time boundary params +func (o *SetTimeBoundaryParams) WithTableName(tableName string) *SetTimeBoundaryParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the set time boundary params +func (o *SetTimeBoundaryParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *SetTimeBoundaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/set_time_boundary_responses.go b/src/client/table/set_time_boundary_responses.go new file mode 100644 index 0000000..8517450 --- /dev/null +++ b/src/client/table/set_time_boundary_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// SetTimeBoundaryReader is a Reader for the SetTimeBoundary structure. +type SetTimeBoundaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetTimeBoundaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetTimeBoundaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewSetTimeBoundaryOK creates a SetTimeBoundaryOK with default headers values +func NewSetTimeBoundaryOK() *SetTimeBoundaryOK { + return &SetTimeBoundaryOK{} +} + +/* +SetTimeBoundaryOK describes a response with status code 200, with default header values. + +successful operation +*/ +type SetTimeBoundaryOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this set time boundary o k response has a 2xx status code +func (o *SetTimeBoundaryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set time boundary o k response has a 3xx status code +func (o *SetTimeBoundaryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set time boundary o k response has a 4xx status code +func (o *SetTimeBoundaryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set time boundary o k response has a 5xx status code +func (o *SetTimeBoundaryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set time boundary o k response a status code equal to that given +func (o *SetTimeBoundaryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the set time boundary o k response +func (o *SetTimeBoundaryOK) Code() int { + return 200 +} + +func (o *SetTimeBoundaryOK) Error() string { + return fmt.Sprintf("[POST /tables/{tableName}/timeBoundary][%d] setTimeBoundaryOK %+v", 200, o.Payload) +} + +func (o *SetTimeBoundaryOK) String() string { + return fmt.Sprintf("[POST /tables/{tableName}/timeBoundary][%d] setTimeBoundaryOK %+v", 200, o.Payload) +} + +func (o *SetTimeBoundaryOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *SetTimeBoundaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/table_client.go b/src/client/table/table_client.go new file mode 100644 index 0000000..f7b141f --- /dev/null +++ b/src/client/table/table_client.go @@ -0,0 +1,1955 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new table API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for table API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + AddConfig(params *AddConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddConfigOK, error) + + AddTable(params *AddTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddTableOK, error) + + AlterTableStateOrListTableConfig(params *AlterTableStateOrListTableConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AlterTableStateOrListTableConfigOK, error) + + AssignInstances(params *AssignInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AssignInstancesOK, error) + + CheckTableConfig(params *CheckTableConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckTableConfigOK, error) + + DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) + + DeleteTable(params *DeleteTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTableOK, error) + + DeleteTimeBoundary(params *DeleteTimeBoundaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTimeBoundaryOK, error) + + ForceCommit(params *ForceCommitParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ForceCommitOK, error) + + GetConfig(params *GetConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConfigOK, error) + + GetConsumingSegmentsInfo(params *GetConsumingSegmentsInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConsumingSegmentsInfoOK, error) + + GetControllerJobs(params *GetControllerJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetControllerJobsOK, error) + + GetExternalView(params *GetExternalViewParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetExternalViewOK, error) + + GetForceCommitJobStatus(params *GetForceCommitJobStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetForceCommitJobStatusOK, error) + + GetIdealState(params *GetIdealStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdealStateOK, error) + + GetInstancePartitions(params *GetInstancePartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInstancePartitionsOK, error) + + GetLiveBrokers(params *GetLiveBrokersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLiveBrokersOK, error) + + GetLiveBrokersForTable(params *GetLiveBrokersForTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLiveBrokersForTableOK, error) + + GetPauseStatus(params *GetPauseStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + GetTableAggregateMetadata(params *GetTableAggregateMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableAggregateMetadataOK, error) + + GetTableInstances(params *GetTableInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableInstancesOK, error) + + GetTableSize(params *GetTableSizeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableSizeOK, error) + + GetTableState(params *GetTableStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableStateOK, error) + + GetTableStats(params *GetTableStatsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableStatsOK, error) + + GetTableStatus(params *GetTableStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableStatusOK, error) + + IngestFromFile(params *IngestFromFileParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + IngestFromURI(params *IngestFromURIParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) + + ListTables(params *ListTablesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTablesOK, error) + + PauseConsumption(params *PauseConsumptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + Put(params *PutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutOK, error) + + Rebalance(params *RebalanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RebalanceOK, error) + + RebuildBrokerResource(params *RebuildBrokerResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RebuildBrokerResourceOK, error) + + RecommendConfig(params *RecommendConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RecommendConfigOK, error) + + RemoveInstancePartitions(params *RemoveInstancePartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveInstancePartitionsOK, error) + + ReplaceInstance(params *ReplaceInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplaceInstanceOK, error) + + ResumeConsumption(params *ResumeConsumptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + SetInstancePartitions(params *SetInstancePartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetInstancePartitionsOK, error) + + SetTimeBoundary(params *SetTimeBoundaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetTimeBoundaryOK, error) + + UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) + + UpdateIndexingConfig(params *UpdateIndexingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIndexingConfigOK, error) + + UpdateTableConfig(params *UpdateTableConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTableConfigOK, error) + + UpdateTableMetadata(params *UpdateTableMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTableMetadataOK, error) + + ValidateConfig(params *ValidateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateConfigOK, error) + + ValidateTableAndSchema(params *ValidateTableAndSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateTableAndSchemaOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AddConfig adds the table configs using the table configs str json + +Add the TableConfigs using the tableConfigsStr json +*/ +func (a *Client) AddConfig(params *AddConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddConfigParams() + } + op := &runtime.ClientOperation{ + ID: "addConfig", + Method: "POST", + PathPattern: "/tableConfigs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AddConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for addConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +AddTable adds a table + +Adds a table +*/ +func (a *Client) AddTable(params *AddTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddTableParams() + } + op := &runtime.ClientOperation{ + ID: "addTable", + Method: "POST", + PathPattern: "/tables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AddTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for addTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +AlterTableStateOrListTableConfig gets enable disable drop a table + +Get/Enable/Disable/Drop a table. If table name is the only parameter specified , the tableconfig will be printed +*/ +func (a *Client) AlterTableStateOrListTableConfig(params *AlterTableStateOrListTableConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AlterTableStateOrListTableConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAlterTableStateOrListTableConfigParams() + } + op := &runtime.ClientOperation{ + ID: "alterTableStateOrListTableConfig", + Method: "GET", + PathPattern: "/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AlterTableStateOrListTableConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AlterTableStateOrListTableConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for alterTableStateOrListTableConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +AssignInstances assigns server instances to a table +*/ +func (a *Client) AssignInstances(params *AssignInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AssignInstancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAssignInstancesParams() + } + op := &runtime.ClientOperation{ + ID: "assignInstances", + Method: "POST", + PathPattern: "/tables/{tableName}/assignInstances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AssignInstancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AssignInstancesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for assignInstances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CheckTableConfig validates table config for a table + +This API returns the table config that matches the one you get from 'GET /tables/{tableName}'. This allows us to validate table config before apply. +*/ +func (a *Client) CheckTableConfig(params *CheckTableConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckTableConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCheckTableConfigParams() + } + op := &runtime.ClientOperation{ + ID: "checkTableConfig", + Method: "POST", + PathPattern: "/tables/validate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CheckTableConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CheckTableConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for checkTableConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteConfig deletes the table configs + +Delete the TableConfigs +*/ +func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteConfigParams() + } + op := &runtime.ClientOperation{ + ID: "deleteConfig", + Method: "DELETE", + PathPattern: "/tableConfigs/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTable deletes a table + +Deletes a table +*/ +func (a *Client) DeleteTable(params *DeleteTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTableParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTable", + Method: "DELETE", + PathPattern: "/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTimeBoundary deletes hybrid table query time boundary + +Delete hybrid table query time boundary +*/ +func (a *Client) DeleteTimeBoundary(params *DeleteTimeBoundaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTimeBoundaryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTimeBoundaryParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTimeBoundary", + Method: "DELETE", + PathPattern: "/tables/{tableName}/timeBoundary", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTimeBoundaryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTimeBoundaryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTimeBoundary: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ForceCommit forces commit the current consuming segments + +Force commit the current segments in consuming state and restart consumption. This should be used after schema/table config changes. Please note that this is an asynchronous operation, and 200 response does not mean it has actually been done already +*/ +func (a *Client) ForceCommit(params *ForceCommitParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ForceCommitOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewForceCommitParams() + } + op := &runtime.ClientOperation{ + ID: "forceCommit", + Method: "POST", + PathPattern: "/tables/{tableName}/forceCommit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ForceCommitReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ForceCommitOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for forceCommit: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetConfig gets the table configs for a given raw table name + +Get the TableConfigs for a given raw tableName +*/ +func (a *Client) GetConfig(params *GetConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetConfigParams() + } + op := &runtime.ClientOperation{ + ID: "getConfig", + Method: "GET", + PathPattern: "/tableConfigs/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetConsumingSegmentsInfo returns state of consuming segments + +Gets the status of consumers from all servers.Note that the partitionToOffsetMap has been deprecated and will be removed in the next release. The info is now embedded within each partition's state as currentOffsetsMap. +*/ +func (a *Client) GetConsumingSegmentsInfo(params *GetConsumingSegmentsInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConsumingSegmentsInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetConsumingSegmentsInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getConsumingSegmentsInfo", + Method: "GET", + PathPattern: "/tables/{tableName}/consumingSegmentsInfo", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetConsumingSegmentsInfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetConsumingSegmentsInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getConsumingSegmentsInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetControllerJobs gets list of controller jobs for this table + +Get list of controller jobs for this table +*/ +func (a *Client) GetControllerJobs(params *GetControllerJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetControllerJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetControllerJobsParams() + } + op := &runtime.ClientOperation{ + ID: "getControllerJobs", + Method: "GET", + PathPattern: "/table/{tableName}/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetControllerJobsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetControllerJobsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getControllerJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetExternalView gets table external view + +Get table external view +*/ +func (a *Client) GetExternalView(params *GetExternalViewParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetExternalViewOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetExternalViewParams() + } + op := &runtime.ClientOperation{ + ID: "getExternalView", + Method: "GET", + PathPattern: "/tables/{tableName}/externalview", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetExternalViewReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetExternalViewOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getExternalView: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetForceCommitJobStatus gets status for a submitted force commit operation + +Get status for a submitted force commit operation +*/ +func (a *Client) GetForceCommitJobStatus(params *GetForceCommitJobStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetForceCommitJobStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetForceCommitJobStatusParams() + } + op := &runtime.ClientOperation{ + ID: "getForceCommitJobStatus", + Method: "GET", + PathPattern: "/tables/forceCommitStatus/{jobId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetForceCommitJobStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetForceCommitJobStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getForceCommitJobStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetIdealState gets table ideal state + +Get table ideal state +*/ +func (a *Client) GetIdealState(params *GetIdealStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdealStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIdealStateParams() + } + op := &runtime.ClientOperation{ + ID: "getIdealState", + Method: "GET", + PathPattern: "/tables/{tableName}/idealstate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetIdealStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetIdealStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getIdealState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetInstancePartitions gets the instance partitions +*/ +func (a *Client) GetInstancePartitions(params *GetInstancePartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInstancePartitionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInstancePartitionsParams() + } + op := &runtime.ClientOperation{ + ID: "getInstancePartitions", + Method: "GET", + PathPattern: "/tables/{tableName}/instancePartitions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetInstancePartitionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetInstancePartitionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getInstancePartitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLiveBrokers lists tables to live brokers mappings + +List tables to live brokers mappings based on EV +*/ +func (a *Client) GetLiveBrokers(params *GetLiveBrokersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLiveBrokersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLiveBrokersParams() + } + op := &runtime.ClientOperation{ + ID: "getLiveBrokers", + Method: "GET", + PathPattern: "/tables/livebrokers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLiveBrokersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLiveBrokersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLiveBrokers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetLiveBrokersForTable lists the brokers serving a table + +List live brokers of the given table based on EV +*/ +func (a *Client) GetLiveBrokersForTable(params *GetLiveBrokersForTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLiveBrokersForTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLiveBrokersForTableParams() + } + op := &runtime.ClientOperation{ + ID: "getLiveBrokersForTable", + Method: "GET", + PathPattern: "/tables/{tableName}/livebrokers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetLiveBrokersForTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLiveBrokersForTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getLiveBrokersForTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetPauseStatus returns pause status of a realtime table + +Return pause status of a realtime table along with list of consuming segments. +*/ +func (a *Client) GetPauseStatus(params *GetPauseStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPauseStatusParams() + } + op := &runtime.ClientOperation{ + ID: "getPauseStatus", + Method: "GET", + PathPattern: "/tables/{tableName}/pauseStatus", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetPauseStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +GetTableAggregateMetadata gets the aggregate metadata of all segments for a table + +Get the aggregate metadata of all segments for a table +*/ +func (a *Client) GetTableAggregateMetadata(params *GetTableAggregateMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableAggregateMetadataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableAggregateMetadataParams() + } + op := &runtime.ClientOperation{ + ID: "getTableAggregateMetadata", + Method: "GET", + PathPattern: "/tables/{tableName}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableAggregateMetadataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableAggregateMetadataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableAggregateMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableInstances lists table instances + +List instances of the given table +*/ +func (a *Client) GetTableInstances(params *GetTableInstancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableInstancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableInstancesParams() + } + op := &runtime.ClientOperation{ + ID: "getTableInstances", + Method: "GET", + PathPattern: "/tables/{tableName}/instances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableInstancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableInstancesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableInstances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableSize reads table sizes + +Get table size details. Table size is the size of untarred segments including replication +*/ +func (a *Client) GetTableSize(params *GetTableSizeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableSizeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableSizeParams() + } + op := &runtime.ClientOperation{ + ID: "getTableSize", + Method: "GET", + PathPattern: "/tables/{tableName}/size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableSizeReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableSizeOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableSize: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableState gets current table state + +Get current table state +*/ +func (a *Client) GetTableState(params *GetTableStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableStateParams() + } + op := &runtime.ClientOperation{ + ID: "getTableState", + Method: "GET", + PathPattern: "/tables/{tableName}/state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableStats tables stats + +Provides metadata info/stats about the table. +*/ +func (a *Client) GetTableStats(params *GetTableStatsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableStatsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableStatsParams() + } + op := &runtime.ClientOperation{ + ID: "getTableStats", + Method: "GET", + PathPattern: "/tables/{tableName}/stats", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableStatsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableStatsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableStats: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTableStatus tables status + +Provides status of the table including ingestion status +*/ +func (a *Client) GetTableStatus(params *GetTableStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTableStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTableStatusParams() + } + op := &runtime.ClientOperation{ + ID: "getTableStatus", + Method: "GET", + PathPattern: "/tables/{tableName}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTableStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTableStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTableStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IngestFromFile ingests a file + + Creates a segment using given file and pushes it to Pinot. + All steps happen on the controller. This API is NOT meant for production environments/large input files. + Example usage (query params need encoding): + +``` +curl -X POST -F file=@data.json -H "Content-Type: multipart/form-data" "http://localhost:9000/ingestFromFile?tableNameWithType=foo_OFFLINE& + + batchConfigMapStr={ + "inputFormat":"csv", + "recordReader.prop.delimiter":"|" + }" + +``` +*/ +func (a *Client) IngestFromFile(params *IngestFromFileParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestFromFileParams() + } + op := &runtime.ClientOperation{ + ID: "ingestFromFile", + Method: "POST", + PathPattern: "/ingestFromFile", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &IngestFromFileReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* + IngestFromURI ingests from the given URI + + Creates a segment using file at the given URI and pushes it to Pinot. + All steps happen on the controller. This API is NOT meant for production environments/large input files. + +Example usage (query params need encoding): +``` +curl -X POST "http://localhost:9000/ingestFromURI?tableNameWithType=foo_OFFLINE + + &batchConfigMapStr={ + "inputFormat":"json", + "input.fs.className":"org.apache.pinot.plugin.filesystem.S3PinotFS", + "input.fs.prop.region":"us-central", + "input.fs.prop.accessKey":"foo", + "input.fs.prop.secretKey":"bar" + } + +&sourceURIStr=s3://test.bucket/path/to/json/data/data.json" +``` +*/ +func (a *Client) IngestFromURI(params *IngestFromURIParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestFromURIParams() + } + op := &runtime.ClientOperation{ + ID: "ingestFromURI", + Method: "POST", + PathPattern: "/ingestFromURI", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &IngestFromURIReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +ListConfigs lists all table configs in cluster + +Lists all TableConfigs in cluster +*/ +func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListConfigsParams() + } + op := &runtime.ClientOperation{ + ID: "listConfigs", + Method: "GET", + PathPattern: "/tableConfigs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListConfigsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListConfigsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListTables lists all tables in cluster + +Lists all tables in cluster +*/ +func (a *Client) ListTables(params *ListTablesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTablesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListTablesParams() + } + op := &runtime.ClientOperation{ + ID: "listTables", + Method: "GET", + PathPattern: "/tables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListTablesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListTablesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listTables: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PauseConsumption pauses consumption of a realtime table + +Pause the consumption of a realtime table +*/ +func (a *Client) PauseConsumption(params *PauseConsumptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewPauseConsumptionParams() + } + op := &runtime.ClientOperation{ + ID: "pauseConsumption", + Method: "POST", + PathPattern: "/tables/{tableName}/pauseConsumption", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PauseConsumptionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +Put updates segments configuration + +Updates segmentsConfig section (validation and retention) of a table +*/ +func (a *Client) Put(params *PutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutParams() + } + op := &runtime.ClientOperation{ + ID: "put", + Method: "PUT", + PathPattern: "/tables/{tableName}/segmentConfigs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Rebalance rebalances a table reassign instances and segments for a table + +Rebalances a table (reassign instances and segments for a table) +*/ +func (a *Client) Rebalance(params *RebalanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RebalanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRebalanceParams() + } + op := &runtime.ClientOperation{ + ID: "rebalance", + Method: "POST", + PathPattern: "/tables/{tableName}/rebalance", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RebalanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RebalanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for rebalance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RebuildBrokerResource rebuilds broker resource for table + +when new brokers are added +*/ +func (a *Client) RebuildBrokerResource(params *RebuildBrokerResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RebuildBrokerResourceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRebuildBrokerResourceParams() + } + op := &runtime.ClientOperation{ + ID: "rebuildBrokerResource", + Method: "POST", + PathPattern: "/tables/{tableName}/rebuildBrokerResourceFromHelixTags", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RebuildBrokerResourceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RebuildBrokerResourceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for rebuildBrokerResource: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RecommendConfig recommends config + +Recommend a config with input json +*/ +func (a *Client) RecommendConfig(params *RecommendConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RecommendConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRecommendConfigParams() + } + op := &runtime.ClientOperation{ + ID: "recommendConfig", + Method: "PUT", + PathPattern: "/tables/recommender", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RecommendConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RecommendConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for recommendConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RemoveInstancePartitions removes the instance partitions +*/ +func (a *Client) RemoveInstancePartitions(params *RemoveInstancePartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveInstancePartitionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRemoveInstancePartitionsParams() + } + op := &runtime.ClientOperation{ + ID: "removeInstancePartitions", + Method: "DELETE", + PathPattern: "/tables/{tableName}/instancePartitions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RemoveInstancePartitionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RemoveInstancePartitionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for removeInstancePartitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReplaceInstance replaces an instance in the instance partitions +*/ +func (a *Client) ReplaceInstance(params *ReplaceInstanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplaceInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReplaceInstanceParams() + } + op := &runtime.ClientOperation{ + ID: "replaceInstance", + Method: "POST", + PathPattern: "/tables/{tableName}/replaceInstance", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReplaceInstanceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReplaceInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for replaceInstance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ResumeConsumption resumes consumption of a realtime table + +Resume the consumption for a realtime table. ConsumeFrom parameter indicates from which offsets consumption should resume. If consumeFrom parameter is not provided, consumption continues based on the offsets in segment ZK metadata, and in case the offsets are already gone, the first available offsets are picked to minimize the data loss. +*/ +func (a *Client) ResumeConsumption(params *ResumeConsumptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewResumeConsumptionParams() + } + op := &runtime.ClientOperation{ + ID: "resumeConsumption", + Method: "POST", + PathPattern: "/tables/{tableName}/resumeConsumption", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ResumeConsumptionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +SetInstancePartitions creates update the instance partitions +*/ +func (a *Client) SetInstancePartitions(params *SetInstancePartitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetInstancePartitionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSetInstancePartitionsParams() + } + op := &runtime.ClientOperation{ + ID: "setInstancePartitions", + Method: "PUT", + PathPattern: "/tables/{tableName}/instancePartitions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SetInstancePartitionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*SetInstancePartitionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for setInstancePartitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +SetTimeBoundary sets hybrid table query time boundary based on offline segments metadata + +Set hybrid table query time boundary based on offline segments' metadata +*/ +func (a *Client) SetTimeBoundary(params *SetTimeBoundaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetTimeBoundaryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSetTimeBoundaryParams() + } + op := &runtime.ClientOperation{ + ID: "setTimeBoundary", + Method: "POST", + PathPattern: "/tables/{tableName}/timeBoundary", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SetTimeBoundaryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*SetTimeBoundaryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for setTimeBoundary: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateConfig updates the table configs provided by the table configs str json + +Update the TableConfigs provided by the tableConfigsStr json +*/ +func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateConfig", + Method: "PUT", + PathPattern: "/tableConfigs/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateIndexingConfig updates table indexing configuration +*/ +func (a *Client) UpdateIndexingConfig(params *UpdateIndexingConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIndexingConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateIndexingConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateIndexingConfig", + Method: "PUT", + PathPattern: "/tables/{tableName}/indexingConfigs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateIndexingConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateIndexingConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateIndexingConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateTableConfig updates table config for a table + +Updates table config for a table +*/ +func (a *Client) UpdateTableConfig(params *UpdateTableConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTableConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateTableConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateTableConfig", + Method: "PUT", + PathPattern: "/tables/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateTableConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateTableConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateTableConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateTableMetadata updates table metadata + +Updates table configuration +*/ +func (a *Client) UpdateTableMetadata(params *UpdateTableMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTableMetadataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateTableMetadataParams() + } + op := &runtime.ClientOperation{ + ID: "updateTableMetadata", + Method: "PUT", + PathPattern: "/tables/{tableName}/metadataConfigs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateTableMetadataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateTableMetadataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateTableMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ValidateConfig validates the table configs + +Validate the TableConfigs +*/ +func (a *Client) ValidateConfig(params *ValidateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateConfigParams() + } + op := &runtime.ClientOperation{ + ID: "validateConfig", + Method: "POST", + PathPattern: "/tableConfigs/validate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ValidateConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for validateConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ValidateTableAndSchema validates table config for a table along with specified schema + +Deprecated. Use /tableConfigs/validate instead.Validate given table config and schema. If specified schema is null, attempt to retrieve schema using the table name. This API returns the table config that matches the one you get from 'GET /tables/{tableName}'. This allows us to validate table config before apply. +*/ +func (a *Client) ValidateTableAndSchema(params *ValidateTableAndSchemaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateTableAndSchemaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateTableAndSchemaParams() + } + op := &runtime.ClientOperation{ + ID: "validateTableAndSchema", + Method: "POST", + PathPattern: "/tables/validateTableAndSchema", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateTableAndSchemaReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ValidateTableAndSchemaOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for validateTableAndSchema: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/table/update_config_parameters.go b/src/client/table/update_config_parameters.go new file mode 100644 index 0000000..e9daccf --- /dev/null +++ b/src/client/table/update_config_parameters.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateConfigParams creates a new UpdateConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateConfigParams() *UpdateConfigParams { + return &UpdateConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateConfigParamsWithTimeout creates a new UpdateConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateConfigParamsWithTimeout(timeout time.Duration) *UpdateConfigParams { + return &UpdateConfigParams{ + timeout: timeout, + } +} + +// NewUpdateConfigParamsWithContext creates a new UpdateConfigParams object +// with the ability to set a context for a request. +func NewUpdateConfigParamsWithContext(ctx context.Context) *UpdateConfigParams { + return &UpdateConfigParams{ + Context: ctx, + } +} + +// NewUpdateConfigParamsWithHTTPClient creates a new UpdateConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateConfigParamsWithHTTPClient(client *http.Client) *UpdateConfigParams { + return &UpdateConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateConfigParams contains all the parameters to send to the API endpoint + + for the update config operation. + + Typically these are written to a http.Request. +*/ +type UpdateConfigParams struct { + + // Body. + Body string + + /* Reload. + + Reload the table if the new schema is backward compatible + */ + Reload *bool + + /* TableName. + + TableConfigs name i.e. raw table name + */ + TableName string + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateConfigParams) WithDefaults() *UpdateConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateConfigParams) SetDefaults() { + var ( + reloadDefault = bool(false) + ) + + val := UpdateConfigParams{ + Reload: &reloadDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the update config params +func (o *UpdateConfigParams) WithTimeout(timeout time.Duration) *UpdateConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update config params +func (o *UpdateConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update config params +func (o *UpdateConfigParams) WithContext(ctx context.Context) *UpdateConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update config params +func (o *UpdateConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update config params +func (o *UpdateConfigParams) WithHTTPClient(client *http.Client) *UpdateConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update config params +func (o *UpdateConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update config params +func (o *UpdateConfigParams) WithBody(body string) *UpdateConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update config params +func (o *UpdateConfigParams) SetBody(body string) { + o.Body = body +} + +// WithReload adds the reload to the update config params +func (o *UpdateConfigParams) WithReload(reload *bool) *UpdateConfigParams { + o.SetReload(reload) + return o +} + +// SetReload adds the reload to the update config params +func (o *UpdateConfigParams) SetReload(reload *bool) { + o.Reload = reload +} + +// WithTableName adds the tableName to the update config params +func (o *UpdateConfigParams) WithTableName(tableName string) *UpdateConfigParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the update config params +func (o *UpdateConfigParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the update config params +func (o *UpdateConfigParams) WithValidationTypesToSkip(validationTypesToSkip *string) *UpdateConfigParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the update config params +func (o *UpdateConfigParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.Reload != nil { + + // query param reload + var qrReload bool + + if o.Reload != nil { + qrReload = *o.Reload + } + qReload := swag.FormatBool(qrReload) + if qReload != "" { + + if err := r.SetQueryParam("reload", qReload); err != nil { + return err + } + } + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/update_config_responses.go b/src/client/table/update_config_responses.go new file mode 100644 index 0000000..6ecc5da --- /dev/null +++ b/src/client/table/update_config_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// UpdateConfigReader is a Reader for the UpdateConfig structure. +type UpdateConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateConfigOK creates a UpdateConfigOK with default headers values +func NewUpdateConfigOK() *UpdateConfigOK { + return &UpdateConfigOK{} +} + +/* +UpdateConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type UpdateConfigOK struct { + Payload *models.ConfigSuccessResponse +} + +// IsSuccess returns true when this update config o k response has a 2xx status code +func (o *UpdateConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update config o k response has a 3xx status code +func (o *UpdateConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update config o k response has a 4xx status code +func (o *UpdateConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update config o k response has a 5xx status code +func (o *UpdateConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update config o k response a status code equal to that given +func (o *UpdateConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update config o k response +func (o *UpdateConfigOK) Code() int { + return 200 +} + +func (o *UpdateConfigOK) Error() string { + return fmt.Sprintf("[PUT /tableConfigs/{tableName}][%d] updateConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateConfigOK) String() string { + return fmt.Sprintf("[PUT /tableConfigs/{tableName}][%d] updateConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateConfigOK) GetPayload() *models.ConfigSuccessResponse { + return o.Payload +} + +func (o *UpdateConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigSuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/update_indexing_config_parameters.go b/src/client/table/update_indexing_config_parameters.go new file mode 100644 index 0000000..4243226 --- /dev/null +++ b/src/client/table/update_indexing_config_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateIndexingConfigParams creates a new UpdateIndexingConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIndexingConfigParams() *UpdateIndexingConfigParams { + return &UpdateIndexingConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIndexingConfigParamsWithTimeout creates a new UpdateIndexingConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateIndexingConfigParamsWithTimeout(timeout time.Duration) *UpdateIndexingConfigParams { + return &UpdateIndexingConfigParams{ + timeout: timeout, + } +} + +// NewUpdateIndexingConfigParamsWithContext creates a new UpdateIndexingConfigParams object +// with the ability to set a context for a request. +func NewUpdateIndexingConfigParamsWithContext(ctx context.Context) *UpdateIndexingConfigParams { + return &UpdateIndexingConfigParams{ + Context: ctx, + } +} + +// NewUpdateIndexingConfigParamsWithHTTPClient creates a new UpdateIndexingConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIndexingConfigParamsWithHTTPClient(client *http.Client) *UpdateIndexingConfigParams { + return &UpdateIndexingConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateIndexingConfigParams contains all the parameters to send to the API endpoint + + for the update indexing config operation. + + Typically these are written to a http.Request. +*/ +type UpdateIndexingConfigParams struct { + + // Body. + Body string + + /* TableName. + + Table name (without type) + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update indexing config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIndexingConfigParams) WithDefaults() *UpdateIndexingConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update indexing config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIndexingConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update indexing config params +func (o *UpdateIndexingConfigParams) WithTimeout(timeout time.Duration) *UpdateIndexingConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update indexing config params +func (o *UpdateIndexingConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update indexing config params +func (o *UpdateIndexingConfigParams) WithContext(ctx context.Context) *UpdateIndexingConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update indexing config params +func (o *UpdateIndexingConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update indexing config params +func (o *UpdateIndexingConfigParams) WithHTTPClient(client *http.Client) *UpdateIndexingConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update indexing config params +func (o *UpdateIndexingConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update indexing config params +func (o *UpdateIndexingConfigParams) WithBody(body string) *UpdateIndexingConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update indexing config params +func (o *UpdateIndexingConfigParams) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the update indexing config params +func (o *UpdateIndexingConfigParams) WithTableName(tableName string) *UpdateIndexingConfigParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the update indexing config params +func (o *UpdateIndexingConfigParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIndexingConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/update_indexing_config_responses.go b/src/client/table/update_indexing_config_responses.go new file mode 100644 index 0000000..9b3035e --- /dev/null +++ b/src/client/table/update_indexing_config_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateIndexingConfigReader is a Reader for the UpdateIndexingConfig structure. +type UpdateIndexingConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIndexingConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIndexingConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewUpdateIndexingConfigNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateIndexingConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIndexingConfigOK creates a UpdateIndexingConfigOK with default headers values +func NewUpdateIndexingConfigOK() *UpdateIndexingConfigOK { + return &UpdateIndexingConfigOK{} +} + +/* +UpdateIndexingConfigOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateIndexingConfigOK struct { +} + +// IsSuccess returns true when this update indexing config o k response has a 2xx status code +func (o *UpdateIndexingConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update indexing config o k response has a 3xx status code +func (o *UpdateIndexingConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update indexing config o k response has a 4xx status code +func (o *UpdateIndexingConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update indexing config o k response has a 5xx status code +func (o *UpdateIndexingConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update indexing config o k response a status code equal to that given +func (o *UpdateIndexingConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update indexing config o k response +func (o *UpdateIndexingConfigOK) Code() int { + return 200 +} + +func (o *UpdateIndexingConfigOK) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/indexingConfigs][%d] updateIndexingConfigOK ", 200) +} + +func (o *UpdateIndexingConfigOK) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/indexingConfigs][%d] updateIndexingConfigOK ", 200) +} + +func (o *UpdateIndexingConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateIndexingConfigNotFound creates a UpdateIndexingConfigNotFound with default headers values +func NewUpdateIndexingConfigNotFound() *UpdateIndexingConfigNotFound { + return &UpdateIndexingConfigNotFound{} +} + +/* +UpdateIndexingConfigNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type UpdateIndexingConfigNotFound struct { +} + +// IsSuccess returns true when this update indexing config not found response has a 2xx status code +func (o *UpdateIndexingConfigNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update indexing config not found response has a 3xx status code +func (o *UpdateIndexingConfigNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update indexing config not found response has a 4xx status code +func (o *UpdateIndexingConfigNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update indexing config not found response has a 5xx status code +func (o *UpdateIndexingConfigNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update indexing config not found response a status code equal to that given +func (o *UpdateIndexingConfigNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update indexing config not found response +func (o *UpdateIndexingConfigNotFound) Code() int { + return 404 +} + +func (o *UpdateIndexingConfigNotFound) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/indexingConfigs][%d] updateIndexingConfigNotFound ", 404) +} + +func (o *UpdateIndexingConfigNotFound) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/indexingConfigs][%d] updateIndexingConfigNotFound ", 404) +} + +func (o *UpdateIndexingConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateIndexingConfigInternalServerError creates a UpdateIndexingConfigInternalServerError with default headers values +func NewUpdateIndexingConfigInternalServerError() *UpdateIndexingConfigInternalServerError { + return &UpdateIndexingConfigInternalServerError{} +} + +/* +UpdateIndexingConfigInternalServerError describes a response with status code 500, with default header values. + +Server error updating configuration +*/ +type UpdateIndexingConfigInternalServerError struct { +} + +// IsSuccess returns true when this update indexing config internal server error response has a 2xx status code +func (o *UpdateIndexingConfigInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update indexing config internal server error response has a 3xx status code +func (o *UpdateIndexingConfigInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update indexing config internal server error response has a 4xx status code +func (o *UpdateIndexingConfigInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update indexing config internal server error response has a 5xx status code +func (o *UpdateIndexingConfigInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update indexing config internal server error response a status code equal to that given +func (o *UpdateIndexingConfigInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update indexing config internal server error response +func (o *UpdateIndexingConfigInternalServerError) Code() int { + return 500 +} + +func (o *UpdateIndexingConfigInternalServerError) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/indexingConfigs][%d] updateIndexingConfigInternalServerError ", 500) +} + +func (o *UpdateIndexingConfigInternalServerError) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/indexingConfigs][%d] updateIndexingConfigInternalServerError ", 500) +} + +func (o *UpdateIndexingConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/update_table_config_parameters.go b/src/client/table/update_table_config_parameters.go new file mode 100644 index 0000000..df626d4 --- /dev/null +++ b/src/client/table/update_table_config_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateTableConfigParams creates a new UpdateTableConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTableConfigParams() *UpdateTableConfigParams { + return &UpdateTableConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTableConfigParamsWithTimeout creates a new UpdateTableConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateTableConfigParamsWithTimeout(timeout time.Duration) *UpdateTableConfigParams { + return &UpdateTableConfigParams{ + timeout: timeout, + } +} + +// NewUpdateTableConfigParamsWithContext creates a new UpdateTableConfigParams object +// with the ability to set a context for a request. +func NewUpdateTableConfigParamsWithContext(ctx context.Context) *UpdateTableConfigParams { + return &UpdateTableConfigParams{ + Context: ctx, + } +} + +// NewUpdateTableConfigParamsWithHTTPClient creates a new UpdateTableConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTableConfigParamsWithHTTPClient(client *http.Client) *UpdateTableConfigParams { + return &UpdateTableConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateTableConfigParams contains all the parameters to send to the API endpoint + + for the update table config operation. + + Typically these are written to a http.Request. +*/ +type UpdateTableConfigParams struct { + + // Body. + Body string + + /* TableName. + + Name of the table to update + */ + TableName string + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update table config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTableConfigParams) WithDefaults() *UpdateTableConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update table config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTableConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update table config params +func (o *UpdateTableConfigParams) WithTimeout(timeout time.Duration) *UpdateTableConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update table config params +func (o *UpdateTableConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update table config params +func (o *UpdateTableConfigParams) WithContext(ctx context.Context) *UpdateTableConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update table config params +func (o *UpdateTableConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update table config params +func (o *UpdateTableConfigParams) WithHTTPClient(client *http.Client) *UpdateTableConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update table config params +func (o *UpdateTableConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update table config params +func (o *UpdateTableConfigParams) WithBody(body string) *UpdateTableConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update table config params +func (o *UpdateTableConfigParams) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the update table config params +func (o *UpdateTableConfigParams) WithTableName(tableName string) *UpdateTableConfigParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the update table config params +func (o *UpdateTableConfigParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the update table config params +func (o *UpdateTableConfigParams) WithValidationTypesToSkip(validationTypesToSkip *string) *UpdateTableConfigParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the update table config params +func (o *UpdateTableConfigParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTableConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/update_table_config_responses.go b/src/client/table/update_table_config_responses.go new file mode 100644 index 0000000..a9780d8 --- /dev/null +++ b/src/client/table/update_table_config_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// UpdateTableConfigReader is a Reader for the UpdateTableConfig structure. +type UpdateTableConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTableConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTableConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTableConfigOK creates a UpdateTableConfigOK with default headers values +func NewUpdateTableConfigOK() *UpdateTableConfigOK { + return &UpdateTableConfigOK{} +} + +/* +UpdateTableConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type UpdateTableConfigOK struct { + Payload *models.ConfigSuccessResponse +} + +// IsSuccess returns true when this update table config o k response has a 2xx status code +func (o *UpdateTableConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update table config o k response has a 3xx status code +func (o *UpdateTableConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update table config o k response has a 4xx status code +func (o *UpdateTableConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update table config o k response has a 5xx status code +func (o *UpdateTableConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update table config o k response a status code equal to that given +func (o *UpdateTableConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update table config o k response +func (o *UpdateTableConfigOK) Code() int { + return 200 +} + +func (o *UpdateTableConfigOK) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}][%d] updateTableConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateTableConfigOK) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}][%d] updateTableConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateTableConfigOK) GetPayload() *models.ConfigSuccessResponse { + return o.Payload +} + +func (o *UpdateTableConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigSuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/update_table_metadata_parameters.go b/src/client/table/update_table_metadata_parameters.go new file mode 100644 index 0000000..3517545 --- /dev/null +++ b/src/client/table/update_table_metadata_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateTableMetadataParams creates a new UpdateTableMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTableMetadataParams() *UpdateTableMetadataParams { + return &UpdateTableMetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTableMetadataParamsWithTimeout creates a new UpdateTableMetadataParams object +// with the ability to set a timeout on a request. +func NewUpdateTableMetadataParamsWithTimeout(timeout time.Duration) *UpdateTableMetadataParams { + return &UpdateTableMetadataParams{ + timeout: timeout, + } +} + +// NewUpdateTableMetadataParamsWithContext creates a new UpdateTableMetadataParams object +// with the ability to set a context for a request. +func NewUpdateTableMetadataParamsWithContext(ctx context.Context) *UpdateTableMetadataParams { + return &UpdateTableMetadataParams{ + Context: ctx, + } +} + +// NewUpdateTableMetadataParamsWithHTTPClient creates a new UpdateTableMetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTableMetadataParamsWithHTTPClient(client *http.Client) *UpdateTableMetadataParams { + return &UpdateTableMetadataParams{ + HTTPClient: client, + } +} + +/* +UpdateTableMetadataParams contains all the parameters to send to the API endpoint + + for the update table metadata operation. + + Typically these are written to a http.Request. +*/ +type UpdateTableMetadataParams struct { + + // Body. + Body string + + // TableName. + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update table metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTableMetadataParams) WithDefaults() *UpdateTableMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update table metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTableMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update table metadata params +func (o *UpdateTableMetadataParams) WithTimeout(timeout time.Duration) *UpdateTableMetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update table metadata params +func (o *UpdateTableMetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update table metadata params +func (o *UpdateTableMetadataParams) WithContext(ctx context.Context) *UpdateTableMetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update table metadata params +func (o *UpdateTableMetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update table metadata params +func (o *UpdateTableMetadataParams) WithHTTPClient(client *http.Client) *UpdateTableMetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update table metadata params +func (o *UpdateTableMetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update table metadata params +func (o *UpdateTableMetadataParams) WithBody(body string) *UpdateTableMetadataParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update table metadata params +func (o *UpdateTableMetadataParams) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the update table metadata params +func (o *UpdateTableMetadataParams) WithTableName(tableName string) *UpdateTableMetadataParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the update table metadata params +func (o *UpdateTableMetadataParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTableMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/update_table_metadata_responses.go b/src/client/table/update_table_metadata_responses.go new file mode 100644 index 0000000..0985754 --- /dev/null +++ b/src/client/table/update_table_metadata_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTableMetadataReader is a Reader for the UpdateTableMetadata structure. +type UpdateTableMetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTableMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTableMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewUpdateTableMetadataNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateTableMetadataInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTableMetadataOK creates a UpdateTableMetadataOK with default headers values +func NewUpdateTableMetadataOK() *UpdateTableMetadataOK { + return &UpdateTableMetadataOK{} +} + +/* +UpdateTableMetadataOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateTableMetadataOK struct { +} + +// IsSuccess returns true when this update table metadata o k response has a 2xx status code +func (o *UpdateTableMetadataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update table metadata o k response has a 3xx status code +func (o *UpdateTableMetadataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update table metadata o k response has a 4xx status code +func (o *UpdateTableMetadataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update table metadata o k response has a 5xx status code +func (o *UpdateTableMetadataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update table metadata o k response a status code equal to that given +func (o *UpdateTableMetadataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update table metadata o k response +func (o *UpdateTableMetadataOK) Code() int { + return 200 +} + +func (o *UpdateTableMetadataOK) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/metadataConfigs][%d] updateTableMetadataOK ", 200) +} + +func (o *UpdateTableMetadataOK) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/metadataConfigs][%d] updateTableMetadataOK ", 200) +} + +func (o *UpdateTableMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateTableMetadataNotFound creates a UpdateTableMetadataNotFound with default headers values +func NewUpdateTableMetadataNotFound() *UpdateTableMetadataNotFound { + return &UpdateTableMetadataNotFound{} +} + +/* +UpdateTableMetadataNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type UpdateTableMetadataNotFound struct { +} + +// IsSuccess returns true when this update table metadata not found response has a 2xx status code +func (o *UpdateTableMetadataNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update table metadata not found response has a 3xx status code +func (o *UpdateTableMetadataNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update table metadata not found response has a 4xx status code +func (o *UpdateTableMetadataNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update table metadata not found response has a 5xx status code +func (o *UpdateTableMetadataNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update table metadata not found response a status code equal to that given +func (o *UpdateTableMetadataNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update table metadata not found response +func (o *UpdateTableMetadataNotFound) Code() int { + return 404 +} + +func (o *UpdateTableMetadataNotFound) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/metadataConfigs][%d] updateTableMetadataNotFound ", 404) +} + +func (o *UpdateTableMetadataNotFound) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/metadataConfigs][%d] updateTableMetadataNotFound ", 404) +} + +func (o *UpdateTableMetadataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateTableMetadataInternalServerError creates a UpdateTableMetadataInternalServerError with default headers values +func NewUpdateTableMetadataInternalServerError() *UpdateTableMetadataInternalServerError { + return &UpdateTableMetadataInternalServerError{} +} + +/* +UpdateTableMetadataInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type UpdateTableMetadataInternalServerError struct { +} + +// IsSuccess returns true when this update table metadata internal server error response has a 2xx status code +func (o *UpdateTableMetadataInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update table metadata internal server error response has a 3xx status code +func (o *UpdateTableMetadataInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update table metadata internal server error response has a 4xx status code +func (o *UpdateTableMetadataInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update table metadata internal server error response has a 5xx status code +func (o *UpdateTableMetadataInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update table metadata internal server error response a status code equal to that given +func (o *UpdateTableMetadataInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update table metadata internal server error response +func (o *UpdateTableMetadataInternalServerError) Code() int { + return 500 +} + +func (o *UpdateTableMetadataInternalServerError) Error() string { + return fmt.Sprintf("[PUT /tables/{tableName}/metadataConfigs][%d] updateTableMetadataInternalServerError ", 500) +} + +func (o *UpdateTableMetadataInternalServerError) String() string { + return fmt.Sprintf("[PUT /tables/{tableName}/metadataConfigs][%d] updateTableMetadataInternalServerError ", 500) +} + +func (o *UpdateTableMetadataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/table/validate_config_parameters.go b/src/client/table/validate_config_parameters.go new file mode 100644 index 0000000..db24ff0 --- /dev/null +++ b/src/client/table/validate_config_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewValidateConfigParams creates a new ValidateConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewValidateConfigParams() *ValidateConfigParams { + return &ValidateConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateConfigParamsWithTimeout creates a new ValidateConfigParams object +// with the ability to set a timeout on a request. +func NewValidateConfigParamsWithTimeout(timeout time.Duration) *ValidateConfigParams { + return &ValidateConfigParams{ + timeout: timeout, + } +} + +// NewValidateConfigParamsWithContext creates a new ValidateConfigParams object +// with the ability to set a context for a request. +func NewValidateConfigParamsWithContext(ctx context.Context) *ValidateConfigParams { + return &ValidateConfigParams{ + Context: ctx, + } +} + +// NewValidateConfigParamsWithHTTPClient creates a new ValidateConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateConfigParamsWithHTTPClient(client *http.Client) *ValidateConfigParams { + return &ValidateConfigParams{ + HTTPClient: client, + } +} + +/* +ValidateConfigParams contains all the parameters to send to the API endpoint + + for the validate config operation. + + Typically these are written to a http.Request. +*/ +type ValidateConfigParams struct { + + // Body. + Body string + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateConfigParams) WithDefaults() *ValidateConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate config params +func (o *ValidateConfigParams) WithTimeout(timeout time.Duration) *ValidateConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate config params +func (o *ValidateConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate config params +func (o *ValidateConfigParams) WithContext(ctx context.Context) *ValidateConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate config params +func (o *ValidateConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate config params +func (o *ValidateConfigParams) WithHTTPClient(client *http.Client) *ValidateConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate config params +func (o *ValidateConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the validate config params +func (o *ValidateConfigParams) WithBody(body string) *ValidateConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the validate config params +func (o *ValidateConfigParams) SetBody(body string) { + o.Body = body +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the validate config params +func (o *ValidateConfigParams) WithValidationTypesToSkip(validationTypesToSkip *string) *ValidateConfigParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the validate config params +func (o *ValidateConfigParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/validate_config_responses.go b/src/client/table/validate_config_responses.go new file mode 100644 index 0000000..0c84547 --- /dev/null +++ b/src/client/table/validate_config_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ValidateConfigReader is a Reader for the ValidateConfig structure. +type ValidateConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewValidateConfigOK creates a ValidateConfigOK with default headers values +func NewValidateConfigOK() *ValidateConfigOK { + return &ValidateConfigOK{} +} + +/* +ValidateConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ValidateConfigOK struct { + Payload string +} + +// IsSuccess returns true when this validate config o k response has a 2xx status code +func (o *ValidateConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate config o k response has a 3xx status code +func (o *ValidateConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate config o k response has a 4xx status code +func (o *ValidateConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate config o k response has a 5xx status code +func (o *ValidateConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate config o k response a status code equal to that given +func (o *ValidateConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate config o k response +func (o *ValidateConfigOK) Code() int { + return 200 +} + +func (o *ValidateConfigOK) Error() string { + return fmt.Sprintf("[POST /tableConfigs/validate][%d] validateConfigOK %+v", 200, o.Payload) +} + +func (o *ValidateConfigOK) String() string { + return fmt.Sprintf("[POST /tableConfigs/validate][%d] validateConfigOK %+v", 200, o.Payload) +} + +func (o *ValidateConfigOK) GetPayload() string { + return o.Payload +} + +func (o *ValidateConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/table/validate_table_and_schema_parameters.go b/src/client/table/validate_table_and_schema_parameters.go new file mode 100644 index 0000000..32270a8 --- /dev/null +++ b/src/client/table/validate_table_and_schema_parameters.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewValidateTableAndSchemaParams creates a new ValidateTableAndSchemaParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewValidateTableAndSchemaParams() *ValidateTableAndSchemaParams { + return &ValidateTableAndSchemaParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateTableAndSchemaParamsWithTimeout creates a new ValidateTableAndSchemaParams object +// with the ability to set a timeout on a request. +func NewValidateTableAndSchemaParamsWithTimeout(timeout time.Duration) *ValidateTableAndSchemaParams { + return &ValidateTableAndSchemaParams{ + timeout: timeout, + } +} + +// NewValidateTableAndSchemaParamsWithContext creates a new ValidateTableAndSchemaParams object +// with the ability to set a context for a request. +func NewValidateTableAndSchemaParamsWithContext(ctx context.Context) *ValidateTableAndSchemaParams { + return &ValidateTableAndSchemaParams{ + Context: ctx, + } +} + +// NewValidateTableAndSchemaParamsWithHTTPClient creates a new ValidateTableAndSchemaParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateTableAndSchemaParamsWithHTTPClient(client *http.Client) *ValidateTableAndSchemaParams { + return &ValidateTableAndSchemaParams{ + HTTPClient: client, + } +} + +/* +ValidateTableAndSchemaParams contains all the parameters to send to the API endpoint + + for the validate table and schema operation. + + Typically these are written to a http.Request. +*/ +type ValidateTableAndSchemaParams struct { + + // Body. + Body *models.TableAndSchemaConfig + + /* ValidationTypesToSkip. + + comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT) + */ + ValidationTypesToSkip *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate table and schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateTableAndSchemaParams) WithDefaults() *ValidateTableAndSchemaParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate table and schema params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateTableAndSchemaParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate table and schema params +func (o *ValidateTableAndSchemaParams) WithTimeout(timeout time.Duration) *ValidateTableAndSchemaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate table and schema params +func (o *ValidateTableAndSchemaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate table and schema params +func (o *ValidateTableAndSchemaParams) WithContext(ctx context.Context) *ValidateTableAndSchemaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate table and schema params +func (o *ValidateTableAndSchemaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate table and schema params +func (o *ValidateTableAndSchemaParams) WithHTTPClient(client *http.Client) *ValidateTableAndSchemaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate table and schema params +func (o *ValidateTableAndSchemaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the validate table and schema params +func (o *ValidateTableAndSchemaParams) WithBody(body *models.TableAndSchemaConfig) *ValidateTableAndSchemaParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the validate table and schema params +func (o *ValidateTableAndSchemaParams) SetBody(body *models.TableAndSchemaConfig) { + o.Body = body +} + +// WithValidationTypesToSkip adds the validationTypesToSkip to the validate table and schema params +func (o *ValidateTableAndSchemaParams) WithValidationTypesToSkip(validationTypesToSkip *string) *ValidateTableAndSchemaParams { + o.SetValidationTypesToSkip(validationTypesToSkip) + return o +} + +// SetValidationTypesToSkip adds the validationTypesToSkip to the validate table and schema params +func (o *ValidateTableAndSchemaParams) SetValidationTypesToSkip(validationTypesToSkip *string) { + o.ValidationTypesToSkip = validationTypesToSkip +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateTableAndSchemaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.ValidationTypesToSkip != nil { + + // query param validationTypesToSkip + var qrValidationTypesToSkip string + + if o.ValidationTypesToSkip != nil { + qrValidationTypesToSkip = *o.ValidationTypesToSkip + } + qValidationTypesToSkip := qrValidationTypesToSkip + if qValidationTypesToSkip != "" { + + if err := r.SetQueryParam("validationTypesToSkip", qValidationTypesToSkip); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/table/validate_table_and_schema_responses.go b/src/client/table/validate_table_and_schema_responses.go new file mode 100644 index 0000000..a6ef73e --- /dev/null +++ b/src/client/table/validate_table_and_schema_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package table + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ValidateTableAndSchemaReader is a Reader for the ValidateTableAndSchema structure. +type ValidateTableAndSchemaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateTableAndSchemaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateTableAndSchemaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewValidateTableAndSchemaOK creates a ValidateTableAndSchemaOK with default headers values +func NewValidateTableAndSchemaOK() *ValidateTableAndSchemaOK { + return &ValidateTableAndSchemaOK{} +} + +/* +ValidateTableAndSchemaOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ValidateTableAndSchemaOK struct { + Payload string +} + +// IsSuccess returns true when this validate table and schema o k response has a 2xx status code +func (o *ValidateTableAndSchemaOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate table and schema o k response has a 3xx status code +func (o *ValidateTableAndSchemaOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate table and schema o k response has a 4xx status code +func (o *ValidateTableAndSchemaOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate table and schema o k response has a 5xx status code +func (o *ValidateTableAndSchemaOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate table and schema o k response a status code equal to that given +func (o *ValidateTableAndSchemaOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate table and schema o k response +func (o *ValidateTableAndSchemaOK) Code() int { + return 200 +} + +func (o *ValidateTableAndSchemaOK) Error() string { + return fmt.Sprintf("[POST /tables/validateTableAndSchema][%d] validateTableAndSchemaOK %+v", 200, o.Payload) +} + +func (o *ValidateTableAndSchemaOK) String() string { + return fmt.Sprintf("[POST /tables/validateTableAndSchema][%d] validateTableAndSchemaOK %+v", 200, o.Payload) +} + +func (o *ValidateTableAndSchemaOK) GetPayload() string { + return o.Payload +} + +func (o *ValidateTableAndSchemaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/clean_up_tasks_deprecated_parameters.go b/src/client/task/clean_up_tasks_deprecated_parameters.go new file mode 100644 index 0000000..b62e6ac --- /dev/null +++ b/src/client/task/clean_up_tasks_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCleanUpTasksDeprecatedParams creates a new CleanUpTasksDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCleanUpTasksDeprecatedParams() *CleanUpTasksDeprecatedParams { + return &CleanUpTasksDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCleanUpTasksDeprecatedParamsWithTimeout creates a new CleanUpTasksDeprecatedParams object +// with the ability to set a timeout on a request. +func NewCleanUpTasksDeprecatedParamsWithTimeout(timeout time.Duration) *CleanUpTasksDeprecatedParams { + return &CleanUpTasksDeprecatedParams{ + timeout: timeout, + } +} + +// NewCleanUpTasksDeprecatedParamsWithContext creates a new CleanUpTasksDeprecatedParams object +// with the ability to set a context for a request. +func NewCleanUpTasksDeprecatedParamsWithContext(ctx context.Context) *CleanUpTasksDeprecatedParams { + return &CleanUpTasksDeprecatedParams{ + Context: ctx, + } +} + +// NewCleanUpTasksDeprecatedParamsWithHTTPClient creates a new CleanUpTasksDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewCleanUpTasksDeprecatedParamsWithHTTPClient(client *http.Client) *CleanUpTasksDeprecatedParams { + return &CleanUpTasksDeprecatedParams{ + HTTPClient: client, + } +} + +/* +CleanUpTasksDeprecatedParams contains all the parameters to send to the API endpoint + + for the clean up tasks deprecated operation. + + Typically these are written to a http.Request. +*/ +type CleanUpTasksDeprecatedParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the clean up tasks deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CleanUpTasksDeprecatedParams) WithDefaults() *CleanUpTasksDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the clean up tasks deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CleanUpTasksDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) WithTimeout(timeout time.Duration) *CleanUpTasksDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) WithContext(ctx context.Context) *CleanUpTasksDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) WithHTTPClient(client *http.Client) *CleanUpTasksDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) WithTaskType(taskType string) *CleanUpTasksDeprecatedParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the clean up tasks deprecated params +func (o *CleanUpTasksDeprecatedParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *CleanUpTasksDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/clean_up_tasks_deprecated_responses.go b/src/client/task/clean_up_tasks_deprecated_responses.go new file mode 100644 index 0000000..d555f3b --- /dev/null +++ b/src/client/task/clean_up_tasks_deprecated_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// CleanUpTasksDeprecatedReader is a Reader for the CleanUpTasksDeprecated structure. +type CleanUpTasksDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CleanUpTasksDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCleanUpTasksDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCleanUpTasksDeprecatedOK creates a CleanUpTasksDeprecatedOK with default headers values +func NewCleanUpTasksDeprecatedOK() *CleanUpTasksDeprecatedOK { + return &CleanUpTasksDeprecatedOK{} +} + +/* +CleanUpTasksDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type CleanUpTasksDeprecatedOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this clean up tasks deprecated o k response has a 2xx status code +func (o *CleanUpTasksDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this clean up tasks deprecated o k response has a 3xx status code +func (o *CleanUpTasksDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this clean up tasks deprecated o k response has a 4xx status code +func (o *CleanUpTasksDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this clean up tasks deprecated o k response has a 5xx status code +func (o *CleanUpTasksDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this clean up tasks deprecated o k response a status code equal to that given +func (o *CleanUpTasksDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the clean up tasks deprecated o k response +func (o *CleanUpTasksDeprecatedOK) Code() int { + return 200 +} + +func (o *CleanUpTasksDeprecatedOK) Error() string { + return fmt.Sprintf("[PUT /tasks/cleanuptasks/{taskType}][%d] cleanUpTasksDeprecatedOK %+v", 200, o.Payload) +} + +func (o *CleanUpTasksDeprecatedOK) String() string { + return fmt.Sprintf("[PUT /tasks/cleanuptasks/{taskType}][%d] cleanUpTasksDeprecatedOK %+v", 200, o.Payload) +} + +func (o *CleanUpTasksDeprecatedOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *CleanUpTasksDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/clean_up_tasks_parameters.go b/src/client/task/clean_up_tasks_parameters.go new file mode 100644 index 0000000..fe2558b --- /dev/null +++ b/src/client/task/clean_up_tasks_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCleanUpTasksParams creates a new CleanUpTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCleanUpTasksParams() *CleanUpTasksParams { + return &CleanUpTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCleanUpTasksParamsWithTimeout creates a new CleanUpTasksParams object +// with the ability to set a timeout on a request. +func NewCleanUpTasksParamsWithTimeout(timeout time.Duration) *CleanUpTasksParams { + return &CleanUpTasksParams{ + timeout: timeout, + } +} + +// NewCleanUpTasksParamsWithContext creates a new CleanUpTasksParams object +// with the ability to set a context for a request. +func NewCleanUpTasksParamsWithContext(ctx context.Context) *CleanUpTasksParams { + return &CleanUpTasksParams{ + Context: ctx, + } +} + +// NewCleanUpTasksParamsWithHTTPClient creates a new CleanUpTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewCleanUpTasksParamsWithHTTPClient(client *http.Client) *CleanUpTasksParams { + return &CleanUpTasksParams{ + HTTPClient: client, + } +} + +/* +CleanUpTasksParams contains all the parameters to send to the API endpoint + + for the clean up tasks operation. + + Typically these are written to a http.Request. +*/ +type CleanUpTasksParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the clean up tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CleanUpTasksParams) WithDefaults() *CleanUpTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the clean up tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CleanUpTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the clean up tasks params +func (o *CleanUpTasksParams) WithTimeout(timeout time.Duration) *CleanUpTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the clean up tasks params +func (o *CleanUpTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the clean up tasks params +func (o *CleanUpTasksParams) WithContext(ctx context.Context) *CleanUpTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the clean up tasks params +func (o *CleanUpTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the clean up tasks params +func (o *CleanUpTasksParams) WithHTTPClient(client *http.Client) *CleanUpTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the clean up tasks params +func (o *CleanUpTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the clean up tasks params +func (o *CleanUpTasksParams) WithTaskType(taskType string) *CleanUpTasksParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the clean up tasks params +func (o *CleanUpTasksParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *CleanUpTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/clean_up_tasks_responses.go b/src/client/task/clean_up_tasks_responses.go new file mode 100644 index 0000000..5ba20e2 --- /dev/null +++ b/src/client/task/clean_up_tasks_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// CleanUpTasksReader is a Reader for the CleanUpTasks structure. +type CleanUpTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CleanUpTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCleanUpTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCleanUpTasksOK creates a CleanUpTasksOK with default headers values +func NewCleanUpTasksOK() *CleanUpTasksOK { + return &CleanUpTasksOK{} +} + +/* +CleanUpTasksOK describes a response with status code 200, with default header values. + +successful operation +*/ +type CleanUpTasksOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this clean up tasks o k response has a 2xx status code +func (o *CleanUpTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this clean up tasks o k response has a 3xx status code +func (o *CleanUpTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this clean up tasks o k response has a 4xx status code +func (o *CleanUpTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this clean up tasks o k response has a 5xx status code +func (o *CleanUpTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this clean up tasks o k response a status code equal to that given +func (o *CleanUpTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the clean up tasks o k response +func (o *CleanUpTasksOK) Code() int { + return 200 +} + +func (o *CleanUpTasksOK) Error() string { + return fmt.Sprintf("[PUT /tasks/{taskType}/cleanup][%d] cleanUpTasksOK %+v", 200, o.Payload) +} + +func (o *CleanUpTasksOK) String() string { + return fmt.Sprintf("[PUT /tasks/{taskType}/cleanup][%d] cleanUpTasksOK %+v", 200, o.Payload) +} + +func (o *CleanUpTasksOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *CleanUpTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/delete_task_metadata_by_table_parameters.go b/src/client/task/delete_task_metadata_by_table_parameters.go new file mode 100644 index 0000000..7bb40c2 --- /dev/null +++ b/src/client/task/delete_task_metadata_by_table_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTaskMetadataByTableParams creates a new DeleteTaskMetadataByTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTaskMetadataByTableParams() *DeleteTaskMetadataByTableParams { + return &DeleteTaskMetadataByTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTaskMetadataByTableParamsWithTimeout creates a new DeleteTaskMetadataByTableParams object +// with the ability to set a timeout on a request. +func NewDeleteTaskMetadataByTableParamsWithTimeout(timeout time.Duration) *DeleteTaskMetadataByTableParams { + return &DeleteTaskMetadataByTableParams{ + timeout: timeout, + } +} + +// NewDeleteTaskMetadataByTableParamsWithContext creates a new DeleteTaskMetadataByTableParams object +// with the ability to set a context for a request. +func NewDeleteTaskMetadataByTableParamsWithContext(ctx context.Context) *DeleteTaskMetadataByTableParams { + return &DeleteTaskMetadataByTableParams{ + Context: ctx, + } +} + +// NewDeleteTaskMetadataByTableParamsWithHTTPClient creates a new DeleteTaskMetadataByTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTaskMetadataByTableParamsWithHTTPClient(client *http.Client) *DeleteTaskMetadataByTableParams { + return &DeleteTaskMetadataByTableParams{ + HTTPClient: client, + } +} + +/* +DeleteTaskMetadataByTableParams contains all the parameters to send to the API endpoint + + for the delete task metadata by table operation. + + Typically these are written to a http.Request. +*/ +type DeleteTaskMetadataByTableParams struct { + + /* TableNameWithType. + + Table name with type + */ + TableNameWithType string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete task metadata by table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskMetadataByTableParams) WithDefaults() *DeleteTaskMetadataByTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete task metadata by table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskMetadataByTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) WithTimeout(timeout time.Duration) *DeleteTaskMetadataByTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) WithContext(ctx context.Context) *DeleteTaskMetadataByTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) WithHTTPClient(client *http.Client) *DeleteTaskMetadataByTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableNameWithType adds the tableNameWithType to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) WithTableNameWithType(tableNameWithType string) *DeleteTaskMetadataByTableParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTaskType adds the taskType to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) WithTaskType(taskType string) *DeleteTaskMetadataByTableParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the delete task metadata by table params +func (o *DeleteTaskMetadataByTableParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTaskMetadataByTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/delete_task_metadata_by_table_responses.go b/src/client/task/delete_task_metadata_by_table_responses.go new file mode 100644 index 0000000..77ee03f --- /dev/null +++ b/src/client/task/delete_task_metadata_by_table_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteTaskMetadataByTableReader is a Reader for the DeleteTaskMetadataByTable structure. +type DeleteTaskMetadataByTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTaskMetadataByTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTaskMetadataByTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTaskMetadataByTableOK creates a DeleteTaskMetadataByTableOK with default headers values +func NewDeleteTaskMetadataByTableOK() *DeleteTaskMetadataByTableOK { + return &DeleteTaskMetadataByTableOK{} +} + +/* +DeleteTaskMetadataByTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteTaskMetadataByTableOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete task metadata by table o k response has a 2xx status code +func (o *DeleteTaskMetadataByTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete task metadata by table o k response has a 3xx status code +func (o *DeleteTaskMetadataByTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete task metadata by table o k response has a 4xx status code +func (o *DeleteTaskMetadataByTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete task metadata by table o k response has a 5xx status code +func (o *DeleteTaskMetadataByTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete task metadata by table o k response a status code equal to that given +func (o *DeleteTaskMetadataByTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete task metadata by table o k response +func (o *DeleteTaskMetadataByTableOK) Code() int { + return 200 +} + +func (o *DeleteTaskMetadataByTableOK) Error() string { + return fmt.Sprintf("[DELETE /tasks/{taskType}/{tableNameWithType}/metadata][%d] deleteTaskMetadataByTableOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskMetadataByTableOK) String() string { + return fmt.Sprintf("[DELETE /tasks/{taskType}/{tableNameWithType}/metadata][%d] deleteTaskMetadataByTableOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskMetadataByTableOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteTaskMetadataByTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/delete_task_parameters.go b/src/client/task/delete_task_parameters.go new file mode 100644 index 0000000..ec2bf1b --- /dev/null +++ b/src/client/task/delete_task_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteTaskParams creates a new DeleteTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTaskParams() *DeleteTaskParams { + return &DeleteTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTaskParamsWithTimeout creates a new DeleteTaskParams object +// with the ability to set a timeout on a request. +func NewDeleteTaskParamsWithTimeout(timeout time.Duration) *DeleteTaskParams { + return &DeleteTaskParams{ + timeout: timeout, + } +} + +// NewDeleteTaskParamsWithContext creates a new DeleteTaskParams object +// with the ability to set a context for a request. +func NewDeleteTaskParamsWithContext(ctx context.Context) *DeleteTaskParams { + return &DeleteTaskParams{ + Context: ctx, + } +} + +// NewDeleteTaskParamsWithHTTPClient creates a new DeleteTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTaskParamsWithHTTPClient(client *http.Client) *DeleteTaskParams { + return &DeleteTaskParams{ + HTTPClient: client, + } +} + +/* +DeleteTaskParams contains all the parameters to send to the API endpoint + + for the delete task operation. + + Typically these are written to a http.Request. +*/ +type DeleteTaskParams struct { + + /* ForceDelete. + + Whether to force deleting the task (expert only option, enable with cautious + */ + ForceDelete *bool + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskParams) WithDefaults() *DeleteTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskParams) SetDefaults() { + var ( + forceDeleteDefault = bool(false) + ) + + val := DeleteTaskParams{ + ForceDelete: &forceDeleteDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the delete task params +func (o *DeleteTaskParams) WithTimeout(timeout time.Duration) *DeleteTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete task params +func (o *DeleteTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete task params +func (o *DeleteTaskParams) WithContext(ctx context.Context) *DeleteTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete task params +func (o *DeleteTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete task params +func (o *DeleteTaskParams) WithHTTPClient(client *http.Client) *DeleteTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete task params +func (o *DeleteTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForceDelete adds the forceDelete to the delete task params +func (o *DeleteTaskParams) WithForceDelete(forceDelete *bool) *DeleteTaskParams { + o.SetForceDelete(forceDelete) + return o +} + +// SetForceDelete adds the forceDelete to the delete task params +func (o *DeleteTaskParams) SetForceDelete(forceDelete *bool) { + o.ForceDelete = forceDelete +} + +// WithTaskName adds the taskName to the delete task params +func (o *DeleteTaskParams) WithTaskName(taskName string) *DeleteTaskParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the delete task params +func (o *DeleteTaskParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForceDelete != nil { + + // query param forceDelete + var qrForceDelete bool + + if o.ForceDelete != nil { + qrForceDelete = *o.ForceDelete + } + qForceDelete := swag.FormatBool(qrForceDelete) + if qForceDelete != "" { + + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { + return err + } + } + } + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/delete_task_queue_parameters.go b/src/client/task/delete_task_queue_parameters.go new file mode 100644 index 0000000..6b1d4f8 --- /dev/null +++ b/src/client/task/delete_task_queue_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteTaskQueueParams creates a new DeleteTaskQueueParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTaskQueueParams() *DeleteTaskQueueParams { + return &DeleteTaskQueueParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTaskQueueParamsWithTimeout creates a new DeleteTaskQueueParams object +// with the ability to set a timeout on a request. +func NewDeleteTaskQueueParamsWithTimeout(timeout time.Duration) *DeleteTaskQueueParams { + return &DeleteTaskQueueParams{ + timeout: timeout, + } +} + +// NewDeleteTaskQueueParamsWithContext creates a new DeleteTaskQueueParams object +// with the ability to set a context for a request. +func NewDeleteTaskQueueParamsWithContext(ctx context.Context) *DeleteTaskQueueParams { + return &DeleteTaskQueueParams{ + Context: ctx, + } +} + +// NewDeleteTaskQueueParamsWithHTTPClient creates a new DeleteTaskQueueParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTaskQueueParamsWithHTTPClient(client *http.Client) *DeleteTaskQueueParams { + return &DeleteTaskQueueParams{ + HTTPClient: client, + } +} + +/* +DeleteTaskQueueParams contains all the parameters to send to the API endpoint + + for the delete task queue operation. + + Typically these are written to a http.Request. +*/ +type DeleteTaskQueueParams struct { + + /* ForceDelete. + + Whether to force delete the task queue (expert only option, enable with cautious + */ + ForceDelete *bool + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete task queue params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskQueueParams) WithDefaults() *DeleteTaskQueueParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete task queue params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskQueueParams) SetDefaults() { + var ( + forceDeleteDefault = bool(false) + ) + + val := DeleteTaskQueueParams{ + ForceDelete: &forceDeleteDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the delete task queue params +func (o *DeleteTaskQueueParams) WithTimeout(timeout time.Duration) *DeleteTaskQueueParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete task queue params +func (o *DeleteTaskQueueParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete task queue params +func (o *DeleteTaskQueueParams) WithContext(ctx context.Context) *DeleteTaskQueueParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete task queue params +func (o *DeleteTaskQueueParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete task queue params +func (o *DeleteTaskQueueParams) WithHTTPClient(client *http.Client) *DeleteTaskQueueParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete task queue params +func (o *DeleteTaskQueueParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForceDelete adds the forceDelete to the delete task queue params +func (o *DeleteTaskQueueParams) WithForceDelete(forceDelete *bool) *DeleteTaskQueueParams { + o.SetForceDelete(forceDelete) + return o +} + +// SetForceDelete adds the forceDelete to the delete task queue params +func (o *DeleteTaskQueueParams) SetForceDelete(forceDelete *bool) { + o.ForceDelete = forceDelete +} + +// WithTaskType adds the taskType to the delete task queue params +func (o *DeleteTaskQueueParams) WithTaskType(taskType string) *DeleteTaskQueueParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the delete task queue params +func (o *DeleteTaskQueueParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTaskQueueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForceDelete != nil { + + // query param forceDelete + var qrForceDelete bool + + if o.ForceDelete != nil { + qrForceDelete = *o.ForceDelete + } + qForceDelete := swag.FormatBool(qrForceDelete) + if qForceDelete != "" { + + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { + return err + } + } + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/delete_task_queue_responses.go b/src/client/task/delete_task_queue_responses.go new file mode 100644 index 0000000..bea6d33 --- /dev/null +++ b/src/client/task/delete_task_queue_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteTaskQueueReader is a Reader for the DeleteTaskQueue structure. +type DeleteTaskQueueReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTaskQueueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTaskQueueOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTaskQueueOK creates a DeleteTaskQueueOK with default headers values +func NewDeleteTaskQueueOK() *DeleteTaskQueueOK { + return &DeleteTaskQueueOK{} +} + +/* +DeleteTaskQueueOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteTaskQueueOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete task queue o k response has a 2xx status code +func (o *DeleteTaskQueueOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete task queue o k response has a 3xx status code +func (o *DeleteTaskQueueOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete task queue o k response has a 4xx status code +func (o *DeleteTaskQueueOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete task queue o k response has a 5xx status code +func (o *DeleteTaskQueueOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete task queue o k response a status code equal to that given +func (o *DeleteTaskQueueOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete task queue o k response +func (o *DeleteTaskQueueOK) Code() int { + return 200 +} + +func (o *DeleteTaskQueueOK) Error() string { + return fmt.Sprintf("[DELETE /tasks/taskqueue/{taskType}][%d] deleteTaskQueueOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskQueueOK) String() string { + return fmt.Sprintf("[DELETE /tasks/taskqueue/{taskType}][%d] deleteTaskQueueOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskQueueOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteTaskQueueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/delete_task_responses.go b/src/client/task/delete_task_responses.go new file mode 100644 index 0000000..27e0d1d --- /dev/null +++ b/src/client/task/delete_task_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteTaskReader is a Reader for the DeleteTask structure. +type DeleteTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTaskOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTaskOK creates a DeleteTaskOK with default headers values +func NewDeleteTaskOK() *DeleteTaskOK { + return &DeleteTaskOK{} +} + +/* +DeleteTaskOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteTaskOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete task o k response has a 2xx status code +func (o *DeleteTaskOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete task o k response has a 3xx status code +func (o *DeleteTaskOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete task o k response has a 4xx status code +func (o *DeleteTaskOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete task o k response has a 5xx status code +func (o *DeleteTaskOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete task o k response a status code equal to that given +func (o *DeleteTaskOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete task o k response +func (o *DeleteTaskOK) Code() int { + return 200 +} + +func (o *DeleteTaskOK) Error() string { + return fmt.Sprintf("[DELETE /tasks/task/{taskName}][%d] deleteTaskOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskOK) String() string { + return fmt.Sprintf("[DELETE /tasks/task/{taskName}][%d] deleteTaskOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteTaskOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/delete_tasks_parameters.go b/src/client/task/delete_tasks_parameters.go new file mode 100644 index 0000000..5b6de40 --- /dev/null +++ b/src/client/task/delete_tasks_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteTasksParams creates a new DeleteTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTasksParams() *DeleteTasksParams { + return &DeleteTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTasksParamsWithTimeout creates a new DeleteTasksParams object +// with the ability to set a timeout on a request. +func NewDeleteTasksParamsWithTimeout(timeout time.Duration) *DeleteTasksParams { + return &DeleteTasksParams{ + timeout: timeout, + } +} + +// NewDeleteTasksParamsWithContext creates a new DeleteTasksParams object +// with the ability to set a context for a request. +func NewDeleteTasksParamsWithContext(ctx context.Context) *DeleteTasksParams { + return &DeleteTasksParams{ + Context: ctx, + } +} + +// NewDeleteTasksParamsWithHTTPClient creates a new DeleteTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTasksParamsWithHTTPClient(client *http.Client) *DeleteTasksParams { + return &DeleteTasksParams{ + HTTPClient: client, + } +} + +/* +DeleteTasksParams contains all the parameters to send to the API endpoint + + for the delete tasks operation. + + Typically these are written to a http.Request. +*/ +type DeleteTasksParams struct { + + /* ForceDelete. + + Whether to force deleting the tasks (expert only option, enable with cautious + */ + ForceDelete *bool + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTasksParams) WithDefaults() *DeleteTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTasksParams) SetDefaults() { + var ( + forceDeleteDefault = bool(false) + ) + + val := DeleteTasksParams{ + ForceDelete: &forceDeleteDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the delete tasks params +func (o *DeleteTasksParams) WithTimeout(timeout time.Duration) *DeleteTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete tasks params +func (o *DeleteTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete tasks params +func (o *DeleteTasksParams) WithContext(ctx context.Context) *DeleteTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete tasks params +func (o *DeleteTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete tasks params +func (o *DeleteTasksParams) WithHTTPClient(client *http.Client) *DeleteTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete tasks params +func (o *DeleteTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForceDelete adds the forceDelete to the delete tasks params +func (o *DeleteTasksParams) WithForceDelete(forceDelete *bool) *DeleteTasksParams { + o.SetForceDelete(forceDelete) + return o +} + +// SetForceDelete adds the forceDelete to the delete tasks params +func (o *DeleteTasksParams) SetForceDelete(forceDelete *bool) { + o.ForceDelete = forceDelete +} + +// WithTaskType adds the taskType to the delete tasks params +func (o *DeleteTasksParams) WithTaskType(taskType string) *DeleteTasksParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the delete tasks params +func (o *DeleteTasksParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForceDelete != nil { + + // query param forceDelete + var qrForceDelete bool + + if o.ForceDelete != nil { + qrForceDelete = *o.ForceDelete + } + qForceDelete := swag.FormatBool(qrForceDelete) + if qForceDelete != "" { + + if err := r.SetQueryParam("forceDelete", qForceDelete); err != nil { + return err + } + } + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/delete_tasks_responses.go b/src/client/task/delete_tasks_responses.go new file mode 100644 index 0000000..1c7078d --- /dev/null +++ b/src/client/task/delete_tasks_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteTasksReader is a Reader for the DeleteTasks structure. +type DeleteTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTasksOK creates a DeleteTasksOK with default headers values +func NewDeleteTasksOK() *DeleteTasksOK { + return &DeleteTasksOK{} +} + +/* +DeleteTasksOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteTasksOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete tasks o k response has a 2xx status code +func (o *DeleteTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete tasks o k response has a 3xx status code +func (o *DeleteTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete tasks o k response has a 4xx status code +func (o *DeleteTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete tasks o k response has a 5xx status code +func (o *DeleteTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete tasks o k response a status code equal to that given +func (o *DeleteTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete tasks o k response +func (o *DeleteTasksOK) Code() int { + return 200 +} + +func (o *DeleteTasksOK) Error() string { + return fmt.Sprintf("[DELETE /tasks/{taskType}][%d] deleteTasksOK %+v", 200, o.Payload) +} + +func (o *DeleteTasksOK) String() string { + return fmt.Sprintf("[DELETE /tasks/{taskType}][%d] deleteTasksOK %+v", 200, o.Payload) +} + +func (o *DeleteTasksOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/execute_adhoc_task_parameters.go b/src/client/task/execute_adhoc_task_parameters.go new file mode 100644 index 0000000..abd5ab6 --- /dev/null +++ b/src/client/task/execute_adhoc_task_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewExecuteAdhocTaskParams creates a new ExecuteAdhocTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewExecuteAdhocTaskParams() *ExecuteAdhocTaskParams { + return &ExecuteAdhocTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewExecuteAdhocTaskParamsWithTimeout creates a new ExecuteAdhocTaskParams object +// with the ability to set a timeout on a request. +func NewExecuteAdhocTaskParamsWithTimeout(timeout time.Duration) *ExecuteAdhocTaskParams { + return &ExecuteAdhocTaskParams{ + timeout: timeout, + } +} + +// NewExecuteAdhocTaskParamsWithContext creates a new ExecuteAdhocTaskParams object +// with the ability to set a context for a request. +func NewExecuteAdhocTaskParamsWithContext(ctx context.Context) *ExecuteAdhocTaskParams { + return &ExecuteAdhocTaskParams{ + Context: ctx, + } +} + +// NewExecuteAdhocTaskParamsWithHTTPClient creates a new ExecuteAdhocTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewExecuteAdhocTaskParamsWithHTTPClient(client *http.Client) *ExecuteAdhocTaskParams { + return &ExecuteAdhocTaskParams{ + HTTPClient: client, + } +} + +/* +ExecuteAdhocTaskParams contains all the parameters to send to the API endpoint + + for the execute adhoc task operation. + + Typically these are written to a http.Request. +*/ +type ExecuteAdhocTaskParams struct { + + // Body. + Body *models.AdhocTaskConfig + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the execute adhoc task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExecuteAdhocTaskParams) WithDefaults() *ExecuteAdhocTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the execute adhoc task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExecuteAdhocTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) WithTimeout(timeout time.Duration) *ExecuteAdhocTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) WithContext(ctx context.Context) *ExecuteAdhocTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) WithHTTPClient(client *http.Client) *ExecuteAdhocTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) WithBody(body *models.AdhocTaskConfig) *ExecuteAdhocTaskParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the execute adhoc task params +func (o *ExecuteAdhocTaskParams) SetBody(body *models.AdhocTaskConfig) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ExecuteAdhocTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/execute_adhoc_task_responses.go b/src/client/task/execute_adhoc_task_responses.go new file mode 100644 index 0000000..62c6d52 --- /dev/null +++ b/src/client/task/execute_adhoc_task_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ExecuteAdhocTaskReader is a Reader for the ExecuteAdhocTask structure. +type ExecuteAdhocTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExecuteAdhocTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewExecuteAdhocTaskDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewExecuteAdhocTaskDefault creates a ExecuteAdhocTaskDefault with default headers values +func NewExecuteAdhocTaskDefault(code int) *ExecuteAdhocTaskDefault { + return &ExecuteAdhocTaskDefault{ + _statusCode: code, + } +} + +/* +ExecuteAdhocTaskDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type ExecuteAdhocTaskDefault struct { + _statusCode int +} + +// IsSuccess returns true when this execute adhoc task default response has a 2xx status code +func (o *ExecuteAdhocTaskDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this execute adhoc task default response has a 3xx status code +func (o *ExecuteAdhocTaskDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this execute adhoc task default response has a 4xx status code +func (o *ExecuteAdhocTaskDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this execute adhoc task default response has a 5xx status code +func (o *ExecuteAdhocTaskDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this execute adhoc task default response a status code equal to that given +func (o *ExecuteAdhocTaskDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the execute adhoc task default response +func (o *ExecuteAdhocTaskDefault) Code() int { + return o._statusCode +} + +func (o *ExecuteAdhocTaskDefault) Error() string { + return fmt.Sprintf("[POST /tasks/execute][%d] executeAdhocTask default ", o._statusCode) +} + +func (o *ExecuteAdhocTaskDefault) String() string { + return fmt.Sprintf("[POST /tasks/execute][%d] executeAdhocTask default ", o._statusCode) +} + +func (o *ExecuteAdhocTaskDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/task/get_cron_scheduler_information_parameters.go b/src/client/task/get_cron_scheduler_information_parameters.go new file mode 100644 index 0000000..9ee65c4 --- /dev/null +++ b/src/client/task/get_cron_scheduler_information_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCronSchedulerInformationParams creates a new GetCronSchedulerInformationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCronSchedulerInformationParams() *GetCronSchedulerInformationParams { + return &GetCronSchedulerInformationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCronSchedulerInformationParamsWithTimeout creates a new GetCronSchedulerInformationParams object +// with the ability to set a timeout on a request. +func NewGetCronSchedulerInformationParamsWithTimeout(timeout time.Duration) *GetCronSchedulerInformationParams { + return &GetCronSchedulerInformationParams{ + timeout: timeout, + } +} + +// NewGetCronSchedulerInformationParamsWithContext creates a new GetCronSchedulerInformationParams object +// with the ability to set a context for a request. +func NewGetCronSchedulerInformationParamsWithContext(ctx context.Context) *GetCronSchedulerInformationParams { + return &GetCronSchedulerInformationParams{ + Context: ctx, + } +} + +// NewGetCronSchedulerInformationParamsWithHTTPClient creates a new GetCronSchedulerInformationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCronSchedulerInformationParamsWithHTTPClient(client *http.Client) *GetCronSchedulerInformationParams { + return &GetCronSchedulerInformationParams{ + HTTPClient: client, + } +} + +/* +GetCronSchedulerInformationParams contains all the parameters to send to the API endpoint + + for the get cron scheduler information operation. + + Typically these are written to a http.Request. +*/ +type GetCronSchedulerInformationParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cron scheduler information params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCronSchedulerInformationParams) WithDefaults() *GetCronSchedulerInformationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cron scheduler information params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCronSchedulerInformationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cron scheduler information params +func (o *GetCronSchedulerInformationParams) WithTimeout(timeout time.Duration) *GetCronSchedulerInformationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cron scheduler information params +func (o *GetCronSchedulerInformationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cron scheduler information params +func (o *GetCronSchedulerInformationParams) WithContext(ctx context.Context) *GetCronSchedulerInformationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cron scheduler information params +func (o *GetCronSchedulerInformationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cron scheduler information params +func (o *GetCronSchedulerInformationParams) WithHTTPClient(client *http.Client) *GetCronSchedulerInformationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cron scheduler information params +func (o *GetCronSchedulerInformationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCronSchedulerInformationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_cron_scheduler_information_responses.go b/src/client/task/get_cron_scheduler_information_responses.go new file mode 100644 index 0000000..a449290 --- /dev/null +++ b/src/client/task/get_cron_scheduler_information_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetCronSchedulerInformationReader is a Reader for the GetCronSchedulerInformation structure. +type GetCronSchedulerInformationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCronSchedulerInformationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCronSchedulerInformationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCronSchedulerInformationOK creates a GetCronSchedulerInformationOK with default headers values +func NewGetCronSchedulerInformationOK() *GetCronSchedulerInformationOK { + return &GetCronSchedulerInformationOK{} +} + +/* +GetCronSchedulerInformationOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetCronSchedulerInformationOK struct { + Payload map[string]interface{} +} + +// IsSuccess returns true when this get cron scheduler information o k response has a 2xx status code +func (o *GetCronSchedulerInformationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get cron scheduler information o k response has a 3xx status code +func (o *GetCronSchedulerInformationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get cron scheduler information o k response has a 4xx status code +func (o *GetCronSchedulerInformationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get cron scheduler information o k response has a 5xx status code +func (o *GetCronSchedulerInformationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get cron scheduler information o k response a status code equal to that given +func (o *GetCronSchedulerInformationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get cron scheduler information o k response +func (o *GetCronSchedulerInformationOK) Code() int { + return 200 +} + +func (o *GetCronSchedulerInformationOK) Error() string { + return fmt.Sprintf("[GET /tasks/scheduler/information][%d] getCronSchedulerInformationOK %+v", 200, o.Payload) +} + +func (o *GetCronSchedulerInformationOK) String() string { + return fmt.Sprintf("[GET /tasks/scheduler/information][%d] getCronSchedulerInformationOK %+v", 200, o.Payload) +} + +func (o *GetCronSchedulerInformationOK) GetPayload() map[string]interface{} { + return o.Payload +} + +func (o *GetCronSchedulerInformationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_cron_scheduler_job_details_parameters.go b/src/client/task/get_cron_scheduler_job_details_parameters.go new file mode 100644 index 0000000..c84a666 --- /dev/null +++ b/src/client/task/get_cron_scheduler_job_details_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCronSchedulerJobDetailsParams creates a new GetCronSchedulerJobDetailsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCronSchedulerJobDetailsParams() *GetCronSchedulerJobDetailsParams { + return &GetCronSchedulerJobDetailsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCronSchedulerJobDetailsParamsWithTimeout creates a new GetCronSchedulerJobDetailsParams object +// with the ability to set a timeout on a request. +func NewGetCronSchedulerJobDetailsParamsWithTimeout(timeout time.Duration) *GetCronSchedulerJobDetailsParams { + return &GetCronSchedulerJobDetailsParams{ + timeout: timeout, + } +} + +// NewGetCronSchedulerJobDetailsParamsWithContext creates a new GetCronSchedulerJobDetailsParams object +// with the ability to set a context for a request. +func NewGetCronSchedulerJobDetailsParamsWithContext(ctx context.Context) *GetCronSchedulerJobDetailsParams { + return &GetCronSchedulerJobDetailsParams{ + Context: ctx, + } +} + +// NewGetCronSchedulerJobDetailsParamsWithHTTPClient creates a new GetCronSchedulerJobDetailsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCronSchedulerJobDetailsParamsWithHTTPClient(client *http.Client) *GetCronSchedulerJobDetailsParams { + return &GetCronSchedulerJobDetailsParams{ + HTTPClient: client, + } +} + +/* +GetCronSchedulerJobDetailsParams contains all the parameters to send to the API endpoint + + for the get cron scheduler job details operation. + + Typically these are written to a http.Request. +*/ +type GetCronSchedulerJobDetailsParams struct { + + /* TableName. + + Table name (with type suffix) + */ + TableName *string + + /* TaskType. + + Task type + */ + TaskType *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cron scheduler job details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCronSchedulerJobDetailsParams) WithDefaults() *GetCronSchedulerJobDetailsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cron scheduler job details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCronSchedulerJobDetailsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) WithTimeout(timeout time.Duration) *GetCronSchedulerJobDetailsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) WithContext(ctx context.Context) *GetCronSchedulerJobDetailsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) WithHTTPClient(client *http.Client) *GetCronSchedulerJobDetailsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) WithTableName(tableName *string) *GetCronSchedulerJobDetailsParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) SetTableName(tableName *string) { + o.TableName = tableName +} + +// WithTaskType adds the taskType to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) WithTaskType(taskType *string) *GetCronSchedulerJobDetailsParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get cron scheduler job details params +func (o *GetCronSchedulerJobDetailsParams) SetTaskType(taskType *string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCronSchedulerJobDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TableName != nil { + + // query param tableName + var qrTableName string + + if o.TableName != nil { + qrTableName = *o.TableName + } + qTableName := qrTableName + if qTableName != "" { + + if err := r.SetQueryParam("tableName", qTableName); err != nil { + return err + } + } + } + + if o.TaskType != nil { + + // query param taskType + var qrTaskType string + + if o.TaskType != nil { + qrTaskType = *o.TaskType + } + qTaskType := qrTaskType + if qTaskType != "" { + + if err := r.SetQueryParam("taskType", qTaskType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_cron_scheduler_job_details_responses.go b/src/client/task/get_cron_scheduler_job_details_responses.go new file mode 100644 index 0000000..b7cd37a --- /dev/null +++ b/src/client/task/get_cron_scheduler_job_details_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetCronSchedulerJobDetailsReader is a Reader for the GetCronSchedulerJobDetails structure. +type GetCronSchedulerJobDetailsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCronSchedulerJobDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCronSchedulerJobDetailsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCronSchedulerJobDetailsOK creates a GetCronSchedulerJobDetailsOK with default headers values +func NewGetCronSchedulerJobDetailsOK() *GetCronSchedulerJobDetailsOK { + return &GetCronSchedulerJobDetailsOK{} +} + +/* +GetCronSchedulerJobDetailsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetCronSchedulerJobDetailsOK struct { + Payload map[string]interface{} +} + +// IsSuccess returns true when this get cron scheduler job details o k response has a 2xx status code +func (o *GetCronSchedulerJobDetailsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get cron scheduler job details o k response has a 3xx status code +func (o *GetCronSchedulerJobDetailsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get cron scheduler job details o k response has a 4xx status code +func (o *GetCronSchedulerJobDetailsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get cron scheduler job details o k response has a 5xx status code +func (o *GetCronSchedulerJobDetailsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get cron scheduler job details o k response a status code equal to that given +func (o *GetCronSchedulerJobDetailsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get cron scheduler job details o k response +func (o *GetCronSchedulerJobDetailsOK) Code() int { + return 200 +} + +func (o *GetCronSchedulerJobDetailsOK) Error() string { + return fmt.Sprintf("[GET /tasks/scheduler/jobDetails][%d] getCronSchedulerJobDetailsOK %+v", 200, o.Payload) +} + +func (o *GetCronSchedulerJobDetailsOK) String() string { + return fmt.Sprintf("[GET /tasks/scheduler/jobDetails][%d] getCronSchedulerJobDetailsOK %+v", 200, o.Payload) +} + +func (o *GetCronSchedulerJobDetailsOK) GetPayload() map[string]interface{} { + return o.Payload +} + +func (o *GetCronSchedulerJobDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_cron_scheduler_job_keys_parameters.go b/src/client/task/get_cron_scheduler_job_keys_parameters.go new file mode 100644 index 0000000..598bb11 --- /dev/null +++ b/src/client/task/get_cron_scheduler_job_keys_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCronSchedulerJobKeysParams creates a new GetCronSchedulerJobKeysParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCronSchedulerJobKeysParams() *GetCronSchedulerJobKeysParams { + return &GetCronSchedulerJobKeysParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCronSchedulerJobKeysParamsWithTimeout creates a new GetCronSchedulerJobKeysParams object +// with the ability to set a timeout on a request. +func NewGetCronSchedulerJobKeysParamsWithTimeout(timeout time.Duration) *GetCronSchedulerJobKeysParams { + return &GetCronSchedulerJobKeysParams{ + timeout: timeout, + } +} + +// NewGetCronSchedulerJobKeysParamsWithContext creates a new GetCronSchedulerJobKeysParams object +// with the ability to set a context for a request. +func NewGetCronSchedulerJobKeysParamsWithContext(ctx context.Context) *GetCronSchedulerJobKeysParams { + return &GetCronSchedulerJobKeysParams{ + Context: ctx, + } +} + +// NewGetCronSchedulerJobKeysParamsWithHTTPClient creates a new GetCronSchedulerJobKeysParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCronSchedulerJobKeysParamsWithHTTPClient(client *http.Client) *GetCronSchedulerJobKeysParams { + return &GetCronSchedulerJobKeysParams{ + HTTPClient: client, + } +} + +/* +GetCronSchedulerJobKeysParams contains all the parameters to send to the API endpoint + + for the get cron scheduler job keys operation. + + Typically these are written to a http.Request. +*/ +type GetCronSchedulerJobKeysParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cron scheduler job keys params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCronSchedulerJobKeysParams) WithDefaults() *GetCronSchedulerJobKeysParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cron scheduler job keys params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCronSchedulerJobKeysParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cron scheduler job keys params +func (o *GetCronSchedulerJobKeysParams) WithTimeout(timeout time.Duration) *GetCronSchedulerJobKeysParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cron scheduler job keys params +func (o *GetCronSchedulerJobKeysParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cron scheduler job keys params +func (o *GetCronSchedulerJobKeysParams) WithContext(ctx context.Context) *GetCronSchedulerJobKeysParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cron scheduler job keys params +func (o *GetCronSchedulerJobKeysParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cron scheduler job keys params +func (o *GetCronSchedulerJobKeysParams) WithHTTPClient(client *http.Client) *GetCronSchedulerJobKeysParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cron scheduler job keys params +func (o *GetCronSchedulerJobKeysParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCronSchedulerJobKeysParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_cron_scheduler_job_keys_responses.go b/src/client/task/get_cron_scheduler_job_keys_responses.go new file mode 100644 index 0000000..42ecd6f --- /dev/null +++ b/src/client/task/get_cron_scheduler_job_keys_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetCronSchedulerJobKeysReader is a Reader for the GetCronSchedulerJobKeys structure. +type GetCronSchedulerJobKeysReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCronSchedulerJobKeysReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCronSchedulerJobKeysOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCronSchedulerJobKeysOK creates a GetCronSchedulerJobKeysOK with default headers values +func NewGetCronSchedulerJobKeysOK() *GetCronSchedulerJobKeysOK { + return &GetCronSchedulerJobKeysOK{} +} + +/* +GetCronSchedulerJobKeysOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetCronSchedulerJobKeysOK struct { + Payload []*models.JobKey +} + +// IsSuccess returns true when this get cron scheduler job keys o k response has a 2xx status code +func (o *GetCronSchedulerJobKeysOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get cron scheduler job keys o k response has a 3xx status code +func (o *GetCronSchedulerJobKeysOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get cron scheduler job keys o k response has a 4xx status code +func (o *GetCronSchedulerJobKeysOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get cron scheduler job keys o k response has a 5xx status code +func (o *GetCronSchedulerJobKeysOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get cron scheduler job keys o k response a status code equal to that given +func (o *GetCronSchedulerJobKeysOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get cron scheduler job keys o k response +func (o *GetCronSchedulerJobKeysOK) Code() int { + return 200 +} + +func (o *GetCronSchedulerJobKeysOK) Error() string { + return fmt.Sprintf("[GET /tasks/scheduler/jobKeys][%d] getCronSchedulerJobKeysOK %+v", 200, o.Payload) +} + +func (o *GetCronSchedulerJobKeysOK) String() string { + return fmt.Sprintf("[GET /tasks/scheduler/jobKeys][%d] getCronSchedulerJobKeysOK %+v", 200, o.Payload) +} + +func (o *GetCronSchedulerJobKeysOK) GetPayload() []*models.JobKey { + return o.Payload +} + +func (o *GetCronSchedulerJobKeysOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_subtask_configs_parameters.go b/src/client/task/get_subtask_configs_parameters.go new file mode 100644 index 0000000..acc001d --- /dev/null +++ b/src/client/task/get_subtask_configs_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSubtaskConfigsParams creates a new GetSubtaskConfigsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSubtaskConfigsParams() *GetSubtaskConfigsParams { + return &GetSubtaskConfigsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubtaskConfigsParamsWithTimeout creates a new GetSubtaskConfigsParams object +// with the ability to set a timeout on a request. +func NewGetSubtaskConfigsParamsWithTimeout(timeout time.Duration) *GetSubtaskConfigsParams { + return &GetSubtaskConfigsParams{ + timeout: timeout, + } +} + +// NewGetSubtaskConfigsParamsWithContext creates a new GetSubtaskConfigsParams object +// with the ability to set a context for a request. +func NewGetSubtaskConfigsParamsWithContext(ctx context.Context) *GetSubtaskConfigsParams { + return &GetSubtaskConfigsParams{ + Context: ctx, + } +} + +// NewGetSubtaskConfigsParamsWithHTTPClient creates a new GetSubtaskConfigsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSubtaskConfigsParamsWithHTTPClient(client *http.Client) *GetSubtaskConfigsParams { + return &GetSubtaskConfigsParams{ + HTTPClient: client, + } +} + +/* +GetSubtaskConfigsParams contains all the parameters to send to the API endpoint + + for the get subtask configs operation. + + Typically these are written to a http.Request. +*/ +type GetSubtaskConfigsParams struct { + + /* SubtaskNames. + + Sub task names separated by comma + */ + SubtaskNames *string + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get subtask configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskConfigsParams) WithDefaults() *GetSubtaskConfigsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get subtask configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskConfigsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get subtask configs params +func (o *GetSubtaskConfigsParams) WithTimeout(timeout time.Duration) *GetSubtaskConfigsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get subtask configs params +func (o *GetSubtaskConfigsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get subtask configs params +func (o *GetSubtaskConfigsParams) WithContext(ctx context.Context) *GetSubtaskConfigsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get subtask configs params +func (o *GetSubtaskConfigsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get subtask configs params +func (o *GetSubtaskConfigsParams) WithHTTPClient(client *http.Client) *GetSubtaskConfigsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get subtask configs params +func (o *GetSubtaskConfigsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubtaskNames adds the subtaskNames to the get subtask configs params +func (o *GetSubtaskConfigsParams) WithSubtaskNames(subtaskNames *string) *GetSubtaskConfigsParams { + o.SetSubtaskNames(subtaskNames) + return o +} + +// SetSubtaskNames adds the subtaskNames to the get subtask configs params +func (o *GetSubtaskConfigsParams) SetSubtaskNames(subtaskNames *string) { + o.SubtaskNames = subtaskNames +} + +// WithTaskName adds the taskName to the get subtask configs params +func (o *GetSubtaskConfigsParams) WithTaskName(taskName string) *GetSubtaskConfigsParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get subtask configs params +func (o *GetSubtaskConfigsParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubtaskConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubtaskNames != nil { + + // query param subtaskNames + var qrSubtaskNames string + + if o.SubtaskNames != nil { + qrSubtaskNames = *o.SubtaskNames + } + qSubtaskNames := qrSubtaskNames + if qSubtaskNames != "" { + + if err := r.SetQueryParam("subtaskNames", qSubtaskNames); err != nil { + return err + } + } + } + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_subtask_configs_responses.go b/src/client/task/get_subtask_configs_responses.go new file mode 100644 index 0000000..a5f9433 --- /dev/null +++ b/src/client/task/get_subtask_configs_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetSubtaskConfigsReader is a Reader for the GetSubtaskConfigs structure. +type GetSubtaskConfigsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubtaskConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubtaskConfigsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSubtaskConfigsOK creates a GetSubtaskConfigsOK with default headers values +func NewGetSubtaskConfigsOK() *GetSubtaskConfigsOK { + return &GetSubtaskConfigsOK{} +} + +/* +GetSubtaskConfigsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSubtaskConfigsOK struct { + Payload map[string]models.PinotTaskConfig +} + +// IsSuccess returns true when this get subtask configs o k response has a 2xx status code +func (o *GetSubtaskConfigsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get subtask configs o k response has a 3xx status code +func (o *GetSubtaskConfigsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get subtask configs o k response has a 4xx status code +func (o *GetSubtaskConfigsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get subtask configs o k response has a 5xx status code +func (o *GetSubtaskConfigsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get subtask configs o k response a status code equal to that given +func (o *GetSubtaskConfigsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get subtask configs o k response +func (o *GetSubtaskConfigsOK) Code() int { + return 200 +} + +func (o *GetSubtaskConfigsOK) Error() string { + return fmt.Sprintf("[GET /tasks/subtask/{taskName}/config][%d] getSubtaskConfigsOK %+v", 200, o.Payload) +} + +func (o *GetSubtaskConfigsOK) String() string { + return fmt.Sprintf("[GET /tasks/subtask/{taskName}/config][%d] getSubtaskConfigsOK %+v", 200, o.Payload) +} + +func (o *GetSubtaskConfigsOK) GetPayload() map[string]models.PinotTaskConfig { + return o.Payload +} + +func (o *GetSubtaskConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_subtask_on_worker_progress_parameters.go b/src/client/task/get_subtask_on_worker_progress_parameters.go new file mode 100644 index 0000000..5e75b94 --- /dev/null +++ b/src/client/task/get_subtask_on_worker_progress_parameters.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSubtaskOnWorkerProgressParams creates a new GetSubtaskOnWorkerProgressParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSubtaskOnWorkerProgressParams() *GetSubtaskOnWorkerProgressParams { + return &GetSubtaskOnWorkerProgressParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubtaskOnWorkerProgressParamsWithTimeout creates a new GetSubtaskOnWorkerProgressParams object +// with the ability to set a timeout on a request. +func NewGetSubtaskOnWorkerProgressParamsWithTimeout(timeout time.Duration) *GetSubtaskOnWorkerProgressParams { + return &GetSubtaskOnWorkerProgressParams{ + timeout: timeout, + } +} + +// NewGetSubtaskOnWorkerProgressParamsWithContext creates a new GetSubtaskOnWorkerProgressParams object +// with the ability to set a context for a request. +func NewGetSubtaskOnWorkerProgressParamsWithContext(ctx context.Context) *GetSubtaskOnWorkerProgressParams { + return &GetSubtaskOnWorkerProgressParams{ + Context: ctx, + } +} + +// NewGetSubtaskOnWorkerProgressParamsWithHTTPClient creates a new GetSubtaskOnWorkerProgressParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSubtaskOnWorkerProgressParamsWithHTTPClient(client *http.Client) *GetSubtaskOnWorkerProgressParams { + return &GetSubtaskOnWorkerProgressParams{ + HTTPClient: client, + } +} + +/* +GetSubtaskOnWorkerProgressParams contains all the parameters to send to the API endpoint + + for the get subtask on worker progress operation. + + Typically these are written to a http.Request. +*/ +type GetSubtaskOnWorkerProgressParams struct { + + /* MinionWorkerIds. + + Minion worker IDs separated by comma + */ + MinionWorkerIds *string + + /* SubTaskState. + + Subtask state (UNKNOWN,IN_PROGRESS,SUCCEEDED,CANCELLED,ERROR) + */ + SubTaskState string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get subtask on worker progress params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskOnWorkerProgressParams) WithDefaults() *GetSubtaskOnWorkerProgressParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get subtask on worker progress params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskOnWorkerProgressParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) WithTimeout(timeout time.Duration) *GetSubtaskOnWorkerProgressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) WithContext(ctx context.Context) *GetSubtaskOnWorkerProgressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) WithHTTPClient(client *http.Client) *GetSubtaskOnWorkerProgressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMinionWorkerIds adds the minionWorkerIds to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) WithMinionWorkerIds(minionWorkerIds *string) *GetSubtaskOnWorkerProgressParams { + o.SetMinionWorkerIds(minionWorkerIds) + return o +} + +// SetMinionWorkerIds adds the minionWorkerIds to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) SetMinionWorkerIds(minionWorkerIds *string) { + o.MinionWorkerIds = minionWorkerIds +} + +// WithSubTaskState adds the subTaskState to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) WithSubTaskState(subTaskState string) *GetSubtaskOnWorkerProgressParams { + o.SetSubTaskState(subTaskState) + return o +} + +// SetSubTaskState adds the subTaskState to the get subtask on worker progress params +func (o *GetSubtaskOnWorkerProgressParams) SetSubTaskState(subTaskState string) { + o.SubTaskState = subTaskState +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubtaskOnWorkerProgressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.MinionWorkerIds != nil { + + // query param minionWorkerIds + var qrMinionWorkerIds string + + if o.MinionWorkerIds != nil { + qrMinionWorkerIds = *o.MinionWorkerIds + } + qMinionWorkerIds := qrMinionWorkerIds + if qMinionWorkerIds != "" { + + if err := r.SetQueryParam("minionWorkerIds", qMinionWorkerIds); err != nil { + return err + } + } + } + + // query param subTaskState + qrSubTaskState := o.SubTaskState + qSubTaskState := qrSubTaskState + if qSubTaskState != "" { + + if err := r.SetQueryParam("subTaskState", qSubTaskState); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_subtask_on_worker_progress_responses.go b/src/client/task/get_subtask_on_worker_progress_responses.go new file mode 100644 index 0000000..cb8c7a0 --- /dev/null +++ b/src/client/task/get_subtask_on_worker_progress_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSubtaskOnWorkerProgressReader is a Reader for the GetSubtaskOnWorkerProgress structure. +type GetSubtaskOnWorkerProgressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubtaskOnWorkerProgressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubtaskOnWorkerProgressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetSubtaskOnWorkerProgressInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSubtaskOnWorkerProgressOK creates a GetSubtaskOnWorkerProgressOK with default headers values +func NewGetSubtaskOnWorkerProgressOK() *GetSubtaskOnWorkerProgressOK { + return &GetSubtaskOnWorkerProgressOK{} +} + +/* +GetSubtaskOnWorkerProgressOK describes a response with status code 200, with default header values. + +Success +*/ +type GetSubtaskOnWorkerProgressOK struct { +} + +// IsSuccess returns true when this get subtask on worker progress o k response has a 2xx status code +func (o *GetSubtaskOnWorkerProgressOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get subtask on worker progress o k response has a 3xx status code +func (o *GetSubtaskOnWorkerProgressOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get subtask on worker progress o k response has a 4xx status code +func (o *GetSubtaskOnWorkerProgressOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get subtask on worker progress o k response has a 5xx status code +func (o *GetSubtaskOnWorkerProgressOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get subtask on worker progress o k response a status code equal to that given +func (o *GetSubtaskOnWorkerProgressOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get subtask on worker progress o k response +func (o *GetSubtaskOnWorkerProgressOK) Code() int { + return 200 +} + +func (o *GetSubtaskOnWorkerProgressOK) Error() string { + return fmt.Sprintf("[GET /tasks/subtask/workers/progress][%d] getSubtaskOnWorkerProgressOK ", 200) +} + +func (o *GetSubtaskOnWorkerProgressOK) String() string { + return fmt.Sprintf("[GET /tasks/subtask/workers/progress][%d] getSubtaskOnWorkerProgressOK ", 200) +} + +func (o *GetSubtaskOnWorkerProgressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetSubtaskOnWorkerProgressInternalServerError creates a GetSubtaskOnWorkerProgressInternalServerError with default headers values +func NewGetSubtaskOnWorkerProgressInternalServerError() *GetSubtaskOnWorkerProgressInternalServerError { + return &GetSubtaskOnWorkerProgressInternalServerError{} +} + +/* +GetSubtaskOnWorkerProgressInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetSubtaskOnWorkerProgressInternalServerError struct { +} + +// IsSuccess returns true when this get subtask on worker progress internal server error response has a 2xx status code +func (o *GetSubtaskOnWorkerProgressInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get subtask on worker progress internal server error response has a 3xx status code +func (o *GetSubtaskOnWorkerProgressInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get subtask on worker progress internal server error response has a 4xx status code +func (o *GetSubtaskOnWorkerProgressInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get subtask on worker progress internal server error response has a 5xx status code +func (o *GetSubtaskOnWorkerProgressInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get subtask on worker progress internal server error response a status code equal to that given +func (o *GetSubtaskOnWorkerProgressInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get subtask on worker progress internal server error response +func (o *GetSubtaskOnWorkerProgressInternalServerError) Code() int { + return 500 +} + +func (o *GetSubtaskOnWorkerProgressInternalServerError) Error() string { + return fmt.Sprintf("[GET /tasks/subtask/workers/progress][%d] getSubtaskOnWorkerProgressInternalServerError ", 500) +} + +func (o *GetSubtaskOnWorkerProgressInternalServerError) String() string { + return fmt.Sprintf("[GET /tasks/subtask/workers/progress][%d] getSubtaskOnWorkerProgressInternalServerError ", 500) +} + +func (o *GetSubtaskOnWorkerProgressInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/task/get_subtask_progress_parameters.go b/src/client/task/get_subtask_progress_parameters.go new file mode 100644 index 0000000..da7d9ee --- /dev/null +++ b/src/client/task/get_subtask_progress_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSubtaskProgressParams creates a new GetSubtaskProgressParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSubtaskProgressParams() *GetSubtaskProgressParams { + return &GetSubtaskProgressParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubtaskProgressParamsWithTimeout creates a new GetSubtaskProgressParams object +// with the ability to set a timeout on a request. +func NewGetSubtaskProgressParamsWithTimeout(timeout time.Duration) *GetSubtaskProgressParams { + return &GetSubtaskProgressParams{ + timeout: timeout, + } +} + +// NewGetSubtaskProgressParamsWithContext creates a new GetSubtaskProgressParams object +// with the ability to set a context for a request. +func NewGetSubtaskProgressParamsWithContext(ctx context.Context) *GetSubtaskProgressParams { + return &GetSubtaskProgressParams{ + Context: ctx, + } +} + +// NewGetSubtaskProgressParamsWithHTTPClient creates a new GetSubtaskProgressParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSubtaskProgressParamsWithHTTPClient(client *http.Client) *GetSubtaskProgressParams { + return &GetSubtaskProgressParams{ + HTTPClient: client, + } +} + +/* +GetSubtaskProgressParams contains all the parameters to send to the API endpoint + + for the get subtask progress operation. + + Typically these are written to a http.Request. +*/ +type GetSubtaskProgressParams struct { + + /* SubtaskNames. + + Sub task names separated by comma + */ + SubtaskNames *string + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get subtask progress params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskProgressParams) WithDefaults() *GetSubtaskProgressParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get subtask progress params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskProgressParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get subtask progress params +func (o *GetSubtaskProgressParams) WithTimeout(timeout time.Duration) *GetSubtaskProgressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get subtask progress params +func (o *GetSubtaskProgressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get subtask progress params +func (o *GetSubtaskProgressParams) WithContext(ctx context.Context) *GetSubtaskProgressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get subtask progress params +func (o *GetSubtaskProgressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get subtask progress params +func (o *GetSubtaskProgressParams) WithHTTPClient(client *http.Client) *GetSubtaskProgressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get subtask progress params +func (o *GetSubtaskProgressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubtaskNames adds the subtaskNames to the get subtask progress params +func (o *GetSubtaskProgressParams) WithSubtaskNames(subtaskNames *string) *GetSubtaskProgressParams { + o.SetSubtaskNames(subtaskNames) + return o +} + +// SetSubtaskNames adds the subtaskNames to the get subtask progress params +func (o *GetSubtaskProgressParams) SetSubtaskNames(subtaskNames *string) { + o.SubtaskNames = subtaskNames +} + +// WithTaskName adds the taskName to the get subtask progress params +func (o *GetSubtaskProgressParams) WithTaskName(taskName string) *GetSubtaskProgressParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get subtask progress params +func (o *GetSubtaskProgressParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubtaskProgressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubtaskNames != nil { + + // query param subtaskNames + var qrSubtaskNames string + + if o.SubtaskNames != nil { + qrSubtaskNames = *o.SubtaskNames + } + qSubtaskNames := qrSubtaskNames + if qSubtaskNames != "" { + + if err := r.SetQueryParam("subtaskNames", qSubtaskNames); err != nil { + return err + } + } + } + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_subtask_progress_responses.go b/src/client/task/get_subtask_progress_responses.go new file mode 100644 index 0000000..6e2565a --- /dev/null +++ b/src/client/task/get_subtask_progress_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSubtaskProgressReader is a Reader for the GetSubtaskProgress structure. +type GetSubtaskProgressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubtaskProgressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubtaskProgressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSubtaskProgressOK creates a GetSubtaskProgressOK with default headers values +func NewGetSubtaskProgressOK() *GetSubtaskProgressOK { + return &GetSubtaskProgressOK{} +} + +/* +GetSubtaskProgressOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSubtaskProgressOK struct { + Payload string +} + +// IsSuccess returns true when this get subtask progress o k response has a 2xx status code +func (o *GetSubtaskProgressOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get subtask progress o k response has a 3xx status code +func (o *GetSubtaskProgressOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get subtask progress o k response has a 4xx status code +func (o *GetSubtaskProgressOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get subtask progress o k response has a 5xx status code +func (o *GetSubtaskProgressOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get subtask progress o k response a status code equal to that given +func (o *GetSubtaskProgressOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get subtask progress o k response +func (o *GetSubtaskProgressOK) Code() int { + return 200 +} + +func (o *GetSubtaskProgressOK) Error() string { + return fmt.Sprintf("[GET /tasks/subtask/{taskName}/progress][%d] getSubtaskProgressOK %+v", 200, o.Payload) +} + +func (o *GetSubtaskProgressOK) String() string { + return fmt.Sprintf("[GET /tasks/subtask/{taskName}/progress][%d] getSubtaskProgressOK %+v", 200, o.Payload) +} + +func (o *GetSubtaskProgressOK) GetPayload() string { + return o.Payload +} + +func (o *GetSubtaskProgressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_subtask_states_parameters.go b/src/client/task/get_subtask_states_parameters.go new file mode 100644 index 0000000..aef562a --- /dev/null +++ b/src/client/task/get_subtask_states_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSubtaskStatesParams creates a new GetSubtaskStatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSubtaskStatesParams() *GetSubtaskStatesParams { + return &GetSubtaskStatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubtaskStatesParamsWithTimeout creates a new GetSubtaskStatesParams object +// with the ability to set a timeout on a request. +func NewGetSubtaskStatesParamsWithTimeout(timeout time.Duration) *GetSubtaskStatesParams { + return &GetSubtaskStatesParams{ + timeout: timeout, + } +} + +// NewGetSubtaskStatesParamsWithContext creates a new GetSubtaskStatesParams object +// with the ability to set a context for a request. +func NewGetSubtaskStatesParamsWithContext(ctx context.Context) *GetSubtaskStatesParams { + return &GetSubtaskStatesParams{ + Context: ctx, + } +} + +// NewGetSubtaskStatesParamsWithHTTPClient creates a new GetSubtaskStatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSubtaskStatesParamsWithHTTPClient(client *http.Client) *GetSubtaskStatesParams { + return &GetSubtaskStatesParams{ + HTTPClient: client, + } +} + +/* +GetSubtaskStatesParams contains all the parameters to send to the API endpoint + + for the get subtask states operation. + + Typically these are written to a http.Request. +*/ +type GetSubtaskStatesParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get subtask states params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskStatesParams) WithDefaults() *GetSubtaskStatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get subtask states params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubtaskStatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get subtask states params +func (o *GetSubtaskStatesParams) WithTimeout(timeout time.Duration) *GetSubtaskStatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get subtask states params +func (o *GetSubtaskStatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get subtask states params +func (o *GetSubtaskStatesParams) WithContext(ctx context.Context) *GetSubtaskStatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get subtask states params +func (o *GetSubtaskStatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get subtask states params +func (o *GetSubtaskStatesParams) WithHTTPClient(client *http.Client) *GetSubtaskStatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get subtask states params +func (o *GetSubtaskStatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get subtask states params +func (o *GetSubtaskStatesParams) WithTaskName(taskName string) *GetSubtaskStatesParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get subtask states params +func (o *GetSubtaskStatesParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubtaskStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_subtask_states_responses.go b/src/client/task/get_subtask_states_responses.go new file mode 100644 index 0000000..55cf81c --- /dev/null +++ b/src/client/task/get_subtask_states_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSubtaskStatesReader is a Reader for the GetSubtaskStates structure. +type GetSubtaskStatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubtaskStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubtaskStatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSubtaskStatesOK creates a GetSubtaskStatesOK with default headers values +func NewGetSubtaskStatesOK() *GetSubtaskStatesOK { + return &GetSubtaskStatesOK{} +} + +/* +GetSubtaskStatesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetSubtaskStatesOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get subtask states o k response has a 2xx status code +func (o *GetSubtaskStatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get subtask states o k response has a 3xx status code +func (o *GetSubtaskStatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get subtask states o k response has a 4xx status code +func (o *GetSubtaskStatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get subtask states o k response has a 5xx status code +func (o *GetSubtaskStatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get subtask states o k response a status code equal to that given +func (o *GetSubtaskStatesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get subtask states o k response +func (o *GetSubtaskStatesOK) Code() int { + return 200 +} + +func (o *GetSubtaskStatesOK) Error() string { + return fmt.Sprintf("[GET /tasks/subtask/{taskName}/state][%d] getSubtaskStatesOK %+v", 200, o.Payload) +} + +func (o *GetSubtaskStatesOK) String() string { + return fmt.Sprintf("[GET /tasks/subtask/{taskName}/state][%d] getSubtaskStatesOK %+v", 200, o.Payload) +} + +func (o *GetSubtaskStatesOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetSubtaskStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_config_parameters.go b/src/client/task/get_task_config_parameters.go new file mode 100644 index 0000000..5c107f8 --- /dev/null +++ b/src/client/task/get_task_config_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskConfigParams creates a new GetTaskConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskConfigParams() *GetTaskConfigParams { + return &GetTaskConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskConfigParamsWithTimeout creates a new GetTaskConfigParams object +// with the ability to set a timeout on a request. +func NewGetTaskConfigParamsWithTimeout(timeout time.Duration) *GetTaskConfigParams { + return &GetTaskConfigParams{ + timeout: timeout, + } +} + +// NewGetTaskConfigParamsWithContext creates a new GetTaskConfigParams object +// with the ability to set a context for a request. +func NewGetTaskConfigParamsWithContext(ctx context.Context) *GetTaskConfigParams { + return &GetTaskConfigParams{ + Context: ctx, + } +} + +// NewGetTaskConfigParamsWithHTTPClient creates a new GetTaskConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskConfigParamsWithHTTPClient(client *http.Client) *GetTaskConfigParams { + return &GetTaskConfigParams{ + HTTPClient: client, + } +} + +/* +GetTaskConfigParams contains all the parameters to send to the API endpoint + + for the get task config operation. + + Typically these are written to a http.Request. +*/ +type GetTaskConfigParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskConfigParams) WithDefaults() *GetTaskConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task config params +func (o *GetTaskConfigParams) WithTimeout(timeout time.Duration) *GetTaskConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task config params +func (o *GetTaskConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task config params +func (o *GetTaskConfigParams) WithContext(ctx context.Context) *GetTaskConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task config params +func (o *GetTaskConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task config params +func (o *GetTaskConfigParams) WithHTTPClient(client *http.Client) *GetTaskConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task config params +func (o *GetTaskConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get task config params +func (o *GetTaskConfigParams) WithTaskName(taskName string) *GetTaskConfigParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get task config params +func (o *GetTaskConfigParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_config_responses.go b/src/client/task/get_task_config_responses.go new file mode 100644 index 0000000..b0158e7 --- /dev/null +++ b/src/client/task/get_task_config_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskConfigReader is a Reader for the GetTaskConfig structure. +type GetTaskConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskConfigOK creates a GetTaskConfigOK with default headers values +func NewGetTaskConfigOK() *GetTaskConfigOK { + return &GetTaskConfigOK{} +} + +/* +GetTaskConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskConfigOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get task config o k response has a 2xx status code +func (o *GetTaskConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task config o k response has a 3xx status code +func (o *GetTaskConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task config o k response has a 4xx status code +func (o *GetTaskConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task config o k response has a 5xx status code +func (o *GetTaskConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task config o k response a status code equal to that given +func (o *GetTaskConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task config o k response +func (o *GetTaskConfigOK) Code() int { + return 200 +} + +func (o *GetTaskConfigOK) Error() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/runtime/config][%d] getTaskConfigOK %+v", 200, o.Payload) +} + +func (o *GetTaskConfigOK) String() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/runtime/config][%d] getTaskConfigOK %+v", 200, o.Payload) +} + +func (o *GetTaskConfigOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetTaskConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_configs_deprecated_parameters.go b/src/client/task/get_task_configs_deprecated_parameters.go new file mode 100644 index 0000000..479225d --- /dev/null +++ b/src/client/task/get_task_configs_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskConfigsDeprecatedParams creates a new GetTaskConfigsDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskConfigsDeprecatedParams() *GetTaskConfigsDeprecatedParams { + return &GetTaskConfigsDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskConfigsDeprecatedParamsWithTimeout creates a new GetTaskConfigsDeprecatedParams object +// with the ability to set a timeout on a request. +func NewGetTaskConfigsDeprecatedParamsWithTimeout(timeout time.Duration) *GetTaskConfigsDeprecatedParams { + return &GetTaskConfigsDeprecatedParams{ + timeout: timeout, + } +} + +// NewGetTaskConfigsDeprecatedParamsWithContext creates a new GetTaskConfigsDeprecatedParams object +// with the ability to set a context for a request. +func NewGetTaskConfigsDeprecatedParamsWithContext(ctx context.Context) *GetTaskConfigsDeprecatedParams { + return &GetTaskConfigsDeprecatedParams{ + Context: ctx, + } +} + +// NewGetTaskConfigsDeprecatedParamsWithHTTPClient creates a new GetTaskConfigsDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskConfigsDeprecatedParamsWithHTTPClient(client *http.Client) *GetTaskConfigsDeprecatedParams { + return &GetTaskConfigsDeprecatedParams{ + HTTPClient: client, + } +} + +/* +GetTaskConfigsDeprecatedParams contains all the parameters to send to the API endpoint + + for the get task configs deprecated operation. + + Typically these are written to a http.Request. +*/ +type GetTaskConfigsDeprecatedParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task configs deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskConfigsDeprecatedParams) WithDefaults() *GetTaskConfigsDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task configs deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskConfigsDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) WithTimeout(timeout time.Duration) *GetTaskConfigsDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) WithContext(ctx context.Context) *GetTaskConfigsDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) WithHTTPClient(client *http.Client) *GetTaskConfigsDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) WithTaskName(taskName string) *GetTaskConfigsDeprecatedParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get task configs deprecated params +func (o *GetTaskConfigsDeprecatedParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskConfigsDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_configs_deprecated_responses.go b/src/client/task/get_task_configs_deprecated_responses.go new file mode 100644 index 0000000..bcb8d8e --- /dev/null +++ b/src/client/task/get_task_configs_deprecated_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTaskConfigsDeprecatedReader is a Reader for the GetTaskConfigsDeprecated structure. +type GetTaskConfigsDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskConfigsDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskConfigsDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskConfigsDeprecatedOK creates a GetTaskConfigsDeprecatedOK with default headers values +func NewGetTaskConfigsDeprecatedOK() *GetTaskConfigsDeprecatedOK { + return &GetTaskConfigsDeprecatedOK{} +} + +/* +GetTaskConfigsDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskConfigsDeprecatedOK struct { + Payload []*models.PinotTaskConfig +} + +// IsSuccess returns true when this get task configs deprecated o k response has a 2xx status code +func (o *GetTaskConfigsDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task configs deprecated o k response has a 3xx status code +func (o *GetTaskConfigsDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task configs deprecated o k response has a 4xx status code +func (o *GetTaskConfigsDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task configs deprecated o k response has a 5xx status code +func (o *GetTaskConfigsDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task configs deprecated o k response a status code equal to that given +func (o *GetTaskConfigsDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task configs deprecated o k response +func (o *GetTaskConfigsDeprecatedOK) Code() int { + return 200 +} + +func (o *GetTaskConfigsDeprecatedOK) Error() string { + return fmt.Sprintf("[GET /tasks/taskconfig/{taskName}][%d] getTaskConfigsDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskConfigsDeprecatedOK) String() string { + return fmt.Sprintf("[GET /tasks/taskconfig/{taskName}][%d] getTaskConfigsDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskConfigsDeprecatedOK) GetPayload() []*models.PinotTaskConfig { + return o.Payload +} + +func (o *GetTaskConfigsDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_configs_parameters.go b/src/client/task/get_task_configs_parameters.go new file mode 100644 index 0000000..ac1276f --- /dev/null +++ b/src/client/task/get_task_configs_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskConfigsParams creates a new GetTaskConfigsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskConfigsParams() *GetTaskConfigsParams { + return &GetTaskConfigsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskConfigsParamsWithTimeout creates a new GetTaskConfigsParams object +// with the ability to set a timeout on a request. +func NewGetTaskConfigsParamsWithTimeout(timeout time.Duration) *GetTaskConfigsParams { + return &GetTaskConfigsParams{ + timeout: timeout, + } +} + +// NewGetTaskConfigsParamsWithContext creates a new GetTaskConfigsParams object +// with the ability to set a context for a request. +func NewGetTaskConfigsParamsWithContext(ctx context.Context) *GetTaskConfigsParams { + return &GetTaskConfigsParams{ + Context: ctx, + } +} + +// NewGetTaskConfigsParamsWithHTTPClient creates a new GetTaskConfigsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskConfigsParamsWithHTTPClient(client *http.Client) *GetTaskConfigsParams { + return &GetTaskConfigsParams{ + HTTPClient: client, + } +} + +/* +GetTaskConfigsParams contains all the parameters to send to the API endpoint + + for the get task configs operation. + + Typically these are written to a http.Request. +*/ +type GetTaskConfigsParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskConfigsParams) WithDefaults() *GetTaskConfigsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task configs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskConfigsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task configs params +func (o *GetTaskConfigsParams) WithTimeout(timeout time.Duration) *GetTaskConfigsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task configs params +func (o *GetTaskConfigsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task configs params +func (o *GetTaskConfigsParams) WithContext(ctx context.Context) *GetTaskConfigsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task configs params +func (o *GetTaskConfigsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task configs params +func (o *GetTaskConfigsParams) WithHTTPClient(client *http.Client) *GetTaskConfigsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task configs params +func (o *GetTaskConfigsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get task configs params +func (o *GetTaskConfigsParams) WithTaskName(taskName string) *GetTaskConfigsParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get task configs params +func (o *GetTaskConfigsParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_configs_responses.go b/src/client/task/get_task_configs_responses.go new file mode 100644 index 0000000..a8fe86c --- /dev/null +++ b/src/client/task/get_task_configs_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTaskConfigsReader is a Reader for the GetTaskConfigs structure. +type GetTaskConfigsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskConfigsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskConfigsOK creates a GetTaskConfigsOK with default headers values +func NewGetTaskConfigsOK() *GetTaskConfigsOK { + return &GetTaskConfigsOK{} +} + +/* +GetTaskConfigsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskConfigsOK struct { + Payload []*models.PinotTaskConfig +} + +// IsSuccess returns true when this get task configs o k response has a 2xx status code +func (o *GetTaskConfigsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task configs o k response has a 3xx status code +func (o *GetTaskConfigsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task configs o k response has a 4xx status code +func (o *GetTaskConfigsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task configs o k response has a 5xx status code +func (o *GetTaskConfigsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task configs o k response a status code equal to that given +func (o *GetTaskConfigsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task configs o k response +func (o *GetTaskConfigsOK) Code() int { + return 200 +} + +func (o *GetTaskConfigsOK) Error() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/config][%d] getTaskConfigsOK %+v", 200, o.Payload) +} + +func (o *GetTaskConfigsOK) String() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/config][%d] getTaskConfigsOK %+v", 200, o.Payload) +} + +func (o *GetTaskConfigsOK) GetPayload() []*models.PinotTaskConfig { + return o.Payload +} + +func (o *GetTaskConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_counts_parameters.go b/src/client/task/get_task_counts_parameters.go new file mode 100644 index 0000000..9d686a5 --- /dev/null +++ b/src/client/task/get_task_counts_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskCountsParams creates a new GetTaskCountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskCountsParams() *GetTaskCountsParams { + return &GetTaskCountsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskCountsParamsWithTimeout creates a new GetTaskCountsParams object +// with the ability to set a timeout on a request. +func NewGetTaskCountsParamsWithTimeout(timeout time.Duration) *GetTaskCountsParams { + return &GetTaskCountsParams{ + timeout: timeout, + } +} + +// NewGetTaskCountsParamsWithContext creates a new GetTaskCountsParams object +// with the ability to set a context for a request. +func NewGetTaskCountsParamsWithContext(ctx context.Context) *GetTaskCountsParams { + return &GetTaskCountsParams{ + Context: ctx, + } +} + +// NewGetTaskCountsParamsWithHTTPClient creates a new GetTaskCountsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskCountsParamsWithHTTPClient(client *http.Client) *GetTaskCountsParams { + return &GetTaskCountsParams{ + HTTPClient: client, + } +} + +/* +GetTaskCountsParams contains all the parameters to send to the API endpoint + + for the get task counts operation. + + Typically these are written to a http.Request. +*/ +type GetTaskCountsParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task counts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskCountsParams) WithDefaults() *GetTaskCountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task counts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskCountsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task counts params +func (o *GetTaskCountsParams) WithTimeout(timeout time.Duration) *GetTaskCountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task counts params +func (o *GetTaskCountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task counts params +func (o *GetTaskCountsParams) WithContext(ctx context.Context) *GetTaskCountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task counts params +func (o *GetTaskCountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task counts params +func (o *GetTaskCountsParams) WithHTTPClient(client *http.Client) *GetTaskCountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task counts params +func (o *GetTaskCountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get task counts params +func (o *GetTaskCountsParams) WithTaskType(taskType string) *GetTaskCountsParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task counts params +func (o *GetTaskCountsParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskCountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_counts_responses.go b/src/client/task/get_task_counts_responses.go new file mode 100644 index 0000000..d39131e --- /dev/null +++ b/src/client/task/get_task_counts_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTaskCountsReader is a Reader for the GetTaskCounts structure. +type GetTaskCountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskCountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskCountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskCountsOK creates a GetTaskCountsOK with default headers values +func NewGetTaskCountsOK() *GetTaskCountsOK { + return &GetTaskCountsOK{} +} + +/* +GetTaskCountsOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskCountsOK struct { + Payload map[string]models.TaskCount +} + +// IsSuccess returns true when this get task counts o k response has a 2xx status code +func (o *GetTaskCountsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task counts o k response has a 3xx status code +func (o *GetTaskCountsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task counts o k response has a 4xx status code +func (o *GetTaskCountsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task counts o k response has a 5xx status code +func (o *GetTaskCountsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task counts o k response a status code equal to that given +func (o *GetTaskCountsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task counts o k response +func (o *GetTaskCountsOK) Code() int { + return 200 +} + +func (o *GetTaskCountsOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/taskcounts][%d] getTaskCountsOK %+v", 200, o.Payload) +} + +func (o *GetTaskCountsOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/taskcounts][%d] getTaskCountsOK %+v", 200, o.Payload) +} + +func (o *GetTaskCountsOK) GetPayload() map[string]models.TaskCount { + return o.Payload +} + +func (o *GetTaskCountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_debug_info_parameters.go b/src/client/task/get_task_debug_info_parameters.go new file mode 100644 index 0000000..3657bcf --- /dev/null +++ b/src/client/task/get_task_debug_info_parameters.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTaskDebugInfoParams creates a new GetTaskDebugInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskDebugInfoParams() *GetTaskDebugInfoParams { + return &GetTaskDebugInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskDebugInfoParamsWithTimeout creates a new GetTaskDebugInfoParams object +// with the ability to set a timeout on a request. +func NewGetTaskDebugInfoParamsWithTimeout(timeout time.Duration) *GetTaskDebugInfoParams { + return &GetTaskDebugInfoParams{ + timeout: timeout, + } +} + +// NewGetTaskDebugInfoParamsWithContext creates a new GetTaskDebugInfoParams object +// with the ability to set a context for a request. +func NewGetTaskDebugInfoParamsWithContext(ctx context.Context) *GetTaskDebugInfoParams { + return &GetTaskDebugInfoParams{ + Context: ctx, + } +} + +// NewGetTaskDebugInfoParamsWithHTTPClient creates a new GetTaskDebugInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskDebugInfoParamsWithHTTPClient(client *http.Client) *GetTaskDebugInfoParams { + return &GetTaskDebugInfoParams{ + HTTPClient: client, + } +} + +/* +GetTaskDebugInfoParams contains all the parameters to send to the API endpoint + + for the get task debug info operation. + + Typically these are written to a http.Request. +*/ +type GetTaskDebugInfoParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + /* Verbosity. + + verbosity (Prints information for the given task name.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks) + + Format: int32 + */ + Verbosity *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskDebugInfoParams) WithDefaults() *GetTaskDebugInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskDebugInfoParams) SetDefaults() { + var ( + verbosityDefault = int32(0) + ) + + val := GetTaskDebugInfoParams{ + Verbosity: &verbosityDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get task debug info params +func (o *GetTaskDebugInfoParams) WithTimeout(timeout time.Duration) *GetTaskDebugInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task debug info params +func (o *GetTaskDebugInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task debug info params +func (o *GetTaskDebugInfoParams) WithContext(ctx context.Context) *GetTaskDebugInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task debug info params +func (o *GetTaskDebugInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task debug info params +func (o *GetTaskDebugInfoParams) WithHTTPClient(client *http.Client) *GetTaskDebugInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task debug info params +func (o *GetTaskDebugInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get task debug info params +func (o *GetTaskDebugInfoParams) WithTaskName(taskName string) *GetTaskDebugInfoParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get task debug info params +func (o *GetTaskDebugInfoParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WithVerbosity adds the verbosity to the get task debug info params +func (o *GetTaskDebugInfoParams) WithVerbosity(verbosity *int32) *GetTaskDebugInfoParams { + o.SetVerbosity(verbosity) + return o +} + +// SetVerbosity adds the verbosity to the get task debug info params +func (o *GetTaskDebugInfoParams) SetVerbosity(verbosity *int32) { + o.Verbosity = verbosity +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskDebugInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if o.Verbosity != nil { + + // query param verbosity + var qrVerbosity int32 + + if o.Verbosity != nil { + qrVerbosity = *o.Verbosity + } + qVerbosity := swag.FormatInt32(qrVerbosity) + if qVerbosity != "" { + + if err := r.SetQueryParam("verbosity", qVerbosity); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_debug_info_responses.go b/src/client/task/get_task_debug_info_responses.go new file mode 100644 index 0000000..a807989 --- /dev/null +++ b/src/client/task/get_task_debug_info_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTaskDebugInfoReader is a Reader for the GetTaskDebugInfo structure. +type GetTaskDebugInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskDebugInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskDebugInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskDebugInfoOK creates a GetTaskDebugInfoOK with default headers values +func NewGetTaskDebugInfoOK() *GetTaskDebugInfoOK { + return &GetTaskDebugInfoOK{} +} + +/* +GetTaskDebugInfoOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskDebugInfoOK struct { + Payload *models.TaskDebugInfo +} + +// IsSuccess returns true when this get task debug info o k response has a 2xx status code +func (o *GetTaskDebugInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task debug info o k response has a 3xx status code +func (o *GetTaskDebugInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task debug info o k response has a 4xx status code +func (o *GetTaskDebugInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task debug info o k response has a 5xx status code +func (o *GetTaskDebugInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task debug info o k response a status code equal to that given +func (o *GetTaskDebugInfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task debug info o k response +func (o *GetTaskDebugInfoOK) Code() int { + return 200 +} + +func (o *GetTaskDebugInfoOK) Error() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/debug][%d] getTaskDebugInfoOK %+v", 200, o.Payload) +} + +func (o *GetTaskDebugInfoOK) String() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/debug][%d] getTaskDebugInfoOK %+v", 200, o.Payload) +} + +func (o *GetTaskDebugInfoOK) GetPayload() *models.TaskDebugInfo { + return o.Payload +} + +func (o *GetTaskDebugInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskDebugInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_generation_debug_into_parameters.go b/src/client/task/get_task_generation_debug_into_parameters.go new file mode 100644 index 0000000..750403d --- /dev/null +++ b/src/client/task/get_task_generation_debug_into_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTaskGenerationDebugIntoParams creates a new GetTaskGenerationDebugIntoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskGenerationDebugIntoParams() *GetTaskGenerationDebugIntoParams { + return &GetTaskGenerationDebugIntoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskGenerationDebugIntoParamsWithTimeout creates a new GetTaskGenerationDebugIntoParams object +// with the ability to set a timeout on a request. +func NewGetTaskGenerationDebugIntoParamsWithTimeout(timeout time.Duration) *GetTaskGenerationDebugIntoParams { + return &GetTaskGenerationDebugIntoParams{ + timeout: timeout, + } +} + +// NewGetTaskGenerationDebugIntoParamsWithContext creates a new GetTaskGenerationDebugIntoParams object +// with the ability to set a context for a request. +func NewGetTaskGenerationDebugIntoParamsWithContext(ctx context.Context) *GetTaskGenerationDebugIntoParams { + return &GetTaskGenerationDebugIntoParams{ + Context: ctx, + } +} + +// NewGetTaskGenerationDebugIntoParamsWithHTTPClient creates a new GetTaskGenerationDebugIntoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskGenerationDebugIntoParamsWithHTTPClient(client *http.Client) *GetTaskGenerationDebugIntoParams { + return &GetTaskGenerationDebugIntoParams{ + HTTPClient: client, + } +} + +/* +GetTaskGenerationDebugIntoParams contains all the parameters to send to the API endpoint + + for the get task generation debug into operation. + + Typically these are written to a http.Request. +*/ +type GetTaskGenerationDebugIntoParams struct { + + /* LocalOnly. + + Whether to only lookup local cache for logs + */ + LocalOnly *bool + + /* TableNameWithType. + + Table name with type + */ + TableNameWithType string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task generation debug into params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskGenerationDebugIntoParams) WithDefaults() *GetTaskGenerationDebugIntoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task generation debug into params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskGenerationDebugIntoParams) SetDefaults() { + var ( + localOnlyDefault = bool(false) + ) + + val := GetTaskGenerationDebugIntoParams{ + LocalOnly: &localOnlyDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) WithTimeout(timeout time.Duration) *GetTaskGenerationDebugIntoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) WithContext(ctx context.Context) *GetTaskGenerationDebugIntoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) WithHTTPClient(client *http.Client) *GetTaskGenerationDebugIntoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocalOnly adds the localOnly to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) WithLocalOnly(localOnly *bool) *GetTaskGenerationDebugIntoParams { + o.SetLocalOnly(localOnly) + return o +} + +// SetLocalOnly adds the localOnly to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) SetLocalOnly(localOnly *bool) { + o.LocalOnly = localOnly +} + +// WithTableNameWithType adds the tableNameWithType to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) WithTableNameWithType(tableNameWithType string) *GetTaskGenerationDebugIntoParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTaskType adds the taskType to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) WithTaskType(taskType string) *GetTaskGenerationDebugIntoParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task generation debug into params +func (o *GetTaskGenerationDebugIntoParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskGenerationDebugIntoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LocalOnly != nil { + + // query param localOnly + var qrLocalOnly bool + + if o.LocalOnly != nil { + qrLocalOnly = *o.LocalOnly + } + qLocalOnly := swag.FormatBool(qrLocalOnly) + if qLocalOnly != "" { + + if err := r.SetQueryParam("localOnly", qLocalOnly); err != nil { + return err + } + } + } + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_generation_debug_into_responses.go b/src/client/task/get_task_generation_debug_into_responses.go new file mode 100644 index 0000000..3617e99 --- /dev/null +++ b/src/client/task/get_task_generation_debug_into_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskGenerationDebugIntoReader is a Reader for the GetTaskGenerationDebugInto structure. +type GetTaskGenerationDebugIntoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskGenerationDebugIntoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskGenerationDebugIntoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskGenerationDebugIntoOK creates a GetTaskGenerationDebugIntoOK with default headers values +func NewGetTaskGenerationDebugIntoOK() *GetTaskGenerationDebugIntoOK { + return &GetTaskGenerationDebugIntoOK{} +} + +/* +GetTaskGenerationDebugIntoOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskGenerationDebugIntoOK struct { + Payload string +} + +// IsSuccess returns true when this get task generation debug into o k response has a 2xx status code +func (o *GetTaskGenerationDebugIntoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task generation debug into o k response has a 3xx status code +func (o *GetTaskGenerationDebugIntoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task generation debug into o k response has a 4xx status code +func (o *GetTaskGenerationDebugIntoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task generation debug into o k response has a 5xx status code +func (o *GetTaskGenerationDebugIntoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task generation debug into o k response a status code equal to that given +func (o *GetTaskGenerationDebugIntoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task generation debug into o k response +func (o *GetTaskGenerationDebugIntoOK) Code() int { + return 200 +} + +func (o *GetTaskGenerationDebugIntoOK) Error() string { + return fmt.Sprintf("[GET /tasks/generator/{tableNameWithType}/{taskType}/debug][%d] getTaskGenerationDebugIntoOK %+v", 200, o.Payload) +} + +func (o *GetTaskGenerationDebugIntoOK) String() string { + return fmt.Sprintf("[GET /tasks/generator/{tableNameWithType}/{taskType}/debug][%d] getTaskGenerationDebugIntoOK %+v", 200, o.Payload) +} + +func (o *GetTaskGenerationDebugIntoOK) GetPayload() string { + return o.Payload +} + +func (o *GetTaskGenerationDebugIntoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_metadata_by_table_parameters.go b/src/client/task/get_task_metadata_by_table_parameters.go new file mode 100644 index 0000000..248ae95 --- /dev/null +++ b/src/client/task/get_task_metadata_by_table_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskMetadataByTableParams creates a new GetTaskMetadataByTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskMetadataByTableParams() *GetTaskMetadataByTableParams { + return &GetTaskMetadataByTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskMetadataByTableParamsWithTimeout creates a new GetTaskMetadataByTableParams object +// with the ability to set a timeout on a request. +func NewGetTaskMetadataByTableParamsWithTimeout(timeout time.Duration) *GetTaskMetadataByTableParams { + return &GetTaskMetadataByTableParams{ + timeout: timeout, + } +} + +// NewGetTaskMetadataByTableParamsWithContext creates a new GetTaskMetadataByTableParams object +// with the ability to set a context for a request. +func NewGetTaskMetadataByTableParamsWithContext(ctx context.Context) *GetTaskMetadataByTableParams { + return &GetTaskMetadataByTableParams{ + Context: ctx, + } +} + +// NewGetTaskMetadataByTableParamsWithHTTPClient creates a new GetTaskMetadataByTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskMetadataByTableParamsWithHTTPClient(client *http.Client) *GetTaskMetadataByTableParams { + return &GetTaskMetadataByTableParams{ + HTTPClient: client, + } +} + +/* +GetTaskMetadataByTableParams contains all the parameters to send to the API endpoint + + for the get task metadata by table operation. + + Typically these are written to a http.Request. +*/ +type GetTaskMetadataByTableParams struct { + + /* TableNameWithType. + + Table name with type + */ + TableNameWithType string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task metadata by table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskMetadataByTableParams) WithDefaults() *GetTaskMetadataByTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task metadata by table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskMetadataByTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) WithTimeout(timeout time.Duration) *GetTaskMetadataByTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) WithContext(ctx context.Context) *GetTaskMetadataByTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) WithHTTPClient(client *http.Client) *GetTaskMetadataByTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableNameWithType adds the tableNameWithType to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) WithTableNameWithType(tableNameWithType string) *GetTaskMetadataByTableParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTaskType adds the taskType to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) WithTaskType(taskType string) *GetTaskMetadataByTableParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task metadata by table params +func (o *GetTaskMetadataByTableParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskMetadataByTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_metadata_by_table_responses.go b/src/client/task/get_task_metadata_by_table_responses.go new file mode 100644 index 0000000..b57ea28 --- /dev/null +++ b/src/client/task/get_task_metadata_by_table_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskMetadataByTableReader is a Reader for the GetTaskMetadataByTable structure. +type GetTaskMetadataByTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskMetadataByTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskMetadataByTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskMetadataByTableOK creates a GetTaskMetadataByTableOK with default headers values +func NewGetTaskMetadataByTableOK() *GetTaskMetadataByTableOK { + return &GetTaskMetadataByTableOK{} +} + +/* +GetTaskMetadataByTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskMetadataByTableOK struct { + Payload string +} + +// IsSuccess returns true when this get task metadata by table o k response has a 2xx status code +func (o *GetTaskMetadataByTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task metadata by table o k response has a 3xx status code +func (o *GetTaskMetadataByTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task metadata by table o k response has a 4xx status code +func (o *GetTaskMetadataByTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task metadata by table o k response has a 5xx status code +func (o *GetTaskMetadataByTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task metadata by table o k response a status code equal to that given +func (o *GetTaskMetadataByTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task metadata by table o k response +func (o *GetTaskMetadataByTableOK) Code() int { + return 200 +} + +func (o *GetTaskMetadataByTableOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/{tableNameWithType}/metadata][%d] getTaskMetadataByTableOK %+v", 200, o.Payload) +} + +func (o *GetTaskMetadataByTableOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/{tableNameWithType}/metadata][%d] getTaskMetadataByTableOK %+v", 200, o.Payload) +} + +func (o *GetTaskMetadataByTableOK) GetPayload() string { + return o.Payload +} + +func (o *GetTaskMetadataByTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_queue_state_deprecated_parameters.go b/src/client/task/get_task_queue_state_deprecated_parameters.go new file mode 100644 index 0000000..6319792 --- /dev/null +++ b/src/client/task/get_task_queue_state_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskQueueStateDeprecatedParams creates a new GetTaskQueueStateDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskQueueStateDeprecatedParams() *GetTaskQueueStateDeprecatedParams { + return &GetTaskQueueStateDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskQueueStateDeprecatedParamsWithTimeout creates a new GetTaskQueueStateDeprecatedParams object +// with the ability to set a timeout on a request. +func NewGetTaskQueueStateDeprecatedParamsWithTimeout(timeout time.Duration) *GetTaskQueueStateDeprecatedParams { + return &GetTaskQueueStateDeprecatedParams{ + timeout: timeout, + } +} + +// NewGetTaskQueueStateDeprecatedParamsWithContext creates a new GetTaskQueueStateDeprecatedParams object +// with the ability to set a context for a request. +func NewGetTaskQueueStateDeprecatedParamsWithContext(ctx context.Context) *GetTaskQueueStateDeprecatedParams { + return &GetTaskQueueStateDeprecatedParams{ + Context: ctx, + } +} + +// NewGetTaskQueueStateDeprecatedParamsWithHTTPClient creates a new GetTaskQueueStateDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskQueueStateDeprecatedParamsWithHTTPClient(client *http.Client) *GetTaskQueueStateDeprecatedParams { + return &GetTaskQueueStateDeprecatedParams{ + HTTPClient: client, + } +} + +/* +GetTaskQueueStateDeprecatedParams contains all the parameters to send to the API endpoint + + for the get task queue state deprecated operation. + + Typically these are written to a http.Request. +*/ +type GetTaskQueueStateDeprecatedParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task queue state deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskQueueStateDeprecatedParams) WithDefaults() *GetTaskQueueStateDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task queue state deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskQueueStateDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) WithTimeout(timeout time.Duration) *GetTaskQueueStateDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) WithContext(ctx context.Context) *GetTaskQueueStateDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) WithHTTPClient(client *http.Client) *GetTaskQueueStateDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) WithTaskType(taskType string) *GetTaskQueueStateDeprecatedParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task queue state deprecated params +func (o *GetTaskQueueStateDeprecatedParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskQueueStateDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_queue_state_deprecated_responses.go b/src/client/task/get_task_queue_state_deprecated_responses.go new file mode 100644 index 0000000..f79d881 --- /dev/null +++ b/src/client/task/get_task_queue_state_deprecated_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTaskQueueStateDeprecatedReader is a Reader for the GetTaskQueueStateDeprecated structure. +type GetTaskQueueStateDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskQueueStateDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskQueueStateDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskQueueStateDeprecatedOK creates a GetTaskQueueStateDeprecatedOK with default headers values +func NewGetTaskQueueStateDeprecatedOK() *GetTaskQueueStateDeprecatedOK { + return &GetTaskQueueStateDeprecatedOK{} +} + +/* +GetTaskQueueStateDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskQueueStateDeprecatedOK struct { + Payload *models.StringResultResponse +} + +// IsSuccess returns true when this get task queue state deprecated o k response has a 2xx status code +func (o *GetTaskQueueStateDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task queue state deprecated o k response has a 3xx status code +func (o *GetTaskQueueStateDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task queue state deprecated o k response has a 4xx status code +func (o *GetTaskQueueStateDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task queue state deprecated o k response has a 5xx status code +func (o *GetTaskQueueStateDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task queue state deprecated o k response a status code equal to that given +func (o *GetTaskQueueStateDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task queue state deprecated o k response +func (o *GetTaskQueueStateDeprecatedOK) Code() int { + return 200 +} + +func (o *GetTaskQueueStateDeprecatedOK) Error() string { + return fmt.Sprintf("[GET /tasks/taskqueuestate/{taskType}][%d] getTaskQueueStateDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskQueueStateDeprecatedOK) String() string { + return fmt.Sprintf("[GET /tasks/taskqueuestate/{taskType}][%d] getTaskQueueStateDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskQueueStateDeprecatedOK) GetPayload() *models.StringResultResponse { + return o.Payload +} + +func (o *GetTaskQueueStateDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StringResultResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_queue_state_parameters.go b/src/client/task/get_task_queue_state_parameters.go new file mode 100644 index 0000000..42466ec --- /dev/null +++ b/src/client/task/get_task_queue_state_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskQueueStateParams creates a new GetTaskQueueStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskQueueStateParams() *GetTaskQueueStateParams { + return &GetTaskQueueStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskQueueStateParamsWithTimeout creates a new GetTaskQueueStateParams object +// with the ability to set a timeout on a request. +func NewGetTaskQueueStateParamsWithTimeout(timeout time.Duration) *GetTaskQueueStateParams { + return &GetTaskQueueStateParams{ + timeout: timeout, + } +} + +// NewGetTaskQueueStateParamsWithContext creates a new GetTaskQueueStateParams object +// with the ability to set a context for a request. +func NewGetTaskQueueStateParamsWithContext(ctx context.Context) *GetTaskQueueStateParams { + return &GetTaskQueueStateParams{ + Context: ctx, + } +} + +// NewGetTaskQueueStateParamsWithHTTPClient creates a new GetTaskQueueStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskQueueStateParamsWithHTTPClient(client *http.Client) *GetTaskQueueStateParams { + return &GetTaskQueueStateParams{ + HTTPClient: client, + } +} + +/* +GetTaskQueueStateParams contains all the parameters to send to the API endpoint + + for the get task queue state operation. + + Typically these are written to a http.Request. +*/ +type GetTaskQueueStateParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task queue state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskQueueStateParams) WithDefaults() *GetTaskQueueStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task queue state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskQueueStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task queue state params +func (o *GetTaskQueueStateParams) WithTimeout(timeout time.Duration) *GetTaskQueueStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task queue state params +func (o *GetTaskQueueStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task queue state params +func (o *GetTaskQueueStateParams) WithContext(ctx context.Context) *GetTaskQueueStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task queue state params +func (o *GetTaskQueueStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task queue state params +func (o *GetTaskQueueStateParams) WithHTTPClient(client *http.Client) *GetTaskQueueStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task queue state params +func (o *GetTaskQueueStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get task queue state params +func (o *GetTaskQueueStateParams) WithTaskType(taskType string) *GetTaskQueueStateParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task queue state params +func (o *GetTaskQueueStateParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskQueueStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_queue_state_responses.go b/src/client/task/get_task_queue_state_responses.go new file mode 100644 index 0000000..4006f0d --- /dev/null +++ b/src/client/task/get_task_queue_state_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskQueueStateReader is a Reader for the GetTaskQueueState structure. +type GetTaskQueueStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskQueueStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskQueueStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskQueueStateOK creates a GetTaskQueueStateOK with default headers values +func NewGetTaskQueueStateOK() *GetTaskQueueStateOK { + return &GetTaskQueueStateOK{} +} + +/* +GetTaskQueueStateOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskQueueStateOK struct { + Payload string +} + +// IsSuccess returns true when this get task queue state o k response has a 2xx status code +func (o *GetTaskQueueStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task queue state o k response has a 3xx status code +func (o *GetTaskQueueStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task queue state o k response has a 4xx status code +func (o *GetTaskQueueStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task queue state o k response has a 5xx status code +func (o *GetTaskQueueStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task queue state o k response a status code equal to that given +func (o *GetTaskQueueStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task queue state o k response +func (o *GetTaskQueueStateOK) Code() int { + return 200 +} + +func (o *GetTaskQueueStateOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/state][%d] getTaskQueueStateOK %+v", 200, o.Payload) +} + +func (o *GetTaskQueueStateOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/state][%d] getTaskQueueStateOK %+v", 200, o.Payload) +} + +func (o *GetTaskQueueStateOK) GetPayload() string { + return o.Payload +} + +func (o *GetTaskQueueStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_queues_parameters.go b/src/client/task/get_task_queues_parameters.go new file mode 100644 index 0000000..8dcf981 --- /dev/null +++ b/src/client/task/get_task_queues_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskQueuesParams creates a new GetTaskQueuesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskQueuesParams() *GetTaskQueuesParams { + return &GetTaskQueuesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskQueuesParamsWithTimeout creates a new GetTaskQueuesParams object +// with the ability to set a timeout on a request. +func NewGetTaskQueuesParamsWithTimeout(timeout time.Duration) *GetTaskQueuesParams { + return &GetTaskQueuesParams{ + timeout: timeout, + } +} + +// NewGetTaskQueuesParamsWithContext creates a new GetTaskQueuesParams object +// with the ability to set a context for a request. +func NewGetTaskQueuesParamsWithContext(ctx context.Context) *GetTaskQueuesParams { + return &GetTaskQueuesParams{ + Context: ctx, + } +} + +// NewGetTaskQueuesParamsWithHTTPClient creates a new GetTaskQueuesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskQueuesParamsWithHTTPClient(client *http.Client) *GetTaskQueuesParams { + return &GetTaskQueuesParams{ + HTTPClient: client, + } +} + +/* +GetTaskQueuesParams contains all the parameters to send to the API endpoint + + for the get task queues operation. + + Typically these are written to a http.Request. +*/ +type GetTaskQueuesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskQueuesParams) WithDefaults() *GetTaskQueuesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskQueuesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task queues params +func (o *GetTaskQueuesParams) WithTimeout(timeout time.Duration) *GetTaskQueuesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task queues params +func (o *GetTaskQueuesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task queues params +func (o *GetTaskQueuesParams) WithContext(ctx context.Context) *GetTaskQueuesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task queues params +func (o *GetTaskQueuesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task queues params +func (o *GetTaskQueuesParams) WithHTTPClient(client *http.Client) *GetTaskQueuesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task queues params +func (o *GetTaskQueuesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskQueuesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_queues_responses.go b/src/client/task/get_task_queues_responses.go new file mode 100644 index 0000000..4a6c0ef --- /dev/null +++ b/src/client/task/get_task_queues_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskQueuesReader is a Reader for the GetTaskQueues structure. +type GetTaskQueuesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskQueuesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskQueuesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskQueuesOK creates a GetTaskQueuesOK with default headers values +func NewGetTaskQueuesOK() *GetTaskQueuesOK { + return &GetTaskQueuesOK{} +} + +/* +GetTaskQueuesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskQueuesOK struct { + Payload []string +} + +// IsSuccess returns true when this get task queues o k response has a 2xx status code +func (o *GetTaskQueuesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task queues o k response has a 3xx status code +func (o *GetTaskQueuesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task queues o k response has a 4xx status code +func (o *GetTaskQueuesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task queues o k response has a 5xx status code +func (o *GetTaskQueuesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task queues o k response a status code equal to that given +func (o *GetTaskQueuesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task queues o k response +func (o *GetTaskQueuesOK) Code() int { + return 200 +} + +func (o *GetTaskQueuesOK) Error() string { + return fmt.Sprintf("[GET /tasks/taskqueues][%d] getTaskQueuesOK %+v", 200, o.Payload) +} + +func (o *GetTaskQueuesOK) String() string { + return fmt.Sprintf("[GET /tasks/taskqueues][%d] getTaskQueuesOK %+v", 200, o.Payload) +} + +func (o *GetTaskQueuesOK) GetPayload() []string { + return o.Payload +} + +func (o *GetTaskQueuesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_state_deprecated_parameters.go b/src/client/task/get_task_state_deprecated_parameters.go new file mode 100644 index 0000000..e9a3cbe --- /dev/null +++ b/src/client/task/get_task_state_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskStateDeprecatedParams creates a new GetTaskStateDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskStateDeprecatedParams() *GetTaskStateDeprecatedParams { + return &GetTaskStateDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskStateDeprecatedParamsWithTimeout creates a new GetTaskStateDeprecatedParams object +// with the ability to set a timeout on a request. +func NewGetTaskStateDeprecatedParamsWithTimeout(timeout time.Duration) *GetTaskStateDeprecatedParams { + return &GetTaskStateDeprecatedParams{ + timeout: timeout, + } +} + +// NewGetTaskStateDeprecatedParamsWithContext creates a new GetTaskStateDeprecatedParams object +// with the ability to set a context for a request. +func NewGetTaskStateDeprecatedParamsWithContext(ctx context.Context) *GetTaskStateDeprecatedParams { + return &GetTaskStateDeprecatedParams{ + Context: ctx, + } +} + +// NewGetTaskStateDeprecatedParamsWithHTTPClient creates a new GetTaskStateDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskStateDeprecatedParamsWithHTTPClient(client *http.Client) *GetTaskStateDeprecatedParams { + return &GetTaskStateDeprecatedParams{ + HTTPClient: client, + } +} + +/* +GetTaskStateDeprecatedParams contains all the parameters to send to the API endpoint + + for the get task state deprecated operation. + + Typically these are written to a http.Request. +*/ +type GetTaskStateDeprecatedParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task state deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStateDeprecatedParams) WithDefaults() *GetTaskStateDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task state deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStateDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) WithTimeout(timeout time.Duration) *GetTaskStateDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) WithContext(ctx context.Context) *GetTaskStateDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) WithHTTPClient(client *http.Client) *GetTaskStateDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) WithTaskName(taskName string) *GetTaskStateDeprecatedParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get task state deprecated params +func (o *GetTaskStateDeprecatedParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskStateDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_state_deprecated_responses.go b/src/client/task/get_task_state_deprecated_responses.go new file mode 100644 index 0000000..cc92d69 --- /dev/null +++ b/src/client/task/get_task_state_deprecated_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTaskStateDeprecatedReader is a Reader for the GetTaskStateDeprecated structure. +type GetTaskStateDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskStateDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskStateDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskStateDeprecatedOK creates a GetTaskStateDeprecatedOK with default headers values +func NewGetTaskStateDeprecatedOK() *GetTaskStateDeprecatedOK { + return &GetTaskStateDeprecatedOK{} +} + +/* +GetTaskStateDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskStateDeprecatedOK struct { + Payload *models.StringResultResponse +} + +// IsSuccess returns true when this get task state deprecated o k response has a 2xx status code +func (o *GetTaskStateDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task state deprecated o k response has a 3xx status code +func (o *GetTaskStateDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task state deprecated o k response has a 4xx status code +func (o *GetTaskStateDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task state deprecated o k response has a 5xx status code +func (o *GetTaskStateDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task state deprecated o k response a status code equal to that given +func (o *GetTaskStateDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task state deprecated o k response +func (o *GetTaskStateDeprecatedOK) Code() int { + return 200 +} + +func (o *GetTaskStateDeprecatedOK) Error() string { + return fmt.Sprintf("[GET /tasks/taskstate/{taskName}][%d] getTaskStateDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskStateDeprecatedOK) String() string { + return fmt.Sprintf("[GET /tasks/taskstate/{taskName}][%d] getTaskStateDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskStateDeprecatedOK) GetPayload() *models.StringResultResponse { + return o.Payload +} + +func (o *GetTaskStateDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StringResultResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_state_parameters.go b/src/client/task/get_task_state_parameters.go new file mode 100644 index 0000000..04fe4af --- /dev/null +++ b/src/client/task/get_task_state_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskStateParams creates a new GetTaskStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskStateParams() *GetTaskStateParams { + return &GetTaskStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskStateParamsWithTimeout creates a new GetTaskStateParams object +// with the ability to set a timeout on a request. +func NewGetTaskStateParamsWithTimeout(timeout time.Duration) *GetTaskStateParams { + return &GetTaskStateParams{ + timeout: timeout, + } +} + +// NewGetTaskStateParamsWithContext creates a new GetTaskStateParams object +// with the ability to set a context for a request. +func NewGetTaskStateParamsWithContext(ctx context.Context) *GetTaskStateParams { + return &GetTaskStateParams{ + Context: ctx, + } +} + +// NewGetTaskStateParamsWithHTTPClient creates a new GetTaskStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskStateParamsWithHTTPClient(client *http.Client) *GetTaskStateParams { + return &GetTaskStateParams{ + HTTPClient: client, + } +} + +/* +GetTaskStateParams contains all the parameters to send to the API endpoint + + for the get task state operation. + + Typically these are written to a http.Request. +*/ +type GetTaskStateParams struct { + + /* TaskName. + + Task name + */ + TaskName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStateParams) WithDefaults() *GetTaskStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task state params +func (o *GetTaskStateParams) WithTimeout(timeout time.Duration) *GetTaskStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task state params +func (o *GetTaskStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task state params +func (o *GetTaskStateParams) WithContext(ctx context.Context) *GetTaskStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task state params +func (o *GetTaskStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task state params +func (o *GetTaskStateParams) WithHTTPClient(client *http.Client) *GetTaskStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task state params +func (o *GetTaskStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskName adds the taskName to the get task state params +func (o *GetTaskStateParams) WithTaskName(taskName string) *GetTaskStateParams { + o.SetTaskName(taskName) + return o +} + +// SetTaskName adds the taskName to the get task state params +func (o *GetTaskStateParams) SetTaskName(taskName string) { + o.TaskName = taskName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskName + if err := r.SetPathParam("taskName", o.TaskName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_state_responses.go b/src/client/task/get_task_state_responses.go new file mode 100644 index 0000000..322c7b9 --- /dev/null +++ b/src/client/task/get_task_state_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskStateReader is a Reader for the GetTaskState structure. +type GetTaskStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskStateOK creates a GetTaskStateOK with default headers values +func NewGetTaskStateOK() *GetTaskStateOK { + return &GetTaskStateOK{} +} + +/* +GetTaskStateOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskStateOK struct { + Payload string +} + +// IsSuccess returns true when this get task state o k response has a 2xx status code +func (o *GetTaskStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task state o k response has a 3xx status code +func (o *GetTaskStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task state o k response has a 4xx status code +func (o *GetTaskStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task state o k response has a 5xx status code +func (o *GetTaskStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task state o k response a status code equal to that given +func (o *GetTaskStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task state o k response +func (o *GetTaskStateOK) Code() int { + return 200 +} + +func (o *GetTaskStateOK) Error() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/state][%d] getTaskStateOK %+v", 200, o.Payload) +} + +func (o *GetTaskStateOK) String() string { + return fmt.Sprintf("[GET /tasks/task/{taskName}/state][%d] getTaskStateOK %+v", 200, o.Payload) +} + +func (o *GetTaskStateOK) GetPayload() string { + return o.Payload +} + +func (o *GetTaskStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_states_by_table_parameters.go b/src/client/task/get_task_states_by_table_parameters.go new file mode 100644 index 0000000..f697531 --- /dev/null +++ b/src/client/task/get_task_states_by_table_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskStatesByTableParams creates a new GetTaskStatesByTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskStatesByTableParams() *GetTaskStatesByTableParams { + return &GetTaskStatesByTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskStatesByTableParamsWithTimeout creates a new GetTaskStatesByTableParams object +// with the ability to set a timeout on a request. +func NewGetTaskStatesByTableParamsWithTimeout(timeout time.Duration) *GetTaskStatesByTableParams { + return &GetTaskStatesByTableParams{ + timeout: timeout, + } +} + +// NewGetTaskStatesByTableParamsWithContext creates a new GetTaskStatesByTableParams object +// with the ability to set a context for a request. +func NewGetTaskStatesByTableParamsWithContext(ctx context.Context) *GetTaskStatesByTableParams { + return &GetTaskStatesByTableParams{ + Context: ctx, + } +} + +// NewGetTaskStatesByTableParamsWithHTTPClient creates a new GetTaskStatesByTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskStatesByTableParamsWithHTTPClient(client *http.Client) *GetTaskStatesByTableParams { + return &GetTaskStatesByTableParams{ + HTTPClient: client, + } +} + +/* +GetTaskStatesByTableParams contains all the parameters to send to the API endpoint + + for the get task states by table operation. + + Typically these are written to a http.Request. +*/ +type GetTaskStatesByTableParams struct { + + /* TableNameWithType. + + Table name with type + */ + TableNameWithType string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task states by table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStatesByTableParams) WithDefaults() *GetTaskStatesByTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task states by table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStatesByTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task states by table params +func (o *GetTaskStatesByTableParams) WithTimeout(timeout time.Duration) *GetTaskStatesByTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task states by table params +func (o *GetTaskStatesByTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task states by table params +func (o *GetTaskStatesByTableParams) WithContext(ctx context.Context) *GetTaskStatesByTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task states by table params +func (o *GetTaskStatesByTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task states by table params +func (o *GetTaskStatesByTableParams) WithHTTPClient(client *http.Client) *GetTaskStatesByTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task states by table params +func (o *GetTaskStatesByTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableNameWithType adds the tableNameWithType to the get task states by table params +func (o *GetTaskStatesByTableParams) WithTableNameWithType(tableNameWithType string) *GetTaskStatesByTableParams { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the get task states by table params +func (o *GetTaskStatesByTableParams) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTaskType adds the taskType to the get task states by table params +func (o *GetTaskStatesByTableParams) WithTaskType(taskType string) *GetTaskStatesByTableParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task states by table params +func (o *GetTaskStatesByTableParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskStatesByTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_states_by_table_responses.go b/src/client/task/get_task_states_by_table_responses.go new file mode 100644 index 0000000..d115d11 --- /dev/null +++ b/src/client/task/get_task_states_by_table_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskStatesByTableReader is a Reader for the GetTaskStatesByTable structure. +type GetTaskStatesByTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskStatesByTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskStatesByTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskStatesByTableOK creates a GetTaskStatesByTableOK with default headers values +func NewGetTaskStatesByTableOK() *GetTaskStatesByTableOK { + return &GetTaskStatesByTableOK{} +} + +/* +GetTaskStatesByTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskStatesByTableOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get task states by table o k response has a 2xx status code +func (o *GetTaskStatesByTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task states by table o k response has a 3xx status code +func (o *GetTaskStatesByTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task states by table o k response has a 4xx status code +func (o *GetTaskStatesByTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task states by table o k response has a 5xx status code +func (o *GetTaskStatesByTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task states by table o k response a status code equal to that given +func (o *GetTaskStatesByTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task states by table o k response +func (o *GetTaskStatesByTableOK) Code() int { + return 200 +} + +func (o *GetTaskStatesByTableOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/{tableNameWithType}/state][%d] getTaskStatesByTableOK %+v", 200, o.Payload) +} + +func (o *GetTaskStatesByTableOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/{tableNameWithType}/state][%d] getTaskStatesByTableOK %+v", 200, o.Payload) +} + +func (o *GetTaskStatesByTableOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetTaskStatesByTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_states_deprecated_parameters.go b/src/client/task/get_task_states_deprecated_parameters.go new file mode 100644 index 0000000..00ed903 --- /dev/null +++ b/src/client/task/get_task_states_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskStatesDeprecatedParams creates a new GetTaskStatesDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskStatesDeprecatedParams() *GetTaskStatesDeprecatedParams { + return &GetTaskStatesDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskStatesDeprecatedParamsWithTimeout creates a new GetTaskStatesDeprecatedParams object +// with the ability to set a timeout on a request. +func NewGetTaskStatesDeprecatedParamsWithTimeout(timeout time.Duration) *GetTaskStatesDeprecatedParams { + return &GetTaskStatesDeprecatedParams{ + timeout: timeout, + } +} + +// NewGetTaskStatesDeprecatedParamsWithContext creates a new GetTaskStatesDeprecatedParams object +// with the ability to set a context for a request. +func NewGetTaskStatesDeprecatedParamsWithContext(ctx context.Context) *GetTaskStatesDeprecatedParams { + return &GetTaskStatesDeprecatedParams{ + Context: ctx, + } +} + +// NewGetTaskStatesDeprecatedParamsWithHTTPClient creates a new GetTaskStatesDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskStatesDeprecatedParamsWithHTTPClient(client *http.Client) *GetTaskStatesDeprecatedParams { + return &GetTaskStatesDeprecatedParams{ + HTTPClient: client, + } +} + +/* +GetTaskStatesDeprecatedParams contains all the parameters to send to the API endpoint + + for the get task states deprecated operation. + + Typically these are written to a http.Request. +*/ +type GetTaskStatesDeprecatedParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task states deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStatesDeprecatedParams) WithDefaults() *GetTaskStatesDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task states deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStatesDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) WithTimeout(timeout time.Duration) *GetTaskStatesDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) WithContext(ctx context.Context) *GetTaskStatesDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) WithHTTPClient(client *http.Client) *GetTaskStatesDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) WithTaskType(taskType string) *GetTaskStatesDeprecatedParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task states deprecated params +func (o *GetTaskStatesDeprecatedParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskStatesDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_states_deprecated_responses.go b/src/client/task/get_task_states_deprecated_responses.go new file mode 100644 index 0000000..9776085 --- /dev/null +++ b/src/client/task/get_task_states_deprecated_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskStatesDeprecatedReader is a Reader for the GetTaskStatesDeprecated structure. +type GetTaskStatesDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskStatesDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskStatesDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskStatesDeprecatedOK creates a GetTaskStatesDeprecatedOK with default headers values +func NewGetTaskStatesDeprecatedOK() *GetTaskStatesDeprecatedOK { + return &GetTaskStatesDeprecatedOK{} +} + +/* +GetTaskStatesDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskStatesDeprecatedOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get task states deprecated o k response has a 2xx status code +func (o *GetTaskStatesDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task states deprecated o k response has a 3xx status code +func (o *GetTaskStatesDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task states deprecated o k response has a 4xx status code +func (o *GetTaskStatesDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task states deprecated o k response has a 5xx status code +func (o *GetTaskStatesDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task states deprecated o k response a status code equal to that given +func (o *GetTaskStatesDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task states deprecated o k response +func (o *GetTaskStatesDeprecatedOK) Code() int { + return 200 +} + +func (o *GetTaskStatesDeprecatedOK) Error() string { + return fmt.Sprintf("[GET /tasks/taskstates/{taskType}][%d] getTaskStatesDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskStatesDeprecatedOK) String() string { + return fmt.Sprintf("[GET /tasks/taskstates/{taskType}][%d] getTaskStatesDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTaskStatesDeprecatedOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetTaskStatesDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_task_states_parameters.go b/src/client/task/get_task_states_parameters.go new file mode 100644 index 0000000..2bbec5b --- /dev/null +++ b/src/client/task/get_task_states_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskStatesParams creates a new GetTaskStatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskStatesParams() *GetTaskStatesParams { + return &GetTaskStatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskStatesParamsWithTimeout creates a new GetTaskStatesParams object +// with the ability to set a timeout on a request. +func NewGetTaskStatesParamsWithTimeout(timeout time.Duration) *GetTaskStatesParams { + return &GetTaskStatesParams{ + timeout: timeout, + } +} + +// NewGetTaskStatesParamsWithContext creates a new GetTaskStatesParams object +// with the ability to set a context for a request. +func NewGetTaskStatesParamsWithContext(ctx context.Context) *GetTaskStatesParams { + return &GetTaskStatesParams{ + Context: ctx, + } +} + +// NewGetTaskStatesParamsWithHTTPClient creates a new GetTaskStatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskStatesParamsWithHTTPClient(client *http.Client) *GetTaskStatesParams { + return &GetTaskStatesParams{ + HTTPClient: client, + } +} + +/* +GetTaskStatesParams contains all the parameters to send to the API endpoint + + for the get task states operation. + + Typically these are written to a http.Request. +*/ +type GetTaskStatesParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task states params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStatesParams) WithDefaults() *GetTaskStatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task states params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskStatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task states params +func (o *GetTaskStatesParams) WithTimeout(timeout time.Duration) *GetTaskStatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task states params +func (o *GetTaskStatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task states params +func (o *GetTaskStatesParams) WithContext(ctx context.Context) *GetTaskStatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task states params +func (o *GetTaskStatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task states params +func (o *GetTaskStatesParams) WithHTTPClient(client *http.Client) *GetTaskStatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task states params +func (o *GetTaskStatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get task states params +func (o *GetTaskStatesParams) WithTaskType(taskType string) *GetTaskStatesParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get task states params +func (o *GetTaskStatesParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_task_states_responses.go b/src/client/task/get_task_states_responses.go new file mode 100644 index 0000000..e9fe8ed --- /dev/null +++ b/src/client/task/get_task_states_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTaskStatesReader is a Reader for the GetTaskStates structure. +type GetTaskStatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskStatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskStatesOK creates a GetTaskStatesOK with default headers values +func NewGetTaskStatesOK() *GetTaskStatesOK { + return &GetTaskStatesOK{} +} + +/* +GetTaskStatesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTaskStatesOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this get task states o k response has a 2xx status code +func (o *GetTaskStatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task states o k response has a 3xx status code +func (o *GetTaskStatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task states o k response has a 4xx status code +func (o *GetTaskStatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task states o k response has a 5xx status code +func (o *GetTaskStatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task states o k response a status code equal to that given +func (o *GetTaskStatesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get task states o k response +func (o *GetTaskStatesOK) Code() int { + return 200 +} + +func (o *GetTaskStatesOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/taskstates][%d] getTaskStatesOK %+v", 200, o.Payload) +} + +func (o *GetTaskStatesOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/taskstates][%d] getTaskStatesOK %+v", 200, o.Payload) +} + +func (o *GetTaskStatesOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *GetTaskStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_tasks_debug_info1_parameters.go b/src/client/task/get_tasks_debug_info1_parameters.go new file mode 100644 index 0000000..1b6bd6b --- /dev/null +++ b/src/client/task/get_tasks_debug_info1_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTasksDebugInfo1Params creates a new GetTasksDebugInfo1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTasksDebugInfo1Params() *GetTasksDebugInfo1Params { + return &GetTasksDebugInfo1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTasksDebugInfo1ParamsWithTimeout creates a new GetTasksDebugInfo1Params object +// with the ability to set a timeout on a request. +func NewGetTasksDebugInfo1ParamsWithTimeout(timeout time.Duration) *GetTasksDebugInfo1Params { + return &GetTasksDebugInfo1Params{ + timeout: timeout, + } +} + +// NewGetTasksDebugInfo1ParamsWithContext creates a new GetTasksDebugInfo1Params object +// with the ability to set a context for a request. +func NewGetTasksDebugInfo1ParamsWithContext(ctx context.Context) *GetTasksDebugInfo1Params { + return &GetTasksDebugInfo1Params{ + Context: ctx, + } +} + +// NewGetTasksDebugInfo1ParamsWithHTTPClient creates a new GetTasksDebugInfo1Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetTasksDebugInfo1ParamsWithHTTPClient(client *http.Client) *GetTasksDebugInfo1Params { + return &GetTasksDebugInfo1Params{ + HTTPClient: client, + } +} + +/* +GetTasksDebugInfo1Params contains all the parameters to send to the API endpoint + + for the get tasks debug info 1 operation. + + Typically these are written to a http.Request. +*/ +type GetTasksDebugInfo1Params struct { + + /* TableNameWithType. + + Table name with type + */ + TableNameWithType string + + /* TaskType. + + Task type + */ + TaskType string + + /* Verbosity. + + verbosity (Prints information for all the tasks for the given task type and table.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks) + + Format: int32 + */ + Verbosity *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tasks debug info 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksDebugInfo1Params) WithDefaults() *GetTasksDebugInfo1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tasks debug info 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksDebugInfo1Params) SetDefaults() { + var ( + verbosityDefault = int32(0) + ) + + val := GetTasksDebugInfo1Params{ + Verbosity: &verbosityDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) WithTimeout(timeout time.Duration) *GetTasksDebugInfo1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) WithContext(ctx context.Context) *GetTasksDebugInfo1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) WithHTTPClient(client *http.Client) *GetTasksDebugInfo1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableNameWithType adds the tableNameWithType to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) WithTableNameWithType(tableNameWithType string) *GetTasksDebugInfo1Params { + o.SetTableNameWithType(tableNameWithType) + return o +} + +// SetTableNameWithType adds the tableNameWithType to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) SetTableNameWithType(tableNameWithType string) { + o.TableNameWithType = tableNameWithType +} + +// WithTaskType adds the taskType to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) WithTaskType(taskType string) *GetTasksDebugInfo1Params { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WithVerbosity adds the verbosity to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) WithVerbosity(verbosity *int32) *GetTasksDebugInfo1Params { + o.SetVerbosity(verbosity) + return o +} + +// SetVerbosity adds the verbosity to the get tasks debug info 1 params +func (o *GetTasksDebugInfo1Params) SetVerbosity(verbosity *int32) { + o.Verbosity = verbosity +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTasksDebugInfo1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableNameWithType + if err := r.SetPathParam("tableNameWithType", o.TableNameWithType); err != nil { + return err + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if o.Verbosity != nil { + + // query param verbosity + var qrVerbosity int32 + + if o.Verbosity != nil { + qrVerbosity = *o.Verbosity + } + qVerbosity := swag.FormatInt32(qrVerbosity) + if qVerbosity != "" { + + if err := r.SetQueryParam("verbosity", qVerbosity); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_tasks_debug_info1_responses.go b/src/client/task/get_tasks_debug_info1_responses.go new file mode 100644 index 0000000..c732cc2 --- /dev/null +++ b/src/client/task/get_tasks_debug_info1_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTasksDebugInfo1Reader is a Reader for the GetTasksDebugInfo1 structure. +type GetTasksDebugInfo1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTasksDebugInfo1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTasksDebugInfo1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTasksDebugInfo1OK creates a GetTasksDebugInfo1OK with default headers values +func NewGetTasksDebugInfo1OK() *GetTasksDebugInfo1OK { + return &GetTasksDebugInfo1OK{} +} + +/* +GetTasksDebugInfo1OK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTasksDebugInfo1OK struct { + Payload map[string]models.TaskDebugInfo +} + +// IsSuccess returns true when this get tasks debug info1 o k response has a 2xx status code +func (o *GetTasksDebugInfo1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tasks debug info1 o k response has a 3xx status code +func (o *GetTasksDebugInfo1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tasks debug info1 o k response has a 4xx status code +func (o *GetTasksDebugInfo1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tasks debug info1 o k response has a 5xx status code +func (o *GetTasksDebugInfo1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tasks debug info1 o k response a status code equal to that given +func (o *GetTasksDebugInfo1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tasks debug info1 o k response +func (o *GetTasksDebugInfo1OK) Code() int { + return 200 +} + +func (o *GetTasksDebugInfo1OK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/{tableNameWithType}/debug][%d] getTasksDebugInfo1OK %+v", 200, o.Payload) +} + +func (o *GetTasksDebugInfo1OK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/{tableNameWithType}/debug][%d] getTasksDebugInfo1OK %+v", 200, o.Payload) +} + +func (o *GetTasksDebugInfo1OK) GetPayload() map[string]models.TaskDebugInfo { + return o.Payload +} + +func (o *GetTasksDebugInfo1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_tasks_debug_info_parameters.go b/src/client/task/get_tasks_debug_info_parameters.go new file mode 100644 index 0000000..eb84ee3 --- /dev/null +++ b/src/client/task/get_tasks_debug_info_parameters.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTasksDebugInfoParams creates a new GetTasksDebugInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTasksDebugInfoParams() *GetTasksDebugInfoParams { + return &GetTasksDebugInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTasksDebugInfoParamsWithTimeout creates a new GetTasksDebugInfoParams object +// with the ability to set a timeout on a request. +func NewGetTasksDebugInfoParamsWithTimeout(timeout time.Duration) *GetTasksDebugInfoParams { + return &GetTasksDebugInfoParams{ + timeout: timeout, + } +} + +// NewGetTasksDebugInfoParamsWithContext creates a new GetTasksDebugInfoParams object +// with the ability to set a context for a request. +func NewGetTasksDebugInfoParamsWithContext(ctx context.Context) *GetTasksDebugInfoParams { + return &GetTasksDebugInfoParams{ + Context: ctx, + } +} + +// NewGetTasksDebugInfoParamsWithHTTPClient creates a new GetTasksDebugInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTasksDebugInfoParamsWithHTTPClient(client *http.Client) *GetTasksDebugInfoParams { + return &GetTasksDebugInfoParams{ + HTTPClient: client, + } +} + +/* +GetTasksDebugInfoParams contains all the parameters to send to the API endpoint + + for the get tasks debug info operation. + + Typically these are written to a http.Request. +*/ +type GetTasksDebugInfoParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + /* Verbosity. + + verbosity (Prints information for all the tasks for the given task type.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks) + + Format: int32 + */ + Verbosity *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tasks debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksDebugInfoParams) WithDefaults() *GetTasksDebugInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tasks debug info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksDebugInfoParams) SetDefaults() { + var ( + verbosityDefault = int32(0) + ) + + val := GetTasksDebugInfoParams{ + Verbosity: &verbosityDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get tasks debug info params +func (o *GetTasksDebugInfoParams) WithTimeout(timeout time.Duration) *GetTasksDebugInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tasks debug info params +func (o *GetTasksDebugInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tasks debug info params +func (o *GetTasksDebugInfoParams) WithContext(ctx context.Context) *GetTasksDebugInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tasks debug info params +func (o *GetTasksDebugInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tasks debug info params +func (o *GetTasksDebugInfoParams) WithHTTPClient(client *http.Client) *GetTasksDebugInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tasks debug info params +func (o *GetTasksDebugInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get tasks debug info params +func (o *GetTasksDebugInfoParams) WithTaskType(taskType string) *GetTasksDebugInfoParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get tasks debug info params +func (o *GetTasksDebugInfoParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WithVerbosity adds the verbosity to the get tasks debug info params +func (o *GetTasksDebugInfoParams) WithVerbosity(verbosity *int32) *GetTasksDebugInfoParams { + o.SetVerbosity(verbosity) + return o +} + +// SetVerbosity adds the verbosity to the get tasks debug info params +func (o *GetTasksDebugInfoParams) SetVerbosity(verbosity *int32) { + o.Verbosity = verbosity +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTasksDebugInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if o.Verbosity != nil { + + // query param verbosity + var qrVerbosity int32 + + if o.Verbosity != nil { + qrVerbosity = *o.Verbosity + } + qVerbosity := swag.FormatInt32(qrVerbosity) + if qVerbosity != "" { + + if err := r.SetQueryParam("verbosity", qVerbosity); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_tasks_debug_info_responses.go b/src/client/task/get_tasks_debug_info_responses.go new file mode 100644 index 0000000..53420ea --- /dev/null +++ b/src/client/task/get_tasks_debug_info_responses.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTasksDebugInfoReader is a Reader for the GetTasksDebugInfo structure. +type GetTasksDebugInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTasksDebugInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTasksDebugInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTasksDebugInfoOK creates a GetTasksDebugInfoOK with default headers values +func NewGetTasksDebugInfoOK() *GetTasksDebugInfoOK { + return &GetTasksDebugInfoOK{} +} + +/* +GetTasksDebugInfoOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTasksDebugInfoOK struct { + Payload map[string]models.TaskDebugInfo +} + +// IsSuccess returns true when this get tasks debug info o k response has a 2xx status code +func (o *GetTasksDebugInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tasks debug info o k response has a 3xx status code +func (o *GetTasksDebugInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tasks debug info o k response has a 4xx status code +func (o *GetTasksDebugInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tasks debug info o k response has a 5xx status code +func (o *GetTasksDebugInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tasks debug info o k response a status code equal to that given +func (o *GetTasksDebugInfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tasks debug info o k response +func (o *GetTasksDebugInfoOK) Code() int { + return 200 +} + +func (o *GetTasksDebugInfoOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/debug][%d] getTasksDebugInfoOK %+v", 200, o.Payload) +} + +func (o *GetTasksDebugInfoOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/debug][%d] getTasksDebugInfoOK %+v", 200, o.Payload) +} + +func (o *GetTasksDebugInfoOK) GetPayload() map[string]models.TaskDebugInfo { + return o.Payload +} + +func (o *GetTasksDebugInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_tasks_deprecated_parameters.go b/src/client/task/get_tasks_deprecated_parameters.go new file mode 100644 index 0000000..e215f34 --- /dev/null +++ b/src/client/task/get_tasks_deprecated_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTasksDeprecatedParams creates a new GetTasksDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTasksDeprecatedParams() *GetTasksDeprecatedParams { + return &GetTasksDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTasksDeprecatedParamsWithTimeout creates a new GetTasksDeprecatedParams object +// with the ability to set a timeout on a request. +func NewGetTasksDeprecatedParamsWithTimeout(timeout time.Duration) *GetTasksDeprecatedParams { + return &GetTasksDeprecatedParams{ + timeout: timeout, + } +} + +// NewGetTasksDeprecatedParamsWithContext creates a new GetTasksDeprecatedParams object +// with the ability to set a context for a request. +func NewGetTasksDeprecatedParamsWithContext(ctx context.Context) *GetTasksDeprecatedParams { + return &GetTasksDeprecatedParams{ + Context: ctx, + } +} + +// NewGetTasksDeprecatedParamsWithHTTPClient creates a new GetTasksDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTasksDeprecatedParamsWithHTTPClient(client *http.Client) *GetTasksDeprecatedParams { + return &GetTasksDeprecatedParams{ + HTTPClient: client, + } +} + +/* +GetTasksDeprecatedParams contains all the parameters to send to the API endpoint + + for the get tasks deprecated operation. + + Typically these are written to a http.Request. +*/ +type GetTasksDeprecatedParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tasks deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksDeprecatedParams) WithDefaults() *GetTasksDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tasks deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) WithTimeout(timeout time.Duration) *GetTasksDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) WithContext(ctx context.Context) *GetTasksDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) WithHTTPClient(client *http.Client) *GetTasksDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) WithTaskType(taskType string) *GetTasksDeprecatedParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get tasks deprecated params +func (o *GetTasksDeprecatedParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTasksDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_tasks_deprecated_responses.go b/src/client/task/get_tasks_deprecated_responses.go new file mode 100644 index 0000000..054ca16 --- /dev/null +++ b/src/client/task/get_tasks_deprecated_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTasksDeprecatedReader is a Reader for the GetTasksDeprecated structure. +type GetTasksDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTasksDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTasksDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTasksDeprecatedOK creates a GetTasksDeprecatedOK with default headers values +func NewGetTasksDeprecatedOK() *GetTasksDeprecatedOK { + return &GetTasksDeprecatedOK{} +} + +/* +GetTasksDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTasksDeprecatedOK struct { + Payload []string +} + +// IsSuccess returns true when this get tasks deprecated o k response has a 2xx status code +func (o *GetTasksDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tasks deprecated o k response has a 3xx status code +func (o *GetTasksDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tasks deprecated o k response has a 4xx status code +func (o *GetTasksDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tasks deprecated o k response has a 5xx status code +func (o *GetTasksDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tasks deprecated o k response a status code equal to that given +func (o *GetTasksDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tasks deprecated o k response +func (o *GetTasksDeprecatedOK) Code() int { + return 200 +} + +func (o *GetTasksDeprecatedOK) Error() string { + return fmt.Sprintf("[GET /tasks/tasks/{taskType}][%d] getTasksDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTasksDeprecatedOK) String() string { + return fmt.Sprintf("[GET /tasks/tasks/{taskType}][%d] getTasksDeprecatedOK %+v", 200, o.Payload) +} + +func (o *GetTasksDeprecatedOK) GetPayload() []string { + return o.Payload +} + +func (o *GetTasksDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/get_tasks_parameters.go b/src/client/task/get_tasks_parameters.go new file mode 100644 index 0000000..4bdde5b --- /dev/null +++ b/src/client/task/get_tasks_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTasksParams creates a new GetTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTasksParams() *GetTasksParams { + return &GetTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTasksParamsWithTimeout creates a new GetTasksParams object +// with the ability to set a timeout on a request. +func NewGetTasksParamsWithTimeout(timeout time.Duration) *GetTasksParams { + return &GetTasksParams{ + timeout: timeout, + } +} + +// NewGetTasksParamsWithContext creates a new GetTasksParams object +// with the ability to set a context for a request. +func NewGetTasksParamsWithContext(ctx context.Context) *GetTasksParams { + return &GetTasksParams{ + Context: ctx, + } +} + +// NewGetTasksParamsWithHTTPClient creates a new GetTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTasksParamsWithHTTPClient(client *http.Client) *GetTasksParams { + return &GetTasksParams{ + HTTPClient: client, + } +} + +/* +GetTasksParams contains all the parameters to send to the API endpoint + + for the get tasks operation. + + Typically these are written to a http.Request. +*/ +type GetTasksParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksParams) WithDefaults() *GetTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tasks params +func (o *GetTasksParams) WithTimeout(timeout time.Duration) *GetTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tasks params +func (o *GetTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tasks params +func (o *GetTasksParams) WithContext(ctx context.Context) *GetTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tasks params +func (o *GetTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tasks params +func (o *GetTasksParams) WithHTTPClient(client *http.Client) *GetTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tasks params +func (o *GetTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the get tasks params +func (o *GetTasksParams) WithTaskType(taskType string) *GetTasksParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get tasks params +func (o *GetTasksParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/get_tasks_responses.go b/src/client/task/get_tasks_responses.go new file mode 100644 index 0000000..10ce4fd --- /dev/null +++ b/src/client/task/get_tasks_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTasksReader is a Reader for the GetTasks structure. +type GetTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTasksOK creates a GetTasksOK with default headers values +func NewGetTasksOK() *GetTasksOK { + return &GetTasksOK{} +} + +/* +GetTasksOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetTasksOK struct { + Payload []string +} + +// IsSuccess returns true when this get tasks o k response has a 2xx status code +func (o *GetTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tasks o k response has a 3xx status code +func (o *GetTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tasks o k response has a 4xx status code +func (o *GetTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tasks o k response has a 5xx status code +func (o *GetTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tasks o k response a status code equal to that given +func (o *GetTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tasks o k response +func (o *GetTasksOK) Code() int { + return 200 +} + +func (o *GetTasksOK) Error() string { + return fmt.Sprintf("[GET /tasks/{taskType}/tasks][%d] getTasksOK %+v", 200, o.Payload) +} + +func (o *GetTasksOK) String() string { + return fmt.Sprintf("[GET /tasks/{taskType}/tasks][%d] getTasksOK %+v", 200, o.Payload) +} + +func (o *GetTasksOK) GetPayload() []string { + return o.Payload +} + +func (o *GetTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/list_task_types_parameters.go b/src/client/task/list_task_types_parameters.go new file mode 100644 index 0000000..4dafb98 --- /dev/null +++ b/src/client/task/list_task_types_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListTaskTypesParams creates a new ListTaskTypesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTaskTypesParams() *ListTaskTypesParams { + return &ListTaskTypesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTaskTypesParamsWithTimeout creates a new ListTaskTypesParams object +// with the ability to set a timeout on a request. +func NewListTaskTypesParamsWithTimeout(timeout time.Duration) *ListTaskTypesParams { + return &ListTaskTypesParams{ + timeout: timeout, + } +} + +// NewListTaskTypesParamsWithContext creates a new ListTaskTypesParams object +// with the ability to set a context for a request. +func NewListTaskTypesParamsWithContext(ctx context.Context) *ListTaskTypesParams { + return &ListTaskTypesParams{ + Context: ctx, + } +} + +// NewListTaskTypesParamsWithHTTPClient creates a new ListTaskTypesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTaskTypesParamsWithHTTPClient(client *http.Client) *ListTaskTypesParams { + return &ListTaskTypesParams{ + HTTPClient: client, + } +} + +/* +ListTaskTypesParams contains all the parameters to send to the API endpoint + + for the list task types operation. + + Typically these are written to a http.Request. +*/ +type ListTaskTypesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list task types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTaskTypesParams) WithDefaults() *ListTaskTypesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list task types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTaskTypesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list task types params +func (o *ListTaskTypesParams) WithTimeout(timeout time.Duration) *ListTaskTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list task types params +func (o *ListTaskTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list task types params +func (o *ListTaskTypesParams) WithContext(ctx context.Context) *ListTaskTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list task types params +func (o *ListTaskTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list task types params +func (o *ListTaskTypesParams) WithHTTPClient(client *http.Client) *ListTaskTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list task types params +func (o *ListTaskTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTaskTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/list_task_types_responses.go b/src/client/task/list_task_types_responses.go new file mode 100644 index 0000000..a073fd9 --- /dev/null +++ b/src/client/task/list_task_types_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListTaskTypesReader is a Reader for the ListTaskTypes structure. +type ListTaskTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTaskTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTaskTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTaskTypesOK creates a ListTaskTypesOK with default headers values +func NewListTaskTypesOK() *ListTaskTypesOK { + return &ListTaskTypesOK{} +} + +/* +ListTaskTypesOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListTaskTypesOK struct { + Payload []string +} + +// IsSuccess returns true when this list task types o k response has a 2xx status code +func (o *ListTaskTypesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list task types o k response has a 3xx status code +func (o *ListTaskTypesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list task types o k response has a 4xx status code +func (o *ListTaskTypesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list task types o k response has a 5xx status code +func (o *ListTaskTypesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list task types o k response a status code equal to that given +func (o *ListTaskTypesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list task types o k response +func (o *ListTaskTypesOK) Code() int { + return 200 +} + +func (o *ListTaskTypesOK) Error() string { + return fmt.Sprintf("[GET /tasks/tasktypes][%d] listTaskTypesOK %+v", 200, o.Payload) +} + +func (o *ListTaskTypesOK) String() string { + return fmt.Sprintf("[GET /tasks/tasktypes][%d] listTaskTypesOK %+v", 200, o.Payload) +} + +func (o *ListTaskTypesOK) GetPayload() []string { + return o.Payload +} + +func (o *ListTaskTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/resume_tasks_parameters.go b/src/client/task/resume_tasks_parameters.go new file mode 100644 index 0000000..97a2410 --- /dev/null +++ b/src/client/task/resume_tasks_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewResumeTasksParams creates a new ResumeTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResumeTasksParams() *ResumeTasksParams { + return &ResumeTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResumeTasksParamsWithTimeout creates a new ResumeTasksParams object +// with the ability to set a timeout on a request. +func NewResumeTasksParamsWithTimeout(timeout time.Duration) *ResumeTasksParams { + return &ResumeTasksParams{ + timeout: timeout, + } +} + +// NewResumeTasksParamsWithContext creates a new ResumeTasksParams object +// with the ability to set a context for a request. +func NewResumeTasksParamsWithContext(ctx context.Context) *ResumeTasksParams { + return &ResumeTasksParams{ + Context: ctx, + } +} + +// NewResumeTasksParamsWithHTTPClient creates a new ResumeTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewResumeTasksParamsWithHTTPClient(client *http.Client) *ResumeTasksParams { + return &ResumeTasksParams{ + HTTPClient: client, + } +} + +/* +ResumeTasksParams contains all the parameters to send to the API endpoint + + for the resume tasks operation. + + Typically these are written to a http.Request. +*/ +type ResumeTasksParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resume tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResumeTasksParams) WithDefaults() *ResumeTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resume tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResumeTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resume tasks params +func (o *ResumeTasksParams) WithTimeout(timeout time.Duration) *ResumeTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resume tasks params +func (o *ResumeTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resume tasks params +func (o *ResumeTasksParams) WithContext(ctx context.Context) *ResumeTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resume tasks params +func (o *ResumeTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resume tasks params +func (o *ResumeTasksParams) WithHTTPClient(client *http.Client) *ResumeTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resume tasks params +func (o *ResumeTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the resume tasks params +func (o *ResumeTasksParams) WithTaskType(taskType string) *ResumeTasksParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the resume tasks params +func (o *ResumeTasksParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *ResumeTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/resume_tasks_responses.go b/src/client/task/resume_tasks_responses.go new file mode 100644 index 0000000..edbb0d3 --- /dev/null +++ b/src/client/task/resume_tasks_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ResumeTasksReader is a Reader for the ResumeTasks structure. +type ResumeTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResumeTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResumeTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewResumeTasksOK creates a ResumeTasksOK with default headers values +func NewResumeTasksOK() *ResumeTasksOK { + return &ResumeTasksOK{} +} + +/* +ResumeTasksOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ResumeTasksOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this resume tasks o k response has a 2xx status code +func (o *ResumeTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this resume tasks o k response has a 3xx status code +func (o *ResumeTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this resume tasks o k response has a 4xx status code +func (o *ResumeTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this resume tasks o k response has a 5xx status code +func (o *ResumeTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this resume tasks o k response a status code equal to that given +func (o *ResumeTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the resume tasks o k response +func (o *ResumeTasksOK) Code() int { + return 200 +} + +func (o *ResumeTasksOK) Error() string { + return fmt.Sprintf("[PUT /tasks/{taskType}/resume][%d] resumeTasksOK %+v", 200, o.Payload) +} + +func (o *ResumeTasksOK) String() string { + return fmt.Sprintf("[PUT /tasks/{taskType}/resume][%d] resumeTasksOK %+v", 200, o.Payload) +} + +func (o *ResumeTasksOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ResumeTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/schedule_tasks_deprecated_parameters.go b/src/client/task/schedule_tasks_deprecated_parameters.go new file mode 100644 index 0000000..c7c1b22 --- /dev/null +++ b/src/client/task/schedule_tasks_deprecated_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewScheduleTasksDeprecatedParams creates a new ScheduleTasksDeprecatedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewScheduleTasksDeprecatedParams() *ScheduleTasksDeprecatedParams { + return &ScheduleTasksDeprecatedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewScheduleTasksDeprecatedParamsWithTimeout creates a new ScheduleTasksDeprecatedParams object +// with the ability to set a timeout on a request. +func NewScheduleTasksDeprecatedParamsWithTimeout(timeout time.Duration) *ScheduleTasksDeprecatedParams { + return &ScheduleTasksDeprecatedParams{ + timeout: timeout, + } +} + +// NewScheduleTasksDeprecatedParamsWithContext creates a new ScheduleTasksDeprecatedParams object +// with the ability to set a context for a request. +func NewScheduleTasksDeprecatedParamsWithContext(ctx context.Context) *ScheduleTasksDeprecatedParams { + return &ScheduleTasksDeprecatedParams{ + Context: ctx, + } +} + +// NewScheduleTasksDeprecatedParamsWithHTTPClient creates a new ScheduleTasksDeprecatedParams object +// with the ability to set a custom HTTPClient for a request. +func NewScheduleTasksDeprecatedParamsWithHTTPClient(client *http.Client) *ScheduleTasksDeprecatedParams { + return &ScheduleTasksDeprecatedParams{ + HTTPClient: client, + } +} + +/* +ScheduleTasksDeprecatedParams contains all the parameters to send to the API endpoint + + for the schedule tasks deprecated operation. + + Typically these are written to a http.Request. +*/ +type ScheduleTasksDeprecatedParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the schedule tasks deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleTasksDeprecatedParams) WithDefaults() *ScheduleTasksDeprecatedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the schedule tasks deprecated params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleTasksDeprecatedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the schedule tasks deprecated params +func (o *ScheduleTasksDeprecatedParams) WithTimeout(timeout time.Duration) *ScheduleTasksDeprecatedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the schedule tasks deprecated params +func (o *ScheduleTasksDeprecatedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the schedule tasks deprecated params +func (o *ScheduleTasksDeprecatedParams) WithContext(ctx context.Context) *ScheduleTasksDeprecatedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the schedule tasks deprecated params +func (o *ScheduleTasksDeprecatedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the schedule tasks deprecated params +func (o *ScheduleTasksDeprecatedParams) WithHTTPClient(client *http.Client) *ScheduleTasksDeprecatedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the schedule tasks deprecated params +func (o *ScheduleTasksDeprecatedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ScheduleTasksDeprecatedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/schedule_tasks_deprecated_responses.go b/src/client/task/schedule_tasks_deprecated_responses.go new file mode 100644 index 0000000..cbcc2e8 --- /dev/null +++ b/src/client/task/schedule_tasks_deprecated_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ScheduleTasksDeprecatedReader is a Reader for the ScheduleTasksDeprecated structure. +type ScheduleTasksDeprecatedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ScheduleTasksDeprecatedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewScheduleTasksDeprecatedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewScheduleTasksDeprecatedOK creates a ScheduleTasksDeprecatedOK with default headers values +func NewScheduleTasksDeprecatedOK() *ScheduleTasksDeprecatedOK { + return &ScheduleTasksDeprecatedOK{} +} + +/* +ScheduleTasksDeprecatedOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ScheduleTasksDeprecatedOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this schedule tasks deprecated o k response has a 2xx status code +func (o *ScheduleTasksDeprecatedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this schedule tasks deprecated o k response has a 3xx status code +func (o *ScheduleTasksDeprecatedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this schedule tasks deprecated o k response has a 4xx status code +func (o *ScheduleTasksDeprecatedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this schedule tasks deprecated o k response has a 5xx status code +func (o *ScheduleTasksDeprecatedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this schedule tasks deprecated o k response a status code equal to that given +func (o *ScheduleTasksDeprecatedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the schedule tasks deprecated o k response +func (o *ScheduleTasksDeprecatedOK) Code() int { + return 200 +} + +func (o *ScheduleTasksDeprecatedOK) Error() string { + return fmt.Sprintf("[PUT /tasks/scheduletasks][%d] scheduleTasksDeprecatedOK %+v", 200, o.Payload) +} + +func (o *ScheduleTasksDeprecatedOK) String() string { + return fmt.Sprintf("[PUT /tasks/scheduletasks][%d] scheduleTasksDeprecatedOK %+v", 200, o.Payload) +} + +func (o *ScheduleTasksDeprecatedOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *ScheduleTasksDeprecatedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/schedule_tasks_parameters.go b/src/client/task/schedule_tasks_parameters.go new file mode 100644 index 0000000..34fbb87 --- /dev/null +++ b/src/client/task/schedule_tasks_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewScheduleTasksParams creates a new ScheduleTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewScheduleTasksParams() *ScheduleTasksParams { + return &ScheduleTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewScheduleTasksParamsWithTimeout creates a new ScheduleTasksParams object +// with the ability to set a timeout on a request. +func NewScheduleTasksParamsWithTimeout(timeout time.Duration) *ScheduleTasksParams { + return &ScheduleTasksParams{ + timeout: timeout, + } +} + +// NewScheduleTasksParamsWithContext creates a new ScheduleTasksParams object +// with the ability to set a context for a request. +func NewScheduleTasksParamsWithContext(ctx context.Context) *ScheduleTasksParams { + return &ScheduleTasksParams{ + Context: ctx, + } +} + +// NewScheduleTasksParamsWithHTTPClient creates a new ScheduleTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewScheduleTasksParamsWithHTTPClient(client *http.Client) *ScheduleTasksParams { + return &ScheduleTasksParams{ + HTTPClient: client, + } +} + +/* +ScheduleTasksParams contains all the parameters to send to the API endpoint + + for the schedule tasks operation. + + Typically these are written to a http.Request. +*/ +type ScheduleTasksParams struct { + + /* TableName. + + Table name (with type suffix) + */ + TableName *string + + /* TaskType. + + Task type + */ + TaskType *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the schedule tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleTasksParams) WithDefaults() *ScheduleTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the schedule tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScheduleTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the schedule tasks params +func (o *ScheduleTasksParams) WithTimeout(timeout time.Duration) *ScheduleTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the schedule tasks params +func (o *ScheduleTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the schedule tasks params +func (o *ScheduleTasksParams) WithContext(ctx context.Context) *ScheduleTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the schedule tasks params +func (o *ScheduleTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the schedule tasks params +func (o *ScheduleTasksParams) WithHTTPClient(client *http.Client) *ScheduleTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the schedule tasks params +func (o *ScheduleTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the schedule tasks params +func (o *ScheduleTasksParams) WithTableName(tableName *string) *ScheduleTasksParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the schedule tasks params +func (o *ScheduleTasksParams) SetTableName(tableName *string) { + o.TableName = tableName +} + +// WithTaskType adds the taskType to the schedule tasks params +func (o *ScheduleTasksParams) WithTaskType(taskType *string) *ScheduleTasksParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the schedule tasks params +func (o *ScheduleTasksParams) SetTaskType(taskType *string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *ScheduleTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TableName != nil { + + // query param tableName + var qrTableName string + + if o.TableName != nil { + qrTableName = *o.TableName + } + qTableName := qrTableName + if qTableName != "" { + + if err := r.SetQueryParam("tableName", qTableName); err != nil { + return err + } + } + } + + if o.TaskType != nil { + + // query param taskType + var qrTaskType string + + if o.TaskType != nil { + qrTaskType = *o.TaskType + } + qTaskType := qrTaskType + if qTaskType != "" { + + if err := r.SetQueryParam("taskType", qTaskType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/schedule_tasks_responses.go b/src/client/task/schedule_tasks_responses.go new file mode 100644 index 0000000..a37b9e7 --- /dev/null +++ b/src/client/task/schedule_tasks_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ScheduleTasksReader is a Reader for the ScheduleTasks structure. +type ScheduleTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ScheduleTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewScheduleTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewScheduleTasksOK creates a ScheduleTasksOK with default headers values +func NewScheduleTasksOK() *ScheduleTasksOK { + return &ScheduleTasksOK{} +} + +/* +ScheduleTasksOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ScheduleTasksOK struct { + Payload map[string]string +} + +// IsSuccess returns true when this schedule tasks o k response has a 2xx status code +func (o *ScheduleTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this schedule tasks o k response has a 3xx status code +func (o *ScheduleTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this schedule tasks o k response has a 4xx status code +func (o *ScheduleTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this schedule tasks o k response has a 5xx status code +func (o *ScheduleTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this schedule tasks o k response a status code equal to that given +func (o *ScheduleTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the schedule tasks o k response +func (o *ScheduleTasksOK) Code() int { + return 200 +} + +func (o *ScheduleTasksOK) Error() string { + return fmt.Sprintf("[POST /tasks/schedule][%d] scheduleTasksOK %+v", 200, o.Payload) +} + +func (o *ScheduleTasksOK) String() string { + return fmt.Sprintf("[POST /tasks/schedule][%d] scheduleTasksOK %+v", 200, o.Payload) +} + +func (o *ScheduleTasksOK) GetPayload() map[string]string { + return o.Payload +} + +func (o *ScheduleTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/stop_tasks_parameters.go b/src/client/task/stop_tasks_parameters.go new file mode 100644 index 0000000..b0d6e3c --- /dev/null +++ b/src/client/task/stop_tasks_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStopTasksParams creates a new StopTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStopTasksParams() *StopTasksParams { + return &StopTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStopTasksParamsWithTimeout creates a new StopTasksParams object +// with the ability to set a timeout on a request. +func NewStopTasksParamsWithTimeout(timeout time.Duration) *StopTasksParams { + return &StopTasksParams{ + timeout: timeout, + } +} + +// NewStopTasksParamsWithContext creates a new StopTasksParams object +// with the ability to set a context for a request. +func NewStopTasksParamsWithContext(ctx context.Context) *StopTasksParams { + return &StopTasksParams{ + Context: ctx, + } +} + +// NewStopTasksParamsWithHTTPClient creates a new StopTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewStopTasksParamsWithHTTPClient(client *http.Client) *StopTasksParams { + return &StopTasksParams{ + HTTPClient: client, + } +} + +/* +StopTasksParams contains all the parameters to send to the API endpoint + + for the stop tasks operation. + + Typically these are written to a http.Request. +*/ +type StopTasksParams struct { + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stop tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopTasksParams) WithDefaults() *StopTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stop tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StopTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stop tasks params +func (o *StopTasksParams) WithTimeout(timeout time.Duration) *StopTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stop tasks params +func (o *StopTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stop tasks params +func (o *StopTasksParams) WithContext(ctx context.Context) *StopTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stop tasks params +func (o *StopTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stop tasks params +func (o *StopTasksParams) WithHTTPClient(client *http.Client) *StopTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stop tasks params +func (o *StopTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskType adds the taskType to the stop tasks params +func (o *StopTasksParams) WithTaskType(taskType string) *StopTasksParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the stop tasks params +func (o *StopTasksParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *StopTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/stop_tasks_responses.go b/src/client/task/stop_tasks_responses.go new file mode 100644 index 0000000..1deace9 --- /dev/null +++ b/src/client/task/stop_tasks_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// StopTasksReader is a Reader for the StopTasks structure. +type StopTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StopTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStopTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewStopTasksOK creates a StopTasksOK with default headers values +func NewStopTasksOK() *StopTasksOK { + return &StopTasksOK{} +} + +/* +StopTasksOK describes a response with status code 200, with default header values. + +successful operation +*/ +type StopTasksOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this stop tasks o k response has a 2xx status code +func (o *StopTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stop tasks o k response has a 3xx status code +func (o *StopTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stop tasks o k response has a 4xx status code +func (o *StopTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this stop tasks o k response has a 5xx status code +func (o *StopTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this stop tasks o k response a status code equal to that given +func (o *StopTasksOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the stop tasks o k response +func (o *StopTasksOK) Code() int { + return 200 +} + +func (o *StopTasksOK) Error() string { + return fmt.Sprintf("[PUT /tasks/{taskType}/stop][%d] stopTasksOK %+v", 200, o.Payload) +} + +func (o *StopTasksOK) String() string { + return fmt.Sprintf("[PUT /tasks/{taskType}/stop][%d] stopTasksOK %+v", 200, o.Payload) +} + +func (o *StopTasksOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *StopTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/task/task_client.go b/src/client/task/task_client.go new file mode 100644 index 0000000..122b51f --- /dev/null +++ b/src/client/task/task_client.go @@ -0,0 +1,1631 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new task API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for task API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CleanUpTasks(params *CleanUpTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CleanUpTasksOK, error) + + CleanUpTasksDeprecated(params *CleanUpTasksDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CleanUpTasksDeprecatedOK, error) + + DeleteTask(params *DeleteTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskOK, error) + + DeleteTaskMetadataByTable(params *DeleteTaskMetadataByTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskMetadataByTableOK, error) + + DeleteTaskQueue(params *DeleteTaskQueueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskQueueOK, error) + + DeleteTasks(params *DeleteTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTasksOK, error) + + ExecuteAdhocTask(params *ExecuteAdhocTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + GetCronSchedulerInformation(params *GetCronSchedulerInformationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCronSchedulerInformationOK, error) + + GetCronSchedulerJobDetails(params *GetCronSchedulerJobDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCronSchedulerJobDetailsOK, error) + + GetCronSchedulerJobKeys(params *GetCronSchedulerJobKeysParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCronSchedulerJobKeysOK, error) + + GetSubtaskConfigs(params *GetSubtaskConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskConfigsOK, error) + + GetSubtaskOnWorkerProgress(params *GetSubtaskOnWorkerProgressParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskOnWorkerProgressOK, error) + + GetSubtaskProgress(params *GetSubtaskProgressParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskProgressOK, error) + + GetSubtaskStates(params *GetSubtaskStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskStatesOK, error) + + GetTaskConfig(params *GetTaskConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskConfigOK, error) + + GetTaskConfigs(params *GetTaskConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskConfigsOK, error) + + GetTaskConfigsDeprecated(params *GetTaskConfigsDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskConfigsDeprecatedOK, error) + + GetTaskCounts(params *GetTaskCountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskCountsOK, error) + + GetTaskDebugInfo(params *GetTaskDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskDebugInfoOK, error) + + GetTaskGenerationDebugInto(params *GetTaskGenerationDebugIntoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskGenerationDebugIntoOK, error) + + GetTaskMetadataByTable(params *GetTaskMetadataByTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskMetadataByTableOK, error) + + GetTaskQueueState(params *GetTaskQueueStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskQueueStateOK, error) + + GetTaskQueueStateDeprecated(params *GetTaskQueueStateDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskQueueStateDeprecatedOK, error) + + GetTaskQueues(params *GetTaskQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskQueuesOK, error) + + GetTaskState(params *GetTaskStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStateOK, error) + + GetTaskStateDeprecated(params *GetTaskStateDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStateDeprecatedOK, error) + + GetTaskStates(params *GetTaskStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStatesOK, error) + + GetTaskStatesByTable(params *GetTaskStatesByTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStatesByTableOK, error) + + GetTaskStatesDeprecated(params *GetTaskStatesDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStatesDeprecatedOK, error) + + GetTasks(params *GetTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksOK, error) + + GetTasksDebugInfo(params *GetTasksDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksDebugInfoOK, error) + + GetTasksDebugInfo1(params *GetTasksDebugInfo1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksDebugInfo1OK, error) + + GetTasksDeprecated(params *GetTasksDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksDeprecatedOK, error) + + ListTaskTypes(params *ListTaskTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTaskTypesOK, error) + + ResumeTasks(params *ResumeTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResumeTasksOK, error) + + ScheduleTasks(params *ScheduleTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ScheduleTasksOK, error) + + ScheduleTasksDeprecated(params *ScheduleTasksDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ScheduleTasksDeprecatedOK, error) + + StopTasks(params *StopTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopTasksOK, error) + + ToggleTaskQueueState(params *ToggleTaskQueueStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ToggleTaskQueueStateOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CleanUpTasks cleans up finished tasks c o m p l e t e d f a i l e d for the given task type +*/ +func (a *Client) CleanUpTasks(params *CleanUpTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CleanUpTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCleanUpTasksParams() + } + op := &runtime.ClientOperation{ + ID: "cleanUpTasks", + Method: "PUT", + PathPattern: "/tasks/{taskType}/cleanup", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CleanUpTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CleanUpTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for cleanUpTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CleanUpTasksDeprecated cleans up finished tasks c o m p l e t e d f a i l e d for the given task type deprecated +*/ +func (a *Client) CleanUpTasksDeprecated(params *CleanUpTasksDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CleanUpTasksDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCleanUpTasksDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "cleanUpTasksDeprecated", + Method: "PUT", + PathPattern: "/tasks/cleanuptasks/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CleanUpTasksDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CleanUpTasksDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for cleanUpTasksDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTask deletes a single task given its task name +*/ +func (a *Client) DeleteTask(params *DeleteTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTaskParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTask", + Method: "DELETE", + PathPattern: "/tasks/task/{taskName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTaskReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTaskOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTask: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTaskMetadataByTable deletes task metadata for the given task type and table +*/ +func (a *Client) DeleteTaskMetadataByTable(params *DeleteTaskMetadataByTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskMetadataByTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTaskMetadataByTableParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTaskMetadataByTable", + Method: "DELETE", + PathPattern: "/tasks/{taskType}/{tableNameWithType}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTaskMetadataByTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTaskMetadataByTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTaskMetadataByTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTaskQueue deletes a task queue deprecated +*/ +func (a *Client) DeleteTaskQueue(params *DeleteTaskQueueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskQueueOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTaskQueueParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTaskQueue", + Method: "DELETE", + PathPattern: "/tasks/taskqueue/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTaskQueueReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTaskQueueOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTaskQueue: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTasks deletes all tasks as well as the task queue for the given task type +*/ +func (a *Client) DeleteTasks(params *DeleteTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTasksParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTasks", + Method: "DELETE", + PathPattern: "/tasks/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ExecuteAdhocTask executes a task on minion +*/ +func (a *Client) ExecuteAdhocTask(params *ExecuteAdhocTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewExecuteAdhocTaskParams() + } + op := &runtime.ClientOperation{ + ID: "executeAdhocTask", + Method: "POST", + PathPattern: "/tasks/execute", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ExecuteAdhocTaskReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +GetCronSchedulerInformation fetches cron scheduler information +*/ +func (a *Client) GetCronSchedulerInformation(params *GetCronSchedulerInformationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCronSchedulerInformationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCronSchedulerInformationParams() + } + op := &runtime.ClientOperation{ + ID: "getCronSchedulerInformation", + Method: "GET", + PathPattern: "/tasks/scheduler/information", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetCronSchedulerInformationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetCronSchedulerInformationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCronSchedulerInformation: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetCronSchedulerJobDetails fetches cron scheduler job keys +*/ +func (a *Client) GetCronSchedulerJobDetails(params *GetCronSchedulerJobDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCronSchedulerJobDetailsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCronSchedulerJobDetailsParams() + } + op := &runtime.ClientOperation{ + ID: "getCronSchedulerJobDetails", + Method: "GET", + PathPattern: "/tasks/scheduler/jobDetails", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetCronSchedulerJobDetailsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetCronSchedulerJobDetailsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCronSchedulerJobDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetCronSchedulerJobKeys fetches cron scheduler job keys +*/ +func (a *Client) GetCronSchedulerJobKeys(params *GetCronSchedulerJobKeysParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCronSchedulerJobKeysOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCronSchedulerJobKeysParams() + } + op := &runtime.ClientOperation{ + ID: "getCronSchedulerJobKeys", + Method: "GET", + PathPattern: "/tasks/scheduler/jobKeys", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetCronSchedulerJobKeysReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetCronSchedulerJobKeysOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCronSchedulerJobKeys: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSubtaskConfigs gets the configs of specified sub tasks for the given task +*/ +func (a *Client) GetSubtaskConfigs(params *GetSubtaskConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskConfigsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubtaskConfigsParams() + } + op := &runtime.ClientOperation{ + ID: "getSubtaskConfigs", + Method: "GET", + PathPattern: "/tasks/subtask/{taskName}/config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSubtaskConfigsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubtaskConfigsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSubtaskConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSubtaskOnWorkerProgress gets progress of all subtasks with specified state tracked by minion worker in memory +*/ +func (a *Client) GetSubtaskOnWorkerProgress(params *GetSubtaskOnWorkerProgressParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskOnWorkerProgressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubtaskOnWorkerProgressParams() + } + op := &runtime.ClientOperation{ + ID: "getSubtaskOnWorkerProgress", + Method: "GET", + PathPattern: "/tasks/subtask/workers/progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSubtaskOnWorkerProgressReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubtaskOnWorkerProgressOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSubtaskOnWorkerProgress: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSubtaskProgress gets progress of specified sub tasks for the given task tracked by minion worker in memory +*/ +func (a *Client) GetSubtaskProgress(params *GetSubtaskProgressParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskProgressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubtaskProgressParams() + } + op := &runtime.ClientOperation{ + ID: "getSubtaskProgress", + Method: "GET", + PathPattern: "/tasks/subtask/{taskName}/progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSubtaskProgressReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubtaskProgressOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSubtaskProgress: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSubtaskStates gets the states of all the sub tasks for the given task +*/ +func (a *Client) GetSubtaskStates(params *GetSubtaskStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubtaskStatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubtaskStatesParams() + } + op := &runtime.ClientOperation{ + ID: "getSubtaskStates", + Method: "GET", + PathPattern: "/tasks/subtask/{taskName}/state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSubtaskStatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubtaskStatesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSubtaskStates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskConfig gets the task runtime config for the given task +*/ +func (a *Client) GetTaskConfig(params *GetTaskConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskConfigParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskConfig", + Method: "GET", + PathPattern: "/tasks/task/{taskName}/runtime/config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskConfigs gets the task config a list of child task configs for the given task +*/ +func (a *Client) GetTaskConfigs(params *GetTaskConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskConfigsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskConfigsParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskConfigs", + Method: "GET", + PathPattern: "/tasks/task/{taskName}/config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskConfigsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskConfigsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskConfigsDeprecated gets the task config a list of child task configs for the given task deprecated +*/ +func (a *Client) GetTaskConfigsDeprecated(params *GetTaskConfigsDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskConfigsDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskConfigsDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskConfigsDeprecated", + Method: "GET", + PathPattern: "/tasks/taskconfig/{taskName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskConfigsDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskConfigsDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskConfigsDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskCounts fetches count of sub tasks for each of the tasks for the given task type +*/ +func (a *Client) GetTaskCounts(params *GetTaskCountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskCountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskCountsParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskCounts", + Method: "GET", + PathPattern: "/tasks/{taskType}/taskcounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskCountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskCountsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskCounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskDebugInfo fetches information for the given task name +*/ +func (a *Client) GetTaskDebugInfo(params *GetTaskDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskDebugInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskDebugInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskDebugInfo", + Method: "GET", + PathPattern: "/tasks/task/{taskName}/debug", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskDebugInfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskDebugInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskDebugInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskGenerationDebugInto fetches task generation information for the recent runs of the given task for the given table +*/ +func (a *Client) GetTaskGenerationDebugInto(params *GetTaskGenerationDebugIntoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskGenerationDebugIntoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskGenerationDebugIntoParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskGenerationDebugInto", + Method: "GET", + PathPattern: "/tasks/generator/{tableNameWithType}/{taskType}/debug", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskGenerationDebugIntoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskGenerationDebugIntoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskGenerationDebugInto: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskMetadataByTable gets task metadata for the given task type and table +*/ +func (a *Client) GetTaskMetadataByTable(params *GetTaskMetadataByTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskMetadataByTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskMetadataByTableParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskMetadataByTable", + Method: "GET", + PathPattern: "/tasks/{taskType}/{tableNameWithType}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskMetadataByTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskMetadataByTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskMetadataByTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskQueueState gets the state task queue state for the given task type +*/ +func (a *Client) GetTaskQueueState(params *GetTaskQueueStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskQueueStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskQueueStateParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskQueueState", + Method: "GET", + PathPattern: "/tasks/{taskType}/state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskQueueStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskQueueStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskQueueState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskQueueStateDeprecated gets the state task queue state for the given task type deprecated +*/ +func (a *Client) GetTaskQueueStateDeprecated(params *GetTaskQueueStateDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskQueueStateDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskQueueStateDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskQueueStateDeprecated", + Method: "GET", + PathPattern: "/tasks/taskqueuestate/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskQueueStateDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskQueueStateDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskQueueStateDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskQueues lists all task queues deprecated +*/ +func (a *Client) GetTaskQueues(params *GetTaskQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskQueuesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskQueuesParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskQueues", + Method: "GET", + PathPattern: "/tasks/taskqueues", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskQueuesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskQueuesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskQueues: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskState gets the task state for the given task +*/ +func (a *Client) GetTaskState(params *GetTaskStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskStateParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskState", + Method: "GET", + PathPattern: "/tasks/task/{taskName}/state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskStateDeprecated gets the task state for the given task deprecated +*/ +func (a *Client) GetTaskStateDeprecated(params *GetTaskStateDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStateDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskStateDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskStateDeprecated", + Method: "GET", + PathPattern: "/tasks/taskstate/{taskName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskStateDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskStateDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskStateDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskStates gets a map from task to task state for the given task type +*/ +func (a *Client) GetTaskStates(params *GetTaskStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskStatesParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskStates", + Method: "GET", + PathPattern: "/tasks/{taskType}/taskstates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskStatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskStatesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskStates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskStatesByTable lists all tasks for the given task type +*/ +func (a *Client) GetTaskStatesByTable(params *GetTaskStatesByTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStatesByTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskStatesByTableParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskStatesByTable", + Method: "GET", + PathPattern: "/tasks/{taskType}/{tableNameWithType}/state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskStatesByTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskStatesByTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskStatesByTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTaskStatesDeprecated gets a map from task to task state for the given task type deprecated +*/ +func (a *Client) GetTaskStatesDeprecated(params *GetTaskStatesDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskStatesDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaskStatesDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "getTaskStatesDeprecated", + Method: "GET", + PathPattern: "/tasks/taskstates/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTaskStatesDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaskStatesDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTaskStatesDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTasks lists all tasks for the given task type +*/ +func (a *Client) GetTasks(params *GetTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTasksParams() + } + op := &runtime.ClientOperation{ + ID: "getTasks", + Method: "GET", + PathPattern: "/tasks/{taskType}/tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTasksDebugInfo fetches information for all the tasks for the given task type +*/ +func (a *Client) GetTasksDebugInfo(params *GetTasksDebugInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksDebugInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTasksDebugInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getTasksDebugInfo", + Method: "GET", + PathPattern: "/tasks/{taskType}/debug", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTasksDebugInfoReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTasksDebugInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTasksDebugInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTasksDebugInfo1 fetches information for all the tasks for the given task type and table +*/ +func (a *Client) GetTasksDebugInfo1(params *GetTasksDebugInfo1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksDebugInfo1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTasksDebugInfo1Params() + } + op := &runtime.ClientOperation{ + ID: "getTasksDebugInfo_1", + Method: "GET", + PathPattern: "/tasks/{taskType}/{tableNameWithType}/debug", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTasksDebugInfo1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTasksDebugInfo1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTasksDebugInfo_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTasksDeprecated lists all tasks for the given task type deprecated +*/ +func (a *Client) GetTasksDeprecated(params *GetTasksDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTasksDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTasksDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "getTasksDeprecated", + Method: "GET", + PathPattern: "/tasks/tasks/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTasksDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTasksDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTasksDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListTaskTypes lists all task types +*/ +func (a *Client) ListTaskTypes(params *ListTaskTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTaskTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListTaskTypesParams() + } + op := &runtime.ClientOperation{ + ID: "listTaskTypes", + Method: "GET", + PathPattern: "/tasks/tasktypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListTaskTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListTaskTypesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listTaskTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ResumeTasks resumes all stopped tasks as well as the task queue for the given task type +*/ +func (a *Client) ResumeTasks(params *ResumeTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResumeTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResumeTasksParams() + } + op := &runtime.ClientOperation{ + ID: "resumeTasks", + Method: "PUT", + PathPattern: "/tasks/{taskType}/resume", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ResumeTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ResumeTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for resumeTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ScheduleTasks schedules tasks and return a map from task type to task name scheduled +*/ +func (a *Client) ScheduleTasks(params *ScheduleTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ScheduleTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewScheduleTasksParams() + } + op := &runtime.ClientOperation{ + ID: "scheduleTasks", + Method: "POST", + PathPattern: "/tasks/schedule", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ScheduleTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ScheduleTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for scheduleTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ScheduleTasksDeprecated schedules tasks deprecated +*/ +func (a *Client) ScheduleTasksDeprecated(params *ScheduleTasksDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ScheduleTasksDeprecatedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewScheduleTasksDeprecatedParams() + } + op := &runtime.ClientOperation{ + ID: "scheduleTasksDeprecated", + Method: "PUT", + PathPattern: "/tasks/scheduletasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ScheduleTasksDeprecatedReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ScheduleTasksDeprecatedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for scheduleTasksDeprecated: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +StopTasks stops all running pending tasks as well as the task queue for the given task type +*/ +func (a *Client) StopTasks(params *StopTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStopTasksParams() + } + op := &runtime.ClientOperation{ + ID: "stopTasks", + Method: "PUT", + PathPattern: "/tasks/{taskType}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &StopTasksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StopTasksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stopTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ToggleTaskQueueState stops resume a task queue deprecated +*/ +func (a *Client) ToggleTaskQueueState(params *ToggleTaskQueueStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ToggleTaskQueueStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewToggleTaskQueueStateParams() + } + op := &runtime.ClientOperation{ + ID: "toggleTaskQueueState", + Method: "PUT", + PathPattern: "/tasks/taskqueue/{taskType}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ToggleTaskQueueStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ToggleTaskQueueStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for toggleTaskQueueState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/task/toggle_task_queue_state_parameters.go b/src/client/task/toggle_task_queue_state_parameters.go new file mode 100644 index 0000000..2f06131 --- /dev/null +++ b/src/client/task/toggle_task_queue_state_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewToggleTaskQueueStateParams creates a new ToggleTaskQueueStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewToggleTaskQueueStateParams() *ToggleTaskQueueStateParams { + return &ToggleTaskQueueStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewToggleTaskQueueStateParamsWithTimeout creates a new ToggleTaskQueueStateParams object +// with the ability to set a timeout on a request. +func NewToggleTaskQueueStateParamsWithTimeout(timeout time.Duration) *ToggleTaskQueueStateParams { + return &ToggleTaskQueueStateParams{ + timeout: timeout, + } +} + +// NewToggleTaskQueueStateParamsWithContext creates a new ToggleTaskQueueStateParams object +// with the ability to set a context for a request. +func NewToggleTaskQueueStateParamsWithContext(ctx context.Context) *ToggleTaskQueueStateParams { + return &ToggleTaskQueueStateParams{ + Context: ctx, + } +} + +// NewToggleTaskQueueStateParamsWithHTTPClient creates a new ToggleTaskQueueStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewToggleTaskQueueStateParamsWithHTTPClient(client *http.Client) *ToggleTaskQueueStateParams { + return &ToggleTaskQueueStateParams{ + HTTPClient: client, + } +} + +/* +ToggleTaskQueueStateParams contains all the parameters to send to the API endpoint + + for the toggle task queue state operation. + + Typically these are written to a http.Request. +*/ +type ToggleTaskQueueStateParams struct { + + /* State. + + state + */ + State string + + /* TaskType. + + Task type + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the toggle task queue state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleTaskQueueStateParams) WithDefaults() *ToggleTaskQueueStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the toggle task queue state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleTaskQueueStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) WithTimeout(timeout time.Duration) *ToggleTaskQueueStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) WithContext(ctx context.Context) *ToggleTaskQueueStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) WithHTTPClient(client *http.Client) *ToggleTaskQueueStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) WithState(state string) *ToggleTaskQueueStateParams { + o.SetState(state) + return o +} + +// SetState adds the state to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) SetState(state string) { + o.State = state +} + +// WithTaskType adds the taskType to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) WithTaskType(taskType string) *ToggleTaskQueueStateParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the toggle task queue state params +func (o *ToggleTaskQueueStateParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *ToggleTaskQueueStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // path param taskType + if err := r.SetPathParam("taskType", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/task/toggle_task_queue_state_responses.go b/src/client/task/toggle_task_queue_state_responses.go new file mode 100644 index 0000000..cce288a --- /dev/null +++ b/src/client/task/toggle_task_queue_state_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package task + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// ToggleTaskQueueStateReader is a Reader for the ToggleTaskQueueState structure. +type ToggleTaskQueueStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ToggleTaskQueueStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewToggleTaskQueueStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewToggleTaskQueueStateOK creates a ToggleTaskQueueStateOK with default headers values +func NewToggleTaskQueueStateOK() *ToggleTaskQueueStateOK { + return &ToggleTaskQueueStateOK{} +} + +/* +ToggleTaskQueueStateOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ToggleTaskQueueStateOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this toggle task queue state o k response has a 2xx status code +func (o *ToggleTaskQueueStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this toggle task queue state o k response has a 3xx status code +func (o *ToggleTaskQueueStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this toggle task queue state o k response has a 4xx status code +func (o *ToggleTaskQueueStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this toggle task queue state o k response has a 5xx status code +func (o *ToggleTaskQueueStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this toggle task queue state o k response a status code equal to that given +func (o *ToggleTaskQueueStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the toggle task queue state o k response +func (o *ToggleTaskQueueStateOK) Code() int { + return 200 +} + +func (o *ToggleTaskQueueStateOK) Error() string { + return fmt.Sprintf("[PUT /tasks/taskqueue/{taskType}][%d] toggleTaskQueueStateOK %+v", 200, o.Payload) +} + +func (o *ToggleTaskQueueStateOK) String() string { + return fmt.Sprintf("[PUT /tasks/taskqueue/{taskType}][%d] toggleTaskQueueStateOK %+v", 200, o.Payload) +} + +func (o *ToggleTaskQueueStateOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *ToggleTaskQueueStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/tenant/change_tenant_state_parameters.go b/src/client/tenant/change_tenant_state_parameters.go new file mode 100644 index 0000000..489b6cb --- /dev/null +++ b/src/client/tenant/change_tenant_state_parameters.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewChangeTenantStateParams creates a new ChangeTenantStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewChangeTenantStateParams() *ChangeTenantStateParams { + return &ChangeTenantStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewChangeTenantStateParamsWithTimeout creates a new ChangeTenantStateParams object +// with the ability to set a timeout on a request. +func NewChangeTenantStateParamsWithTimeout(timeout time.Duration) *ChangeTenantStateParams { + return &ChangeTenantStateParams{ + timeout: timeout, + } +} + +// NewChangeTenantStateParamsWithContext creates a new ChangeTenantStateParams object +// with the ability to set a context for a request. +func NewChangeTenantStateParamsWithContext(ctx context.Context) *ChangeTenantStateParams { + return &ChangeTenantStateParams{ + Context: ctx, + } +} + +// NewChangeTenantStateParamsWithHTTPClient creates a new ChangeTenantStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewChangeTenantStateParamsWithHTTPClient(client *http.Client) *ChangeTenantStateParams { + return &ChangeTenantStateParams{ + HTTPClient: client, + } +} + +/* +ChangeTenantStateParams contains all the parameters to send to the API endpoint + + for the change tenant state operation. + + Typically these are written to a http.Request. +*/ +type ChangeTenantStateParams struct { + + /* State. + + state + */ + State string + + /* TenantName. + + Tenant name + */ + TenantName string + + /* Type. + + tenant type + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the change tenant state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeTenantStateParams) WithDefaults() *ChangeTenantStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change tenant state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeTenantStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the change tenant state params +func (o *ChangeTenantStateParams) WithTimeout(timeout time.Duration) *ChangeTenantStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the change tenant state params +func (o *ChangeTenantStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the change tenant state params +func (o *ChangeTenantStateParams) WithContext(ctx context.Context) *ChangeTenantStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the change tenant state params +func (o *ChangeTenantStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the change tenant state params +func (o *ChangeTenantStateParams) WithHTTPClient(client *http.Client) *ChangeTenantStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the change tenant state params +func (o *ChangeTenantStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the change tenant state params +func (o *ChangeTenantStateParams) WithState(state string) *ChangeTenantStateParams { + o.SetState(state) + return o +} + +// SetState adds the state to the change tenant state params +func (o *ChangeTenantStateParams) SetState(state string) { + o.State = state +} + +// WithTenantName adds the tenantName to the change tenant state params +func (o *ChangeTenantStateParams) WithTenantName(tenantName string) *ChangeTenantStateParams { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the change tenant state params +func (o *ChangeTenantStateParams) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WithType adds the typeVar to the change tenant state params +func (o *ChangeTenantStateParams) WithType(typeVar *string) *ChangeTenantStateParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the change tenant state params +func (o *ChangeTenantStateParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ChangeTenantStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/change_tenant_state_responses.go b/src/client/tenant/change_tenant_state_responses.go new file mode 100644 index 0000000..0f8da27 --- /dev/null +++ b/src/client/tenant/change_tenant_state_responses.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ChangeTenantStateReader is a Reader for the ChangeTenantState structure. +type ChangeTenantStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChangeTenantStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChangeTenantStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewChangeTenantStateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewChangeTenantStateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewChangeTenantStateOK creates a ChangeTenantStateOK with default headers values +func NewChangeTenantStateOK() *ChangeTenantStateOK { + return &ChangeTenantStateOK{} +} + +/* +ChangeTenantStateOK describes a response with status code 200, with default header values. + +Success +*/ +type ChangeTenantStateOK struct { + Payload string +} + +// IsSuccess returns true when this change tenant state o k response has a 2xx status code +func (o *ChangeTenantStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this change tenant state o k response has a 3xx status code +func (o *ChangeTenantStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change tenant state o k response has a 4xx status code +func (o *ChangeTenantStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this change tenant state o k response has a 5xx status code +func (o *ChangeTenantStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this change tenant state o k response a status code equal to that given +func (o *ChangeTenantStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the change tenant state o k response +func (o *ChangeTenantStateOK) Code() int { + return 200 +} + +func (o *ChangeTenantStateOK) Error() string { + return fmt.Sprintf("[POST /tenants/{tenantName}/metadata][%d] changeTenantStateOK %+v", 200, o.Payload) +} + +func (o *ChangeTenantStateOK) String() string { + return fmt.Sprintf("[POST /tenants/{tenantName}/metadata][%d] changeTenantStateOK %+v", 200, o.Payload) +} + +func (o *ChangeTenantStateOK) GetPayload() string { + return o.Payload +} + +func (o *ChangeTenantStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewChangeTenantStateNotFound creates a ChangeTenantStateNotFound with default headers values +func NewChangeTenantStateNotFound() *ChangeTenantStateNotFound { + return &ChangeTenantStateNotFound{} +} + +/* +ChangeTenantStateNotFound describes a response with status code 404, with default header values. + +Tenant not found +*/ +type ChangeTenantStateNotFound struct { +} + +// IsSuccess returns true when this change tenant state not found response has a 2xx status code +func (o *ChangeTenantStateNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change tenant state not found response has a 3xx status code +func (o *ChangeTenantStateNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change tenant state not found response has a 4xx status code +func (o *ChangeTenantStateNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this change tenant state not found response has a 5xx status code +func (o *ChangeTenantStateNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this change tenant state not found response a status code equal to that given +func (o *ChangeTenantStateNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the change tenant state not found response +func (o *ChangeTenantStateNotFound) Code() int { + return 404 +} + +func (o *ChangeTenantStateNotFound) Error() string { + return fmt.Sprintf("[POST /tenants/{tenantName}/metadata][%d] changeTenantStateNotFound ", 404) +} + +func (o *ChangeTenantStateNotFound) String() string { + return fmt.Sprintf("[POST /tenants/{tenantName}/metadata][%d] changeTenantStateNotFound ", 404) +} + +func (o *ChangeTenantStateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewChangeTenantStateInternalServerError creates a ChangeTenantStateInternalServerError with default headers values +func NewChangeTenantStateInternalServerError() *ChangeTenantStateInternalServerError { + return &ChangeTenantStateInternalServerError{} +} + +/* +ChangeTenantStateInternalServerError describes a response with status code 500, with default header values. + +Server error reading tenant information +*/ +type ChangeTenantStateInternalServerError struct { +} + +// IsSuccess returns true when this change tenant state internal server error response has a 2xx status code +func (o *ChangeTenantStateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this change tenant state internal server error response has a 3xx status code +func (o *ChangeTenantStateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this change tenant state internal server error response has a 4xx status code +func (o *ChangeTenantStateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this change tenant state internal server error response has a 5xx status code +func (o *ChangeTenantStateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this change tenant state internal server error response a status code equal to that given +func (o *ChangeTenantStateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the change tenant state internal server error response +func (o *ChangeTenantStateInternalServerError) Code() int { + return 500 +} + +func (o *ChangeTenantStateInternalServerError) Error() string { + return fmt.Sprintf("[POST /tenants/{tenantName}/metadata][%d] changeTenantStateInternalServerError ", 500) +} + +func (o *ChangeTenantStateInternalServerError) String() string { + return fmt.Sprintf("[POST /tenants/{tenantName}/metadata][%d] changeTenantStateInternalServerError ", 500) +} + +func (o *ChangeTenantStateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/create_tenant_parameters.go b/src/client/tenant/create_tenant_parameters.go new file mode 100644 index 0000000..a2f0d22 --- /dev/null +++ b/src/client/tenant/create_tenant_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewCreateTenantParams creates a new CreateTenantParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTenantParams() *CreateTenantParams { + return &CreateTenantParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTenantParamsWithTimeout creates a new CreateTenantParams object +// with the ability to set a timeout on a request. +func NewCreateTenantParamsWithTimeout(timeout time.Duration) *CreateTenantParams { + return &CreateTenantParams{ + timeout: timeout, + } +} + +// NewCreateTenantParamsWithContext creates a new CreateTenantParams object +// with the ability to set a context for a request. +func NewCreateTenantParamsWithContext(ctx context.Context) *CreateTenantParams { + return &CreateTenantParams{ + Context: ctx, + } +} + +// NewCreateTenantParamsWithHTTPClient creates a new CreateTenantParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTenantParamsWithHTTPClient(client *http.Client) *CreateTenantParams { + return &CreateTenantParams{ + HTTPClient: client, + } +} + +/* +CreateTenantParams contains all the parameters to send to the API endpoint + + for the create tenant operation. + + Typically these are written to a http.Request. +*/ +type CreateTenantParams struct { + + // Body. + Body *models.Tenant + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTenantParams) WithDefaults() *CreateTenantParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTenantParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create tenant params +func (o *CreateTenantParams) WithTimeout(timeout time.Duration) *CreateTenantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create tenant params +func (o *CreateTenantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create tenant params +func (o *CreateTenantParams) WithContext(ctx context.Context) *CreateTenantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create tenant params +func (o *CreateTenantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create tenant params +func (o *CreateTenantParams) WithHTTPClient(client *http.Client) *CreateTenantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create tenant params +func (o *CreateTenantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create tenant params +func (o *CreateTenantParams) WithBody(body *models.Tenant) *CreateTenantParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create tenant params +func (o *CreateTenantParams) SetBody(body *models.Tenant) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTenantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/create_tenant_responses.go b/src/client/tenant/create_tenant_responses.go new file mode 100644 index 0000000..aa97e71 --- /dev/null +++ b/src/client/tenant/create_tenant_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateTenantReader is a Reader for the CreateTenant structure. +type CreateTenantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTenantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateTenantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewCreateTenantInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTenantOK creates a CreateTenantOK with default headers values +func NewCreateTenantOK() *CreateTenantOK { + return &CreateTenantOK{} +} + +/* +CreateTenantOK describes a response with status code 200, with default header values. + +Success +*/ +type CreateTenantOK struct { +} + +// IsSuccess returns true when this create tenant o k response has a 2xx status code +func (o *CreateTenantOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create tenant o k response has a 3xx status code +func (o *CreateTenantOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create tenant o k response has a 4xx status code +func (o *CreateTenantOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create tenant o k response has a 5xx status code +func (o *CreateTenantOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create tenant o k response a status code equal to that given +func (o *CreateTenantOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create tenant o k response +func (o *CreateTenantOK) Code() int { + return 200 +} + +func (o *CreateTenantOK) Error() string { + return fmt.Sprintf("[POST /tenants][%d] createTenantOK ", 200) +} + +func (o *CreateTenantOK) String() string { + return fmt.Sprintf("[POST /tenants][%d] createTenantOK ", 200) +} + +func (o *CreateTenantOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateTenantInternalServerError creates a CreateTenantInternalServerError with default headers values +func NewCreateTenantInternalServerError() *CreateTenantInternalServerError { + return &CreateTenantInternalServerError{} +} + +/* +CreateTenantInternalServerError describes a response with status code 500, with default header values. + +Error creating tenant +*/ +type CreateTenantInternalServerError struct { +} + +// IsSuccess returns true when this create tenant internal server error response has a 2xx status code +func (o *CreateTenantInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create tenant internal server error response has a 3xx status code +func (o *CreateTenantInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create tenant internal server error response has a 4xx status code +func (o *CreateTenantInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create tenant internal server error response has a 5xx status code +func (o *CreateTenantInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create tenant internal server error response a status code equal to that given +func (o *CreateTenantInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create tenant internal server error response +func (o *CreateTenantInternalServerError) Code() int { + return 500 +} + +func (o *CreateTenantInternalServerError) Error() string { + return fmt.Sprintf("[POST /tenants][%d] createTenantInternalServerError ", 500) +} + +func (o *CreateTenantInternalServerError) String() string { + return fmt.Sprintf("[POST /tenants][%d] createTenantInternalServerError ", 500) +} + +func (o *CreateTenantInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/delete_tenant_parameters.go b/src/client/tenant/delete_tenant_parameters.go new file mode 100644 index 0000000..6b3584d --- /dev/null +++ b/src/client/tenant/delete_tenant_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTenantParams creates a new DeleteTenantParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTenantParams() *DeleteTenantParams { + return &DeleteTenantParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTenantParamsWithTimeout creates a new DeleteTenantParams object +// with the ability to set a timeout on a request. +func NewDeleteTenantParamsWithTimeout(timeout time.Duration) *DeleteTenantParams { + return &DeleteTenantParams{ + timeout: timeout, + } +} + +// NewDeleteTenantParamsWithContext creates a new DeleteTenantParams object +// with the ability to set a context for a request. +func NewDeleteTenantParamsWithContext(ctx context.Context) *DeleteTenantParams { + return &DeleteTenantParams{ + Context: ctx, + } +} + +// NewDeleteTenantParamsWithHTTPClient creates a new DeleteTenantParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTenantParamsWithHTTPClient(client *http.Client) *DeleteTenantParams { + return &DeleteTenantParams{ + HTTPClient: client, + } +} + +/* +DeleteTenantParams contains all the parameters to send to the API endpoint + + for the delete tenant operation. + + Typically these are written to a http.Request. +*/ +type DeleteTenantParams struct { + + /* TenantName. + + Tenant name + */ + TenantName string + + /* Type. + + Tenant type + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTenantParams) WithDefaults() *DeleteTenantParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTenantParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete tenant params +func (o *DeleteTenantParams) WithTimeout(timeout time.Duration) *DeleteTenantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete tenant params +func (o *DeleteTenantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete tenant params +func (o *DeleteTenantParams) WithContext(ctx context.Context) *DeleteTenantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete tenant params +func (o *DeleteTenantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete tenant params +func (o *DeleteTenantParams) WithHTTPClient(client *http.Client) *DeleteTenantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete tenant params +func (o *DeleteTenantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantName adds the tenantName to the delete tenant params +func (o *DeleteTenantParams) WithTenantName(tenantName string) *DeleteTenantParams { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the delete tenant params +func (o *DeleteTenantParams) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WithType adds the typeVar to the delete tenant params +func (o *DeleteTenantParams) WithType(typeVar string) *DeleteTenantParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the delete tenant params +func (o *DeleteTenantParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTenantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/delete_tenant_responses.go b/src/client/tenant/delete_tenant_responses.go new file mode 100644 index 0000000..2dc9ff1 --- /dev/null +++ b/src/client/tenant/delete_tenant_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteTenantReader is a Reader for the DeleteTenant structure. +type DeleteTenantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTenantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTenantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteTenantBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteTenantNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteTenantInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTenantOK creates a DeleteTenantOK with default headers values +func NewDeleteTenantOK() *DeleteTenantOK { + return &DeleteTenantOK{} +} + +/* +DeleteTenantOK describes a response with status code 200, with default header values. + +Success +*/ +type DeleteTenantOK struct { +} + +// IsSuccess returns true when this delete tenant o k response has a 2xx status code +func (o *DeleteTenantOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete tenant o k response has a 3xx status code +func (o *DeleteTenantOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete tenant o k response has a 4xx status code +func (o *DeleteTenantOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete tenant o k response has a 5xx status code +func (o *DeleteTenantOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete tenant o k response a status code equal to that given +func (o *DeleteTenantOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete tenant o k response +func (o *DeleteTenantOK) Code() int { + return 200 +} + +func (o *DeleteTenantOK) Error() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantOK ", 200) +} + +func (o *DeleteTenantOK) String() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantOK ", 200) +} + +func (o *DeleteTenantOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteTenantBadRequest creates a DeleteTenantBadRequest with default headers values +func NewDeleteTenantBadRequest() *DeleteTenantBadRequest { + return &DeleteTenantBadRequest{} +} + +/* +DeleteTenantBadRequest describes a response with status code 400, with default header values. + +Tenant can not be deleted +*/ +type DeleteTenantBadRequest struct { +} + +// IsSuccess returns true when this delete tenant bad request response has a 2xx status code +func (o *DeleteTenantBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete tenant bad request response has a 3xx status code +func (o *DeleteTenantBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete tenant bad request response has a 4xx status code +func (o *DeleteTenantBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete tenant bad request response has a 5xx status code +func (o *DeleteTenantBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete tenant bad request response a status code equal to that given +func (o *DeleteTenantBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the delete tenant bad request response +func (o *DeleteTenantBadRequest) Code() int { + return 400 +} + +func (o *DeleteTenantBadRequest) Error() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantBadRequest ", 400) +} + +func (o *DeleteTenantBadRequest) String() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantBadRequest ", 400) +} + +func (o *DeleteTenantBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteTenantNotFound creates a DeleteTenantNotFound with default headers values +func NewDeleteTenantNotFound() *DeleteTenantNotFound { + return &DeleteTenantNotFound{} +} + +/* +DeleteTenantNotFound describes a response with status code 404, with default header values. + +Tenant not found +*/ +type DeleteTenantNotFound struct { +} + +// IsSuccess returns true when this delete tenant not found response has a 2xx status code +func (o *DeleteTenantNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete tenant not found response has a 3xx status code +func (o *DeleteTenantNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete tenant not found response has a 4xx status code +func (o *DeleteTenantNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete tenant not found response has a 5xx status code +func (o *DeleteTenantNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete tenant not found response a status code equal to that given +func (o *DeleteTenantNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete tenant not found response +func (o *DeleteTenantNotFound) Code() int { + return 404 +} + +func (o *DeleteTenantNotFound) Error() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantNotFound ", 404) +} + +func (o *DeleteTenantNotFound) String() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantNotFound ", 404) +} + +func (o *DeleteTenantNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteTenantInternalServerError creates a DeleteTenantInternalServerError with default headers values +func NewDeleteTenantInternalServerError() *DeleteTenantInternalServerError { + return &DeleteTenantInternalServerError{} +} + +/* +DeleteTenantInternalServerError describes a response with status code 500, with default header values. + +Error deleting tenant +*/ +type DeleteTenantInternalServerError struct { +} + +// IsSuccess returns true when this delete tenant internal server error response has a 2xx status code +func (o *DeleteTenantInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete tenant internal server error response has a 3xx status code +func (o *DeleteTenantInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete tenant internal server error response has a 4xx status code +func (o *DeleteTenantInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete tenant internal server error response has a 5xx status code +func (o *DeleteTenantInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete tenant internal server error response a status code equal to that given +func (o *DeleteTenantInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete tenant internal server error response +func (o *DeleteTenantInternalServerError) Code() int { + return 500 +} + +func (o *DeleteTenantInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantInternalServerError ", 500) +} + +func (o *DeleteTenantInternalServerError) String() string { + return fmt.Sprintf("[DELETE /tenants/{tenantName}][%d] deleteTenantInternalServerError ", 500) +} + +func (o *DeleteTenantInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/get_all_tenants_parameters.go b/src/client/tenant/get_all_tenants_parameters.go new file mode 100644 index 0000000..7a6ea55 --- /dev/null +++ b/src/client/tenant/get_all_tenants_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAllTenantsParams creates a new GetAllTenantsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAllTenantsParams() *GetAllTenantsParams { + return &GetAllTenantsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAllTenantsParamsWithTimeout creates a new GetAllTenantsParams object +// with the ability to set a timeout on a request. +func NewGetAllTenantsParamsWithTimeout(timeout time.Duration) *GetAllTenantsParams { + return &GetAllTenantsParams{ + timeout: timeout, + } +} + +// NewGetAllTenantsParamsWithContext creates a new GetAllTenantsParams object +// with the ability to set a context for a request. +func NewGetAllTenantsParamsWithContext(ctx context.Context) *GetAllTenantsParams { + return &GetAllTenantsParams{ + Context: ctx, + } +} + +// NewGetAllTenantsParamsWithHTTPClient creates a new GetAllTenantsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAllTenantsParamsWithHTTPClient(client *http.Client) *GetAllTenantsParams { + return &GetAllTenantsParams{ + HTTPClient: client, + } +} + +/* +GetAllTenantsParams contains all the parameters to send to the API endpoint + + for the get all tenants operation. + + Typically these are written to a http.Request. +*/ +type GetAllTenantsParams struct { + + /* Type. + + Tenant type + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get all tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAllTenantsParams) WithDefaults() *GetAllTenantsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get all tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAllTenantsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get all tenants params +func (o *GetAllTenantsParams) WithTimeout(timeout time.Duration) *GetAllTenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get all tenants params +func (o *GetAllTenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get all tenants params +func (o *GetAllTenantsParams) WithContext(ctx context.Context) *GetAllTenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get all tenants params +func (o *GetAllTenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get all tenants params +func (o *GetAllTenantsParams) WithHTTPClient(client *http.Client) *GetAllTenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get all tenants params +func (o *GetAllTenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithType adds the typeVar to the get all tenants params +func (o *GetAllTenantsParams) WithType(typeVar *string) *GetAllTenantsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get all tenants params +func (o *GetAllTenantsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAllTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/get_all_tenants_responses.go b/src/client/tenant/get_all_tenants_responses.go new file mode 100644 index 0000000..4080931 --- /dev/null +++ b/src/client/tenant/get_all_tenants_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetAllTenantsReader is a Reader for the GetAllTenants structure. +type GetAllTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAllTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAllTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetAllTenantsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAllTenantsOK creates a GetAllTenantsOK with default headers values +func NewGetAllTenantsOK() *GetAllTenantsOK { + return &GetAllTenantsOK{} +} + +/* +GetAllTenantsOK describes a response with status code 200, with default header values. + +Success +*/ +type GetAllTenantsOK struct { +} + +// IsSuccess returns true when this get all tenants o k response has a 2xx status code +func (o *GetAllTenantsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get all tenants o k response has a 3xx status code +func (o *GetAllTenantsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get all tenants o k response has a 4xx status code +func (o *GetAllTenantsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get all tenants o k response has a 5xx status code +func (o *GetAllTenantsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get all tenants o k response a status code equal to that given +func (o *GetAllTenantsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get all tenants o k response +func (o *GetAllTenantsOK) Code() int { + return 200 +} + +func (o *GetAllTenantsOK) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getAllTenantsOK ", 200) +} + +func (o *GetAllTenantsOK) String() string { + return fmt.Sprintf("[GET /tenants][%d] getAllTenantsOK ", 200) +} + +func (o *GetAllTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAllTenantsInternalServerError creates a GetAllTenantsInternalServerError with default headers values +func NewGetAllTenantsInternalServerError() *GetAllTenantsInternalServerError { + return &GetAllTenantsInternalServerError{} +} + +/* +GetAllTenantsInternalServerError describes a response with status code 500, with default header values. + +Error reading tenants list +*/ +type GetAllTenantsInternalServerError struct { +} + +// IsSuccess returns true when this get all tenants internal server error response has a 2xx status code +func (o *GetAllTenantsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get all tenants internal server error response has a 3xx status code +func (o *GetAllTenantsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get all tenants internal server error response has a 4xx status code +func (o *GetAllTenantsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get all tenants internal server error response has a 5xx status code +func (o *GetAllTenantsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get all tenants internal server error response a status code equal to that given +func (o *GetAllTenantsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get all tenants internal server error response +func (o *GetAllTenantsInternalServerError) Code() int { + return 500 +} + +func (o *GetAllTenantsInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getAllTenantsInternalServerError ", 500) +} + +func (o *GetAllTenantsInternalServerError) String() string { + return fmt.Sprintf("[GET /tenants][%d] getAllTenantsInternalServerError ", 500) +} + +func (o *GetAllTenantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/get_tables_on_tenant_parameters.go b/src/client/tenant/get_tables_on_tenant_parameters.go new file mode 100644 index 0000000..fffc05e --- /dev/null +++ b/src/client/tenant/get_tables_on_tenant_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTablesOnTenantParams creates a new GetTablesOnTenantParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTablesOnTenantParams() *GetTablesOnTenantParams { + return &GetTablesOnTenantParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTablesOnTenantParamsWithTimeout creates a new GetTablesOnTenantParams object +// with the ability to set a timeout on a request. +func NewGetTablesOnTenantParamsWithTimeout(timeout time.Duration) *GetTablesOnTenantParams { + return &GetTablesOnTenantParams{ + timeout: timeout, + } +} + +// NewGetTablesOnTenantParamsWithContext creates a new GetTablesOnTenantParams object +// with the ability to set a context for a request. +func NewGetTablesOnTenantParamsWithContext(ctx context.Context) *GetTablesOnTenantParams { + return &GetTablesOnTenantParams{ + Context: ctx, + } +} + +// NewGetTablesOnTenantParamsWithHTTPClient creates a new GetTablesOnTenantParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTablesOnTenantParamsWithHTTPClient(client *http.Client) *GetTablesOnTenantParams { + return &GetTablesOnTenantParams{ + HTTPClient: client, + } +} + +/* +GetTablesOnTenantParams contains all the parameters to send to the API endpoint + + for the get tables on tenant operation. + + Typically these are written to a http.Request. +*/ +type GetTablesOnTenantParams struct { + + /* TenantName. + + Tenant name + */ + TenantName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tables on tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTablesOnTenantParams) WithDefaults() *GetTablesOnTenantParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tables on tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTablesOnTenantParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tables on tenant params +func (o *GetTablesOnTenantParams) WithTimeout(timeout time.Duration) *GetTablesOnTenantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tables on tenant params +func (o *GetTablesOnTenantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tables on tenant params +func (o *GetTablesOnTenantParams) WithContext(ctx context.Context) *GetTablesOnTenantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tables on tenant params +func (o *GetTablesOnTenantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tables on tenant params +func (o *GetTablesOnTenantParams) WithHTTPClient(client *http.Client) *GetTablesOnTenantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tables on tenant params +func (o *GetTablesOnTenantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantName adds the tenantName to the get tables on tenant params +func (o *GetTablesOnTenantParams) WithTenantName(tenantName string) *GetTablesOnTenantParams { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the get tables on tenant params +func (o *GetTablesOnTenantParams) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTablesOnTenantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/get_tables_on_tenant_responses.go b/src/client/tenant/get_tables_on_tenant_responses.go new file mode 100644 index 0000000..72d9c66 --- /dev/null +++ b/src/client/tenant/get_tables_on_tenant_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTablesOnTenantReader is a Reader for the GetTablesOnTenant structure. +type GetTablesOnTenantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTablesOnTenantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTablesOnTenantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetTablesOnTenantInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTablesOnTenantOK creates a GetTablesOnTenantOK with default headers values +func NewGetTablesOnTenantOK() *GetTablesOnTenantOK { + return &GetTablesOnTenantOK{} +} + +/* +GetTablesOnTenantOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTablesOnTenantOK struct { +} + +// IsSuccess returns true when this get tables on tenant o k response has a 2xx status code +func (o *GetTablesOnTenantOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tables on tenant o k response has a 3xx status code +func (o *GetTablesOnTenantOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tables on tenant o k response has a 4xx status code +func (o *GetTablesOnTenantOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tables on tenant o k response has a 5xx status code +func (o *GetTablesOnTenantOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tables on tenant o k response a status code equal to that given +func (o *GetTablesOnTenantOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tables on tenant o k response +func (o *GetTablesOnTenantOK) Code() int { + return 200 +} + +func (o *GetTablesOnTenantOK) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/tables][%d] getTablesOnTenantOK ", 200) +} + +func (o *GetTablesOnTenantOK) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/tables][%d] getTablesOnTenantOK ", 200) +} + +func (o *GetTablesOnTenantOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTablesOnTenantInternalServerError creates a GetTablesOnTenantInternalServerError with default headers values +func NewGetTablesOnTenantInternalServerError() *GetTablesOnTenantInternalServerError { + return &GetTablesOnTenantInternalServerError{} +} + +/* +GetTablesOnTenantInternalServerError describes a response with status code 500, with default header values. + +Error reading list +*/ +type GetTablesOnTenantInternalServerError struct { +} + +// IsSuccess returns true when this get tables on tenant internal server error response has a 2xx status code +func (o *GetTablesOnTenantInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tables on tenant internal server error response has a 3xx status code +func (o *GetTablesOnTenantInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tables on tenant internal server error response has a 4xx status code +func (o *GetTablesOnTenantInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tables on tenant internal server error response has a 5xx status code +func (o *GetTablesOnTenantInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get tables on tenant internal server error response a status code equal to that given +func (o *GetTablesOnTenantInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get tables on tenant internal server error response +func (o *GetTablesOnTenantInternalServerError) Code() int { + return 500 +} + +func (o *GetTablesOnTenantInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/tables][%d] getTablesOnTenantInternalServerError ", 500) +} + +func (o *GetTablesOnTenantInternalServerError) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/tables][%d] getTablesOnTenantInternalServerError ", 500) +} + +func (o *GetTablesOnTenantInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/get_tenant_metadata_parameters.go b/src/client/tenant/get_tenant_metadata_parameters.go new file mode 100644 index 0000000..707fd7c --- /dev/null +++ b/src/client/tenant/get_tenant_metadata_parameters.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTenantMetadataParams creates a new GetTenantMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTenantMetadataParams() *GetTenantMetadataParams { + return &GetTenantMetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantMetadataParamsWithTimeout creates a new GetTenantMetadataParams object +// with the ability to set a timeout on a request. +func NewGetTenantMetadataParamsWithTimeout(timeout time.Duration) *GetTenantMetadataParams { + return &GetTenantMetadataParams{ + timeout: timeout, + } +} + +// NewGetTenantMetadataParamsWithContext creates a new GetTenantMetadataParams object +// with the ability to set a context for a request. +func NewGetTenantMetadataParamsWithContext(ctx context.Context) *GetTenantMetadataParams { + return &GetTenantMetadataParams{ + Context: ctx, + } +} + +// NewGetTenantMetadataParamsWithHTTPClient creates a new GetTenantMetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTenantMetadataParamsWithHTTPClient(client *http.Client) *GetTenantMetadataParams { + return &GetTenantMetadataParams{ + HTTPClient: client, + } +} + +/* +GetTenantMetadataParams contains all the parameters to send to the API endpoint + + for the get tenant metadata operation. + + Typically these are written to a http.Request. +*/ +type GetTenantMetadataParams struct { + + /* TenantName. + + Tenant name + */ + TenantName string + + /* Type. + + tenant type + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tenant metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantMetadataParams) WithDefaults() *GetTenantMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tenant metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tenant metadata params +func (o *GetTenantMetadataParams) WithTimeout(timeout time.Duration) *GetTenantMetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tenant metadata params +func (o *GetTenantMetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tenant metadata params +func (o *GetTenantMetadataParams) WithContext(ctx context.Context) *GetTenantMetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tenant metadata params +func (o *GetTenantMetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tenant metadata params +func (o *GetTenantMetadataParams) WithHTTPClient(client *http.Client) *GetTenantMetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tenant metadata params +func (o *GetTenantMetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantName adds the tenantName to the get tenant metadata params +func (o *GetTenantMetadataParams) WithTenantName(tenantName string) *GetTenantMetadataParams { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the get tenant metadata params +func (o *GetTenantMetadataParams) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WithType adds the typeVar to the get tenant metadata params +func (o *GetTenantMetadataParams) WithType(typeVar *string) *GetTenantMetadataParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get tenant metadata params +func (o *GetTenantMetadataParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTenantMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/get_tenant_metadata_responses.go b/src/client/tenant/get_tenant_metadata_responses.go new file mode 100644 index 0000000..2b6a384 --- /dev/null +++ b/src/client/tenant/get_tenant_metadata_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// GetTenantMetadataReader is a Reader for the GetTenantMetadata structure. +type GetTenantMetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTenantMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTenantMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetTenantMetadataNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTenantMetadataInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTenantMetadataOK creates a GetTenantMetadataOK with default headers values +func NewGetTenantMetadataOK() *GetTenantMetadataOK { + return &GetTenantMetadataOK{} +} + +/* +GetTenantMetadataOK describes a response with status code 200, with default header values. + +Success +*/ +type GetTenantMetadataOK struct { + Payload *models.TenantMetadata +} + +// IsSuccess returns true when this get tenant metadata o k response has a 2xx status code +func (o *GetTenantMetadataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get tenant metadata o k response has a 3xx status code +func (o *GetTenantMetadataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tenant metadata o k response has a 4xx status code +func (o *GetTenantMetadataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tenant metadata o k response has a 5xx status code +func (o *GetTenantMetadataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get tenant metadata o k response a status code equal to that given +func (o *GetTenantMetadataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get tenant metadata o k response +func (o *GetTenantMetadataOK) Code() int { + return 200 +} + +func (o *GetTenantMetadataOK) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/metadata][%d] getTenantMetadataOK %+v", 200, o.Payload) +} + +func (o *GetTenantMetadataOK) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/metadata][%d] getTenantMetadataOK %+v", 200, o.Payload) +} + +func (o *GetTenantMetadataOK) GetPayload() *models.TenantMetadata { + return o.Payload +} + +func (o *GetTenantMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantMetadata) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantMetadataNotFound creates a GetTenantMetadataNotFound with default headers values +func NewGetTenantMetadataNotFound() *GetTenantMetadataNotFound { + return &GetTenantMetadataNotFound{} +} + +/* +GetTenantMetadataNotFound describes a response with status code 404, with default header values. + +Tenant not found +*/ +type GetTenantMetadataNotFound struct { +} + +// IsSuccess returns true when this get tenant metadata not found response has a 2xx status code +func (o *GetTenantMetadataNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tenant metadata not found response has a 3xx status code +func (o *GetTenantMetadataNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tenant metadata not found response has a 4xx status code +func (o *GetTenantMetadataNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get tenant metadata not found response has a 5xx status code +func (o *GetTenantMetadataNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get tenant metadata not found response a status code equal to that given +func (o *GetTenantMetadataNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get tenant metadata not found response +func (o *GetTenantMetadataNotFound) Code() int { + return 404 +} + +func (o *GetTenantMetadataNotFound) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/metadata][%d] getTenantMetadataNotFound ", 404) +} + +func (o *GetTenantMetadataNotFound) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/metadata][%d] getTenantMetadataNotFound ", 404) +} + +func (o *GetTenantMetadataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetTenantMetadataInternalServerError creates a GetTenantMetadataInternalServerError with default headers values +func NewGetTenantMetadataInternalServerError() *GetTenantMetadataInternalServerError { + return &GetTenantMetadataInternalServerError{} +} + +/* +GetTenantMetadataInternalServerError describes a response with status code 500, with default header values. + +Server error reading tenant information +*/ +type GetTenantMetadataInternalServerError struct { +} + +// IsSuccess returns true when this get tenant metadata internal server error response has a 2xx status code +func (o *GetTenantMetadataInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get tenant metadata internal server error response has a 3xx status code +func (o *GetTenantMetadataInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get tenant metadata internal server error response has a 4xx status code +func (o *GetTenantMetadataInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get tenant metadata internal server error response has a 5xx status code +func (o *GetTenantMetadataInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get tenant metadata internal server error response a status code equal to that given +func (o *GetTenantMetadataInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get tenant metadata internal server error response +func (o *GetTenantMetadataInternalServerError) Code() int { + return 500 +} + +func (o *GetTenantMetadataInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/metadata][%d] getTenantMetadataInternalServerError ", 500) +} + +func (o *GetTenantMetadataInternalServerError) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}/metadata][%d] getTenantMetadataInternalServerError ", 500) +} + +func (o *GetTenantMetadataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/list_instance_or_toggle_tenant_state_parameters.go b/src/client/tenant/list_instance_or_toggle_tenant_state_parameters.go new file mode 100644 index 0000000..b82e136 --- /dev/null +++ b/src/client/tenant/list_instance_or_toggle_tenant_state_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListInstanceOrToggleTenantStateParams creates a new ListInstanceOrToggleTenantStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListInstanceOrToggleTenantStateParams() *ListInstanceOrToggleTenantStateParams { + return &ListInstanceOrToggleTenantStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListInstanceOrToggleTenantStateParamsWithTimeout creates a new ListInstanceOrToggleTenantStateParams object +// with the ability to set a timeout on a request. +func NewListInstanceOrToggleTenantStateParamsWithTimeout(timeout time.Duration) *ListInstanceOrToggleTenantStateParams { + return &ListInstanceOrToggleTenantStateParams{ + timeout: timeout, + } +} + +// NewListInstanceOrToggleTenantStateParamsWithContext creates a new ListInstanceOrToggleTenantStateParams object +// with the ability to set a context for a request. +func NewListInstanceOrToggleTenantStateParamsWithContext(ctx context.Context) *ListInstanceOrToggleTenantStateParams { + return &ListInstanceOrToggleTenantStateParams{ + Context: ctx, + } +} + +// NewListInstanceOrToggleTenantStateParamsWithHTTPClient creates a new ListInstanceOrToggleTenantStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewListInstanceOrToggleTenantStateParamsWithHTTPClient(client *http.Client) *ListInstanceOrToggleTenantStateParams { + return &ListInstanceOrToggleTenantStateParams{ + HTTPClient: client, + } +} + +/* +ListInstanceOrToggleTenantStateParams contains all the parameters to send to the API endpoint + + for the list instance or toggle tenant state operation. + + Typically these are written to a http.Request. +*/ +type ListInstanceOrToggleTenantStateParams struct { + + /* State. + + state + */ + State *string + + /* TableType. + + Table type (offline|realtime) + */ + TableType *string + + /* TenantName. + + Tenant name + */ + TenantName string + + /* Type. + + Tenant type (server|broker) + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list instance or toggle tenant state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInstanceOrToggleTenantStateParams) WithDefaults() *ListInstanceOrToggleTenantStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list instance or toggle tenant state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInstanceOrToggleTenantStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithTimeout(timeout time.Duration) *ListInstanceOrToggleTenantStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithContext(ctx context.Context) *ListInstanceOrToggleTenantStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithHTTPClient(client *http.Client) *ListInstanceOrToggleTenantStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithState adds the state to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithState(state *string) *ListInstanceOrToggleTenantStateParams { + o.SetState(state) + return o +} + +// SetState adds the state to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetState(state *string) { + o.State = state +} + +// WithTableType adds the tableType to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithTableType(tableType *string) *ListInstanceOrToggleTenantStateParams { + o.SetTableType(tableType) + return o +} + +// SetTableType adds the tableType to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetTableType(tableType *string) { + o.TableType = tableType +} + +// WithTenantName adds the tenantName to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithTenantName(tenantName string) *ListInstanceOrToggleTenantStateParams { + o.SetTenantName(tenantName) + return o +} + +// SetTenantName adds the tenantName to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetTenantName(tenantName string) { + o.TenantName = tenantName +} + +// WithType adds the typeVar to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) WithType(typeVar *string) *ListInstanceOrToggleTenantStateParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list instance or toggle tenant state params +func (o *ListInstanceOrToggleTenantStateParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListInstanceOrToggleTenantStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if o.TableType != nil { + + // query param tableType + var qrTableType string + + if o.TableType != nil { + qrTableType = *o.TableType + } + qTableType := qrTableType + if qTableType != "" { + + if err := r.SetQueryParam("tableType", qTableType); err != nil { + return err + } + } + } + + // path param tenantName + if err := r.SetPathParam("tenantName", o.TenantName); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/list_instance_or_toggle_tenant_state_responses.go b/src/client/tenant/list_instance_or_toggle_tenant_state_responses.go new file mode 100644 index 0000000..4b119fa --- /dev/null +++ b/src/client/tenant/list_instance_or_toggle_tenant_state_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListInstanceOrToggleTenantStateReader is a Reader for the ListInstanceOrToggleTenantState structure. +type ListInstanceOrToggleTenantStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListInstanceOrToggleTenantStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListInstanceOrToggleTenantStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewListInstanceOrToggleTenantStateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListInstanceOrToggleTenantStateOK creates a ListInstanceOrToggleTenantStateOK with default headers values +func NewListInstanceOrToggleTenantStateOK() *ListInstanceOrToggleTenantStateOK { + return &ListInstanceOrToggleTenantStateOK{} +} + +/* +ListInstanceOrToggleTenantStateOK describes a response with status code 200, with default header values. + +Success +*/ +type ListInstanceOrToggleTenantStateOK struct { +} + +// IsSuccess returns true when this list instance or toggle tenant state o k response has a 2xx status code +func (o *ListInstanceOrToggleTenantStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list instance or toggle tenant state o k response has a 3xx status code +func (o *ListInstanceOrToggleTenantStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list instance or toggle tenant state o k response has a 4xx status code +func (o *ListInstanceOrToggleTenantStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list instance or toggle tenant state o k response has a 5xx status code +func (o *ListInstanceOrToggleTenantStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list instance or toggle tenant state o k response a status code equal to that given +func (o *ListInstanceOrToggleTenantStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list instance or toggle tenant state o k response +func (o *ListInstanceOrToggleTenantStateOK) Code() int { + return 200 +} + +func (o *ListInstanceOrToggleTenantStateOK) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}][%d] listInstanceOrToggleTenantStateOK ", 200) +} + +func (o *ListInstanceOrToggleTenantStateOK) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}][%d] listInstanceOrToggleTenantStateOK ", 200) +} + +func (o *ListInstanceOrToggleTenantStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewListInstanceOrToggleTenantStateInternalServerError creates a ListInstanceOrToggleTenantStateInternalServerError with default headers values +func NewListInstanceOrToggleTenantStateInternalServerError() *ListInstanceOrToggleTenantStateInternalServerError { + return &ListInstanceOrToggleTenantStateInternalServerError{} +} + +/* +ListInstanceOrToggleTenantStateInternalServerError describes a response with status code 500, with default header values. + +Error reading tenants list +*/ +type ListInstanceOrToggleTenantStateInternalServerError struct { +} + +// IsSuccess returns true when this list instance or toggle tenant state internal server error response has a 2xx status code +func (o *ListInstanceOrToggleTenantStateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list instance or toggle tenant state internal server error response has a 3xx status code +func (o *ListInstanceOrToggleTenantStateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list instance or toggle tenant state internal server error response has a 4xx status code +func (o *ListInstanceOrToggleTenantStateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list instance or toggle tenant state internal server error response has a 5xx status code +func (o *ListInstanceOrToggleTenantStateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list instance or toggle tenant state internal server error response a status code equal to that given +func (o *ListInstanceOrToggleTenantStateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list instance or toggle tenant state internal server error response +func (o *ListInstanceOrToggleTenantStateInternalServerError) Code() int { + return 500 +} + +func (o *ListInstanceOrToggleTenantStateInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantName}][%d] listInstanceOrToggleTenantStateInternalServerError ", 500) +} + +func (o *ListInstanceOrToggleTenantStateInternalServerError) String() string { + return fmt.Sprintf("[GET /tenants/{tenantName}][%d] listInstanceOrToggleTenantStateInternalServerError ", 500) +} + +func (o *ListInstanceOrToggleTenantStateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tenant/tenant_client.go b/src/client/tenant/tenant_client.go new file mode 100644 index 0000000..00baa12 --- /dev/null +++ b/src/client/tenant/tenant_client.go @@ -0,0 +1,367 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new tenant API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tenant API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ChangeTenantState(params *ChangeTenantStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeTenantStateOK, error) + + CreateTenant(params *CreateTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTenantOK, error) + + DeleteTenant(params *DeleteTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTenantOK, error) + + GetAllTenants(params *GetAllTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllTenantsOK, error) + + GetTablesOnTenant(params *GetTablesOnTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTablesOnTenantOK, error) + + GetTenantMetadata(params *GetTenantMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantMetadataOK, error) + + ListInstanceOrToggleTenantState(params *ListInstanceOrToggleTenantStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInstanceOrToggleTenantStateOK, error) + + UpdateTenant(params *UpdateTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTenantOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +ChangeTenantState changes tenant state +*/ +func (a *Client) ChangeTenantState(params *ChangeTenantStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeTenantStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChangeTenantStateParams() + } + op := &runtime.ClientOperation{ + ID: "changeTenantState", + Method: "POST", + PathPattern: "/tenants/{tenantName}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ChangeTenantStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ChangeTenantStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for changeTenantState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateTenant creates a tenant +*/ +func (a *Client) CreateTenant(params *CreateTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateTenantParams() + } + op := &runtime.ClientOperation{ + ID: "createTenant", + Method: "POST", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateTenantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateTenantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createTenant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteTenant deletes a tenant +*/ +func (a *Client) DeleteTenant(params *DeleteTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTenantParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTenant", + Method: "DELETE", + PathPattern: "/tenants/{tenantName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTenantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTenantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteTenant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetAllTenants lists all tenants +*/ +func (a *Client) GetAllTenants(params *GetAllTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAllTenantsParams() + } + op := &runtime.ClientOperation{ + ID: "getAllTenants", + Method: "GET", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAllTenantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetAllTenantsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getAllTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTablesOnTenant lists tables on a a server tenant +*/ +func (a *Client) GetTablesOnTenant(params *GetTablesOnTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTablesOnTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTablesOnTenantParams() + } + op := &runtime.ClientOperation{ + ID: "getTablesOnTenant", + Method: "GET", + PathPattern: "/tenants/{tenantName}/tables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTablesOnTenantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTablesOnTenantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTablesOnTenant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTenantMetadata gets tenant information +*/ +func (a *Client) GetTenantMetadata(params *GetTenantMetadataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantMetadataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantMetadataParams() + } + op := &runtime.ClientOperation{ + ID: "getTenantMetadata", + Method: "GET", + PathPattern: "/tenants/{tenantName}/metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTenantMetadataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTenantMetadataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTenantMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListInstanceOrToggleTenantState lists instance for a tenant or enable disable drop a tenant +*/ +func (a *Client) ListInstanceOrToggleTenantState(params *ListInstanceOrToggleTenantStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInstanceOrToggleTenantStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListInstanceOrToggleTenantStateParams() + } + op := &runtime.ClientOperation{ + ID: "listInstanceOrToggleTenantState", + Method: "GET", + PathPattern: "/tenants/{tenantName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListInstanceOrToggleTenantStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListInstanceOrToggleTenantStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listInstanceOrToggleTenantState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateTenant updates a tenant +*/ +func (a *Client) UpdateTenant(params *UpdateTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateTenantParams() + } + op := &runtime.ClientOperation{ + ID: "updateTenant", + Method: "PUT", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateTenantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateTenantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateTenant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/tenant/update_tenant_parameters.go b/src/client/tenant/update_tenant_parameters.go new file mode 100644 index 0000000..8e50f4b --- /dev/null +++ b/src/client/tenant/update_tenant_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewUpdateTenantParams creates a new UpdateTenantParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTenantParams() *UpdateTenantParams { + return &UpdateTenantParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTenantParamsWithTimeout creates a new UpdateTenantParams object +// with the ability to set a timeout on a request. +func NewUpdateTenantParamsWithTimeout(timeout time.Duration) *UpdateTenantParams { + return &UpdateTenantParams{ + timeout: timeout, + } +} + +// NewUpdateTenantParamsWithContext creates a new UpdateTenantParams object +// with the ability to set a context for a request. +func NewUpdateTenantParamsWithContext(ctx context.Context) *UpdateTenantParams { + return &UpdateTenantParams{ + Context: ctx, + } +} + +// NewUpdateTenantParamsWithHTTPClient creates a new UpdateTenantParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTenantParamsWithHTTPClient(client *http.Client) *UpdateTenantParams { + return &UpdateTenantParams{ + HTTPClient: client, + } +} + +/* +UpdateTenantParams contains all the parameters to send to the API endpoint + + for the update tenant operation. + + Typically these are written to a http.Request. +*/ +type UpdateTenantParams struct { + + // Body. + Body *models.Tenant + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTenantParams) WithDefaults() *UpdateTenantParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTenantParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update tenant params +func (o *UpdateTenantParams) WithTimeout(timeout time.Duration) *UpdateTenantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update tenant params +func (o *UpdateTenantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update tenant params +func (o *UpdateTenantParams) WithContext(ctx context.Context) *UpdateTenantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update tenant params +func (o *UpdateTenantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update tenant params +func (o *UpdateTenantParams) WithHTTPClient(client *http.Client) *UpdateTenantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update tenant params +func (o *UpdateTenantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update tenant params +func (o *UpdateTenantParams) WithBody(body *models.Tenant) *UpdateTenantParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update tenant params +func (o *UpdateTenantParams) SetBody(body *models.Tenant) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTenantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tenant/update_tenant_responses.go b/src/client/tenant/update_tenant_responses.go new file mode 100644 index 0000000..6f04b63 --- /dev/null +++ b/src/client/tenant/update_tenant_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenant + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTenantReader is a Reader for the UpdateTenant structure. +type UpdateTenantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTenantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTenantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewUpdateTenantInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTenantOK creates a UpdateTenantOK with default headers values +func NewUpdateTenantOK() *UpdateTenantOK { + return &UpdateTenantOK{} +} + +/* +UpdateTenantOK describes a response with status code 200, with default header values. + +Success +*/ +type UpdateTenantOK struct { +} + +// IsSuccess returns true when this update tenant o k response has a 2xx status code +func (o *UpdateTenantOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update tenant o k response has a 3xx status code +func (o *UpdateTenantOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update tenant o k response has a 4xx status code +func (o *UpdateTenantOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update tenant o k response has a 5xx status code +func (o *UpdateTenantOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update tenant o k response a status code equal to that given +func (o *UpdateTenantOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update tenant o k response +func (o *UpdateTenantOK) Code() int { + return 200 +} + +func (o *UpdateTenantOK) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] updateTenantOK ", 200) +} + +func (o *UpdateTenantOK) String() string { + return fmt.Sprintf("[PUT /tenants][%d] updateTenantOK ", 200) +} + +func (o *UpdateTenantOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateTenantInternalServerError creates a UpdateTenantInternalServerError with default headers values +func NewUpdateTenantInternalServerError() *UpdateTenantInternalServerError { + return &UpdateTenantInternalServerError{} +} + +/* +UpdateTenantInternalServerError describes a response with status code 500, with default header values. + +Failed to update the tenant +*/ +type UpdateTenantInternalServerError struct { +} + +// IsSuccess returns true when this update tenant internal server error response has a 2xx status code +func (o *UpdateTenantInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update tenant internal server error response has a 3xx status code +func (o *UpdateTenantInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update tenant internal server error response has a 4xx status code +func (o *UpdateTenantInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update tenant internal server error response has a 5xx status code +func (o *UpdateTenantInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update tenant internal server error response a status code equal to that given +func (o *UpdateTenantInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update tenant internal server error response +func (o *UpdateTenantInternalServerError) Code() int { + return 500 +} + +func (o *UpdateTenantInternalServerError) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] updateTenantInternalServerError ", 500) +} + +func (o *UpdateTenantInternalServerError) String() string { + return fmt.Sprintf("[PUT /tenants][%d] updateTenantInternalServerError ", 500) +} + +func (o *UpdateTenantInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/tuner/tune_table1_parameters.go b/src/client/tuner/tune_table1_parameters.go new file mode 100644 index 0000000..c6545fc --- /dev/null +++ b/src/client/tuner/tune_table1_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tuner + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewTuneTable1Params creates a new TuneTable1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTuneTable1Params() *TuneTable1Params { + return &TuneTable1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewTuneTable1ParamsWithTimeout creates a new TuneTable1Params object +// with the ability to set a timeout on a request. +func NewTuneTable1ParamsWithTimeout(timeout time.Duration) *TuneTable1Params { + return &TuneTable1Params{ + timeout: timeout, + } +} + +// NewTuneTable1ParamsWithContext creates a new TuneTable1Params object +// with the ability to set a context for a request. +func NewTuneTable1ParamsWithContext(ctx context.Context) *TuneTable1Params { + return &TuneTable1Params{ + Context: ctx, + } +} + +// NewTuneTable1ParamsWithHTTPClient creates a new TuneTable1Params object +// with the ability to set a custom HTTPClient for a request. +func NewTuneTable1ParamsWithHTTPClient(client *http.Client) *TuneTable1Params { + return &TuneTable1Params{ + HTTPClient: client, + } +} + +/* +TuneTable1Params contains all the parameters to send to the API endpoint + + for the tune table 1 operation. + + Typically these are written to a http.Request. +*/ +type TuneTable1Params struct { + + // Body. + Body string + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tune table 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TuneTable1Params) WithDefaults() *TuneTable1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tune table 1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TuneTable1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tune table 1 params +func (o *TuneTable1Params) WithTimeout(timeout time.Duration) *TuneTable1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tune table 1 params +func (o *TuneTable1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tune table 1 params +func (o *TuneTable1Params) WithContext(ctx context.Context) *TuneTable1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tune table 1 params +func (o *TuneTable1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tune table 1 params +func (o *TuneTable1Params) WithHTTPClient(client *http.Client) *TuneTable1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tune table 1 params +func (o *TuneTable1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the tune table 1 params +func (o *TuneTable1Params) WithBody(body string) *TuneTable1Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the tune table 1 params +func (o *TuneTable1Params) SetBody(body string) { + o.Body = body +} + +// WithTableName adds the tableName to the tune table 1 params +func (o *TuneTable1Params) WithTableName(tableName string) *TuneTable1Params { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the tune table 1 params +func (o *TuneTable1Params) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *TuneTable1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tuner/tune_table1_responses.go b/src/client/tuner/tune_table1_responses.go new file mode 100644 index 0000000..a4f0819 --- /dev/null +++ b/src/client/tuner/tune_table1_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tuner + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TuneTable1Reader is a Reader for the TuneTable1 structure. +type TuneTable1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TuneTable1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTuneTable1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTuneTable1OK creates a TuneTable1OK with default headers values +func NewTuneTable1OK() *TuneTable1OK { + return &TuneTable1OK{} +} + +/* +TuneTable1OK describes a response with status code 200, with default header values. + +successful operation +*/ +type TuneTable1OK struct { + Payload string +} + +// IsSuccess returns true when this tune table1 o k response has a 2xx status code +func (o *TuneTable1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this tune table1 o k response has a 3xx status code +func (o *TuneTable1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this tune table1 o k response has a 4xx status code +func (o *TuneTable1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this tune table1 o k response has a 5xx status code +func (o *TuneTable1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this tune table1 o k response a status code equal to that given +func (o *TuneTable1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the tune table1 o k response +func (o *TuneTable1OK) Code() int { + return 200 +} + +func (o *TuneTable1OK) Error() string { + return fmt.Sprintf("[POST /tuner/{tableName}][%d] tuneTable1OK %+v", 200, o.Payload) +} + +func (o *TuneTable1OK) String() string { + return fmt.Sprintf("[POST /tuner/{tableName}][%d] tuneTable1OK %+v", 200, o.Payload) +} + +func (o *TuneTable1OK) GetPayload() string { + return o.Payload +} + +func (o *TuneTable1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/tuner/tune_table_parameters.go b/src/client/tuner/tune_table_parameters.go new file mode 100644 index 0000000..7f18280 --- /dev/null +++ b/src/client/tuner/tune_table_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tuner + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewTuneTableParams creates a new TuneTableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTuneTableParams() *TuneTableParams { + return &TuneTableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTuneTableParamsWithTimeout creates a new TuneTableParams object +// with the ability to set a timeout on a request. +func NewTuneTableParamsWithTimeout(timeout time.Duration) *TuneTableParams { + return &TuneTableParams{ + timeout: timeout, + } +} + +// NewTuneTableParamsWithContext creates a new TuneTableParams object +// with the ability to set a context for a request. +func NewTuneTableParamsWithContext(ctx context.Context) *TuneTableParams { + return &TuneTableParams{ + Context: ctx, + } +} + +// NewTuneTableParamsWithHTTPClient creates a new TuneTableParams object +// with the ability to set a custom HTTPClient for a request. +func NewTuneTableParamsWithHTTPClient(client *http.Client) *TuneTableParams { + return &TuneTableParams{ + HTTPClient: client, + } +} + +/* +TuneTableParams contains all the parameters to send to the API endpoint + + for the tune table operation. + + Typically these are written to a http.Request. +*/ +type TuneTableParams struct { + + /* TableName. + + Name of the table + */ + TableName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tune table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TuneTableParams) WithDefaults() *TuneTableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tune table params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TuneTableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tune table params +func (o *TuneTableParams) WithTimeout(timeout time.Duration) *TuneTableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tune table params +func (o *TuneTableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tune table params +func (o *TuneTableParams) WithContext(ctx context.Context) *TuneTableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tune table params +func (o *TuneTableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tune table params +func (o *TuneTableParams) WithHTTPClient(client *http.Client) *TuneTableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tune table params +func (o *TuneTableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTableName adds the tableName to the tune table params +func (o *TuneTableParams) WithTableName(tableName string) *TuneTableParams { + o.SetTableName(tableName) + return o +} + +// SetTableName adds the tableName to the tune table params +func (o *TuneTableParams) SetTableName(tableName string) { + o.TableName = tableName +} + +// WriteToRequest writes these params to a swagger request +func (o *TuneTableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tableName + if err := r.SetPathParam("tableName", o.TableName); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/tuner/tune_table_responses.go b/src/client/tuner/tune_table_responses.go new file mode 100644 index 0000000..01ec852 --- /dev/null +++ b/src/client/tuner/tune_table_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tuner + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TuneTableReader is a Reader for the TuneTable structure. +type TuneTableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TuneTableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTuneTableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTuneTableOK creates a TuneTableOK with default headers values +func NewTuneTableOK() *TuneTableOK { + return &TuneTableOK{} +} + +/* +TuneTableOK describes a response with status code 200, with default header values. + +successful operation +*/ +type TuneTableOK struct { + Payload string +} + +// IsSuccess returns true when this tune table o k response has a 2xx status code +func (o *TuneTableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this tune table o k response has a 3xx status code +func (o *TuneTableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this tune table o k response has a 4xx status code +func (o *TuneTableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this tune table o k response has a 5xx status code +func (o *TuneTableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this tune table o k response a status code equal to that given +func (o *TuneTableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the tune table o k response +func (o *TuneTableOK) Code() int { + return 200 +} + +func (o *TuneTableOK) Error() string { + return fmt.Sprintf("[GET /tuner/{tableName}][%d] tuneTableOK %+v", 200, o.Payload) +} + +func (o *TuneTableOK) String() string { + return fmt.Sprintf("[GET /tuner/{tableName}][%d] tuneTableOK %+v", 200, o.Payload) +} + +func (o *TuneTableOK) GetPayload() string { + return o.Payload +} + +func (o *TuneTableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/tuner/tuner_client.go b/src/client/tuner/tuner_client.go new file mode 100644 index 0000000..e958824 --- /dev/null +++ b/src/client/tuner/tuner_client.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tuner + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new tuner API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tuner API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + TuneTable(params *TuneTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TuneTableOK, error) + + TuneTable1(params *TuneTable1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TuneTable1OK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +TuneTable applies tuner s to a table +*/ +func (a *Client) TuneTable(params *TuneTableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TuneTableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTuneTableParams() + } + op := &runtime.ClientOperation{ + ID: "tuneTable", + Method: "GET", + PathPattern: "/tuner/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &TuneTableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TuneTableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tuneTable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +TuneTable1 applies specific tuner to a table +*/ +func (a *Client) TuneTable1(params *TuneTable1Params, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TuneTable1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTuneTable1Params() + } + op := &runtime.ClientOperation{ + ID: "tuneTable_1", + Method: "POST", + PathPattern: "/tuner/{tableName}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &TuneTable1Reader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TuneTable1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tuneTable_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/upsert/estimate_heap_usage_parameters.go b/src/client/upsert/estimate_heap_usage_parameters.go new file mode 100644 index 0000000..69d881f --- /dev/null +++ b/src/client/upsert/estimate_heap_usage_parameters.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package upsert + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewEstimateHeapUsageParams creates a new EstimateHeapUsageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewEstimateHeapUsageParams() *EstimateHeapUsageParams { + return &EstimateHeapUsageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEstimateHeapUsageParamsWithTimeout creates a new EstimateHeapUsageParams object +// with the ability to set a timeout on a request. +func NewEstimateHeapUsageParamsWithTimeout(timeout time.Duration) *EstimateHeapUsageParams { + return &EstimateHeapUsageParams{ + timeout: timeout, + } +} + +// NewEstimateHeapUsageParamsWithContext creates a new EstimateHeapUsageParams object +// with the ability to set a context for a request. +func NewEstimateHeapUsageParamsWithContext(ctx context.Context) *EstimateHeapUsageParams { + return &EstimateHeapUsageParams{ + Context: ctx, + } +} + +// NewEstimateHeapUsageParamsWithHTTPClient creates a new EstimateHeapUsageParams object +// with the ability to set a custom HTTPClient for a request. +func NewEstimateHeapUsageParamsWithHTTPClient(client *http.Client) *EstimateHeapUsageParams { + return &EstimateHeapUsageParams{ + HTTPClient: client, + } +} + +/* +EstimateHeapUsageParams contains all the parameters to send to the API endpoint + + for the estimate heap usage operation. + + Typically these are written to a http.Request. +*/ +type EstimateHeapUsageParams struct { + + // Body. + Body string + + /* Cardinality. + + cardinality + + Format: int64 + */ + Cardinality int64 + + /* NumPartitions. + + numPartitions + + Format: int32 + Default: -1 + */ + NumPartitions *int32 + + /* PrimaryKeySize. + + primaryKeySize + + Format: int32 + Default: -1 + */ + PrimaryKeySize *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the estimate heap usage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EstimateHeapUsageParams) WithDefaults() *EstimateHeapUsageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the estimate heap usage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EstimateHeapUsageParams) SetDefaults() { + var ( + numPartitionsDefault = int32(-1) + + primaryKeySizeDefault = int32(-1) + ) + + val := EstimateHeapUsageParams{ + NumPartitions: &numPartitionsDefault, + PrimaryKeySize: &primaryKeySizeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithTimeout(timeout time.Duration) *EstimateHeapUsageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithContext(ctx context.Context) *EstimateHeapUsageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithHTTPClient(client *http.Client) *EstimateHeapUsageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithBody(body string) *EstimateHeapUsageParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetBody(body string) { + o.Body = body +} + +// WithCardinality adds the cardinality to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithCardinality(cardinality int64) *EstimateHeapUsageParams { + o.SetCardinality(cardinality) + return o +} + +// SetCardinality adds the cardinality to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetCardinality(cardinality int64) { + o.Cardinality = cardinality +} + +// WithNumPartitions adds the numPartitions to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithNumPartitions(numPartitions *int32) *EstimateHeapUsageParams { + o.SetNumPartitions(numPartitions) + return o +} + +// SetNumPartitions adds the numPartitions to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetNumPartitions(numPartitions *int32) { + o.NumPartitions = numPartitions +} + +// WithPrimaryKeySize adds the primaryKeySize to the estimate heap usage params +func (o *EstimateHeapUsageParams) WithPrimaryKeySize(primaryKeySize *int32) *EstimateHeapUsageParams { + o.SetPrimaryKeySize(primaryKeySize) + return o +} + +// SetPrimaryKeySize adds the primaryKeySize to the estimate heap usage params +func (o *EstimateHeapUsageParams) SetPrimaryKeySize(primaryKeySize *int32) { + o.PrimaryKeySize = primaryKeySize +} + +// WriteToRequest writes these params to a swagger request +func (o *EstimateHeapUsageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // query param cardinality + qrCardinality := o.Cardinality + qCardinality := swag.FormatInt64(qrCardinality) + if qCardinality != "" { + + if err := r.SetQueryParam("cardinality", qCardinality); err != nil { + return err + } + } + + if o.NumPartitions != nil { + + // query param numPartitions + var qrNumPartitions int32 + + if o.NumPartitions != nil { + qrNumPartitions = *o.NumPartitions + } + qNumPartitions := swag.FormatInt32(qrNumPartitions) + if qNumPartitions != "" { + + if err := r.SetQueryParam("numPartitions", qNumPartitions); err != nil { + return err + } + } + } + + if o.PrimaryKeySize != nil { + + // query param primaryKeySize + var qrPrimaryKeySize int32 + + if o.PrimaryKeySize != nil { + qrPrimaryKeySize = *o.PrimaryKeySize + } + qPrimaryKeySize := swag.FormatInt32(qrPrimaryKeySize) + if qPrimaryKeySize != "" { + + if err := r.SetQueryParam("primaryKeySize", qPrimaryKeySize); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/upsert/estimate_heap_usage_responses.go b/src/client/upsert/estimate_heap_usage_responses.go new file mode 100644 index 0000000..61b7059 --- /dev/null +++ b/src/client/upsert/estimate_heap_usage_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package upsert + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// EstimateHeapUsageReader is a Reader for the EstimateHeapUsage structure. +type EstimateHeapUsageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EstimateHeapUsageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewEstimateHeapUsageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewEstimateHeapUsageOK creates a EstimateHeapUsageOK with default headers values +func NewEstimateHeapUsageOK() *EstimateHeapUsageOK { + return &EstimateHeapUsageOK{} +} + +/* +EstimateHeapUsageOK describes a response with status code 200, with default header values. + +successful operation +*/ +type EstimateHeapUsageOK struct { + Payload string +} + +// IsSuccess returns true when this estimate heap usage o k response has a 2xx status code +func (o *EstimateHeapUsageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this estimate heap usage o k response has a 3xx status code +func (o *EstimateHeapUsageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this estimate heap usage o k response has a 4xx status code +func (o *EstimateHeapUsageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this estimate heap usage o k response has a 5xx status code +func (o *EstimateHeapUsageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this estimate heap usage o k response a status code equal to that given +func (o *EstimateHeapUsageOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the estimate heap usage o k response +func (o *EstimateHeapUsageOK) Code() int { + return 200 +} + +func (o *EstimateHeapUsageOK) Error() string { + return fmt.Sprintf("[POST /upsert/estimateHeapUsage][%d] estimateHeapUsageOK %+v", 200, o.Payload) +} + +func (o *EstimateHeapUsageOK) String() string { + return fmt.Sprintf("[POST /upsert/estimateHeapUsage][%d] estimateHeapUsageOK %+v", 200, o.Payload) +} + +func (o *EstimateHeapUsageOK) GetPayload() string { + return o.Payload +} + +func (o *EstimateHeapUsageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/upsert/upsert_client.go b/src/client/upsert/upsert_client.go new file mode 100644 index 0000000..7f99f3b --- /dev/null +++ b/src/client/upsert/upsert_client.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package upsert + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new upsert API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for upsert API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + EstimateHeapUsage(params *EstimateHeapUsageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EstimateHeapUsageOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +EstimateHeapUsage estimates memory usage for an upsert table + +This API returns the estimated heap usage based on primary key column stats. This allows us to estimate table size before onboarding. +*/ +func (a *Client) EstimateHeapUsage(params *EstimateHeapUsageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EstimateHeapUsageOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEstimateHeapUsageParams() + } + op := &runtime.ClientOperation{ + ID: "estimateHeapUsage", + Method: "POST", + PathPattern: "/upsert/estimateHeapUsage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &EstimateHeapUsageReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*EstimateHeapUsageOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for estimateHeapUsage: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/user/add_user_parameters.go b/src/client/user/add_user_parameters.go new file mode 100644 index 0000000..0e1f212 --- /dev/null +++ b/src/client/user/add_user_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddUserParams creates a new AddUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddUserParams() *AddUserParams { + return &AddUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddUserParamsWithTimeout creates a new AddUserParams object +// with the ability to set a timeout on a request. +func NewAddUserParamsWithTimeout(timeout time.Duration) *AddUserParams { + return &AddUserParams{ + timeout: timeout, + } +} + +// NewAddUserParamsWithContext creates a new AddUserParams object +// with the ability to set a context for a request. +func NewAddUserParamsWithContext(ctx context.Context) *AddUserParams { + return &AddUserParams{ + Context: ctx, + } +} + +// NewAddUserParamsWithHTTPClient creates a new AddUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddUserParamsWithHTTPClient(client *http.Client) *AddUserParams { + return &AddUserParams{ + HTTPClient: client, + } +} + +/* +AddUserParams contains all the parameters to send to the API endpoint + + for the add user operation. + + Typically these are written to a http.Request. +*/ +type AddUserParams struct { + + // Body. + Body string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddUserParams) WithDefaults() *AddUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the add user params +func (o *AddUserParams) WithTimeout(timeout time.Duration) *AddUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add user params +func (o *AddUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add user params +func (o *AddUserParams) WithContext(ctx context.Context) *AddUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add user params +func (o *AddUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add user params +func (o *AddUserParams) WithHTTPClient(client *http.Client) *AddUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add user params +func (o *AddUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add user params +func (o *AddUserParams) WithBody(body string) *AddUserParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add user params +func (o *AddUserParams) SetBody(body string) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/user/add_user_responses.go b/src/client/user/add_user_responses.go new file mode 100644 index 0000000..f5a152e --- /dev/null +++ b/src/client/user/add_user_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// AddUserReader is a Reader for the AddUser structure. +type AddUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewAddUserOK creates a AddUserOK with default headers values +func NewAddUserOK() *AddUserOK { + return &AddUserOK{} +} + +/* +AddUserOK describes a response with status code 200, with default header values. + +successful operation +*/ +type AddUserOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this add user o k response has a 2xx status code +func (o *AddUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this add user o k response has a 3xx status code +func (o *AddUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add user o k response has a 4xx status code +func (o *AddUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this add user o k response has a 5xx status code +func (o *AddUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this add user o k response a status code equal to that given +func (o *AddUserOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the add user o k response +func (o *AddUserOK) Code() int { + return 200 +} + +func (o *AddUserOK) Error() string { + return fmt.Sprintf("[POST /users][%d] addUserOK %+v", 200, o.Payload) +} + +func (o *AddUserOK) String() string { + return fmt.Sprintf("[POST /users][%d] addUserOK %+v", 200, o.Payload) +} + +func (o *AddUserOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *AddUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/user/delete_user_parameters.go b/src/client/user/delete_user_parameters.go new file mode 100644 index 0000000..521891b --- /dev/null +++ b/src/client/user/delete_user_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteUserParams creates a new DeleteUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteUserParams() *DeleteUserParams { + return &DeleteUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteUserParamsWithTimeout creates a new DeleteUserParams object +// with the ability to set a timeout on a request. +func NewDeleteUserParamsWithTimeout(timeout time.Duration) *DeleteUserParams { + return &DeleteUserParams{ + timeout: timeout, + } +} + +// NewDeleteUserParamsWithContext creates a new DeleteUserParams object +// with the ability to set a context for a request. +func NewDeleteUserParamsWithContext(ctx context.Context) *DeleteUserParams { + return &DeleteUserParams{ + Context: ctx, + } +} + +// NewDeleteUserParamsWithHTTPClient creates a new DeleteUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteUserParamsWithHTTPClient(client *http.Client) *DeleteUserParams { + return &DeleteUserParams{ + HTTPClient: client, + } +} + +/* +DeleteUserParams contains all the parameters to send to the API endpoint + + for the delete user operation. + + Typically these are written to a http.Request. +*/ +type DeleteUserParams struct { + + // Component. + Component *string + + // Username. + Username string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteUserParams) WithDefaults() *DeleteUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete user params +func (o *DeleteUserParams) WithTimeout(timeout time.Duration) *DeleteUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete user params +func (o *DeleteUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete user params +func (o *DeleteUserParams) WithContext(ctx context.Context) *DeleteUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete user params +func (o *DeleteUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete user params +func (o *DeleteUserParams) WithHTTPClient(client *http.Client) *DeleteUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete user params +func (o *DeleteUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithComponent adds the component to the delete user params +func (o *DeleteUserParams) WithComponent(component *string) *DeleteUserParams { + o.SetComponent(component) + return o +} + +// SetComponent adds the component to the delete user params +func (o *DeleteUserParams) SetComponent(component *string) { + o.Component = component +} + +// WithUsername adds the username to the delete user params +func (o *DeleteUserParams) WithUsername(username string) *DeleteUserParams { + o.SetUsername(username) + return o +} + +// SetUsername adds the username to the delete user params +func (o *DeleteUserParams) SetUsername(username string) { + o.Username = username +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Component != nil { + + // query param component + var qrComponent string + + if o.Component != nil { + qrComponent = *o.Component + } + qComponent := qrComponent + if qComponent != "" { + + if err := r.SetQueryParam("component", qComponent); err != nil { + return err + } + } + } + + // path param username + if err := r.SetPathParam("username", o.Username); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/user/delete_user_responses.go b/src/client/user/delete_user_responses.go new file mode 100644 index 0000000..874af38 --- /dev/null +++ b/src/client/user/delete_user_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// DeleteUserReader is a Reader for the DeleteUser structure. +type DeleteUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteUserOK creates a DeleteUserOK with default headers values +func NewDeleteUserOK() *DeleteUserOK { + return &DeleteUserOK{} +} + +/* +DeleteUserOK describes a response with status code 200, with default header values. + +successful operation +*/ +type DeleteUserOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this delete user o k response has a 2xx status code +func (o *DeleteUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete user o k response has a 3xx status code +func (o *DeleteUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete user o k response has a 4xx status code +func (o *DeleteUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete user o k response has a 5xx status code +func (o *DeleteUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete user o k response a status code equal to that given +func (o *DeleteUserOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete user o k response +func (o *DeleteUserOK) Code() int { + return 200 +} + +func (o *DeleteUserOK) Error() string { + return fmt.Sprintf("[DELETE /users/{username}][%d] deleteUserOK %+v", 200, o.Payload) +} + +func (o *DeleteUserOK) String() string { + return fmt.Sprintf("[DELETE /users/{username}][%d] deleteUserOK %+v", 200, o.Payload) +} + +func (o *DeleteUserOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *DeleteUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/user/get_user_parameters.go b/src/client/user/get_user_parameters.go new file mode 100644 index 0000000..0ee676e --- /dev/null +++ b/src/client/user/get_user_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetUserParams creates a new GetUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetUserParams() *GetUserParams { + return &GetUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserParamsWithTimeout creates a new GetUserParams object +// with the ability to set a timeout on a request. +func NewGetUserParamsWithTimeout(timeout time.Duration) *GetUserParams { + return &GetUserParams{ + timeout: timeout, + } +} + +// NewGetUserParamsWithContext creates a new GetUserParams object +// with the ability to set a context for a request. +func NewGetUserParamsWithContext(ctx context.Context) *GetUserParams { + return &GetUserParams{ + Context: ctx, + } +} + +// NewGetUserParamsWithHTTPClient creates a new GetUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUserParamsWithHTTPClient(client *http.Client) *GetUserParams { + return &GetUserParams{ + HTTPClient: client, + } +} + +/* +GetUserParams contains all the parameters to send to the API endpoint + + for the get user operation. + + Typically these are written to a http.Request. +*/ +type GetUserParams struct { + + // Component. + Component *string + + // Username. + Username string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserParams) WithDefaults() *GetUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get user params +func (o *GetUserParams) WithTimeout(timeout time.Duration) *GetUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get user params +func (o *GetUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get user params +func (o *GetUserParams) WithContext(ctx context.Context) *GetUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get user params +func (o *GetUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get user params +func (o *GetUserParams) WithHTTPClient(client *http.Client) *GetUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get user params +func (o *GetUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithComponent adds the component to the get user params +func (o *GetUserParams) WithComponent(component *string) *GetUserParams { + o.SetComponent(component) + return o +} + +// SetComponent adds the component to the get user params +func (o *GetUserParams) SetComponent(component *string) { + o.Component = component +} + +// WithUsername adds the username to the get user params +func (o *GetUserParams) WithUsername(username string) *GetUserParams { + o.SetUsername(username) + return o +} + +// SetUsername adds the username to the get user params +func (o *GetUserParams) SetUsername(username string) { + o.Username = username +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Component != nil { + + // query param component + var qrComponent string + + if o.Component != nil { + qrComponent = *o.Component + } + qComponent := qrComponent + if qComponent != "" { + + if err := r.SetQueryParam("component", qComponent); err != nil { + return err + } + } + } + + // path param username + if err := r.SetPathParam("username", o.Username); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/user/get_user_responses.go b/src/client/user/get_user_responses.go new file mode 100644 index 0000000..af4bb6c --- /dev/null +++ b/src/client/user/get_user_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetUserReader is a Reader for the GetUser structure. +type GetUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetUserOK creates a GetUserOK with default headers values +func NewGetUserOK() *GetUserOK { + return &GetUserOK{} +} + +/* +GetUserOK describes a response with status code 200, with default header values. + +successful operation +*/ +type GetUserOK struct { + Payload string +} + +// IsSuccess returns true when this get user o k response has a 2xx status code +func (o *GetUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get user o k response has a 3xx status code +func (o *GetUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get user o k response has a 4xx status code +func (o *GetUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get user o k response has a 5xx status code +func (o *GetUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get user o k response a status code equal to that given +func (o *GetUserOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get user o k response +func (o *GetUserOK) Code() int { + return 200 +} + +func (o *GetUserOK) Error() string { + return fmt.Sprintf("[GET /users/{username}][%d] getUserOK %+v", 200, o.Payload) +} + +func (o *GetUserOK) String() string { + return fmt.Sprintf("[GET /users/{username}][%d] getUserOK %+v", 200, o.Payload) +} + +func (o *GetUserOK) GetPayload() string { + return o.Payload +} + +func (o *GetUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/user/list_uers_parameters.go b/src/client/user/list_uers_parameters.go new file mode 100644 index 0000000..16bbe55 --- /dev/null +++ b/src/client/user/list_uers_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListUersParams creates a new ListUersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListUersParams() *ListUersParams { + return &ListUersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListUersParamsWithTimeout creates a new ListUersParams object +// with the ability to set a timeout on a request. +func NewListUersParamsWithTimeout(timeout time.Duration) *ListUersParams { + return &ListUersParams{ + timeout: timeout, + } +} + +// NewListUersParamsWithContext creates a new ListUersParams object +// with the ability to set a context for a request. +func NewListUersParamsWithContext(ctx context.Context) *ListUersParams { + return &ListUersParams{ + Context: ctx, + } +} + +// NewListUersParamsWithHTTPClient creates a new ListUersParams object +// with the ability to set a custom HTTPClient for a request. +func NewListUersParamsWithHTTPClient(client *http.Client) *ListUersParams { + return &ListUersParams{ + HTTPClient: client, + } +} + +/* +ListUersParams contains all the parameters to send to the API endpoint + + for the list uers operation. + + Typically these are written to a http.Request. +*/ +type ListUersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list uers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUersParams) WithDefaults() *ListUersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list uers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list uers params +func (o *ListUersParams) WithTimeout(timeout time.Duration) *ListUersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list uers params +func (o *ListUersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list uers params +func (o *ListUersParams) WithContext(ctx context.Context) *ListUersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list uers params +func (o *ListUersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list uers params +func (o *ListUersParams) WithHTTPClient(client *http.Client) *ListUersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list uers params +func (o *ListUersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListUersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/user/list_uers_responses.go b/src/client/user/list_uers_responses.go new file mode 100644 index 0000000..7a6cb9d --- /dev/null +++ b/src/client/user/list_uers_responses.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListUersReader is a Reader for the ListUers structure. +type ListUersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListUersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListUersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListUersOK creates a ListUersOK with default headers values +func NewListUersOK() *ListUersOK { + return &ListUersOK{} +} + +/* +ListUersOK describes a response with status code 200, with default header values. + +successful operation +*/ +type ListUersOK struct { + Payload string +} + +// IsSuccess returns true when this list uers o k response has a 2xx status code +func (o *ListUersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list uers o k response has a 3xx status code +func (o *ListUersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list uers o k response has a 4xx status code +func (o *ListUersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list uers o k response has a 5xx status code +func (o *ListUersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list uers o k response a status code equal to that given +func (o *ListUersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list uers o k response +func (o *ListUersOK) Code() int { + return 200 +} + +func (o *ListUersOK) Error() string { + return fmt.Sprintf("[GET /users][%d] listUersOK %+v", 200, o.Payload) +} + +func (o *ListUersOK) String() string { + return fmt.Sprintf("[GET /users][%d] listUersOK %+v", 200, o.Payload) +} + +func (o *ListUersOK) GetPayload() string { + return o.Payload +} + +func (o *ListUersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/user/update_user_config_parameters.go b/src/client/user/update_user_config_parameters.go new file mode 100644 index 0000000..047298f --- /dev/null +++ b/src/client/user/update_user_config_parameters.go @@ -0,0 +1,228 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateUserConfigParams creates a new UpdateUserConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateUserConfigParams() *UpdateUserConfigParams { + return &UpdateUserConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateUserConfigParamsWithTimeout creates a new UpdateUserConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateUserConfigParamsWithTimeout(timeout time.Duration) *UpdateUserConfigParams { + return &UpdateUserConfigParams{ + timeout: timeout, + } +} + +// NewUpdateUserConfigParamsWithContext creates a new UpdateUserConfigParams object +// with the ability to set a context for a request. +func NewUpdateUserConfigParamsWithContext(ctx context.Context) *UpdateUserConfigParams { + return &UpdateUserConfigParams{ + Context: ctx, + } +} + +// NewUpdateUserConfigParamsWithHTTPClient creates a new UpdateUserConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateUserConfigParamsWithHTTPClient(client *http.Client) *UpdateUserConfigParams { + return &UpdateUserConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateUserConfigParams contains all the parameters to send to the API endpoint + + for the update user config operation. + + Typically these are written to a http.Request. +*/ +type UpdateUserConfigParams struct { + + // Body. + Body string + + // Component. + Component *string + + // PasswordChanged. + PasswordChanged *bool + + // Username. + Username string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update user config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateUserConfigParams) WithDefaults() *UpdateUserConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update user config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateUserConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update user config params +func (o *UpdateUserConfigParams) WithTimeout(timeout time.Duration) *UpdateUserConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update user config params +func (o *UpdateUserConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update user config params +func (o *UpdateUserConfigParams) WithContext(ctx context.Context) *UpdateUserConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update user config params +func (o *UpdateUserConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update user config params +func (o *UpdateUserConfigParams) WithHTTPClient(client *http.Client) *UpdateUserConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update user config params +func (o *UpdateUserConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update user config params +func (o *UpdateUserConfigParams) WithBody(body string) *UpdateUserConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update user config params +func (o *UpdateUserConfigParams) SetBody(body string) { + o.Body = body +} + +// WithComponent adds the component to the update user config params +func (o *UpdateUserConfigParams) WithComponent(component *string) *UpdateUserConfigParams { + o.SetComponent(component) + return o +} + +// SetComponent adds the component to the update user config params +func (o *UpdateUserConfigParams) SetComponent(component *string) { + o.Component = component +} + +// WithPasswordChanged adds the passwordChanged to the update user config params +func (o *UpdateUserConfigParams) WithPasswordChanged(passwordChanged *bool) *UpdateUserConfigParams { + o.SetPasswordChanged(passwordChanged) + return o +} + +// SetPasswordChanged adds the passwordChanged to the update user config params +func (o *UpdateUserConfigParams) SetPasswordChanged(passwordChanged *bool) { + o.PasswordChanged = passwordChanged +} + +// WithUsername adds the username to the update user config params +func (o *UpdateUserConfigParams) WithUsername(username string) *UpdateUserConfigParams { + o.SetUsername(username) + return o +} + +// SetUsername adds the username to the update user config params +func (o *UpdateUserConfigParams) SetUsername(username string) { + o.Username = username +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateUserConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.Component != nil { + + // query param component + var qrComponent string + + if o.Component != nil { + qrComponent = *o.Component + } + qComponent := qrComponent + if qComponent != "" { + + if err := r.SetQueryParam("component", qComponent); err != nil { + return err + } + } + } + + if o.PasswordChanged != nil { + + // query param passwordChanged + var qrPasswordChanged bool + + if o.PasswordChanged != nil { + qrPasswordChanged = *o.PasswordChanged + } + qPasswordChanged := swag.FormatBool(qrPasswordChanged) + if qPasswordChanged != "" { + + if err := r.SetQueryParam("passwordChanged", qPasswordChanged); err != nil { + return err + } + } + } + + // path param username + if err := r.SetPathParam("username", o.Username); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/user/update_user_config_responses.go b/src/client/user/update_user_config_responses.go new file mode 100644 index 0000000..0f0602e --- /dev/null +++ b/src/client/user/update_user_config_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// UpdateUserConfigReader is a Reader for the UpdateUserConfig structure. +type UpdateUserConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateUserConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateUserConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateUserConfigOK creates a UpdateUserConfigOK with default headers values +func NewUpdateUserConfigOK() *UpdateUserConfigOK { + return &UpdateUserConfigOK{} +} + +/* +UpdateUserConfigOK describes a response with status code 200, with default header values. + +successful operation +*/ +type UpdateUserConfigOK struct { + Payload *models.SuccessResponse +} + +// IsSuccess returns true when this update user config o k response has a 2xx status code +func (o *UpdateUserConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update user config o k response has a 3xx status code +func (o *UpdateUserConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update user config o k response has a 4xx status code +func (o *UpdateUserConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update user config o k response has a 5xx status code +func (o *UpdateUserConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update user config o k response a status code equal to that given +func (o *UpdateUserConfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update user config o k response +func (o *UpdateUserConfigOK) Code() int { + return 200 +} + +func (o *UpdateUserConfigOK) Error() string { + return fmt.Sprintf("[PUT /users/{username}][%d] updateUserConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateUserConfigOK) String() string { + return fmt.Sprintf("[PUT /users/{username}][%d] updateUserConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateUserConfigOK) GetPayload() *models.SuccessResponse { + return o.Payload +} + +func (o *UpdateUserConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/src/client/user/user_client.go b/src/client/user/user_client.go new file mode 100644 index 0000000..af0400f --- /dev/null +++ b/src/client/user/user_client.go @@ -0,0 +1,254 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new user API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for user API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + AddUser(params *AddUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddUserOK, error) + + DeleteUser(params *DeleteUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteUserOK, error) + + GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, error) + + ListUers(params *ListUersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUersOK, error) + + UpdateUserConfig(params *UpdateUserConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateUserConfigOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AddUser adds a user + +Add a user +*/ +func (a *Client) AddUser(params *AddUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddUserOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddUserParams() + } + op := &runtime.ClientOperation{ + ID: "addUser", + Method: "POST", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AddUserReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddUserOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for addUser: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteUser deletes a user + +Delete a user +*/ +func (a *Client) DeleteUser(params *DeleteUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteUserOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteUserParams() + } + op := &runtime.ClientOperation{ + ID: "deleteUser", + Method: "DELETE", + PathPattern: "/users/{username}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteUserReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteUserOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteUser: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetUser gets an user in cluster + +Get an user in cluster +*/ +func (a *Client) GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUserParams() + } + op := &runtime.ClientOperation{ + ID: "getUser", + Method: "GET", + PathPattern: "/users/{username}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetUserReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetUserOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getUser: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListUers lists all uses in cluster + +List all users in cluster +*/ +func (a *Client) ListUers(params *ListUersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListUersParams() + } + op := &runtime.ClientOperation{ + ID: "listUers", + Method: "GET", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListUersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListUersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listUers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateUserConfig updates user config for a user + +Update user config for user +*/ +func (a *Client) UpdateUserConfig(params *UpdateUserConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateUserConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateUserConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateUserConfig", + Method: "PUT", + PathPattern: "/users/{username}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateUserConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateUserConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateUserConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/version/get_version_number_parameters.go b/src/client/version/get_version_number_parameters.go new file mode 100644 index 0000000..b188a67 --- /dev/null +++ b/src/client/version/get_version_number_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetVersionNumberParams creates a new GetVersionNumberParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetVersionNumberParams() *GetVersionNumberParams { + return &GetVersionNumberParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetVersionNumberParamsWithTimeout creates a new GetVersionNumberParams object +// with the ability to set a timeout on a request. +func NewGetVersionNumberParamsWithTimeout(timeout time.Duration) *GetVersionNumberParams { + return &GetVersionNumberParams{ + timeout: timeout, + } +} + +// NewGetVersionNumberParamsWithContext creates a new GetVersionNumberParams object +// with the ability to set a context for a request. +func NewGetVersionNumberParamsWithContext(ctx context.Context) *GetVersionNumberParams { + return &GetVersionNumberParams{ + Context: ctx, + } +} + +// NewGetVersionNumberParamsWithHTTPClient creates a new GetVersionNumberParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetVersionNumberParamsWithHTTPClient(client *http.Client) *GetVersionNumberParams { + return &GetVersionNumberParams{ + HTTPClient: client, + } +} + +/* +GetVersionNumberParams contains all the parameters to send to the API endpoint + + for the get version number operation. + + Typically these are written to a http.Request. +*/ +type GetVersionNumberParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get version number params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionNumberParams) WithDefaults() *GetVersionNumberParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get version number params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionNumberParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get version number params +func (o *GetVersionNumberParams) WithTimeout(timeout time.Duration) *GetVersionNumberParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get version number params +func (o *GetVersionNumberParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get version number params +func (o *GetVersionNumberParams) WithContext(ctx context.Context) *GetVersionNumberParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get version number params +func (o *GetVersionNumberParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get version number params +func (o *GetVersionNumberParams) WithHTTPClient(client *http.Client) *GetVersionNumberParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get version number params +func (o *GetVersionNumberParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVersionNumberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/version/get_version_number_responses.go b/src/client/version/get_version_number_responses.go new file mode 100644 index 0000000..be9345a --- /dev/null +++ b/src/client/version/get_version_number_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetVersionNumberReader is a Reader for the GetVersionNumber structure. +type GetVersionNumberReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVersionNumberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetVersionNumberOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetVersionNumberOK creates a GetVersionNumberOK with default headers values +func NewGetVersionNumberOK() *GetVersionNumberOK { + return &GetVersionNumberOK{} +} + +/* +GetVersionNumberOK describes a response with status code 200, with default header values. + +Success +*/ +type GetVersionNumberOK struct { +} + +// IsSuccess returns true when this get version number o k response has a 2xx status code +func (o *GetVersionNumberOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get version number o k response has a 3xx status code +func (o *GetVersionNumberOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get version number o k response has a 4xx status code +func (o *GetVersionNumberOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get version number o k response has a 5xx status code +func (o *GetVersionNumberOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get version number o k response a status code equal to that given +func (o *GetVersionNumberOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get version number o k response +func (o *GetVersionNumberOK) Code() int { + return 200 +} + +func (o *GetVersionNumberOK) Error() string { + return fmt.Sprintf("[GET /version][%d] getVersionNumberOK ", 200) +} + +func (o *GetVersionNumberOK) String() string { + return fmt.Sprintf("[GET /version][%d] getVersionNumberOK ", 200) +} + +func (o *GetVersionNumberOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/version/version_client.go b/src/client/version/version_client.go new file mode 100644 index 0000000..62ce8a8 --- /dev/null +++ b/src/client/version/version_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new version API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for version API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetVersionNumber(params *GetVersionNumberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVersionNumberOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetVersionNumber gets version number of pinot components +*/ +func (a *Client) GetVersionNumber(params *GetVersionNumberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVersionNumberOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetVersionNumberParams() + } + op := &runtime.ClientOperation{ + ID: "getVersionNumber", + Method: "GET", + PathPattern: "/version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetVersionNumberReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetVersionNumberOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getVersionNumber: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/write_api/get_write_config_parameters.go b/src/client/write_api/get_write_config_parameters.go new file mode 100644 index 0000000..0713221 --- /dev/null +++ b/src/client/write_api/get_write_config_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetWriteConfigParams creates a new GetWriteConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetWriteConfigParams() *GetWriteConfigParams { + return &GetWriteConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetWriteConfigParamsWithTimeout creates a new GetWriteConfigParams object +// with the ability to set a timeout on a request. +func NewGetWriteConfigParamsWithTimeout(timeout time.Duration) *GetWriteConfigParams { + return &GetWriteConfigParams{ + timeout: timeout, + } +} + +// NewGetWriteConfigParamsWithContext creates a new GetWriteConfigParams object +// with the ability to set a context for a request. +func NewGetWriteConfigParamsWithContext(ctx context.Context) *GetWriteConfigParams { + return &GetWriteConfigParams{ + Context: ctx, + } +} + +// NewGetWriteConfigParamsWithHTTPClient creates a new GetWriteConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetWriteConfigParamsWithHTTPClient(client *http.Client) *GetWriteConfigParams { + return &GetWriteConfigParams{ + HTTPClient: client, + } +} + +/* +GetWriteConfigParams contains all the parameters to send to the API endpoint + + for the get write config operation. + + Typically these are written to a http.Request. +*/ +type GetWriteConfigParams struct { + + // Table. + Table string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get write config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetWriteConfigParams) WithDefaults() *GetWriteConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get write config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetWriteConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get write config params +func (o *GetWriteConfigParams) WithTimeout(timeout time.Duration) *GetWriteConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get write config params +func (o *GetWriteConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get write config params +func (o *GetWriteConfigParams) WithContext(ctx context.Context) *GetWriteConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get write config params +func (o *GetWriteConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get write config params +func (o *GetWriteConfigParams) WithHTTPClient(client *http.Client) *GetWriteConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get write config params +func (o *GetWriteConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTable adds the table to the get write config params +func (o *GetWriteConfigParams) WithTable(table string) *GetWriteConfigParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the get write config params +func (o *GetWriteConfigParams) SetTable(table string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *GetWriteConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param table + if err := r.SetPathParam("table", o.Table); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/write_api/get_write_config_responses.go b/src/client/write_api/get_write_config_responses.go new file mode 100644 index 0000000..baffefa --- /dev/null +++ b/src/client/write_api/get_write_config_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetWriteConfigReader is a Reader for the GetWriteConfig structure. +type GetWriteConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetWriteConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewGetWriteConfigDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewGetWriteConfigDefault creates a GetWriteConfigDefault with default headers values +func NewGetWriteConfigDefault(code int) *GetWriteConfigDefault { + return &GetWriteConfigDefault{ + _statusCode: code, + } +} + +/* +GetWriteConfigDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type GetWriteConfigDefault struct { + _statusCode int +} + +// IsSuccess returns true when this get write config default response has a 2xx status code +func (o *GetWriteConfigDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get write config default response has a 3xx status code +func (o *GetWriteConfigDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get write config default response has a 4xx status code +func (o *GetWriteConfigDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get write config default response has a 5xx status code +func (o *GetWriteConfigDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get write config default response a status code equal to that given +func (o *GetWriteConfigDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get write config default response +func (o *GetWriteConfigDefault) Code() int { + return o._statusCode +} + +func (o *GetWriteConfigDefault) Error() string { + return fmt.Sprintf("[GET /v1/write/config/{table}][%d] getWriteConfig default ", o._statusCode) +} + +func (o *GetWriteConfigDefault) String() string { + return fmt.Sprintf("[GET /v1/write/config/{table}][%d] getWriteConfig default ", o._statusCode) +} + +func (o *GetWriteConfigDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/write_api/insert_parameters.go b/src/client/write_api/insert_parameters.go new file mode 100644 index 0000000..865e6f6 --- /dev/null +++ b/src/client/write_api/insert_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewInsertParams creates a new InsertParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewInsertParams() *InsertParams { + return &InsertParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewInsertParamsWithTimeout creates a new InsertParams object +// with the ability to set a timeout on a request. +func NewInsertParamsWithTimeout(timeout time.Duration) *InsertParams { + return &InsertParams{ + timeout: timeout, + } +} + +// NewInsertParamsWithContext creates a new InsertParams object +// with the ability to set a context for a request. +func NewInsertParamsWithContext(ctx context.Context) *InsertParams { + return &InsertParams{ + Context: ctx, + } +} + +// NewInsertParamsWithHTTPClient creates a new InsertParams object +// with the ability to set a custom HTTPClient for a request. +func NewInsertParamsWithHTTPClient(client *http.Client) *InsertParams { + return &InsertParams{ + HTTPClient: client, + } +} + +/* +InsertParams contains all the parameters to send to the API endpoint + + for the insert operation. + + Typically these are written to a http.Request. +*/ +type InsertParams struct { + + // Body. + Body *models.WritePayload + + // Table. + Table string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the insert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InsertParams) WithDefaults() *InsertParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the insert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InsertParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the insert params +func (o *InsertParams) WithTimeout(timeout time.Duration) *InsertParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the insert params +func (o *InsertParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the insert params +func (o *InsertParams) WithContext(ctx context.Context) *InsertParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the insert params +func (o *InsertParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the insert params +func (o *InsertParams) WithHTTPClient(client *http.Client) *InsertParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the insert params +func (o *InsertParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the insert params +func (o *InsertParams) WithBody(body *models.WritePayload) *InsertParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the insert params +func (o *InsertParams) SetBody(body *models.WritePayload) { + o.Body = body +} + +// WithTable adds the table to the insert params +func (o *InsertParams) WithTable(table string) *InsertParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the insert params +func (o *InsertParams) SetTable(table string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *InsertParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param table + if err := r.SetPathParam("table", o.Table); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/write_api/insert_responses.go b/src/client/write_api/insert_responses.go new file mode 100644 index 0000000..5ebf624 --- /dev/null +++ b/src/client/write_api/insert_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// InsertReader is a Reader for the Insert structure. +type InsertReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InsertReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewInsertDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewInsertDefault creates a InsertDefault with default headers values +func NewInsertDefault(code int) *InsertDefault { + return &InsertDefault{ + _statusCode: code, + } +} + +/* +InsertDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type InsertDefault struct { + _statusCode int +} + +// IsSuccess returns true when this insert default response has a 2xx status code +func (o *InsertDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this insert default response has a 3xx status code +func (o *InsertDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this insert default response has a 4xx status code +func (o *InsertDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this insert default response has a 5xx status code +func (o *InsertDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this insert default response a status code equal to that given +func (o *InsertDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the insert default response +func (o *InsertDefault) Code() int { + return o._statusCode +} + +func (o *InsertDefault) Error() string { + return fmt.Sprintf("[POST /v1/write/{table}][%d] insert default ", o._statusCode) +} + +func (o *InsertDefault) String() string { + return fmt.Sprintf("[POST /v1/write/{table}][%d] insert default ", o._statusCode) +} + +func (o *InsertDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/write_api/update_write_config_parameters.go b/src/client/write_api/update_write_config_parameters.go new file mode 100644 index 0000000..be3c483 --- /dev/null +++ b/src/client/write_api/update_write_config_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "startree.ai/cli/models" +) + +// NewUpdateWriteConfigParams creates a new UpdateWriteConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateWriteConfigParams() *UpdateWriteConfigParams { + return &UpdateWriteConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateWriteConfigParamsWithTimeout creates a new UpdateWriteConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateWriteConfigParamsWithTimeout(timeout time.Duration) *UpdateWriteConfigParams { + return &UpdateWriteConfigParams{ + timeout: timeout, + } +} + +// NewUpdateWriteConfigParamsWithContext creates a new UpdateWriteConfigParams object +// with the ability to set a context for a request. +func NewUpdateWriteConfigParamsWithContext(ctx context.Context) *UpdateWriteConfigParams { + return &UpdateWriteConfigParams{ + Context: ctx, + } +} + +// NewUpdateWriteConfigParamsWithHTTPClient creates a new UpdateWriteConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateWriteConfigParamsWithHTTPClient(client *http.Client) *UpdateWriteConfigParams { + return &UpdateWriteConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateWriteConfigParams contains all the parameters to send to the API endpoint + + for the update write config operation. + + Typically these are written to a http.Request. +*/ +type UpdateWriteConfigParams struct { + + // Body. + Body *models.TableWriteConfig + + // Table. + Table string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update write config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateWriteConfigParams) WithDefaults() *UpdateWriteConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update write config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateWriteConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update write config params +func (o *UpdateWriteConfigParams) WithTimeout(timeout time.Duration) *UpdateWriteConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update write config params +func (o *UpdateWriteConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update write config params +func (o *UpdateWriteConfigParams) WithContext(ctx context.Context) *UpdateWriteConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update write config params +func (o *UpdateWriteConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update write config params +func (o *UpdateWriteConfigParams) WithHTTPClient(client *http.Client) *UpdateWriteConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update write config params +func (o *UpdateWriteConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update write config params +func (o *UpdateWriteConfigParams) WithBody(body *models.TableWriteConfig) *UpdateWriteConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update write config params +func (o *UpdateWriteConfigParams) SetBody(body *models.TableWriteConfig) { + o.Body = body +} + +// WithTable adds the table to the update write config params +func (o *UpdateWriteConfigParams) WithTable(table string) *UpdateWriteConfigParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the update write config params +func (o *UpdateWriteConfigParams) SetTable(table string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateWriteConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param table + if err := r.SetPathParam("table", o.Table); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/write_api/update_write_config_responses.go b/src/client/write_api/update_write_config_responses.go new file mode 100644 index 0000000..b3f8bfb --- /dev/null +++ b/src/client/write_api/update_write_config_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateWriteConfigReader is a Reader for the UpdateWriteConfig structure. +type UpdateWriteConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateWriteConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewUpdateWriteConfigDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewUpdateWriteConfigDefault creates a UpdateWriteConfigDefault with default headers values +func NewUpdateWriteConfigDefault(code int) *UpdateWriteConfigDefault { + return &UpdateWriteConfigDefault{ + _statusCode: code, + } +} + +/* +UpdateWriteConfigDefault describes a response with status code -1, with default header values. + +successful operation +*/ +type UpdateWriteConfigDefault struct { + _statusCode int +} + +// IsSuccess returns true when this update write config default response has a 2xx status code +func (o *UpdateWriteConfigDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update write config default response has a 3xx status code +func (o *UpdateWriteConfigDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update write config default response has a 4xx status code +func (o *UpdateWriteConfigDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update write config default response has a 5xx status code +func (o *UpdateWriteConfigDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update write config default response a status code equal to that given +func (o *UpdateWriteConfigDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update write config default response +func (o *UpdateWriteConfigDefault) Code() int { + return o._statusCode +} + +func (o *UpdateWriteConfigDefault) Error() string { + return fmt.Sprintf("[PUT /v1/write/config/{table}][%d] updateWriteConfig default ", o._statusCode) +} + +func (o *UpdateWriteConfigDefault) String() string { + return fmt.Sprintf("[PUT /v1/write/config/{table}][%d] updateWriteConfig default ", o._statusCode) +} + +func (o *UpdateWriteConfigDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/write_api/write_api_client.go b/src/client/write_api/write_api_client.go new file mode 100644 index 0000000..3889f53 --- /dev/null +++ b/src/client/write_api/write_api_client.go @@ -0,0 +1,145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package write_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new write api API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for write api API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetWriteConfig(params *GetWriteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + Insert(params *InsertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + UpdateWriteConfig(params *UpdateWriteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetWriteConfig gets table config for write operation + +Gets a config for specific table. May contain Kafka producer configs +*/ +func (a *Client) GetWriteConfig(params *GetWriteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewGetWriteConfigParams() + } + op := &runtime.ClientOperation{ + ID: "getWriteConfig", + Method: "GET", + PathPattern: "/v1/write/config/{table}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetWriteConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +Insert inserts by p o s t payload + +Insert records into a table +*/ +func (a *Client) Insert(params *InsertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewInsertParams() + } + op := &runtime.ClientOperation{ + ID: "insert", + Method: "POST", + PathPattern: "/v1/write/{table}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &InsertReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +UpdateWriteConfig updates table config for write operation + +Gets a config for specific table. May contain Kafka producer configs +*/ +func (a *Client) UpdateWriteConfig(params *UpdateWriteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateWriteConfigParams() + } + op := &runtime.ClientOperation{ + ID: "updateWriteConfig", + Method: "PUT", + PathPattern: "/v1/write/config/{table}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateWriteConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/client/zookeeper/delete_parameters.go b/src/client/zookeeper/delete_parameters.go new file mode 100644 index 0000000..5c13f9a --- /dev/null +++ b/src/client/zookeeper/delete_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteParams creates a new DeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteParams() *DeleteParams { + return &DeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteParamsWithTimeout creates a new DeleteParams object +// with the ability to set a timeout on a request. +func NewDeleteParamsWithTimeout(timeout time.Duration) *DeleteParams { + return &DeleteParams{ + timeout: timeout, + } +} + +// NewDeleteParamsWithContext creates a new DeleteParams object +// with the ability to set a context for a request. +func NewDeleteParamsWithContext(ctx context.Context) *DeleteParams { + return &DeleteParams{ + Context: ctx, + } +} + +// NewDeleteParamsWithHTTPClient creates a new DeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteParamsWithHTTPClient(client *http.Client) *DeleteParams { + return &DeleteParams{ + HTTPClient: client, + } +} + +/* +DeleteParams contains all the parameters to send to the API endpoint + + for the delete operation. + + Typically these are written to a http.Request. +*/ +type DeleteParams struct { + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteParams) WithDefaults() *DeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete params +func (o *DeleteParams) WithTimeout(timeout time.Duration) *DeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete params +func (o *DeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete params +func (o *DeleteParams) WithContext(ctx context.Context) *DeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete params +func (o *DeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) WithHTTPClient(client *http.Client) *DeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the delete params +func (o *DeleteParams) WithPath(path string) *DeleteParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the delete params +func (o *DeleteParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/delete_responses.go b/src/client/zookeeper/delete_responses.go new file mode 100644 index 0000000..6015813 --- /dev/null +++ b/src/client/zookeeper/delete_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteReader is a Reader for the Delete structure. +type DeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteOK creates a DeleteOK with default headers values +func NewDeleteOK() *DeleteOK { + return &DeleteOK{} +} + +/* +DeleteOK describes a response with status code 200, with default header values. + +Success +*/ +type DeleteOK struct { +} + +// IsSuccess returns true when this delete o k response has a 2xx status code +func (o *DeleteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete o k response has a 3xx status code +func (o *DeleteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete o k response has a 4xx status code +func (o *DeleteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete o k response has a 5xx status code +func (o *DeleteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete o k response a status code equal to that given +func (o *DeleteOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete o k response +func (o *DeleteOK) Code() int { + return 200 +} + +func (o *DeleteOK) Error() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteOK ", 200) +} + +func (o *DeleteOK) String() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteOK ", 200) +} + +func (o *DeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteNoContent creates a DeleteNoContent with default headers values +func NewDeleteNoContent() *DeleteNoContent { + return &DeleteNoContent{} +} + +/* +DeleteNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type DeleteNoContent struct { +} + +// IsSuccess returns true when this delete no content response has a 2xx status code +func (o *DeleteNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete no content response has a 3xx status code +func (o *DeleteNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete no content response has a 4xx status code +func (o *DeleteNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete no content response has a 5xx status code +func (o *DeleteNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete no content response a status code equal to that given +func (o *DeleteNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the delete no content response +func (o *DeleteNoContent) Code() int { + return 204 +} + +func (o *DeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteNoContent ", 204) +} + +func (o *DeleteNoContent) String() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteNoContent ", 204) +} + +func (o *DeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteNotFound creates a DeleteNotFound with default headers values +func NewDeleteNotFound() *DeleteNotFound { + return &DeleteNotFound{} +} + +/* +DeleteNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type DeleteNotFound struct { +} + +// IsSuccess returns true when this delete not found response has a 2xx status code +func (o *DeleteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete not found response has a 3xx status code +func (o *DeleteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete not found response has a 4xx status code +func (o *DeleteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete not found response has a 5xx status code +func (o *DeleteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete not found response a status code equal to that given +func (o *DeleteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete not found response +func (o *DeleteNotFound) Code() int { + return 404 +} + +func (o *DeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteNotFound ", 404) +} + +func (o *DeleteNotFound) String() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteNotFound ", 404) +} + +func (o *DeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteInternalServerError creates a DeleteInternalServerError with default headers values +func NewDeleteInternalServerError() *DeleteInternalServerError { + return &DeleteInternalServerError{} +} + +/* +DeleteInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type DeleteInternalServerError struct { +} + +// IsSuccess returns true when this delete internal server error response has a 2xx status code +func (o *DeleteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete internal server error response has a 3xx status code +func (o *DeleteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete internal server error response has a 4xx status code +func (o *DeleteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete internal server error response has a 5xx status code +func (o *DeleteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete internal server error response a status code equal to that given +func (o *DeleteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete internal server error response +func (o *DeleteInternalServerError) Code() int { + return 500 +} + +func (o *DeleteInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteInternalServerError ", 500) +} + +func (o *DeleteInternalServerError) String() string { + return fmt.Sprintf("[DELETE /zk/delete][%d] deleteInternalServerError ", 500) +} + +func (o *DeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/get_children_parameters.go b/src/client/zookeeper/get_children_parameters.go new file mode 100644 index 0000000..b7a2197 --- /dev/null +++ b/src/client/zookeeper/get_children_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetChildrenParams creates a new GetChildrenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetChildrenParams() *GetChildrenParams { + return &GetChildrenParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetChildrenParamsWithTimeout creates a new GetChildrenParams object +// with the ability to set a timeout on a request. +func NewGetChildrenParamsWithTimeout(timeout time.Duration) *GetChildrenParams { + return &GetChildrenParams{ + timeout: timeout, + } +} + +// NewGetChildrenParamsWithContext creates a new GetChildrenParams object +// with the ability to set a context for a request. +func NewGetChildrenParamsWithContext(ctx context.Context) *GetChildrenParams { + return &GetChildrenParams{ + Context: ctx, + } +} + +// NewGetChildrenParamsWithHTTPClient creates a new GetChildrenParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetChildrenParamsWithHTTPClient(client *http.Client) *GetChildrenParams { + return &GetChildrenParams{ + HTTPClient: client, + } +} + +/* +GetChildrenParams contains all the parameters to send to the API endpoint + + for the get children operation. + + Typically these are written to a http.Request. +*/ +type GetChildrenParams struct { + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get children params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetChildrenParams) WithDefaults() *GetChildrenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get children params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetChildrenParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get children params +func (o *GetChildrenParams) WithTimeout(timeout time.Duration) *GetChildrenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get children params +func (o *GetChildrenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get children params +func (o *GetChildrenParams) WithContext(ctx context.Context) *GetChildrenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get children params +func (o *GetChildrenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get children params +func (o *GetChildrenParams) WithHTTPClient(client *http.Client) *GetChildrenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get children params +func (o *GetChildrenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the get children params +func (o *GetChildrenParams) WithPath(path string) *GetChildrenParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the get children params +func (o *GetChildrenParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *GetChildrenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/get_children_responses.go b/src/client/zookeeper/get_children_responses.go new file mode 100644 index 0000000..128ab91 --- /dev/null +++ b/src/client/zookeeper/get_children_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetChildrenReader is a Reader for the GetChildren structure. +type GetChildrenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetChildrenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetChildrenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewGetChildrenNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetChildrenNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetChildrenInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetChildrenOK creates a GetChildrenOK with default headers values +func NewGetChildrenOK() *GetChildrenOK { + return &GetChildrenOK{} +} + +/* +GetChildrenOK describes a response with status code 200, with default header values. + +Success +*/ +type GetChildrenOK struct { +} + +// IsSuccess returns true when this get children o k response has a 2xx status code +func (o *GetChildrenOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get children o k response has a 3xx status code +func (o *GetChildrenOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get children o k response has a 4xx status code +func (o *GetChildrenOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get children o k response has a 5xx status code +func (o *GetChildrenOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get children o k response a status code equal to that given +func (o *GetChildrenOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get children o k response +func (o *GetChildrenOK) Code() int { + return 200 +} + +func (o *GetChildrenOK) Error() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenOK ", 200) +} + +func (o *GetChildrenOK) String() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenOK ", 200) +} + +func (o *GetChildrenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetChildrenNoContent creates a GetChildrenNoContent with default headers values +func NewGetChildrenNoContent() *GetChildrenNoContent { + return &GetChildrenNoContent{} +} + +/* +GetChildrenNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type GetChildrenNoContent struct { +} + +// IsSuccess returns true when this get children no content response has a 2xx status code +func (o *GetChildrenNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get children no content response has a 3xx status code +func (o *GetChildrenNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get children no content response has a 4xx status code +func (o *GetChildrenNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this get children no content response has a 5xx status code +func (o *GetChildrenNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this get children no content response a status code equal to that given +func (o *GetChildrenNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the get children no content response +func (o *GetChildrenNoContent) Code() int { + return 204 +} + +func (o *GetChildrenNoContent) Error() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenNoContent ", 204) +} + +func (o *GetChildrenNoContent) String() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenNoContent ", 204) +} + +func (o *GetChildrenNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetChildrenNotFound creates a GetChildrenNotFound with default headers values +func NewGetChildrenNotFound() *GetChildrenNotFound { + return &GetChildrenNotFound{} +} + +/* +GetChildrenNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type GetChildrenNotFound struct { +} + +// IsSuccess returns true when this get children not found response has a 2xx status code +func (o *GetChildrenNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get children not found response has a 3xx status code +func (o *GetChildrenNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get children not found response has a 4xx status code +func (o *GetChildrenNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get children not found response has a 5xx status code +func (o *GetChildrenNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get children not found response a status code equal to that given +func (o *GetChildrenNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get children not found response +func (o *GetChildrenNotFound) Code() int { + return 404 +} + +func (o *GetChildrenNotFound) Error() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenNotFound ", 404) +} + +func (o *GetChildrenNotFound) String() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenNotFound ", 404) +} + +func (o *GetChildrenNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetChildrenInternalServerError creates a GetChildrenInternalServerError with default headers values +func NewGetChildrenInternalServerError() *GetChildrenInternalServerError { + return &GetChildrenInternalServerError{} +} + +/* +GetChildrenInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetChildrenInternalServerError struct { +} + +// IsSuccess returns true when this get children internal server error response has a 2xx status code +func (o *GetChildrenInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get children internal server error response has a 3xx status code +func (o *GetChildrenInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get children internal server error response has a 4xx status code +func (o *GetChildrenInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get children internal server error response has a 5xx status code +func (o *GetChildrenInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get children internal server error response a status code equal to that given +func (o *GetChildrenInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get children internal server error response +func (o *GetChildrenInternalServerError) Code() int { + return 500 +} + +func (o *GetChildrenInternalServerError) Error() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenInternalServerError ", 500) +} + +func (o *GetChildrenInternalServerError) String() string { + return fmt.Sprintf("[GET /zk/getChildren][%d] getChildrenInternalServerError ", 500) +} + +func (o *GetChildrenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/get_data_parameters.go b/src/client/zookeeper/get_data_parameters.go new file mode 100644 index 0000000..aca5e6c --- /dev/null +++ b/src/client/zookeeper/get_data_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetDataParams creates a new GetDataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDataParams() *GetDataParams { + return &GetDataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDataParamsWithTimeout creates a new GetDataParams object +// with the ability to set a timeout on a request. +func NewGetDataParamsWithTimeout(timeout time.Duration) *GetDataParams { + return &GetDataParams{ + timeout: timeout, + } +} + +// NewGetDataParamsWithContext creates a new GetDataParams object +// with the ability to set a context for a request. +func NewGetDataParamsWithContext(ctx context.Context) *GetDataParams { + return &GetDataParams{ + Context: ctx, + } +} + +// NewGetDataParamsWithHTTPClient creates a new GetDataParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDataParamsWithHTTPClient(client *http.Client) *GetDataParams { + return &GetDataParams{ + HTTPClient: client, + } +} + +/* +GetDataParams contains all the parameters to send to the API endpoint + + for the get data operation. + + Typically these are written to a http.Request. +*/ +type GetDataParams struct { + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDataParams) WithDefaults() *GetDataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get data params +func (o *GetDataParams) WithTimeout(timeout time.Duration) *GetDataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get data params +func (o *GetDataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get data params +func (o *GetDataParams) WithContext(ctx context.Context) *GetDataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get data params +func (o *GetDataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get data params +func (o *GetDataParams) WithHTTPClient(client *http.Client) *GetDataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get data params +func (o *GetDataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the get data params +func (o *GetDataParams) WithPath(path string) *GetDataParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the get data params +func (o *GetDataParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/get_data_responses.go b/src/client/zookeeper/get_data_responses.go new file mode 100644 index 0000000..e11f75d --- /dev/null +++ b/src/client/zookeeper/get_data_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetDataReader is a Reader for the GetData structure. +type GetDataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewGetDataNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetDataNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDataInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetDataOK creates a GetDataOK with default headers values +func NewGetDataOK() *GetDataOK { + return &GetDataOK{} +} + +/* +GetDataOK describes a response with status code 200, with default header values. + +Success +*/ +type GetDataOK struct { +} + +// IsSuccess returns true when this get data o k response has a 2xx status code +func (o *GetDataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get data o k response has a 3xx status code +func (o *GetDataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get data o k response has a 4xx status code +func (o *GetDataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get data o k response has a 5xx status code +func (o *GetDataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get data o k response a status code equal to that given +func (o *GetDataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get data o k response +func (o *GetDataOK) Code() int { + return 200 +} + +func (o *GetDataOK) Error() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataOK ", 200) +} + +func (o *GetDataOK) String() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataOK ", 200) +} + +func (o *GetDataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetDataNoContent creates a GetDataNoContent with default headers values +func NewGetDataNoContent() *GetDataNoContent { + return &GetDataNoContent{} +} + +/* +GetDataNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type GetDataNoContent struct { +} + +// IsSuccess returns true when this get data no content response has a 2xx status code +func (o *GetDataNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get data no content response has a 3xx status code +func (o *GetDataNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get data no content response has a 4xx status code +func (o *GetDataNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this get data no content response has a 5xx status code +func (o *GetDataNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this get data no content response a status code equal to that given +func (o *GetDataNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the get data no content response +func (o *GetDataNoContent) Code() int { + return 204 +} + +func (o *GetDataNoContent) Error() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataNoContent ", 204) +} + +func (o *GetDataNoContent) String() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataNoContent ", 204) +} + +func (o *GetDataNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetDataNotFound creates a GetDataNotFound with default headers values +func NewGetDataNotFound() *GetDataNotFound { + return &GetDataNotFound{} +} + +/* +GetDataNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type GetDataNotFound struct { +} + +// IsSuccess returns true when this get data not found response has a 2xx status code +func (o *GetDataNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get data not found response has a 3xx status code +func (o *GetDataNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get data not found response has a 4xx status code +func (o *GetDataNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get data not found response has a 5xx status code +func (o *GetDataNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get data not found response a status code equal to that given +func (o *GetDataNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get data not found response +func (o *GetDataNotFound) Code() int { + return 404 +} + +func (o *GetDataNotFound) Error() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataNotFound ", 404) +} + +func (o *GetDataNotFound) String() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataNotFound ", 404) +} + +func (o *GetDataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetDataInternalServerError creates a GetDataInternalServerError with default headers values +func NewGetDataInternalServerError() *GetDataInternalServerError { + return &GetDataInternalServerError{} +} + +/* +GetDataInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetDataInternalServerError struct { +} + +// IsSuccess returns true when this get data internal server error response has a 2xx status code +func (o *GetDataInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get data internal server error response has a 3xx status code +func (o *GetDataInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get data internal server error response has a 4xx status code +func (o *GetDataInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get data internal server error response has a 5xx status code +func (o *GetDataInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get data internal server error response a status code equal to that given +func (o *GetDataInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get data internal server error response +func (o *GetDataInternalServerError) Code() int { + return 500 +} + +func (o *GetDataInternalServerError) Error() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataInternalServerError ", 500) +} + +func (o *GetDataInternalServerError) String() string { + return fmt.Sprintf("[GET /zk/get][%d] getDataInternalServerError ", 500) +} + +func (o *GetDataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/ls_parameters.go b/src/client/zookeeper/ls_parameters.go new file mode 100644 index 0000000..8b31cc8 --- /dev/null +++ b/src/client/zookeeper/ls_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewLsParams creates a new LsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewLsParams() *LsParams { + return &LsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewLsParamsWithTimeout creates a new LsParams object +// with the ability to set a timeout on a request. +func NewLsParamsWithTimeout(timeout time.Duration) *LsParams { + return &LsParams{ + timeout: timeout, + } +} + +// NewLsParamsWithContext creates a new LsParams object +// with the ability to set a context for a request. +func NewLsParamsWithContext(ctx context.Context) *LsParams { + return &LsParams{ + Context: ctx, + } +} + +// NewLsParamsWithHTTPClient creates a new LsParams object +// with the ability to set a custom HTTPClient for a request. +func NewLsParamsWithHTTPClient(client *http.Client) *LsParams { + return &LsParams{ + HTTPClient: client, + } +} + +/* +LsParams contains all the parameters to send to the API endpoint + + for the ls operation. + + Typically these are written to a http.Request. +*/ +type LsParams struct { + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ls params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LsParams) WithDefaults() *LsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ls params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ls params +func (o *LsParams) WithTimeout(timeout time.Duration) *LsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ls params +func (o *LsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ls params +func (o *LsParams) WithContext(ctx context.Context) *LsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ls params +func (o *LsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ls params +func (o *LsParams) WithHTTPClient(client *http.Client) *LsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ls params +func (o *LsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the ls params +func (o *LsParams) WithPath(path string) *LsParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the ls params +func (o *LsParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *LsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/ls_responses.go b/src/client/zookeeper/ls_responses.go new file mode 100644 index 0000000..179bd07 --- /dev/null +++ b/src/client/zookeeper/ls_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// LsReader is a Reader for the Ls structure. +type LsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewLsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewLsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewLsOK creates a LsOK with default headers values +func NewLsOK() *LsOK { + return &LsOK{} +} + +/* +LsOK describes a response with status code 200, with default header values. + +Success +*/ +type LsOK struct { +} + +// IsSuccess returns true when this ls o k response has a 2xx status code +func (o *LsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this ls o k response has a 3xx status code +func (o *LsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ls o k response has a 4xx status code +func (o *LsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this ls o k response has a 5xx status code +func (o *LsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this ls o k response a status code equal to that given +func (o *LsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the ls o k response +func (o *LsOK) Code() int { + return 200 +} + +func (o *LsOK) Error() string { + return fmt.Sprintf("[GET /zk/ls][%d] lsOK ", 200) +} + +func (o *LsOK) String() string { + return fmt.Sprintf("[GET /zk/ls][%d] lsOK ", 200) +} + +func (o *LsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewLsNotFound creates a LsNotFound with default headers values +func NewLsNotFound() *LsNotFound { + return &LsNotFound{} +} + +/* +LsNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type LsNotFound struct { +} + +// IsSuccess returns true when this ls not found response has a 2xx status code +func (o *LsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ls not found response has a 3xx status code +func (o *LsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ls not found response has a 4xx status code +func (o *LsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this ls not found response has a 5xx status code +func (o *LsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this ls not found response a status code equal to that given +func (o *LsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the ls not found response +func (o *LsNotFound) Code() int { + return 404 +} + +func (o *LsNotFound) Error() string { + return fmt.Sprintf("[GET /zk/ls][%d] lsNotFound ", 404) +} + +func (o *LsNotFound) String() string { + return fmt.Sprintf("[GET /zk/ls][%d] lsNotFound ", 404) +} + +func (o *LsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewLsInternalServerError creates a LsInternalServerError with default headers values +func NewLsInternalServerError() *LsInternalServerError { + return &LsInternalServerError{} +} + +/* +LsInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type LsInternalServerError struct { +} + +// IsSuccess returns true when this ls internal server error response has a 2xx status code +func (o *LsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ls internal server error response has a 3xx status code +func (o *LsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ls internal server error response has a 4xx status code +func (o *LsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this ls internal server error response has a 5xx status code +func (o *LsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this ls internal server error response a status code equal to that given +func (o *LsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the ls internal server error response +func (o *LsInternalServerError) Code() int { + return 500 +} + +func (o *LsInternalServerError) Error() string { + return fmt.Sprintf("[GET /zk/ls][%d] lsInternalServerError ", 500) +} + +func (o *LsInternalServerError) String() string { + return fmt.Sprintf("[GET /zk/ls][%d] lsInternalServerError ", 500) +} + +func (o *LsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/lsl_parameters.go b/src/client/zookeeper/lsl_parameters.go new file mode 100644 index 0000000..ac8b2b3 --- /dev/null +++ b/src/client/zookeeper/lsl_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewLslParams creates a new LslParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewLslParams() *LslParams { + return &LslParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewLslParamsWithTimeout creates a new LslParams object +// with the ability to set a timeout on a request. +func NewLslParamsWithTimeout(timeout time.Duration) *LslParams { + return &LslParams{ + timeout: timeout, + } +} + +// NewLslParamsWithContext creates a new LslParams object +// with the ability to set a context for a request. +func NewLslParamsWithContext(ctx context.Context) *LslParams { + return &LslParams{ + Context: ctx, + } +} + +// NewLslParamsWithHTTPClient creates a new LslParams object +// with the ability to set a custom HTTPClient for a request. +func NewLslParamsWithHTTPClient(client *http.Client) *LslParams { + return &LslParams{ + HTTPClient: client, + } +} + +/* +LslParams contains all the parameters to send to the API endpoint + + for the lsl operation. + + Typically these are written to a http.Request. +*/ +type LslParams struct { + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the lsl params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LslParams) WithDefaults() *LslParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the lsl params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LslParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the lsl params +func (o *LslParams) WithTimeout(timeout time.Duration) *LslParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the lsl params +func (o *LslParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the lsl params +func (o *LslParams) WithContext(ctx context.Context) *LslParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the lsl params +func (o *LslParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the lsl params +func (o *LslParams) WithHTTPClient(client *http.Client) *LslParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the lsl params +func (o *LslParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the lsl params +func (o *LslParams) WithPath(path string) *LslParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the lsl params +func (o *LslParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *LslParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/lsl_responses.go b/src/client/zookeeper/lsl_responses.go new file mode 100644 index 0000000..d9393ef --- /dev/null +++ b/src/client/zookeeper/lsl_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// LslReader is a Reader for the Lsl structure. +type LslReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LslReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLslOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewLslNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewLslInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewLslOK creates a LslOK with default headers values +func NewLslOK() *LslOK { + return &LslOK{} +} + +/* +LslOK describes a response with status code 200, with default header values. + +Success +*/ +type LslOK struct { +} + +// IsSuccess returns true when this lsl o k response has a 2xx status code +func (o *LslOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this lsl o k response has a 3xx status code +func (o *LslOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this lsl o k response has a 4xx status code +func (o *LslOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this lsl o k response has a 5xx status code +func (o *LslOK) IsServerError() bool { + return false +} + +// IsCode returns true when this lsl o k response a status code equal to that given +func (o *LslOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the lsl o k response +func (o *LslOK) Code() int { + return 200 +} + +func (o *LslOK) Error() string { + return fmt.Sprintf("[GET /zk/lsl][%d] lslOK ", 200) +} + +func (o *LslOK) String() string { + return fmt.Sprintf("[GET /zk/lsl][%d] lslOK ", 200) +} + +func (o *LslOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewLslNotFound creates a LslNotFound with default headers values +func NewLslNotFound() *LslNotFound { + return &LslNotFound{} +} + +/* +LslNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type LslNotFound struct { +} + +// IsSuccess returns true when this lsl not found response has a 2xx status code +func (o *LslNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this lsl not found response has a 3xx status code +func (o *LslNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this lsl not found response has a 4xx status code +func (o *LslNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this lsl not found response has a 5xx status code +func (o *LslNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this lsl not found response a status code equal to that given +func (o *LslNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the lsl not found response +func (o *LslNotFound) Code() int { + return 404 +} + +func (o *LslNotFound) Error() string { + return fmt.Sprintf("[GET /zk/lsl][%d] lslNotFound ", 404) +} + +func (o *LslNotFound) String() string { + return fmt.Sprintf("[GET /zk/lsl][%d] lslNotFound ", 404) +} + +func (o *LslNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewLslInternalServerError creates a LslInternalServerError with default headers values +func NewLslInternalServerError() *LslInternalServerError { + return &LslInternalServerError{} +} + +/* +LslInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type LslInternalServerError struct { +} + +// IsSuccess returns true when this lsl internal server error response has a 2xx status code +func (o *LslInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this lsl internal server error response has a 3xx status code +func (o *LslInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this lsl internal server error response has a 4xx status code +func (o *LslInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this lsl internal server error response has a 5xx status code +func (o *LslInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this lsl internal server error response a status code equal to that given +func (o *LslInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the lsl internal server error response +func (o *LslInternalServerError) Code() int { + return 500 +} + +func (o *LslInternalServerError) Error() string { + return fmt.Sprintf("[GET /zk/lsl][%d] lslInternalServerError ", 500) +} + +func (o *LslInternalServerError) String() string { + return fmt.Sprintf("[GET /zk/lsl][%d] lslInternalServerError ", 500) +} + +func (o *LslInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/put_children_parameters.go b/src/client/zookeeper/put_children_parameters.go new file mode 100644 index 0000000..e50de1a --- /dev/null +++ b/src/client/zookeeper/put_children_parameters.go @@ -0,0 +1,296 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPutChildrenParams creates a new PutChildrenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPutChildrenParams() *PutChildrenParams { + return &PutChildrenParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutChildrenParamsWithTimeout creates a new PutChildrenParams object +// with the ability to set a timeout on a request. +func NewPutChildrenParamsWithTimeout(timeout time.Duration) *PutChildrenParams { + return &PutChildrenParams{ + timeout: timeout, + } +} + +// NewPutChildrenParamsWithContext creates a new PutChildrenParams object +// with the ability to set a context for a request. +func NewPutChildrenParamsWithContext(ctx context.Context) *PutChildrenParams { + return &PutChildrenParams{ + Context: ctx, + } +} + +// NewPutChildrenParamsWithHTTPClient creates a new PutChildrenParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutChildrenParamsWithHTTPClient(client *http.Client) *PutChildrenParams { + return &PutChildrenParams{ + HTTPClient: client, + } +} + +/* +PutChildrenParams contains all the parameters to send to the API endpoint + + for the put children operation. + + Typically these are written to a http.Request. +*/ +type PutChildrenParams struct { + + /* AccessOption. + + accessOption + + Format: int32 + Default: 1 + */ + AccessOption *int32 + + // Body. + Body string + + /* Data. + + Content + */ + Data *string + + /* ExpectedVersion. + + expectedVersion + + Format: int32 + Default: -1 + */ + ExpectedVersion *int32 + + /* Path. + + Zookeeper path of parent, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put children params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutChildrenParams) WithDefaults() *PutChildrenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put children params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutChildrenParams) SetDefaults() { + var ( + accessOptionDefault = int32(1) + + expectedVersionDefault = int32(-1) + ) + + val := PutChildrenParams{ + AccessOption: &accessOptionDefault, + ExpectedVersion: &expectedVersionDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the put children params +func (o *PutChildrenParams) WithTimeout(timeout time.Duration) *PutChildrenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put children params +func (o *PutChildrenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put children params +func (o *PutChildrenParams) WithContext(ctx context.Context) *PutChildrenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put children params +func (o *PutChildrenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put children params +func (o *PutChildrenParams) WithHTTPClient(client *http.Client) *PutChildrenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put children params +func (o *PutChildrenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccessOption adds the accessOption to the put children params +func (o *PutChildrenParams) WithAccessOption(accessOption *int32) *PutChildrenParams { + o.SetAccessOption(accessOption) + return o +} + +// SetAccessOption adds the accessOption to the put children params +func (o *PutChildrenParams) SetAccessOption(accessOption *int32) { + o.AccessOption = accessOption +} + +// WithBody adds the body to the put children params +func (o *PutChildrenParams) WithBody(body string) *PutChildrenParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the put children params +func (o *PutChildrenParams) SetBody(body string) { + o.Body = body +} + +// WithData adds the data to the put children params +func (o *PutChildrenParams) WithData(data *string) *PutChildrenParams { + o.SetData(data) + return o +} + +// SetData adds the data to the put children params +func (o *PutChildrenParams) SetData(data *string) { + o.Data = data +} + +// WithExpectedVersion adds the expectedVersion to the put children params +func (o *PutChildrenParams) WithExpectedVersion(expectedVersion *int32) *PutChildrenParams { + o.SetExpectedVersion(expectedVersion) + return o +} + +// SetExpectedVersion adds the expectedVersion to the put children params +func (o *PutChildrenParams) SetExpectedVersion(expectedVersion *int32) { + o.ExpectedVersion = expectedVersion +} + +// WithPath adds the path to the put children params +func (o *PutChildrenParams) WithPath(path string) *PutChildrenParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the put children params +func (o *PutChildrenParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *PutChildrenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccessOption != nil { + + // query param accessOption + var qrAccessOption int32 + + if o.AccessOption != nil { + qrAccessOption = *o.AccessOption + } + qAccessOption := swag.FormatInt32(qrAccessOption) + if qAccessOption != "" { + + if err := r.SetQueryParam("accessOption", qAccessOption); err != nil { + return err + } + } + } + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.Data != nil { + + // query param data + var qrData string + + if o.Data != nil { + qrData = *o.Data + } + qData := qrData + if qData != "" { + + if err := r.SetQueryParam("data", qData); err != nil { + return err + } + } + } + + if o.ExpectedVersion != nil { + + // query param expectedVersion + var qrExpectedVersion int32 + + if o.ExpectedVersion != nil { + qrExpectedVersion = *o.ExpectedVersion + } + qExpectedVersion := swag.FormatInt32(qrExpectedVersion) + if qExpectedVersion != "" { + + if err := r.SetQueryParam("expectedVersion", qExpectedVersion); err != nil { + return err + } + } + } + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/put_children_responses.go b/src/client/zookeeper/put_children_responses.go new file mode 100644 index 0000000..a7e7780 --- /dev/null +++ b/src/client/zookeeper/put_children_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PutChildrenReader is a Reader for the PutChildren structure. +type PutChildrenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutChildrenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutChildrenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewPutChildrenNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewPutChildrenNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutChildrenInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutChildrenOK creates a PutChildrenOK with default headers values +func NewPutChildrenOK() *PutChildrenOK { + return &PutChildrenOK{} +} + +/* +PutChildrenOK describes a response with status code 200, with default header values. + +Success +*/ +type PutChildrenOK struct { +} + +// IsSuccess returns true when this put children o k response has a 2xx status code +func (o *PutChildrenOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put children o k response has a 3xx status code +func (o *PutChildrenOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put children o k response has a 4xx status code +func (o *PutChildrenOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this put children o k response has a 5xx status code +func (o *PutChildrenOK) IsServerError() bool { + return false +} + +// IsCode returns true when this put children o k response a status code equal to that given +func (o *PutChildrenOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the put children o k response +func (o *PutChildrenOK) Code() int { + return 200 +} + +func (o *PutChildrenOK) Error() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenOK ", 200) +} + +func (o *PutChildrenOK) String() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenOK ", 200) +} + +func (o *PutChildrenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutChildrenNoContent creates a PutChildrenNoContent with default headers values +func NewPutChildrenNoContent() *PutChildrenNoContent { + return &PutChildrenNoContent{} +} + +/* +PutChildrenNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type PutChildrenNoContent struct { +} + +// IsSuccess returns true when this put children no content response has a 2xx status code +func (o *PutChildrenNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put children no content response has a 3xx status code +func (o *PutChildrenNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put children no content response has a 4xx status code +func (o *PutChildrenNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this put children no content response has a 5xx status code +func (o *PutChildrenNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this put children no content response a status code equal to that given +func (o *PutChildrenNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the put children no content response +func (o *PutChildrenNoContent) Code() int { + return 204 +} + +func (o *PutChildrenNoContent) Error() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenNoContent ", 204) +} + +func (o *PutChildrenNoContent) String() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenNoContent ", 204) +} + +func (o *PutChildrenNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutChildrenNotFound creates a PutChildrenNotFound with default headers values +func NewPutChildrenNotFound() *PutChildrenNotFound { + return &PutChildrenNotFound{} +} + +/* +PutChildrenNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type PutChildrenNotFound struct { +} + +// IsSuccess returns true when this put children not found response has a 2xx status code +func (o *PutChildrenNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put children not found response has a 3xx status code +func (o *PutChildrenNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put children not found response has a 4xx status code +func (o *PutChildrenNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this put children not found response has a 5xx status code +func (o *PutChildrenNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this put children not found response a status code equal to that given +func (o *PutChildrenNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the put children not found response +func (o *PutChildrenNotFound) Code() int { + return 404 +} + +func (o *PutChildrenNotFound) Error() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenNotFound ", 404) +} + +func (o *PutChildrenNotFound) String() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenNotFound ", 404) +} + +func (o *PutChildrenNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutChildrenInternalServerError creates a PutChildrenInternalServerError with default headers values +func NewPutChildrenInternalServerError() *PutChildrenInternalServerError { + return &PutChildrenInternalServerError{} +} + +/* +PutChildrenInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type PutChildrenInternalServerError struct { +} + +// IsSuccess returns true when this put children internal server error response has a 2xx status code +func (o *PutChildrenInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put children internal server error response has a 3xx status code +func (o *PutChildrenInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put children internal server error response has a 4xx status code +func (o *PutChildrenInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this put children internal server error response has a 5xx status code +func (o *PutChildrenInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this put children internal server error response a status code equal to that given +func (o *PutChildrenInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the put children internal server error response +func (o *PutChildrenInternalServerError) Code() int { + return 500 +} + +func (o *PutChildrenInternalServerError) Error() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenInternalServerError ", 500) +} + +func (o *PutChildrenInternalServerError) String() string { + return fmt.Sprintf("[PUT /zk/putChildren][%d] putChildrenInternalServerError ", 500) +} + +func (o *PutChildrenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/put_data_parameters.go b/src/client/zookeeper/put_data_parameters.go new file mode 100644 index 0000000..e0bbc03 --- /dev/null +++ b/src/client/zookeeper/put_data_parameters.go @@ -0,0 +1,296 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPutDataParams creates a new PutDataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPutDataParams() *PutDataParams { + return &PutDataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutDataParamsWithTimeout creates a new PutDataParams object +// with the ability to set a timeout on a request. +func NewPutDataParamsWithTimeout(timeout time.Duration) *PutDataParams { + return &PutDataParams{ + timeout: timeout, + } +} + +// NewPutDataParamsWithContext creates a new PutDataParams object +// with the ability to set a context for a request. +func NewPutDataParamsWithContext(ctx context.Context) *PutDataParams { + return &PutDataParams{ + Context: ctx, + } +} + +// NewPutDataParamsWithHTTPClient creates a new PutDataParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutDataParamsWithHTTPClient(client *http.Client) *PutDataParams { + return &PutDataParams{ + HTTPClient: client, + } +} + +/* +PutDataParams contains all the parameters to send to the API endpoint + + for the put data operation. + + Typically these are written to a http.Request. +*/ +type PutDataParams struct { + + /* AccessOption. + + accessOption + + Format: int32 + Default: 1 + */ + AccessOption *int32 + + // Body. + Body string + + /* Data. + + Content + */ + Data *string + + /* ExpectedVersion. + + expectedVersion + + Format: int32 + Default: -1 + */ + ExpectedVersion *int32 + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutDataParams) WithDefaults() *PutDataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutDataParams) SetDefaults() { + var ( + accessOptionDefault = int32(1) + + expectedVersionDefault = int32(-1) + ) + + val := PutDataParams{ + AccessOption: &accessOptionDefault, + ExpectedVersion: &expectedVersionDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the put data params +func (o *PutDataParams) WithTimeout(timeout time.Duration) *PutDataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put data params +func (o *PutDataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put data params +func (o *PutDataParams) WithContext(ctx context.Context) *PutDataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put data params +func (o *PutDataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put data params +func (o *PutDataParams) WithHTTPClient(client *http.Client) *PutDataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put data params +func (o *PutDataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccessOption adds the accessOption to the put data params +func (o *PutDataParams) WithAccessOption(accessOption *int32) *PutDataParams { + o.SetAccessOption(accessOption) + return o +} + +// SetAccessOption adds the accessOption to the put data params +func (o *PutDataParams) SetAccessOption(accessOption *int32) { + o.AccessOption = accessOption +} + +// WithBody adds the body to the put data params +func (o *PutDataParams) WithBody(body string) *PutDataParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the put data params +func (o *PutDataParams) SetBody(body string) { + o.Body = body +} + +// WithData adds the data to the put data params +func (o *PutDataParams) WithData(data *string) *PutDataParams { + o.SetData(data) + return o +} + +// SetData adds the data to the put data params +func (o *PutDataParams) SetData(data *string) { + o.Data = data +} + +// WithExpectedVersion adds the expectedVersion to the put data params +func (o *PutDataParams) WithExpectedVersion(expectedVersion *int32) *PutDataParams { + o.SetExpectedVersion(expectedVersion) + return o +} + +// SetExpectedVersion adds the expectedVersion to the put data params +func (o *PutDataParams) SetExpectedVersion(expectedVersion *int32) { + o.ExpectedVersion = expectedVersion +} + +// WithPath adds the path to the put data params +func (o *PutDataParams) WithPath(path string) *PutDataParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the put data params +func (o *PutDataParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *PutDataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccessOption != nil { + + // query param accessOption + var qrAccessOption int32 + + if o.AccessOption != nil { + qrAccessOption = *o.AccessOption + } + qAccessOption := swag.FormatInt32(qrAccessOption) + if qAccessOption != "" { + + if err := r.SetQueryParam("accessOption", qAccessOption); err != nil { + return err + } + } + } + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if o.Data != nil { + + // query param data + var qrData string + + if o.Data != nil { + qrData = *o.Data + } + qData := qrData + if qData != "" { + + if err := r.SetQueryParam("data", qData); err != nil { + return err + } + } + } + + if o.ExpectedVersion != nil { + + // query param expectedVersion + var qrExpectedVersion int32 + + if o.ExpectedVersion != nil { + qrExpectedVersion = *o.ExpectedVersion + } + qExpectedVersion := swag.FormatInt32(qrExpectedVersion) + if qExpectedVersion != "" { + + if err := r.SetQueryParam("expectedVersion", qExpectedVersion); err != nil { + return err + } + } + } + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/put_data_responses.go b/src/client/zookeeper/put_data_responses.go new file mode 100644 index 0000000..54f3df5 --- /dev/null +++ b/src/client/zookeeper/put_data_responses.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PutDataReader is a Reader for the PutData structure. +type PutDataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutDataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutDataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewPutDataNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewPutDataNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutDataInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutDataOK creates a PutDataOK with default headers values +func NewPutDataOK() *PutDataOK { + return &PutDataOK{} +} + +/* +PutDataOK describes a response with status code 200, with default header values. + +Success +*/ +type PutDataOK struct { +} + +// IsSuccess returns true when this put data o k response has a 2xx status code +func (o *PutDataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put data o k response has a 3xx status code +func (o *PutDataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put data o k response has a 4xx status code +func (o *PutDataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this put data o k response has a 5xx status code +func (o *PutDataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this put data o k response a status code equal to that given +func (o *PutDataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the put data o k response +func (o *PutDataOK) Code() int { + return 200 +} + +func (o *PutDataOK) Error() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataOK ", 200) +} + +func (o *PutDataOK) String() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataOK ", 200) +} + +func (o *PutDataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutDataNoContent creates a PutDataNoContent with default headers values +func NewPutDataNoContent() *PutDataNoContent { + return &PutDataNoContent{} +} + +/* +PutDataNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type PutDataNoContent struct { +} + +// IsSuccess returns true when this put data no content response has a 2xx status code +func (o *PutDataNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put data no content response has a 3xx status code +func (o *PutDataNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put data no content response has a 4xx status code +func (o *PutDataNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this put data no content response has a 5xx status code +func (o *PutDataNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this put data no content response a status code equal to that given +func (o *PutDataNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the put data no content response +func (o *PutDataNoContent) Code() int { + return 204 +} + +func (o *PutDataNoContent) Error() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataNoContent ", 204) +} + +func (o *PutDataNoContent) String() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataNoContent ", 204) +} + +func (o *PutDataNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutDataNotFound creates a PutDataNotFound with default headers values +func NewPutDataNotFound() *PutDataNotFound { + return &PutDataNotFound{} +} + +/* +PutDataNotFound describes a response with status code 404, with default header values. + +ZK Path not found +*/ +type PutDataNotFound struct { +} + +// IsSuccess returns true when this put data not found response has a 2xx status code +func (o *PutDataNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put data not found response has a 3xx status code +func (o *PutDataNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put data not found response has a 4xx status code +func (o *PutDataNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this put data not found response has a 5xx status code +func (o *PutDataNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this put data not found response a status code equal to that given +func (o *PutDataNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the put data not found response +func (o *PutDataNotFound) Code() int { + return 404 +} + +func (o *PutDataNotFound) Error() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataNotFound ", 404) +} + +func (o *PutDataNotFound) String() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataNotFound ", 404) +} + +func (o *PutDataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutDataInternalServerError creates a PutDataInternalServerError with default headers values +func NewPutDataInternalServerError() *PutDataInternalServerError { + return &PutDataInternalServerError{} +} + +/* +PutDataInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type PutDataInternalServerError struct { +} + +// IsSuccess returns true when this put data internal server error response has a 2xx status code +func (o *PutDataInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put data internal server error response has a 3xx status code +func (o *PutDataInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put data internal server error response has a 4xx status code +func (o *PutDataInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this put data internal server error response has a 5xx status code +func (o *PutDataInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this put data internal server error response a status code equal to that given +func (o *PutDataInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the put data internal server error response +func (o *PutDataInternalServerError) Code() int { + return 500 +} + +func (o *PutDataInternalServerError) Error() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataInternalServerError ", 500) +} + +func (o *PutDataInternalServerError) String() string { + return fmt.Sprintf("[PUT /zk/put][%d] putDataInternalServerError ", 500) +} + +func (o *PutDataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/stat_parameters.go b/src/client/zookeeper/stat_parameters.go new file mode 100644 index 0000000..965f68a --- /dev/null +++ b/src/client/zookeeper/stat_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStatParams creates a new StatParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewStatParams() *StatParams { + return &StatParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewStatParamsWithTimeout creates a new StatParams object +// with the ability to set a timeout on a request. +func NewStatParamsWithTimeout(timeout time.Duration) *StatParams { + return &StatParams{ + timeout: timeout, + } +} + +// NewStatParamsWithContext creates a new StatParams object +// with the ability to set a context for a request. +func NewStatParamsWithContext(ctx context.Context) *StatParams { + return &StatParams{ + Context: ctx, + } +} + +// NewStatParamsWithHTTPClient creates a new StatParams object +// with the ability to set a custom HTTPClient for a request. +func NewStatParamsWithHTTPClient(client *http.Client) *StatParams { + return &StatParams{ + HTTPClient: client, + } +} + +/* +StatParams contains all the parameters to send to the API endpoint + + for the stat operation. + + Typically these are written to a http.Request. +*/ +type StatParams struct { + + /* Path. + + Zookeeper Path, must start with / + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the stat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StatParams) WithDefaults() *StatParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the stat params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StatParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the stat params +func (o *StatParams) WithTimeout(timeout time.Duration) *StatParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stat params +func (o *StatParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stat params +func (o *StatParams) WithContext(ctx context.Context) *StatParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stat params +func (o *StatParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stat params +func (o *StatParams) WithHTTPClient(client *http.Client) *StatParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stat params +func (o *StatParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the stat params +func (o *StatParams) WithPath(path string) *StatParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the stat params +func (o *StatParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *StatParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param path + qrPath := o.Path + qPath := qrPath + if qPath != "" { + + if err := r.SetQueryParam("path", qPath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/src/client/zookeeper/stat_responses.go b/src/client/zookeeper/stat_responses.go new file mode 100644 index 0000000..7d13591 --- /dev/null +++ b/src/client/zookeeper/stat_responses.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// StatReader is a Reader for the Stat structure. +type StatReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StatReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStatOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewStatNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewStatInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewStatOK creates a StatOK with default headers values +func NewStatOK() *StatOK { + return &StatOK{} +} + +/* +StatOK describes a response with status code 200, with default header values. + +Success +*/ +type StatOK struct { +} + +// IsSuccess returns true when this stat o k response has a 2xx status code +func (o *StatOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this stat o k response has a 3xx status code +func (o *StatOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stat o k response has a 4xx status code +func (o *StatOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this stat o k response has a 5xx status code +func (o *StatOK) IsServerError() bool { + return false +} + +// IsCode returns true when this stat o k response a status code equal to that given +func (o *StatOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the stat o k response +func (o *StatOK) Code() int { + return 200 +} + +func (o *StatOK) Error() string { + return fmt.Sprintf("[GET /zk/stat][%d] statOK ", 200) +} + +func (o *StatOK) String() string { + return fmt.Sprintf("[GET /zk/stat][%d] statOK ", 200) +} + +func (o *StatOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStatNotFound creates a StatNotFound with default headers values +func NewStatNotFound() *StatNotFound { + return &StatNotFound{} +} + +/* +StatNotFound describes a response with status code 404, with default header values. + +Table not found +*/ +type StatNotFound struct { +} + +// IsSuccess returns true when this stat not found response has a 2xx status code +func (o *StatNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stat not found response has a 3xx status code +func (o *StatNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stat not found response has a 4xx status code +func (o *StatNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this stat not found response has a 5xx status code +func (o *StatNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this stat not found response a status code equal to that given +func (o *StatNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the stat not found response +func (o *StatNotFound) Code() int { + return 404 +} + +func (o *StatNotFound) Error() string { + return fmt.Sprintf("[GET /zk/stat][%d] statNotFound ", 404) +} + +func (o *StatNotFound) String() string { + return fmt.Sprintf("[GET /zk/stat][%d] statNotFound ", 404) +} + +func (o *StatNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStatInternalServerError creates a StatInternalServerError with default headers values +func NewStatInternalServerError() *StatInternalServerError { + return &StatInternalServerError{} +} + +/* +StatInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type StatInternalServerError struct { +} + +// IsSuccess returns true when this stat internal server error response has a 2xx status code +func (o *StatInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this stat internal server error response has a 3xx status code +func (o *StatInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this stat internal server error response has a 4xx status code +func (o *StatInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this stat internal server error response has a 5xx status code +func (o *StatInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this stat internal server error response a status code equal to that given +func (o *StatInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the stat internal server error response +func (o *StatInternalServerError) Code() int { + return 500 +} + +func (o *StatInternalServerError) Error() string { + return fmt.Sprintf("[GET /zk/stat][%d] statInternalServerError ", 500) +} + +func (o *StatInternalServerError) String() string { + return fmt.Sprintf("[GET /zk/stat][%d] statInternalServerError ", 500) +} + +func (o *StatInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/src/client/zookeeper/zookeeper_client.go b/src/client/zookeeper/zookeeper_client.go new file mode 100644 index 0000000..f4da55f --- /dev/null +++ b/src/client/zookeeper/zookeeper_client.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package zookeeper + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new zookeeper API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for zookeeper API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOK, *DeleteNoContent, error) + + GetChildren(params *GetChildrenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetChildrenOK, *GetChildrenNoContent, error) + + GetData(params *GetDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDataOK, *GetDataNoContent, error) + + Ls(params *LsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LsOK, error) + + Lsl(params *LslParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LslOK, error) + + PutChildren(params *PutChildrenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutChildrenOK, *PutChildrenNoContent, error) + + PutData(params *PutDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDataOK, *PutDataNoContent, error) + + Stat(params *StatParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StatOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +Delete deletes the znode at this path +*/ +func (a *Client) Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOK, *DeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "delete", + Method: "DELETE", + PathPattern: "/zk/delete", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *DeleteOK: + return value, nil, nil + case *DeleteNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for zookeeper: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetChildren gets all child znodes +*/ +func (a *Client) GetChildren(params *GetChildrenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetChildrenOK, *GetChildrenNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetChildrenParams() + } + op := &runtime.ClientOperation{ + ID: "getChildren", + Method: "GET", + PathPattern: "/zk/getChildren", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetChildrenReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *GetChildrenOK: + return value, nil, nil + case *GetChildrenNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for zookeeper: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetData gets content of the znode +*/ +func (a *Client) GetData(params *GetDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDataOK, *GetDataNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDataParams() + } + op := &runtime.ClientOperation{ + ID: "getData", + Method: "GET", + PathPattern: "/zk/get", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetDataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *GetDataOK: + return value, nil, nil + case *GetDataNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for zookeeper: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Ls lists the child znodes +*/ +func (a *Client) Ls(params *LsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLsParams() + } + op := &runtime.ClientOperation{ + ID: "ls", + Method: "GET", + PathPattern: "/zk/ls", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &LsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*LsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ls: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Lsl lists the child znodes along with stats +*/ +func (a *Client) Lsl(params *LslParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LslOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLslParams() + } + op := &runtime.ClientOperation{ + ID: "lsl", + Method: "GET", + PathPattern: "/zk/lsl", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &LslReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*LslOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for lsl: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PutChildren updates the content of multiple zn record node under the same path +*/ +func (a *Client) PutChildren(params *PutChildrenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutChildrenOK, *PutChildrenNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutChildrenParams() + } + op := &runtime.ClientOperation{ + ID: "putChildren", + Method: "PUT", + PathPattern: "/zk/putChildren", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PutChildrenReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *PutChildrenOK: + return value, nil, nil + case *PutChildrenNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for zookeeper: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PutData updates the content of the node +*/ +func (a *Client) PutData(params *PutDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDataOK, *PutDataNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutDataParams() + } + op := &runtime.ClientOperation{ + ID: "putData", + Method: "PUT", + PathPattern: "/zk/put", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PutDataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *PutDataOK: + return value, nil, nil + case *PutDataNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for zookeeper: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Stat gets the stat + + Use this api to fetch additional details of a znode such as creation time, modified time, numChildren etc +*/ +func (a *Client) Stat(params *StatParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StatOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStatParams() + } + op := &runtime.ClientOperation{ + ID: "stat", + Method: "GET", + PathPattern: "/zk/stat", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &StatReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*StatOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for stat: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/src/cmd/startree/main.go b/src/cmd/startree/main.go new file mode 100644 index 0000000..c8031f2 --- /dev/null +++ b/src/cmd/startree/main.go @@ -0,0 +1,25 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package main + +import ( + "fmt" + "os" + + "startree.ai/cli/cli" +) + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +func main() { + rootCmd, err := cli.MakeRootCmd() + if err != nil { + fmt.Println("Cmd construction error: ", err) + os.Exit(1) + } + + if err := rootCmd.Execute(); err != nil { + os.Exit(1) + } +} diff --git a/src/cmd/startree/startree b/src/cmd/startree/startree new file mode 100755 index 0000000..552721b Binary files /dev/null and b/src/cmd/startree/startree differ diff --git a/src/go.mod b/src/go.mod new file mode 100644 index 0000000..d9b958a --- /dev/null +++ b/src/go.mod @@ -0,0 +1,51 @@ +module startree.ai/cli + +go 1.20 + +require ( + github.com/go-openapi/errors v0.20.3 + github.com/go-openapi/runtime v0.25.0 + github.com/go-openapi/strfmt v0.21.5 + github.com/go-openapi/swag v0.22.3 + github.com/go-openapi/validate v0.22.1 + github.com/mitchellh/go-homedir v1.1.0 + github.com/spf13/cobra v1.6.1 + github.com/spf13/viper v1.15.0 +) + +require ( + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/analysis v0.21.2 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.6 // indirect + github.com/go-openapi/loads v0.21.1 // indirect + github.com/go-openapi/spec v0.20.4 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/spf13/afero v1.9.3 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + go.mongodb.org/mongo-driver v1.10.0 // indirect + go.opentelemetry.io/otel v1.11.1 // indirect + go.opentelemetry.io/otel/trace v1.11.1 // indirect + golang.org/x/net v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/src/go.sum b/src/go.sum new file mode 100644 index 0000000..6efe3cf --- /dev/null +++ b/src/go.sum @@ -0,0 +1,641 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/analysis v0.21.2 h1:hXFrOYFHUAMQdu6zwAiKKJHJQ8kqZs1ux/ru1P1wLJU= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= +github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/runtime v0.25.0 h1:7yQTCdRbWhX8vnIjdzU8S00tBYf7Sg71EBeorlPHvhc= +github.com/go-openapi/runtime v0.25.0/go.mod h1:Ux6fikcHXyyob6LNWxtE96hWwjBPYF0DXgVFuMTneOs= +github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.5 h1:Z/algjpXIZpbvdN+6KbVTkpO75RuedMrqpn1GN529h4= +github.com/go-openapi/strfmt v0.21.5/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= +github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= +github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.10.0 h1:UtV6N5k14upNp4LTduX0QCufG124fSu25Wz9tu94GLg= +go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= +go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= +go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= +go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= +go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/src/models/adhoc_task_config.go b/src/models/adhoc_task_config.go new file mode 100644 index 0000000..2174eed --- /dev/null +++ b/src/models/adhoc_task_config.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AdhocTaskConfig adhoc task config +// +// swagger:model AdhocTaskConfig +type AdhocTaskConfig struct { + + // table name + // Required: true + // Read Only: true + TableName string `json:"tableName"` + + // task configs + // Read Only: true + TaskConfigs map[string]string `json:"taskConfigs,omitempty"` + + // task name + // Read Only: true + TaskName string `json:"taskName,omitempty"` + + // task type + // Required: true + // Read Only: true + TaskType string `json:"taskType"` +} + +// Validate validates this adhoc task config +func (m *AdhocTaskConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTableName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaskType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AdhocTaskConfig) validateTableName(formats strfmt.Registry) error { + + if err := validate.RequiredString("tableName", "body", m.TableName); err != nil { + return err + } + + return nil +} + +func (m *AdhocTaskConfig) validateTaskType(formats strfmt.Registry) error { + + if err := validate.RequiredString("taskType", "body", m.TaskType); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this adhoc task config based on the context it is used +func (m *AdhocTaskConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTableName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AdhocTaskConfig) contextValidateTableName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tableName", "body", string(m.TableName)); err != nil { + return err + } + + return nil +} + +func (m *AdhocTaskConfig) contextValidateTaskConfigs(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *AdhocTaskConfig) contextValidateTaskName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "taskName", "body", string(m.TaskName)); err != nil { + return err + } + + return nil +} + +func (m *AdhocTaskConfig) contextValidateTaskType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "taskType", "body", string(m.TaskType)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AdhocTaskConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AdhocTaskConfig) UnmarshalBinary(b []byte) error { + var res AdhocTaskConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/aggregation_config.go b/src/models/aggregation_config.go new file mode 100644 index 0000000..95a68c1 --- /dev/null +++ b/src/models/aggregation_config.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AggregationConfig aggregation config +// +// swagger:model AggregationConfig +type AggregationConfig struct { + + // aggregation function + // Read Only: true + AggregationFunction string `json:"aggregationFunction,omitempty"` + + // column name + // Read Only: true + ColumnName string `json:"columnName,omitempty"` +} + +// Validate validates this aggregation config +func (m *AggregationConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this aggregation config based on the context it is used +func (m *AggregationConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAggregationFunction(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateColumnName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AggregationConfig) contextValidateAggregationFunction(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "aggregationFunction", "body", string(m.AggregationFunction)); err != nil { + return err + } + + return nil +} + +func (m *AggregationConfig) contextValidateColumnName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "columnName", "body", string(m.ColumnName)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AggregationConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AggregationConfig) UnmarshalBinary(b []byte) error { + var res AggregationConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/auth_workflow_info.go b/src/models/auth_workflow_info.go new file mode 100644 index 0000000..6ae2309 --- /dev/null +++ b/src/models/auth_workflow_info.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuthWorkflowInfo auth workflow info +// +// swagger:model AuthWorkflowInfo +type AuthWorkflowInfo struct { + + // workflow + Workflow string `json:"workflow,omitempty"` +} + +// Validate validates this auth workflow info +func (m *AuthWorkflowInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this auth workflow info based on context it is used +func (m *AuthWorkflowInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AuthWorkflowInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuthWorkflowInfo) UnmarshalBinary(b []byte) error { + var res AuthWorkflowInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/batch_ingestion_config.go b/src/models/batch_ingestion_config.go new file mode 100644 index 0000000..a886687 --- /dev/null +++ b/src/models/batch_ingestion_config.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BatchIngestionConfig batch ingestion config +// +// swagger:model BatchIngestionConfig +type BatchIngestionConfig struct { + + // batch config maps + BatchConfigMaps []map[string]string `json:"batchConfigMaps"` + + // consistent data push + ConsistentDataPush bool `json:"consistentDataPush,omitempty"` + + // segment ingestion frequency + SegmentIngestionFrequency string `json:"segmentIngestionFrequency,omitempty"` + + // segment ingestion type + SegmentIngestionType string `json:"segmentIngestionType,omitempty"` +} + +// Validate validates this batch ingestion config +func (m *BatchIngestionConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this batch ingestion config based on context it is used +func (m *BatchIngestionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BatchIngestionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BatchIngestionConfig) UnmarshalBinary(b []byte) error { + var res BatchIngestionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/bloom_filter_config.go b/src/models/bloom_filter_config.go new file mode 100644 index 0000000..890ca05 --- /dev/null +++ b/src/models/bloom_filter_config.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// BloomFilterConfig bloom filter config +// +// swagger:model BloomFilterConfig +type BloomFilterConfig struct { + + // fpp + // Read Only: true + Fpp float64 `json:"fpp,omitempty"` + + // load on heap + // Read Only: true + LoadOnHeap *bool `json:"loadOnHeap,omitempty"` + + // max size in bytes + // Read Only: true + MaxSizeInBytes int32 `json:"maxSizeInBytes,omitempty"` +} + +// Validate validates this bloom filter config +func (m *BloomFilterConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this bloom filter config based on the context it is used +func (m *BloomFilterConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFpp(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLoadOnHeap(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxSizeInBytes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BloomFilterConfig) contextValidateFpp(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "fpp", "body", float64(m.Fpp)); err != nil { + return err + } + + return nil +} + +func (m *BloomFilterConfig) contextValidateLoadOnHeap(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "loadOnHeap", "body", m.LoadOnHeap); err != nil { + return err + } + + return nil +} + +func (m *BloomFilterConfig) contextValidateMaxSizeInBytes(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "maxSizeInBytes", "body", int32(m.MaxSizeInBytes)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BloomFilterConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BloomFilterConfig) UnmarshalBinary(b []byte) error { + var res BloomFilterConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/body_part.go b/src/models/body_part.go new file mode 100644 index 0000000..ea8759a --- /dev/null +++ b/src/models/body_part.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// BodyPart body part +// +// swagger:model BodyPart +type BodyPart struct { + + // content disposition + ContentDisposition *ContentDisposition `json:"contentDisposition,omitempty"` + + // entity + Entity interface{} `json:"entity,omitempty"` + + // headers + Headers map[string][]string `json:"headers,omitempty"` + + // media type + MediaType *MediaType `json:"mediaType,omitempty"` + + // message body workers + MessageBodyWorkers MessageBodyWorkers `json:"messageBodyWorkers,omitempty"` + + // parameterized headers + ParameterizedHeaders map[string][]ParameterizedHeader `json:"parameterizedHeaders,omitempty"` + + // parent + Parent *MultiPart `json:"parent,omitempty"` + + // providers + Providers Providers `json:"providers,omitempty"` +} + +// Validate validates this body part +func (m *BodyPart) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentDisposition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMediaType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParameterizedHeaders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BodyPart) validateContentDisposition(formats strfmt.Registry) error { + if swag.IsZero(m.ContentDisposition) { // not required + return nil + } + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *BodyPart) validateMediaType(formats strfmt.Registry) error { + if swag.IsZero(m.MediaType) { // not required + return nil + } + + if m.MediaType != nil { + if err := m.MediaType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *BodyPart) validateParameterizedHeaders(formats strfmt.Registry) error { + if swag.IsZero(m.ParameterizedHeaders) { // not required + return nil + } + + for k := range m.ParameterizedHeaders { + + if err := validate.Required("parameterizedHeaders"+"."+k, "body", m.ParameterizedHeaders[k]); err != nil { + return err + } + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *BodyPart) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this body part based on the context it is used +func (m *BodyPart) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContentDisposition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMediaType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParameterizedHeaders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BodyPart) contextValidateContentDisposition(ctx context.Context, formats strfmt.Registry) error { + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *BodyPart) contextValidateMediaType(ctx context.Context, formats strfmt.Registry) error { + + if m.MediaType != nil { + if err := m.MediaType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *BodyPart) contextValidateParameterizedHeaders(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ParameterizedHeaders { + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *BodyPart) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BodyPart) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BodyPart) UnmarshalBinary(b []byte) error { + var res BodyPart + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/cluster_health_response.go b/src/models/cluster_health_response.go new file mode 100644 index 0000000..a660653 --- /dev/null +++ b/src/models/cluster_health_response.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ClusterHealthResponse cluster health response +// +// swagger:model ClusterHealthResponse +type ClusterHealthResponse struct { + + // table to error segments count + TableToErrorSegmentsCount map[string]int32 `json:"tableToErrorSegmentsCount,omitempty"` + + // table to misconfigured segment count + TableToMisconfiguredSegmentCount map[string]int32 `json:"tableToMisconfiguredSegmentCount,omitempty"` + + // table to segments wit h missing columns count + TableToSegmentsWitHMissingColumnsCount map[string]int32 `json:"tableToSegmentsWitHMissingColumnsCount,omitempty"` + + // unhealthy server count + UnhealthyServerCount int64 `json:"unhealthyServerCount,omitempty"` +} + +// Validate validates this cluster health response +func (m *ClusterHealthResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this cluster health response based on context it is used +func (m *ClusterHealthResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterHealthResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterHealthResponse) UnmarshalBinary(b []byte) error { + var res ClusterHealthResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/column_partition_config.go b/src/models/column_partition_config.go new file mode 100644 index 0000000..dc2a0e7 --- /dev/null +++ b/src/models/column_partition_config.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ColumnPartitionConfig column partition config +// +// swagger:model ColumnPartitionConfig +type ColumnPartitionConfig struct { + + // function config + // Read Only: true + FunctionConfig map[string]string `json:"functionConfig,omitempty"` + + // function name + // Required: true + // Read Only: true + FunctionName string `json:"functionName"` + + // num partitions + // Required: true + // Read Only: true + NumPartitions int32 `json:"numPartitions"` +} + +// Validate validates this column partition config +func (m *ColumnPartitionConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFunctionName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNumPartitions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ColumnPartitionConfig) validateFunctionName(formats strfmt.Registry) error { + + if err := validate.RequiredString("functionName", "body", m.FunctionName); err != nil { + return err + } + + return nil +} + +func (m *ColumnPartitionConfig) validateNumPartitions(formats strfmt.Registry) error { + + if err := validate.Required("numPartitions", "body", int32(m.NumPartitions)); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this column partition config based on the context it is used +func (m *ColumnPartitionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFunctionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFunctionName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumPartitions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ColumnPartitionConfig) contextValidateFunctionConfig(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *ColumnPartitionConfig) contextValidateFunctionName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "functionName", "body", string(m.FunctionName)); err != nil { + return err + } + + return nil +} + +func (m *ColumnPartitionConfig) contextValidateNumPartitions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numPartitions", "body", int32(m.NumPartitions)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ColumnPartitionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ColumnPartitionConfig) UnmarshalBinary(b []byte) error { + var res ColumnPartitionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/completion_config.go b/src/models/completion_config.go new file mode 100644 index 0000000..b207c71 --- /dev/null +++ b/src/models/completion_config.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CompletionConfig completion config +// +// swagger:model CompletionConfig +type CompletionConfig struct { + + // completion mode + // Required: true + // Read Only: true + CompletionMode string `json:"completionMode"` +} + +// Validate validates this completion config +func (m *CompletionConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletionMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompletionConfig) validateCompletionMode(formats strfmt.Registry) error { + + if err := validate.RequiredString("completionMode", "body", m.CompletionMode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this completion config based on the context it is used +func (m *CompletionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCompletionMode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompletionConfig) contextValidateCompletionMode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "completionMode", "body", string(m.CompletionMode)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompletionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompletionConfig) UnmarshalBinary(b []byte) error { + var res CompletionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/complex_type_config.go b/src/models/complex_type_config.go new file mode 100644 index 0000000..afa07ee --- /dev/null +++ b/src/models/complex_type_config.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ComplexTypeConfig complex type config +// +// swagger:model ComplexTypeConfig +type ComplexTypeConfig struct { + + // collection not unnested to Json + // Read Only: true + // Enum: [NONE NON_PRIMITIVE ALL] + CollectionNotUnnestedToJSON string `json:"collectionNotUnnestedToJson,omitempty"` + + // delimiter + // Read Only: true + Delimiter string `json:"delimiter,omitempty"` + + // fields to unnest + // Read Only: true + FieldsToUnnest []string `json:"fieldsToUnnest"` + + // prefixes to rename + // Read Only: true + PrefixesToRename map[string]string `json:"prefixesToRename,omitempty"` +} + +// Validate validates this complex type config +func (m *ComplexTypeConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCollectionNotUnnestedToJSON(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var complexTypeConfigTypeCollectionNotUnnestedToJSONPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NONE","NON_PRIMITIVE","ALL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + complexTypeConfigTypeCollectionNotUnnestedToJSONPropEnum = append(complexTypeConfigTypeCollectionNotUnnestedToJSONPropEnum, v) + } +} + +const ( + + // ComplexTypeConfigCollectionNotUnnestedToJSONNONE captures enum value "NONE" + ComplexTypeConfigCollectionNotUnnestedToJSONNONE string = "NONE" + + // ComplexTypeConfigCollectionNotUnnestedToJSONNONPRIMITIVE captures enum value "NON_PRIMITIVE" + ComplexTypeConfigCollectionNotUnnestedToJSONNONPRIMITIVE string = "NON_PRIMITIVE" + + // ComplexTypeConfigCollectionNotUnnestedToJSONALL captures enum value "ALL" + ComplexTypeConfigCollectionNotUnnestedToJSONALL string = "ALL" +) + +// prop value enum +func (m *ComplexTypeConfig) validateCollectionNotUnnestedToJSONEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, complexTypeConfigTypeCollectionNotUnnestedToJSONPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ComplexTypeConfig) validateCollectionNotUnnestedToJSON(formats strfmt.Registry) error { + if swag.IsZero(m.CollectionNotUnnestedToJSON) { // not required + return nil + } + + // value enum + if err := m.validateCollectionNotUnnestedToJSONEnum("collectionNotUnnestedToJson", "body", m.CollectionNotUnnestedToJSON); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this complex type config based on the context it is used +func (m *ComplexTypeConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCollectionNotUnnestedToJSON(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDelimiter(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFieldsToUnnest(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrefixesToRename(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ComplexTypeConfig) contextValidateCollectionNotUnnestedToJSON(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "collectionNotUnnestedToJson", "body", string(m.CollectionNotUnnestedToJSON)); err != nil { + return err + } + + return nil +} + +func (m *ComplexTypeConfig) contextValidateDelimiter(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "delimiter", "body", string(m.Delimiter)); err != nil { + return err + } + + return nil +} + +func (m *ComplexTypeConfig) contextValidateFieldsToUnnest(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "fieldsToUnnest", "body", []string(m.FieldsToUnnest)); err != nil { + return err + } + + return nil +} + +func (m *ComplexTypeConfig) contextValidatePrefixesToRename(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *ComplexTypeConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ComplexTypeConfig) UnmarshalBinary(b []byte) error { + var res ComplexTypeConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/config_success_response.go b/src/models/config_success_response.go new file mode 100644 index 0000000..273debc --- /dev/null +++ b/src/models/config_success_response.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ConfigSuccessResponse config success response +// +// swagger:model ConfigSuccessResponse +type ConfigSuccessResponse struct { + + // status + Status string `json:"status,omitempty"` + + // unrecognized properties + UnrecognizedProperties map[string]interface{} `json:"unrecognizedProperties,omitempty"` +} + +// Validate validates this config success response +func (m *ConfigSuccessResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this config success response based on context it is used +func (m *ConfigSuccessResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ConfigSuccessResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConfigSuccessResponse) UnmarshalBinary(b []byte) error { + var res ConfigSuccessResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/consuming_segment_info.go b/src/models/consuming_segment_info.go new file mode 100644 index 0000000..0ad0bac --- /dev/null +++ b/src/models/consuming_segment_info.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ConsumingSegmentInfo consuming segment info +// +// swagger:model ConsumingSegmentInfo +type ConsumingSegmentInfo struct { + + // consumer state + ConsumerState string `json:"consumerState,omitempty"` + + // last consumed timestamp + LastConsumedTimestamp int64 `json:"lastConsumedTimestamp,omitempty"` + + // partition offset info + PartitionOffsetInfo *PartitionOffsetInfo `json:"partitionOffsetInfo,omitempty"` + + // partition to offset map + PartitionToOffsetMap map[string]string `json:"partitionToOffsetMap,omitempty"` + + // server name + ServerName string `json:"serverName,omitempty"` +} + +// Validate validates this consuming segment info +func (m *ConsumingSegmentInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePartitionOffsetInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsumingSegmentInfo) validatePartitionOffsetInfo(formats strfmt.Registry) error { + if swag.IsZero(m.PartitionOffsetInfo) { // not required + return nil + } + + if m.PartitionOffsetInfo != nil { + if err := m.PartitionOffsetInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("partitionOffsetInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("partitionOffsetInfo") + } + return err + } + } + + return nil +} + +// ContextValidate validate this consuming segment info based on the context it is used +func (m *ConsumingSegmentInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePartitionOffsetInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsumingSegmentInfo) contextValidatePartitionOffsetInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.PartitionOffsetInfo != nil { + if err := m.PartitionOffsetInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("partitionOffsetInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("partitionOffsetInfo") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsumingSegmentInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsumingSegmentInfo) UnmarshalBinary(b []byte) error { + var res ConsumingSegmentInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/consuming_segments_info_map.go b/src/models/consuming_segments_info_map.go new file mode 100644 index 0000000..7eacec7 --- /dev/null +++ b/src/models/consuming_segments_info_map.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConsumingSegmentsInfoMap consuming segments info map +// +// swagger:model ConsumingSegmentsInfoMap +type ConsumingSegmentsInfoMap struct { + + // segment to consuming info map + SegmentToConsumingInfoMap map[string][]ConsumingSegmentInfo `json:"_segmentToConsumingInfoMap,omitempty"` +} + +// Validate validates this consuming segments info map +func (m *ConsumingSegmentsInfoMap) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSegmentToConsumingInfoMap(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsumingSegmentsInfoMap) validateSegmentToConsumingInfoMap(formats strfmt.Registry) error { + if swag.IsZero(m.SegmentToConsumingInfoMap) { // not required + return nil + } + + for k := range m.SegmentToConsumingInfoMap { + + if err := validate.Required("_segmentToConsumingInfoMap"+"."+k, "body", m.SegmentToConsumingInfoMap[k]); err != nil { + return err + } + + for i := 0; i < len(m.SegmentToConsumingInfoMap[k]); i++ { + + if err := m.SegmentToConsumingInfoMap[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_segmentToConsumingInfoMap" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("_segmentToConsumingInfoMap" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +// ContextValidate validate this consuming segments info map based on the context it is used +func (m *ConsumingSegmentsInfoMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSegmentToConsumingInfoMap(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsumingSegmentsInfoMap) contextValidateSegmentToConsumingInfoMap(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.SegmentToConsumingInfoMap { + + for i := 0; i < len(m.SegmentToConsumingInfoMap[k]); i++ { + + if err := m.SegmentToConsumingInfoMap[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_segmentToConsumingInfoMap" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("_segmentToConsumingInfoMap" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsumingSegmentsInfoMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsumingSegmentsInfoMap) UnmarshalBinary(b []byte) error { + var res ConsumingSegmentsInfoMap + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/content_disposition.go b/src/models/content_disposition.go new file mode 100644 index 0000000..c50f1cf --- /dev/null +++ b/src/models/content_disposition.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ContentDisposition content disposition +// +// swagger:model ContentDisposition +type ContentDisposition struct { + + // creation date + // Format: date-time + CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + + // file name + FileName string `json:"fileName,omitempty"` + + // modification date + // Format: date-time + ModificationDate strfmt.DateTime `json:"modificationDate,omitempty"` + + // parameters + Parameters map[string]string `json:"parameters,omitempty"` + + // read date + // Format: date-time + ReadDate strfmt.DateTime `json:"readDate,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this content disposition +func (m *ContentDisposition) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModificationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReadDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContentDisposition) validateCreationDate(formats strfmt.Registry) error { + if swag.IsZero(m.CreationDate) { // not required + return nil + } + + if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContentDisposition) validateModificationDate(formats strfmt.Registry) error { + if swag.IsZero(m.ModificationDate) { // not required + return nil + } + + if err := validate.FormatOf("modificationDate", "body", "date-time", m.ModificationDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContentDisposition) validateReadDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReadDate) { // not required + return nil + } + + if err := validate.FormatOf("readDate", "body", "date-time", m.ReadDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this content disposition based on context it is used +func (m *ContentDisposition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ContentDisposition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContentDisposition) UnmarshalBinary(b []byte) error { + var res ContentDisposition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/date_time_field_spec.go b/src/models/date_time_field_spec.go new file mode 100644 index 0000000..b1cdc6a --- /dev/null +++ b/src/models/date_time_field_spec.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DateTimeFieldSpec date time field spec +// +// swagger:model DateTimeFieldSpec +type DateTimeFieldSpec struct { + + // data type + // Enum: [INT LONG FLOAT DOUBLE BIG_DECIMAL BOOLEAN TIMESTAMP STRING JSON BYTES STRUCT MAP LIST] + DataType string `json:"dataType,omitempty"` + + // default null value + DefaultNullValue interface{} `json:"defaultNullValue,omitempty"` + + // default null value string + DefaultNullValueString string `json:"defaultNullValueString,omitempty"` + + // format + Format string `json:"format,omitempty"` + + // granularity + Granularity string `json:"granularity,omitempty"` + + // max length + MaxLength int32 `json:"maxLength,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // sample value + SampleValue interface{} `json:"sampleValue,omitempty"` + + // single value field + SingleValueField bool `json:"singleValueField,omitempty"` + + // transform function + TransformFunction string `json:"transformFunction,omitempty"` + + // virtual column provider + VirtualColumnProvider string `json:"virtualColumnProvider,omitempty"` +} + +// Validate validates this date time field spec +func (m *DateTimeFieldSpec) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDataType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dateTimeFieldSpecTypeDataTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dateTimeFieldSpecTypeDataTypePropEnum = append(dateTimeFieldSpecTypeDataTypePropEnum, v) + } +} + +const ( + + // DateTimeFieldSpecDataTypeINT captures enum value "INT" + DateTimeFieldSpecDataTypeINT string = "INT" + + // DateTimeFieldSpecDataTypeLONG captures enum value "LONG" + DateTimeFieldSpecDataTypeLONG string = "LONG" + + // DateTimeFieldSpecDataTypeFLOAT captures enum value "FLOAT" + DateTimeFieldSpecDataTypeFLOAT string = "FLOAT" + + // DateTimeFieldSpecDataTypeDOUBLE captures enum value "DOUBLE" + DateTimeFieldSpecDataTypeDOUBLE string = "DOUBLE" + + // DateTimeFieldSpecDataTypeBIGDECIMAL captures enum value "BIG_DECIMAL" + DateTimeFieldSpecDataTypeBIGDECIMAL string = "BIG_DECIMAL" + + // DateTimeFieldSpecDataTypeBOOLEAN captures enum value "BOOLEAN" + DateTimeFieldSpecDataTypeBOOLEAN string = "BOOLEAN" + + // DateTimeFieldSpecDataTypeTIMESTAMP captures enum value "TIMESTAMP" + DateTimeFieldSpecDataTypeTIMESTAMP string = "TIMESTAMP" + + // DateTimeFieldSpecDataTypeSTRING captures enum value "STRING" + DateTimeFieldSpecDataTypeSTRING string = "STRING" + + // DateTimeFieldSpecDataTypeJSON captures enum value "JSON" + DateTimeFieldSpecDataTypeJSON string = "JSON" + + // DateTimeFieldSpecDataTypeBYTES captures enum value "BYTES" + DateTimeFieldSpecDataTypeBYTES string = "BYTES" + + // DateTimeFieldSpecDataTypeSTRUCT captures enum value "STRUCT" + DateTimeFieldSpecDataTypeSTRUCT string = "STRUCT" + + // DateTimeFieldSpecDataTypeMAP captures enum value "MAP" + DateTimeFieldSpecDataTypeMAP string = "MAP" + + // DateTimeFieldSpecDataTypeLIST captures enum value "LIST" + DateTimeFieldSpecDataTypeLIST string = "LIST" +) + +// prop value enum +func (m *DateTimeFieldSpec) validateDataTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dateTimeFieldSpecTypeDataTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DateTimeFieldSpec) validateDataType(formats strfmt.Registry) error { + if swag.IsZero(m.DataType) { // not required + return nil + } + + // value enum + if err := m.validateDataTypeEnum("dataType", "body", m.DataType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this date time field spec based on context it is used +func (m *DateTimeFieldSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DateTimeFieldSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DateTimeFieldSpec) UnmarshalBinary(b []byte) error { + var res DateTimeFieldSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/dedup_config.go b/src/models/dedup_config.go new file mode 100644 index 0000000..f4cb096 --- /dev/null +++ b/src/models/dedup_config.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DedupConfig dedup config +// +// swagger:model DedupConfig +type DedupConfig struct { + + // dedup enabled + // Required: true + // Read Only: true + DedupEnabled bool `json:"dedupEnabled"` + + // hash function + // Read Only: true + // Enum: [NONE MD5 MURMUR3] + HashFunction string `json:"hashFunction,omitempty"` +} + +// Validate validates this dedup config +func (m *DedupConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDedupEnabled(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHashFunction(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DedupConfig) validateDedupEnabled(formats strfmt.Registry) error { + + if err := validate.Required("dedupEnabled", "body", bool(m.DedupEnabled)); err != nil { + return err + } + + return nil +} + +var dedupConfigTypeHashFunctionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NONE","MD5","MURMUR3"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dedupConfigTypeHashFunctionPropEnum = append(dedupConfigTypeHashFunctionPropEnum, v) + } +} + +const ( + + // DedupConfigHashFunctionNONE captures enum value "NONE" + DedupConfigHashFunctionNONE string = "NONE" + + // DedupConfigHashFunctionMD5 captures enum value "MD5" + DedupConfigHashFunctionMD5 string = "MD5" + + // DedupConfigHashFunctionMURMUR3 captures enum value "MURMUR3" + DedupConfigHashFunctionMURMUR3 string = "MURMUR3" +) + +// prop value enum +func (m *DedupConfig) validateHashFunctionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dedupConfigTypeHashFunctionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DedupConfig) validateHashFunction(formats strfmt.Registry) error { + if swag.IsZero(m.HashFunction) { // not required + return nil + } + + // value enum + if err := m.validateHashFunctionEnum("hashFunction", "body", m.HashFunction); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this dedup config based on the context it is used +func (m *DedupConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDedupEnabled(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHashFunction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DedupConfig) contextValidateDedupEnabled(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dedupEnabled", "body", bool(m.DedupEnabled)); err != nil { + return err + } + + return nil +} + +func (m *DedupConfig) contextValidateHashFunction(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "hashFunction", "body", string(m.HashFunction)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DedupConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DedupConfig) UnmarshalBinary(b []byte) error { + var res DedupConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/dimension_field_spec.go b/src/models/dimension_field_spec.go new file mode 100644 index 0000000..94d21f8 --- /dev/null +++ b/src/models/dimension_field_spec.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DimensionFieldSpec dimension field spec +// +// swagger:model DimensionFieldSpec +type DimensionFieldSpec struct { + + // data type + // Enum: [INT LONG FLOAT DOUBLE BIG_DECIMAL BOOLEAN TIMESTAMP STRING JSON BYTES STRUCT MAP LIST] + DataType string `json:"dataType,omitempty"` + + // default null value + DefaultNullValue interface{} `json:"defaultNullValue,omitempty"` + + // default null value string + DefaultNullValueString string `json:"defaultNullValueString,omitempty"` + + // max length + MaxLength int32 `json:"maxLength,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // single value field + SingleValueField bool `json:"singleValueField,omitempty"` + + // transform function + TransformFunction string `json:"transformFunction,omitempty"` + + // virtual column provider + VirtualColumnProvider string `json:"virtualColumnProvider,omitempty"` +} + +// Validate validates this dimension field spec +func (m *DimensionFieldSpec) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDataType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dimensionFieldSpecTypeDataTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dimensionFieldSpecTypeDataTypePropEnum = append(dimensionFieldSpecTypeDataTypePropEnum, v) + } +} + +const ( + + // DimensionFieldSpecDataTypeINT captures enum value "INT" + DimensionFieldSpecDataTypeINT string = "INT" + + // DimensionFieldSpecDataTypeLONG captures enum value "LONG" + DimensionFieldSpecDataTypeLONG string = "LONG" + + // DimensionFieldSpecDataTypeFLOAT captures enum value "FLOAT" + DimensionFieldSpecDataTypeFLOAT string = "FLOAT" + + // DimensionFieldSpecDataTypeDOUBLE captures enum value "DOUBLE" + DimensionFieldSpecDataTypeDOUBLE string = "DOUBLE" + + // DimensionFieldSpecDataTypeBIGDECIMAL captures enum value "BIG_DECIMAL" + DimensionFieldSpecDataTypeBIGDECIMAL string = "BIG_DECIMAL" + + // DimensionFieldSpecDataTypeBOOLEAN captures enum value "BOOLEAN" + DimensionFieldSpecDataTypeBOOLEAN string = "BOOLEAN" + + // DimensionFieldSpecDataTypeTIMESTAMP captures enum value "TIMESTAMP" + DimensionFieldSpecDataTypeTIMESTAMP string = "TIMESTAMP" + + // DimensionFieldSpecDataTypeSTRING captures enum value "STRING" + DimensionFieldSpecDataTypeSTRING string = "STRING" + + // DimensionFieldSpecDataTypeJSON captures enum value "JSON" + DimensionFieldSpecDataTypeJSON string = "JSON" + + // DimensionFieldSpecDataTypeBYTES captures enum value "BYTES" + DimensionFieldSpecDataTypeBYTES string = "BYTES" + + // DimensionFieldSpecDataTypeSTRUCT captures enum value "STRUCT" + DimensionFieldSpecDataTypeSTRUCT string = "STRUCT" + + // DimensionFieldSpecDataTypeMAP captures enum value "MAP" + DimensionFieldSpecDataTypeMAP string = "MAP" + + // DimensionFieldSpecDataTypeLIST captures enum value "LIST" + DimensionFieldSpecDataTypeLIST string = "LIST" +) + +// prop value enum +func (m *DimensionFieldSpec) validateDataTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dimensionFieldSpecTypeDataTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DimensionFieldSpec) validateDataType(formats strfmt.Registry) error { + if swag.IsZero(m.DataType) { // not required + return nil + } + + // value enum + if err := m.validateDataTypeEnum("dataType", "body", m.DataType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this dimension field spec based on context it is used +func (m *DimensionFieldSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DimensionFieldSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DimensionFieldSpec) UnmarshalBinary(b []byte) error { + var res DimensionFieldSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/dimension_table_config.go b/src/models/dimension_table_config.go new file mode 100644 index 0000000..ea67966 --- /dev/null +++ b/src/models/dimension_table_config.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DimensionTableConfig dimension table config +// +// swagger:model DimensionTableConfig +type DimensionTableConfig struct { + + // disable preload + // Required: true + // Read Only: true + DisablePreload bool `json:"disablePreload"` +} + +// Validate validates this dimension table config +func (m *DimensionTableConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDisablePreload(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DimensionTableConfig) validateDisablePreload(formats strfmt.Registry) error { + + if err := validate.Required("disablePreload", "body", bool(m.DisablePreload)); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this dimension table config based on the context it is used +func (m *DimensionTableConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisablePreload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DimensionTableConfig) contextValidateDisablePreload(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "disablePreload", "body", bool(m.DisablePreload)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DimensionTableConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DimensionTableConfig) UnmarshalBinary(b []byte) error { + var res DimensionTableConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/field_config.go b/src/models/field_config.go new file mode 100644 index 0000000..bd68d04 --- /dev/null +++ b/src/models/field_config.go @@ -0,0 +1,425 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FieldConfig field config +// +// swagger:model FieldConfig +type FieldConfig struct { + + // compression codec + // Read Only: true + // Enum: [PASS_THROUGH SNAPPY ZSTANDARD LZ4] + CompressionCodec string `json:"compressionCodec,omitempty"` + + // encoding type + // Read Only: true + // Enum: [RAW DICTIONARY] + EncodingType string `json:"encodingType,omitempty"` + + // index type + // Read Only: true + // Enum: [INVERTED SORTED TEXT FST H3 JSON TIMESTAMP RANGE] + IndexType string `json:"indexType,omitempty"` + + // index types + // Read Only: true + IndexTypes []string `json:"indexTypes"` + + // name + // Required: true + // Read Only: true + Name string `json:"name"` + + // properties + // Read Only: true + Properties map[string]string `json:"properties,omitempty"` + + // timestamp config + // Read Only: true + TimestampConfig *TimestampConfig `json:"timestampConfig,omitempty"` +} + +// Validate validates this field config +func (m *FieldConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompressionCodec(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEncodingType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIndexType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIndexTypes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestampConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var fieldConfigTypeCompressionCodecPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PASS_THROUGH","SNAPPY","ZSTANDARD","LZ4"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fieldConfigTypeCompressionCodecPropEnum = append(fieldConfigTypeCompressionCodecPropEnum, v) + } +} + +const ( + + // FieldConfigCompressionCodecPASSTHROUGH captures enum value "PASS_THROUGH" + FieldConfigCompressionCodecPASSTHROUGH string = "PASS_THROUGH" + + // FieldConfigCompressionCodecSNAPPY captures enum value "SNAPPY" + FieldConfigCompressionCodecSNAPPY string = "SNAPPY" + + // FieldConfigCompressionCodecZSTANDARD captures enum value "ZSTANDARD" + FieldConfigCompressionCodecZSTANDARD string = "ZSTANDARD" + + // FieldConfigCompressionCodecLZ4 captures enum value "LZ4" + FieldConfigCompressionCodecLZ4 string = "LZ4" +) + +// prop value enum +func (m *FieldConfig) validateCompressionCodecEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fieldConfigTypeCompressionCodecPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *FieldConfig) validateCompressionCodec(formats strfmt.Registry) error { + if swag.IsZero(m.CompressionCodec) { // not required + return nil + } + + // value enum + if err := m.validateCompressionCodecEnum("compressionCodec", "body", m.CompressionCodec); err != nil { + return err + } + + return nil +} + +var fieldConfigTypeEncodingTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["RAW","DICTIONARY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fieldConfigTypeEncodingTypePropEnum = append(fieldConfigTypeEncodingTypePropEnum, v) + } +} + +const ( + + // FieldConfigEncodingTypeRAW captures enum value "RAW" + FieldConfigEncodingTypeRAW string = "RAW" + + // FieldConfigEncodingTypeDICTIONARY captures enum value "DICTIONARY" + FieldConfigEncodingTypeDICTIONARY string = "DICTIONARY" +) + +// prop value enum +func (m *FieldConfig) validateEncodingTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fieldConfigTypeEncodingTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *FieldConfig) validateEncodingType(formats strfmt.Registry) error { + if swag.IsZero(m.EncodingType) { // not required + return nil + } + + // value enum + if err := m.validateEncodingTypeEnum("encodingType", "body", m.EncodingType); err != nil { + return err + } + + return nil +} + +var fieldConfigTypeIndexTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INVERTED","SORTED","TEXT","FST","H3","JSON","TIMESTAMP","RANGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fieldConfigTypeIndexTypePropEnum = append(fieldConfigTypeIndexTypePropEnum, v) + } +} + +const ( + + // FieldConfigIndexTypeINVERTED captures enum value "INVERTED" + FieldConfigIndexTypeINVERTED string = "INVERTED" + + // FieldConfigIndexTypeSORTED captures enum value "SORTED" + FieldConfigIndexTypeSORTED string = "SORTED" + + // FieldConfigIndexTypeTEXT captures enum value "TEXT" + FieldConfigIndexTypeTEXT string = "TEXT" + + // FieldConfigIndexTypeFST captures enum value "FST" + FieldConfigIndexTypeFST string = "FST" + + // FieldConfigIndexTypeH3 captures enum value "H3" + FieldConfigIndexTypeH3 string = "H3" + + // FieldConfigIndexTypeJSON captures enum value "JSON" + FieldConfigIndexTypeJSON string = "JSON" + + // FieldConfigIndexTypeTIMESTAMP captures enum value "TIMESTAMP" + FieldConfigIndexTypeTIMESTAMP string = "TIMESTAMP" + + // FieldConfigIndexTypeRANGE captures enum value "RANGE" + FieldConfigIndexTypeRANGE string = "RANGE" +) + +// prop value enum +func (m *FieldConfig) validateIndexTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fieldConfigTypeIndexTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *FieldConfig) validateIndexType(formats strfmt.Registry) error { + if swag.IsZero(m.IndexType) { // not required + return nil + } + + // value enum + if err := m.validateIndexTypeEnum("indexType", "body", m.IndexType); err != nil { + return err + } + + return nil +} + +var fieldConfigIndexTypesItemsEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INVERTED","SORTED","TEXT","FST","H3","JSON","TIMESTAMP","RANGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fieldConfigIndexTypesItemsEnum = append(fieldConfigIndexTypesItemsEnum, v) + } +} + +func (m *FieldConfig) validateIndexTypesItemsEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fieldConfigIndexTypesItemsEnum, true); err != nil { + return err + } + return nil +} + +func (m *FieldConfig) validateIndexTypes(formats strfmt.Registry) error { + if swag.IsZero(m.IndexTypes) { // not required + return nil + } + + for i := 0; i < len(m.IndexTypes); i++ { + + // value enum + if err := m.validateIndexTypesItemsEnum("indexTypes"+"."+strconv.Itoa(i), "body", m.IndexTypes[i]); err != nil { + return err + } + + } + + return nil +} + +func (m *FieldConfig) validateName(formats strfmt.Registry) error { + + if err := validate.RequiredString("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *FieldConfig) validateTimestampConfig(formats strfmt.Registry) error { + if swag.IsZero(m.TimestampConfig) { // not required + return nil + } + + if m.TimestampConfig != nil { + if err := m.TimestampConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timestampConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timestampConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this field config based on the context it is used +func (m *FieldConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCompressionCodec(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEncodingType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIndexType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIndexTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProperties(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimestampConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FieldConfig) contextValidateCompressionCodec(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "compressionCodec", "body", string(m.CompressionCodec)); err != nil { + return err + } + + return nil +} + +func (m *FieldConfig) contextValidateEncodingType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "encodingType", "body", string(m.EncodingType)); err != nil { + return err + } + + return nil +} + +func (m *FieldConfig) contextValidateIndexType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "indexType", "body", string(m.IndexType)); err != nil { + return err + } + + return nil +} + +func (m *FieldConfig) contextValidateIndexTypes(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "indexTypes", "body", []string(m.IndexTypes)); err != nil { + return err + } + + return nil +} + +func (m *FieldConfig) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "name", "body", string(m.Name)); err != nil { + return err + } + + return nil +} + +func (m *FieldConfig) contextValidateProperties(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *FieldConfig) contextValidateTimestampConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TimestampConfig != nil { + if err := m.TimestampConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timestampConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timestampConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FieldConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FieldConfig) UnmarshalBinary(b []byte) error { + var res FieldConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/filter_config.go b/src/models/filter_config.go new file mode 100644 index 0000000..193b42b --- /dev/null +++ b/src/models/filter_config.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FilterConfig filter config +// +// swagger:model FilterConfig +type FilterConfig struct { + + // filter function + // Read Only: true + FilterFunction string `json:"filterFunction,omitempty"` +} + +// Validate validates this filter config +func (m *FilterConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this filter config based on the context it is used +func (m *FilterConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFilterFunction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FilterConfig) contextValidateFilterFunction(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "filterFunction", "body", string(m.FilterFunction)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FilterConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilterConfig) UnmarshalBinary(b []byte) error { + var res FilterConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/form_data_body_part.go b/src/models/form_data_body_part.go new file mode 100644 index 0000000..66bf4a8 --- /dev/null +++ b/src/models/form_data_body_part.go @@ -0,0 +1,327 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FormDataBodyPart form data body part +// +// swagger:model FormDataBodyPart +type FormDataBodyPart struct { + + // content disposition + ContentDisposition *ContentDisposition `json:"contentDisposition,omitempty"` + + // entity + Entity interface{} `json:"entity,omitempty"` + + // form data content disposition + FormDataContentDisposition *FormDataContentDisposition `json:"formDataContentDisposition,omitempty"` + + // headers + Headers map[string][]string `json:"headers,omitempty"` + + // media type + MediaType *MediaType `json:"mediaType,omitempty"` + + // message body workers + MessageBodyWorkers MessageBodyWorkers `json:"messageBodyWorkers,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // parameterized headers + ParameterizedHeaders map[string][]ParameterizedHeader `json:"parameterizedHeaders,omitempty"` + + // parent + Parent *MultiPart `json:"parent,omitempty"` + + // providers + Providers Providers `json:"providers,omitempty"` + + // simple + Simple bool `json:"simple,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this form data body part +func (m *FormDataBodyPart) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentDisposition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFormDataContentDisposition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMediaType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParameterizedHeaders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FormDataBodyPart) validateContentDisposition(formats strfmt.Registry) error { + if swag.IsZero(m.ContentDisposition) { // not required + return nil + } + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *FormDataBodyPart) validateFormDataContentDisposition(formats strfmt.Registry) error { + if swag.IsZero(m.FormDataContentDisposition) { // not required + return nil + } + + if m.FormDataContentDisposition != nil { + if err := m.FormDataContentDisposition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("formDataContentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("formDataContentDisposition") + } + return err + } + } + + return nil +} + +func (m *FormDataBodyPart) validateMediaType(formats strfmt.Registry) error { + if swag.IsZero(m.MediaType) { // not required + return nil + } + + if m.MediaType != nil { + if err := m.MediaType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *FormDataBodyPart) validateParameterizedHeaders(formats strfmt.Registry) error { + if swag.IsZero(m.ParameterizedHeaders) { // not required + return nil + } + + for k := range m.ParameterizedHeaders { + + if err := validate.Required("parameterizedHeaders"+"."+k, "body", m.ParameterizedHeaders[k]); err != nil { + return err + } + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *FormDataBodyPart) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this form data body part based on the context it is used +func (m *FormDataBodyPart) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContentDisposition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFormDataContentDisposition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMediaType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParameterizedHeaders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FormDataBodyPart) contextValidateContentDisposition(ctx context.Context, formats strfmt.Registry) error { + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *FormDataBodyPart) contextValidateFormDataContentDisposition(ctx context.Context, formats strfmt.Registry) error { + + if m.FormDataContentDisposition != nil { + if err := m.FormDataContentDisposition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("formDataContentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("formDataContentDisposition") + } + return err + } + } + + return nil +} + +func (m *FormDataBodyPart) contextValidateMediaType(ctx context.Context, formats strfmt.Registry) error { + + if m.MediaType != nil { + if err := m.MediaType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *FormDataBodyPart) contextValidateParameterizedHeaders(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ParameterizedHeaders { + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *FormDataBodyPart) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FormDataBodyPart) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FormDataBodyPart) UnmarshalBinary(b []byte) error { + var res FormDataBodyPart + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/form_data_content_disposition.go b/src/models/form_data_content_disposition.go new file mode 100644 index 0000000..de137c2 --- /dev/null +++ b/src/models/form_data_content_disposition.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FormDataContentDisposition form data content disposition +// +// swagger:model FormDataContentDisposition +type FormDataContentDisposition struct { + + // creation date + // Format: date-time + CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + + // file name + FileName string `json:"fileName,omitempty"` + + // modification date + // Format: date-time + ModificationDate strfmt.DateTime `json:"modificationDate,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // parameters + Parameters map[string]string `json:"parameters,omitempty"` + + // read date + // Format: date-time + ReadDate strfmt.DateTime `json:"readDate,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this form data content disposition +func (m *FormDataContentDisposition) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModificationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReadDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FormDataContentDisposition) validateCreationDate(formats strfmt.Registry) error { + if swag.IsZero(m.CreationDate) { // not required + return nil + } + + if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *FormDataContentDisposition) validateModificationDate(formats strfmt.Registry) error { + if swag.IsZero(m.ModificationDate) { // not required + return nil + } + + if err := validate.FormatOf("modificationDate", "body", "date-time", m.ModificationDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *FormDataContentDisposition) validateReadDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReadDate) { // not required + return nil + } + + if err := validate.FormatOf("readDate", "body", "date-time", m.ReadDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this form data content disposition based on context it is used +func (m *FormDataContentDisposition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FormDataContentDisposition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FormDataContentDisposition) UnmarshalBinary(b []byte) error { + var res FormDataContentDisposition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/form_data_multi_part.go b/src/models/form_data_multi_part.go new file mode 100644 index 0000000..1aeb0ee --- /dev/null +++ b/src/models/form_data_multi_part.go @@ -0,0 +1,391 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FormDataMultiPart form data multi part +// +// swagger:model FormDataMultiPart +type FormDataMultiPart struct { + + // body parts + BodyParts []*BodyPart `json:"bodyParts"` + + // content disposition + ContentDisposition *ContentDisposition `json:"contentDisposition,omitempty"` + + // entity + Entity interface{} `json:"entity,omitempty"` + + // fields + Fields map[string][]FormDataBodyPart `json:"fields,omitempty"` + + // headers + Headers map[string][]string `json:"headers,omitempty"` + + // media type + MediaType *MediaType `json:"mediaType,omitempty"` + + // message body workers + MessageBodyWorkers MessageBodyWorkers `json:"messageBodyWorkers,omitempty"` + + // parameterized headers + ParameterizedHeaders map[string][]ParameterizedHeader `json:"parameterizedHeaders,omitempty"` + + // parent + Parent *MultiPart `json:"parent,omitempty"` + + // providers + Providers Providers `json:"providers,omitempty"` +} + +// Validate validates this form data multi part +func (m *FormDataMultiPart) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBodyParts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentDisposition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMediaType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParameterizedHeaders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FormDataMultiPart) validateBodyParts(formats strfmt.Registry) error { + if swag.IsZero(m.BodyParts) { // not required + return nil + } + + for i := 0; i < len(m.BodyParts); i++ { + if swag.IsZero(m.BodyParts[i]) { // not required + continue + } + + if m.BodyParts[i] != nil { + if err := m.BodyParts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FormDataMultiPart) validateContentDisposition(formats strfmt.Registry) error { + if swag.IsZero(m.ContentDisposition) { // not required + return nil + } + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *FormDataMultiPart) validateFields(formats strfmt.Registry) error { + if swag.IsZero(m.Fields) { // not required + return nil + } + + for k := range m.Fields { + + if err := validate.Required("fields"+"."+k, "body", m.Fields[k]); err != nil { + return err + } + + for i := 0; i < len(m.Fields[k]); i++ { + + if err := m.Fields[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fields" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fields" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *FormDataMultiPart) validateMediaType(formats strfmt.Registry) error { + if swag.IsZero(m.MediaType) { // not required + return nil + } + + if m.MediaType != nil { + if err := m.MediaType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *FormDataMultiPart) validateParameterizedHeaders(formats strfmt.Registry) error { + if swag.IsZero(m.ParameterizedHeaders) { // not required + return nil + } + + for k := range m.ParameterizedHeaders { + + if err := validate.Required("parameterizedHeaders"+"."+k, "body", m.ParameterizedHeaders[k]); err != nil { + return err + } + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *FormDataMultiPart) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this form data multi part based on the context it is used +func (m *FormDataMultiPart) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBodyParts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentDisposition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFields(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMediaType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParameterizedHeaders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FormDataMultiPart) contextValidateBodyParts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BodyParts); i++ { + + if m.BodyParts[i] != nil { + if err := m.BodyParts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FormDataMultiPart) contextValidateContentDisposition(ctx context.Context, formats strfmt.Registry) error { + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *FormDataMultiPart) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Fields { + + for i := 0; i < len(m.Fields[k]); i++ { + + if err := m.Fields[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fields" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fields" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *FormDataMultiPart) contextValidateMediaType(ctx context.Context, formats strfmt.Registry) error { + + if m.MediaType != nil { + if err := m.MediaType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *FormDataMultiPart) contextValidateParameterizedHeaders(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ParameterizedHeaders { + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *FormDataMultiPart) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FormDataMultiPart) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FormDataMultiPart) UnmarshalBinary(b []byte) error { + var res FormDataMultiPart + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/indexing_config.go b/src/models/indexing_config.go new file mode 100644 index 0000000..f4de4d6 --- /dev/null +++ b/src/models/indexing_config.go @@ -0,0 +1,390 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IndexingConfig indexing config +// +// swagger:model IndexingConfig +type IndexingConfig struct { + + // aggregate metrics + AggregateMetrics bool `json:"aggregateMetrics,omitempty"` + + // auto generated inverted index + AutoGeneratedInvertedIndex bool `json:"autoGeneratedInvertedIndex,omitempty"` + + // bloom filter columns + BloomFilterColumns []string `json:"bloomFilterColumns"` + + // bloom filter configs + BloomFilterConfigs map[string]BloomFilterConfig `json:"bloomFilterConfigs,omitempty"` + + // column min max value generator mode + ColumnMinMaxValueGeneratorMode string `json:"columnMinMaxValueGeneratorMode,omitempty"` + + // create inverted index during segment generation + CreateInvertedIndexDuringSegmentGeneration bool `json:"createInvertedIndexDuringSegmentGeneration,omitempty"` + + // enable default star tree + EnableDefaultStarTree bool `json:"enableDefaultStarTree,omitempty"` + + // enable dynamic star tree creation + EnableDynamicStarTreeCreation bool `json:"enableDynamicStarTreeCreation,omitempty"` + + // fstindex type + // Enum: [LUCENE NATIVE] + FstindexType string `json:"fstindexType,omitempty"` + + // inverted index columns + InvertedIndexColumns []string `json:"invertedIndexColumns"` + + // json index columns + JSONIndexColumns []string `json:"jsonIndexColumns"` + + // json index configs + JSONIndexConfigs map[string]JSONIndexConfig `json:"jsonIndexConfigs,omitempty"` + + // load mode + LoadMode string `json:"loadMode,omitempty"` + + // no dictionary columns + NoDictionaryColumns []string `json:"noDictionaryColumns"` + + // no dictionary config + NoDictionaryConfig map[string]string `json:"noDictionaryConfig,omitempty"` + + // no dictionary size ratio threshold + NoDictionarySizeRatioThreshold float64 `json:"noDictionarySizeRatioThreshold,omitempty"` + + // null handling enabled + NullHandlingEnabled bool `json:"nullHandlingEnabled,omitempty"` + + // on heap dictionary columns + OnHeapDictionaryColumns []string `json:"onHeapDictionaryColumns"` + + // optimize dictionary + OptimizeDictionary bool `json:"optimizeDictionary,omitempty"` + + // optimize dictionary for metrics + OptimizeDictionaryForMetrics bool `json:"optimizeDictionaryForMetrics,omitempty"` + + // range index columns + RangeIndexColumns []string `json:"rangeIndexColumns"` + + // range index version + RangeIndexVersion int32 `json:"rangeIndexVersion,omitempty"` + + // segment format version + SegmentFormatVersion string `json:"segmentFormatVersion,omitempty"` + + // segment name generator type + SegmentNameGeneratorType string `json:"segmentNameGeneratorType,omitempty"` + + // segment partition config + SegmentPartitionConfig *SegmentPartitionConfig `json:"segmentPartitionConfig,omitempty"` + + // sorted column + SortedColumn []string `json:"sortedColumn"` + + // star tree index configs + StarTreeIndexConfigs []*StarTreeIndexConfig `json:"starTreeIndexConfigs"` + + // stream configs + StreamConfigs map[string]string `json:"streamConfigs,omitempty"` + + // var length dictionary columns + VarLengthDictionaryColumns []string `json:"varLengthDictionaryColumns"` +} + +// Validate validates this indexing config +func (m *IndexingConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBloomFilterConfigs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFstindexType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJSONIndexConfigs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSegmentPartitionConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStarTreeIndexConfigs(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IndexingConfig) validateBloomFilterConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.BloomFilterConfigs) { // not required + return nil + } + + for k := range m.BloomFilterConfigs { + + if err := validate.Required("bloomFilterConfigs"+"."+k, "body", m.BloomFilterConfigs[k]); err != nil { + return err + } + if val, ok := m.BloomFilterConfigs[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bloomFilterConfigs" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bloomFilterConfigs" + "." + k) + } + return err + } + } + + } + + return nil +} + +var indexingConfigTypeFstindexTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["LUCENE","NATIVE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + indexingConfigTypeFstindexTypePropEnum = append(indexingConfigTypeFstindexTypePropEnum, v) + } +} + +const ( + + // IndexingConfigFstindexTypeLUCENE captures enum value "LUCENE" + IndexingConfigFstindexTypeLUCENE string = "LUCENE" + + // IndexingConfigFstindexTypeNATIVE captures enum value "NATIVE" + IndexingConfigFstindexTypeNATIVE string = "NATIVE" +) + +// prop value enum +func (m *IndexingConfig) validateFstindexTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, indexingConfigTypeFstindexTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *IndexingConfig) validateFstindexType(formats strfmt.Registry) error { + if swag.IsZero(m.FstindexType) { // not required + return nil + } + + // value enum + if err := m.validateFstindexTypeEnum("fstindexType", "body", m.FstindexType); err != nil { + return err + } + + return nil +} + +func (m *IndexingConfig) validateJSONIndexConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.JSONIndexConfigs) { // not required + return nil + } + + for k := range m.JSONIndexConfigs { + + if err := validate.Required("jsonIndexConfigs"+"."+k, "body", m.JSONIndexConfigs[k]); err != nil { + return err + } + if val, ok := m.JSONIndexConfigs[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jsonIndexConfigs" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jsonIndexConfigs" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *IndexingConfig) validateSegmentPartitionConfig(formats strfmt.Registry) error { + if swag.IsZero(m.SegmentPartitionConfig) { // not required + return nil + } + + if m.SegmentPartitionConfig != nil { + if err := m.SegmentPartitionConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("segmentPartitionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("segmentPartitionConfig") + } + return err + } + } + + return nil +} + +func (m *IndexingConfig) validateStarTreeIndexConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.StarTreeIndexConfigs) { // not required + return nil + } + + for i := 0; i < len(m.StarTreeIndexConfigs); i++ { + if swag.IsZero(m.StarTreeIndexConfigs[i]) { // not required + continue + } + + if m.StarTreeIndexConfigs[i] != nil { + if err := m.StarTreeIndexConfigs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("starTreeIndexConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("starTreeIndexConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this indexing config based on the context it is used +func (m *IndexingConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBloomFilterConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateJSONIndexConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentPartitionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStarTreeIndexConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IndexingConfig) contextValidateBloomFilterConfigs(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.BloomFilterConfigs { + + if val, ok := m.BloomFilterConfigs[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *IndexingConfig) contextValidateJSONIndexConfigs(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.JSONIndexConfigs { + + if val, ok := m.JSONIndexConfigs[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *IndexingConfig) contextValidateSegmentPartitionConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SegmentPartitionConfig != nil { + if err := m.SegmentPartitionConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("segmentPartitionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("segmentPartitionConfig") + } + return err + } + } + + return nil +} + +func (m *IndexingConfig) contextValidateStarTreeIndexConfigs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StarTreeIndexConfigs); i++ { + + if m.StarTreeIndexConfigs[i] != nil { + if err := m.StarTreeIndexConfigs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("starTreeIndexConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("starTreeIndexConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IndexingConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IndexingConfig) UnmarshalBinary(b []byte) error { + var res IndexingConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/ingestion_config.go b/src/models/ingestion_config.go new file mode 100644 index 0000000..efd834e --- /dev/null +++ b/src/models/ingestion_config.go @@ -0,0 +1,366 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IngestionConfig ingestion config +// +// swagger:model IngestionConfig +type IngestionConfig struct { + + // aggregation configs + AggregationConfigs []*AggregationConfig `json:"aggregationConfigs"` + + // batch ingestion config + BatchIngestionConfig *BatchIngestionConfig `json:"batchIngestionConfig,omitempty"` + + // complex type config + ComplexTypeConfig *ComplexTypeConfig `json:"complexTypeConfig,omitempty"` + + // continue on error + ContinueOnError bool `json:"continueOnError,omitempty"` + + // filter config + FilterConfig *FilterConfig `json:"filterConfig,omitempty"` + + // row time value check + RowTimeValueCheck bool `json:"rowTimeValueCheck,omitempty"` + + // segment time value check + SegmentTimeValueCheck bool `json:"segmentTimeValueCheck,omitempty"` + + // stream ingestion config + StreamIngestionConfig *StreamIngestionConfig `json:"streamIngestionConfig,omitempty"` + + // transform configs + TransformConfigs []*TransformConfig `json:"transformConfigs"` +} + +// Validate validates this ingestion config +func (m *IngestionConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAggregationConfigs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBatchIngestionConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateComplexTypeConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilterConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStreamIngestionConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransformConfigs(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestionConfig) validateAggregationConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.AggregationConfigs) { // not required + return nil + } + + for i := 0; i < len(m.AggregationConfigs); i++ { + if swag.IsZero(m.AggregationConfigs[i]) { // not required + continue + } + + if m.AggregationConfigs[i] != nil { + if err := m.AggregationConfigs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("aggregationConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("aggregationConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *IngestionConfig) validateBatchIngestionConfig(formats strfmt.Registry) error { + if swag.IsZero(m.BatchIngestionConfig) { // not required + return nil + } + + if m.BatchIngestionConfig != nil { + if err := m.BatchIngestionConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("batchIngestionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("batchIngestionConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) validateComplexTypeConfig(formats strfmt.Registry) error { + if swag.IsZero(m.ComplexTypeConfig) { // not required + return nil + } + + if m.ComplexTypeConfig != nil { + if err := m.ComplexTypeConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("complexTypeConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("complexTypeConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) validateFilterConfig(formats strfmt.Registry) error { + if swag.IsZero(m.FilterConfig) { // not required + return nil + } + + if m.FilterConfig != nil { + if err := m.FilterConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filterConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("filterConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) validateStreamIngestionConfig(formats strfmt.Registry) error { + if swag.IsZero(m.StreamIngestionConfig) { // not required + return nil + } + + if m.StreamIngestionConfig != nil { + if err := m.StreamIngestionConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("streamIngestionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("streamIngestionConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) validateTransformConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.TransformConfigs) { // not required + return nil + } + + for i := 0; i < len(m.TransformConfigs); i++ { + if swag.IsZero(m.TransformConfigs[i]) { // not required + continue + } + + if m.TransformConfigs[i] != nil { + if err := m.TransformConfigs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transformConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transformConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this ingestion config based on the context it is used +func (m *IngestionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAggregationConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBatchIngestionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateComplexTypeConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFilterConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStreamIngestionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestionConfig) contextValidateAggregationConfigs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AggregationConfigs); i++ { + + if m.AggregationConfigs[i] != nil { + if err := m.AggregationConfigs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("aggregationConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("aggregationConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *IngestionConfig) contextValidateBatchIngestionConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.BatchIngestionConfig != nil { + if err := m.BatchIngestionConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("batchIngestionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("batchIngestionConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) contextValidateComplexTypeConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.ComplexTypeConfig != nil { + if err := m.ComplexTypeConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("complexTypeConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("complexTypeConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) contextValidateFilterConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.FilterConfig != nil { + if err := m.FilterConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filterConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("filterConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) contextValidateStreamIngestionConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.StreamIngestionConfig != nil { + if err := m.StreamIngestionConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("streamIngestionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("streamIngestionConfig") + } + return err + } + } + + return nil +} + +func (m *IngestionConfig) contextValidateTransformConfigs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransformConfigs); i++ { + + if m.TransformConfigs[i] != nil { + if err := m.TransformConfigs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transformConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transformConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IngestionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IngestionConfig) UnmarshalBinary(b []byte) error { + var res IngestionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance.go b/src/models/instance.go new file mode 100644 index 0000000..e1c45e4 --- /dev/null +++ b/src/models/instance.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Instance instance +// +// swagger:model Instance +type Instance struct { + + // admin port + // Read Only: true + AdminPort int32 `json:"adminPort,omitempty"` + + // grpc port + // Read Only: true + GrpcPort int32 `json:"grpcPort,omitempty"` + + // host + // Required: true + // Read Only: true + Host string `json:"host"` + + // pools + // Read Only: true + Pools map[string]int32 `json:"pools,omitempty"` + + // port + // Required: true + // Read Only: true + Port int32 `json:"port"` + + // queries disabled + // Read Only: true + QueriesDisabled *bool `json:"queriesDisabled,omitempty"` + + // query mailbox port + // Read Only: true + QueryMailboxPort int32 `json:"queryMailboxPort,omitempty"` + + // query service port + // Read Only: true + QueryServicePort int32 `json:"queryServicePort,omitempty"` + + // tags + // Read Only: true + Tags []string `json:"tags"` + + // type + // Required: true + // Read Only: true + // Enum: [CONTROLLER BROKER SERVER MINION] + Type string `json:"type"` +} + +// Validate validates this instance +func (m *Instance) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHost(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Instance) validateHost(formats strfmt.Registry) error { + + if err := validate.RequiredString("host", "body", m.Host); err != nil { + return err + } + + return nil +} + +func (m *Instance) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", int32(m.Port)); err != nil { + return err + } + + return nil +} + +var instanceTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CONTROLLER","BROKER","SERVER","MINION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceTypeTypePropEnum = append(instanceTypeTypePropEnum, v) + } +} + +const ( + + // InstanceTypeCONTROLLER captures enum value "CONTROLLER" + InstanceTypeCONTROLLER string = "CONTROLLER" + + // InstanceTypeBROKER captures enum value "BROKER" + InstanceTypeBROKER string = "BROKER" + + // InstanceTypeSERVER captures enum value "SERVER" + InstanceTypeSERVER string = "SERVER" + + // InstanceTypeMINION captures enum value "MINION" + InstanceTypeMINION string = "MINION" +) + +// prop value enum +func (m *Instance) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, instanceTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Instance) validateType(formats strfmt.Registry) error { + + if err := validate.RequiredString("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this instance based on the context it is used +func (m *Instance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdminPort(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrpcPort(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHost(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePools(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePort(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateQueriesDisabled(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateQueryMailboxPort(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateQueryServicePort(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Instance) contextValidateAdminPort(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "adminPort", "body", int32(m.AdminPort)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateGrpcPort(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "grpcPort", "body", int32(m.GrpcPort)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "host", "body", string(m.Host)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidatePools(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *Instance) contextValidatePort(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "port", "body", int32(m.Port)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateQueriesDisabled(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "queriesDisabled", "body", m.QueriesDisabled); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateQueryMailboxPort(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "queryMailboxPort", "body", int32(m.QueryMailboxPort)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateQueryServicePort(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "queryServicePort", "body", int32(m.QueryServicePort)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tags", "body", []string(m.Tags)); err != nil { + return err + } + + return nil +} + +func (m *Instance) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "type", "body", string(m.Type)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Instance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Instance) UnmarshalBinary(b []byte) error { + var res Instance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance_assignment_config.go b/src/models/instance_assignment_config.go new file mode 100644 index 0000000..c515c70 --- /dev/null +++ b/src/models/instance_assignment_config.go @@ -0,0 +1,269 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceAssignmentConfig instance assignment config +// +// swagger:model InstanceAssignmentConfig +type InstanceAssignmentConfig struct { + + // constraint config + // Read Only: true + ConstraintConfig *InstanceConstraintConfig `json:"constraintConfig,omitempty"` + + // partition selector + // Read Only: true + // Enum: [FD_AWARE_INSTANCE_PARTITION_SELECTOR INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR] + PartitionSelector string `json:"partitionSelector,omitempty"` + + // replica group partition config + // Required: true + // Read Only: true + ReplicaGroupPartitionConfig *InstanceReplicaGroupPartitionConfig `json:"replicaGroupPartitionConfig"` + + // tag pool config + // Required: true + // Read Only: true + TagPoolConfig *InstanceTagPoolConfig `json:"tagPoolConfig"` +} + +// Validate validates this instance assignment config +func (m *InstanceAssignmentConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConstraintConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePartitionSelector(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaGroupPartitionConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTagPoolConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceAssignmentConfig) validateConstraintConfig(formats strfmt.Registry) error { + if swag.IsZero(m.ConstraintConfig) { // not required + return nil + } + + if m.ConstraintConfig != nil { + if err := m.ConstraintConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraintConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("constraintConfig") + } + return err + } + } + + return nil +} + +var instanceAssignmentConfigTypePartitionSelectorPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FD_AWARE_INSTANCE_PARTITION_SELECTOR","INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceAssignmentConfigTypePartitionSelectorPropEnum = append(instanceAssignmentConfigTypePartitionSelectorPropEnum, v) + } +} + +const ( + + // InstanceAssignmentConfigPartitionSelectorFDAWAREINSTANCEPARTITIONSELECTOR captures enum value "FD_AWARE_INSTANCE_PARTITION_SELECTOR" + InstanceAssignmentConfigPartitionSelectorFDAWAREINSTANCEPARTITIONSELECTOR string = "FD_AWARE_INSTANCE_PARTITION_SELECTOR" + + // InstanceAssignmentConfigPartitionSelectorINSTANCEREPLICAGROUPPARTITIONSELECTOR captures enum value "INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR" + InstanceAssignmentConfigPartitionSelectorINSTANCEREPLICAGROUPPARTITIONSELECTOR string = "INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR" +) + +// prop value enum +func (m *InstanceAssignmentConfig) validatePartitionSelectorEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, instanceAssignmentConfigTypePartitionSelectorPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InstanceAssignmentConfig) validatePartitionSelector(formats strfmt.Registry) error { + if swag.IsZero(m.PartitionSelector) { // not required + return nil + } + + // value enum + if err := m.validatePartitionSelectorEnum("partitionSelector", "body", m.PartitionSelector); err != nil { + return err + } + + return nil +} + +func (m *InstanceAssignmentConfig) validateReplicaGroupPartitionConfig(formats strfmt.Registry) error { + + if err := validate.Required("replicaGroupPartitionConfig", "body", m.ReplicaGroupPartitionConfig); err != nil { + return err + } + + if m.ReplicaGroupPartitionConfig != nil { + if err := m.ReplicaGroupPartitionConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaGroupPartitionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaGroupPartitionConfig") + } + return err + } + } + + return nil +} + +func (m *InstanceAssignmentConfig) validateTagPoolConfig(formats strfmt.Registry) error { + + if err := validate.Required("tagPoolConfig", "body", m.TagPoolConfig); err != nil { + return err + } + + if m.TagPoolConfig != nil { + if err := m.TagPoolConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagPoolConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tagPoolConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this instance assignment config based on the context it is used +func (m *InstanceAssignmentConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConstraintConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePartitionSelector(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplicaGroupPartitionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagPoolConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceAssignmentConfig) contextValidateConstraintConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.ConstraintConfig != nil { + if err := m.ConstraintConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("constraintConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("constraintConfig") + } + return err + } + } + + return nil +} + +func (m *InstanceAssignmentConfig) contextValidatePartitionSelector(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "partitionSelector", "body", string(m.PartitionSelector)); err != nil { + return err + } + + return nil +} + +func (m *InstanceAssignmentConfig) contextValidateReplicaGroupPartitionConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.ReplicaGroupPartitionConfig != nil { + if err := m.ReplicaGroupPartitionConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaGroupPartitionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaGroupPartitionConfig") + } + return err + } + } + + return nil +} + +func (m *InstanceAssignmentConfig) contextValidateTagPoolConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TagPoolConfig != nil { + if err := m.TagPoolConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagPoolConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tagPoolConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceAssignmentConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceAssignmentConfig) UnmarshalBinary(b []byte) error { + var res InstanceAssignmentConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance_constraint_config.go b/src/models/instance_constraint_config.go new file mode 100644 index 0000000..38ab53c --- /dev/null +++ b/src/models/instance_constraint_config.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceConstraintConfig instance constraint config +// +// swagger:model InstanceConstraintConfig +type InstanceConstraintConfig struct { + + // constraints + // Required: true + // Read Only: true + Constraints []string `json:"constraints"` +} + +// Validate validates this instance constraint config +func (m *InstanceConstraintConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConstraints(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceConstraintConfig) validateConstraints(formats strfmt.Registry) error { + + if err := validate.Required("constraints", "body", m.Constraints); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this instance constraint config based on the context it is used +func (m *InstanceConstraintConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConstraints(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceConstraintConfig) contextValidateConstraints(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "constraints", "body", []string(m.Constraints)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceConstraintConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceConstraintConfig) UnmarshalBinary(b []byte) error { + var res InstanceConstraintConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance_info.go b/src/models/instance_info.go new file mode 100644 index 0000000..6c4a087 --- /dev/null +++ b/src/models/instance_info.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InstanceInfo instance info +// +// swagger:model InstanceInfo +type InstanceInfo struct { + + // host + Host string `json:"host,omitempty"` + + // instance name + InstanceName string `json:"instanceName,omitempty"` + + // port + Port int32 `json:"port,omitempty"` +} + +// Validate validates this instance info +func (m *InstanceInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this instance info based on context it is used +func (m *InstanceInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceInfo) UnmarshalBinary(b []byte) error { + var res InstanceInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance_partitions.go b/src/models/instance_partitions.go new file mode 100644 index 0000000..3d3f6fa --- /dev/null +++ b/src/models/instance_partitions.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstancePartitions instance partitions +// +// swagger:model InstancePartitions +type InstancePartitions struct { + + // instance partitions name + // Read Only: true + InstancePartitionsName string `json:"instancePartitionsName,omitempty"` + + // partition to instances map + // Read Only: true + PartitionToInstancesMap map[string][]string `json:"partitionToInstancesMap,omitempty"` +} + +// Validate validates this instance partitions +func (m *InstancePartitions) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this instance partitions based on the context it is used +func (m *InstancePartitions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInstancePartitionsName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePartitionToInstancesMap(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstancePartitions) contextValidateInstancePartitionsName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "instancePartitionsName", "body", string(m.InstancePartitionsName)); err != nil { + return err + } + + return nil +} + +func (m *InstancePartitions) contextValidatePartitionToInstancesMap(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *InstancePartitions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstancePartitions) UnmarshalBinary(b []byte) error { + var res InstancePartitions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance_replica_group_partition_config.go b/src/models/instance_replica_group_partition_config.go new file mode 100644 index 0000000..5e462fe --- /dev/null +++ b/src/models/instance_replica_group_partition_config.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceReplicaGroupPartitionConfig instance replica group partition config +// +// swagger:model InstanceReplicaGroupPartitionConfig +type InstanceReplicaGroupPartitionConfig struct { + + // minimize data movement + // Read Only: true + MinimizeDataMovement *bool `json:"minimizeDataMovement,omitempty"` + + // num instances + // Read Only: true + NumInstances int32 `json:"numInstances,omitempty"` + + // num instances per partition + // Read Only: true + NumInstancesPerPartition int32 `json:"numInstancesPerPartition,omitempty"` + + // num instances per replica group + // Read Only: true + NumInstancesPerReplicaGroup int32 `json:"numInstancesPerReplicaGroup,omitempty"` + + // num partitions + // Read Only: true + NumPartitions int32 `json:"numPartitions,omitempty"` + + // num replica groups + // Read Only: true + NumReplicaGroups int32 `json:"numReplicaGroups,omitempty"` + + // replica group based + // Read Only: true + ReplicaGroupBased *bool `json:"replicaGroupBased,omitempty"` +} + +// Validate validates this instance replica group partition config +func (m *InstanceReplicaGroupPartitionConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this instance replica group partition config based on the context it is used +func (m *InstanceReplicaGroupPartitionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMinimizeDataMovement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumInstancesPerPartition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumInstancesPerReplicaGroup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumPartitions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNumReplicaGroups(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplicaGroupBased(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateMinimizeDataMovement(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "minimizeDataMovement", "body", m.MinimizeDataMovement); err != nil { + return err + } + + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateNumInstances(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numInstances", "body", int32(m.NumInstances)); err != nil { + return err + } + + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateNumInstancesPerPartition(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numInstancesPerPartition", "body", int32(m.NumInstancesPerPartition)); err != nil { + return err + } + + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateNumInstancesPerReplicaGroup(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numInstancesPerReplicaGroup", "body", int32(m.NumInstancesPerReplicaGroup)); err != nil { + return err + } + + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateNumPartitions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numPartitions", "body", int32(m.NumPartitions)); err != nil { + return err + } + + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateNumReplicaGroups(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numReplicaGroups", "body", int32(m.NumReplicaGroups)); err != nil { + return err + } + + return nil +} + +func (m *InstanceReplicaGroupPartitionConfig) contextValidateReplicaGroupBased(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "replicaGroupBased", "body", m.ReplicaGroupBased); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceReplicaGroupPartitionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceReplicaGroupPartitionConfig) UnmarshalBinary(b []byte) error { + var res InstanceReplicaGroupPartitionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instance_tag_pool_config.go b/src/models/instance_tag_pool_config.go new file mode 100644 index 0000000..582b0a9 --- /dev/null +++ b/src/models/instance_tag_pool_config.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceTagPoolConfig instance tag pool config +// +// swagger:model InstanceTagPoolConfig +type InstanceTagPoolConfig struct { + + // num pools + // Read Only: true + NumPools int32 `json:"numPools,omitempty"` + + // pool based + // Read Only: true + PoolBased *bool `json:"poolBased,omitempty"` + + // pools + // Read Only: true + Pools []int32 `json:"pools"` + + // tag + // Required: true + // Read Only: true + Tag string `json:"tag"` +} + +// Validate validates this instance tag pool config +func (m *InstanceTagPoolConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTag(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceTagPoolConfig) validateTag(formats strfmt.Registry) error { + + if err := validate.RequiredString("tag", "body", m.Tag); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this instance tag pool config based on the context it is used +func (m *InstanceTagPoolConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNumPools(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePoolBased(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePools(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceTagPoolConfig) contextValidateNumPools(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numPools", "body", int32(m.NumPools)); err != nil { + return err + } + + return nil +} + +func (m *InstanceTagPoolConfig) contextValidatePoolBased(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "poolBased", "body", m.PoolBased); err != nil { + return err + } + + return nil +} + +func (m *InstanceTagPoolConfig) contextValidatePools(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "pools", "body", []int32(m.Pools)); err != nil { + return err + } + + return nil +} + +func (m *InstanceTagPoolConfig) contextValidateTag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tag", "body", string(m.Tag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceTagPoolConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceTagPoolConfig) UnmarshalBinary(b []byte) error { + var res InstanceTagPoolConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/instances.go b/src/models/instances.go new file mode 100644 index 0000000..8e7221f --- /dev/null +++ b/src/models/instances.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Instances instances +// +// swagger:model Instances +type Instances struct { + + // instances + // Read Only: true + Instances []string `json:"instances"` +} + +// Validate validates this instances +func (m *Instances) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this instances based on the context it is used +func (m *Instances) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Instances) contextValidateInstances(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "instances", "body", []string(m.Instances)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Instances) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Instances) UnmarshalBinary(b []byte) error { + var res Instances + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/job_key.go b/src/models/job_key.go new file mode 100644 index 0000000..1c0ca25 --- /dev/null +++ b/src/models/job_key.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JobKey job key +// +// swagger:model JobKey +type JobKey struct { + + // group + Group string `json:"group,omitempty"` + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this job key +func (m *JobKey) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this job key based on context it is used +func (m *JobKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JobKey) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobKey) UnmarshalBinary(b []byte) error { + var res JobKey + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/json_index_config.go b/src/models/json_index_config.go new file mode 100644 index 0000000..851a659 --- /dev/null +++ b/src/models/json_index_config.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// JSONIndexConfig Json index config +// +// swagger:model JsonIndexConfig +type JSONIndexConfig struct { + + // disable cross array unnest + DisableCrossArrayUnnest bool `json:"disableCrossArrayUnnest,omitempty"` + + // exclude array + ExcludeArray bool `json:"excludeArray,omitempty"` + + // exclude fields + // Unique: true + ExcludeFields []string `json:"excludeFields"` + + // exclude paths + // Unique: true + ExcludePaths []string `json:"excludePaths"` + + // include paths + // Unique: true + IncludePaths []string `json:"includePaths"` + + // max levels + MaxLevels int32 `json:"maxLevels,omitempty"` +} + +// Validate validates this Json index config +func (m *JSONIndexConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExcludeFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcludePaths(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIncludePaths(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JSONIndexConfig) validateExcludeFields(formats strfmt.Registry) error { + if swag.IsZero(m.ExcludeFields) { // not required + return nil + } + + if err := validate.UniqueItems("excludeFields", "body", m.ExcludeFields); err != nil { + return err + } + + return nil +} + +func (m *JSONIndexConfig) validateExcludePaths(formats strfmt.Registry) error { + if swag.IsZero(m.ExcludePaths) { // not required + return nil + } + + if err := validate.UniqueItems("excludePaths", "body", m.ExcludePaths); err != nil { + return err + } + + return nil +} + +func (m *JSONIndexConfig) validateIncludePaths(formats strfmt.Registry) error { + if swag.IsZero(m.IncludePaths) { // not required + return nil + } + + if err := validate.UniqueItems("includePaths", "body", m.IncludePaths); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this Json index config based on context it is used +func (m *JSONIndexConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JSONIndexConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JSONIndexConfig) UnmarshalBinary(b []byte) error { + var res JSONIndexConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/json_node.go b/src/models/json_node.go new file mode 100644 index 0000000..dce5804 --- /dev/null +++ b/src/models/json_node.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// JSONNode Json node +// +// swagger:model JsonNode +type JSONNode interface{} diff --git a/src/models/lead_controller_entry.go b/src/models/lead_controller_entry.go new file mode 100644 index 0000000..f38ae41 --- /dev/null +++ b/src/models/lead_controller_entry.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LeadControllerEntry lead controller entry +// +// swagger:model LeadControllerEntry +type LeadControllerEntry struct { + + // lead controller Id + // Read Only: true + LeadControllerID string `json:"leadControllerId,omitempty"` + + // table names + // Read Only: true + TableNames []string `json:"tableNames"` +} + +// Validate validates this lead controller entry +func (m *LeadControllerEntry) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this lead controller entry based on the context it is used +func (m *LeadControllerEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLeadControllerID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTableNames(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadControllerEntry) contextValidateLeadControllerID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "leadControllerId", "body", string(m.LeadControllerID)); err != nil { + return err + } + + return nil +} + +func (m *LeadControllerEntry) contextValidateTableNames(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tableNames", "body", []string(m.TableNames)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LeadControllerEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LeadControllerEntry) UnmarshalBinary(b []byte) error { + var res LeadControllerEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/lead_controller_response.go b/src/models/lead_controller_response.go new file mode 100644 index 0000000..4d7c88a --- /dev/null +++ b/src/models/lead_controller_response.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LeadControllerResponse lead controller response +// +// swagger:model LeadControllerResponse +type LeadControllerResponse struct { + + // lead controller entry map + LeadControllerEntryMap map[string]LeadControllerEntry `json:"leadControllerEntryMap,omitempty"` + + // lead controller resource enabled + LeadControllerResourceEnabled bool `json:"leadControllerResourceEnabled,omitempty"` +} + +// Validate validates this lead controller response +func (m *LeadControllerResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLeadControllerEntryMap(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadControllerResponse) validateLeadControllerEntryMap(formats strfmt.Registry) error { + if swag.IsZero(m.LeadControllerEntryMap) { // not required + return nil + } + + for k := range m.LeadControllerEntryMap { + + if err := validate.Required("leadControllerEntryMap"+"."+k, "body", m.LeadControllerEntryMap[k]); err != nil { + return err + } + if val, ok := m.LeadControllerEntryMap[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("leadControllerEntryMap" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leadControllerEntryMap" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this lead controller response based on the context it is used +func (m *LeadControllerResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLeadControllerEntryMap(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadControllerResponse) contextValidateLeadControllerEntryMap(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.LeadControllerEntryMap { + + if val, ok := m.LeadControllerEntryMap[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LeadControllerResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LeadControllerResponse) UnmarshalBinary(b []byte) error { + var res LeadControllerResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/media_type.go b/src/models/media_type.go new file mode 100644 index 0000000..2a19209 --- /dev/null +++ b/src/models/media_type.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MediaType media type +// +// swagger:model MediaType +type MediaType struct { + + // parameters + Parameters map[string]string `json:"parameters,omitempty"` + + // subtype + Subtype string `json:"subtype,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // wildcard subtype + WildcardSubtype bool `json:"wildcardSubtype,omitempty"` + + // wildcard type + WildcardType bool `json:"wildcardType,omitempty"` +} + +// Validate validates this media type +func (m *MediaType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this media type based on context it is used +func (m *MediaType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MediaType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MediaType) UnmarshalBinary(b []byte) error { + var res MediaType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/message_body_workers.go b/src/models/message_body_workers.go new file mode 100644 index 0000000..f8c1188 --- /dev/null +++ b/src/models/message_body_workers.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// MessageBodyWorkers message body workers +// +// swagger:model MessageBodyWorkers +type MessageBodyWorkers interface{} diff --git a/src/models/metric_field_spec.go b/src/models/metric_field_spec.go new file mode 100644 index 0000000..92406a6 --- /dev/null +++ b/src/models/metric_field_spec.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MetricFieldSpec metric field spec +// +// swagger:model MetricFieldSpec +type MetricFieldSpec struct { + + // data type + // Enum: [INT LONG FLOAT DOUBLE BIG_DECIMAL BOOLEAN TIMESTAMP STRING JSON BYTES STRUCT MAP LIST] + DataType string `json:"dataType,omitempty"` + + // default null value + DefaultNullValue interface{} `json:"defaultNullValue,omitempty"` + + // default null value string + DefaultNullValueString string `json:"defaultNullValueString,omitempty"` + + // max length + MaxLength int32 `json:"maxLength,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // single value field + SingleValueField bool `json:"singleValueField,omitempty"` + + // transform function + TransformFunction string `json:"transformFunction,omitempty"` + + // virtual column provider + VirtualColumnProvider string `json:"virtualColumnProvider,omitempty"` +} + +// Validate validates this metric field spec +func (m *MetricFieldSpec) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDataType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var metricFieldSpecTypeDataTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + metricFieldSpecTypeDataTypePropEnum = append(metricFieldSpecTypeDataTypePropEnum, v) + } +} + +const ( + + // MetricFieldSpecDataTypeINT captures enum value "INT" + MetricFieldSpecDataTypeINT string = "INT" + + // MetricFieldSpecDataTypeLONG captures enum value "LONG" + MetricFieldSpecDataTypeLONG string = "LONG" + + // MetricFieldSpecDataTypeFLOAT captures enum value "FLOAT" + MetricFieldSpecDataTypeFLOAT string = "FLOAT" + + // MetricFieldSpecDataTypeDOUBLE captures enum value "DOUBLE" + MetricFieldSpecDataTypeDOUBLE string = "DOUBLE" + + // MetricFieldSpecDataTypeBIGDECIMAL captures enum value "BIG_DECIMAL" + MetricFieldSpecDataTypeBIGDECIMAL string = "BIG_DECIMAL" + + // MetricFieldSpecDataTypeBOOLEAN captures enum value "BOOLEAN" + MetricFieldSpecDataTypeBOOLEAN string = "BOOLEAN" + + // MetricFieldSpecDataTypeTIMESTAMP captures enum value "TIMESTAMP" + MetricFieldSpecDataTypeTIMESTAMP string = "TIMESTAMP" + + // MetricFieldSpecDataTypeSTRING captures enum value "STRING" + MetricFieldSpecDataTypeSTRING string = "STRING" + + // MetricFieldSpecDataTypeJSON captures enum value "JSON" + MetricFieldSpecDataTypeJSON string = "JSON" + + // MetricFieldSpecDataTypeBYTES captures enum value "BYTES" + MetricFieldSpecDataTypeBYTES string = "BYTES" + + // MetricFieldSpecDataTypeSTRUCT captures enum value "STRUCT" + MetricFieldSpecDataTypeSTRUCT string = "STRUCT" + + // MetricFieldSpecDataTypeMAP captures enum value "MAP" + MetricFieldSpecDataTypeMAP string = "MAP" + + // MetricFieldSpecDataTypeLIST captures enum value "LIST" + MetricFieldSpecDataTypeLIST string = "LIST" +) + +// prop value enum +func (m *MetricFieldSpec) validateDataTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, metricFieldSpecTypeDataTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MetricFieldSpec) validateDataType(formats strfmt.Registry) error { + if swag.IsZero(m.DataType) { // not required + return nil + } + + // value enum + if err := m.validateDataTypeEnum("dataType", "body", m.DataType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this metric field spec based on context it is used +func (m *MetricFieldSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetricFieldSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricFieldSpec) UnmarshalBinary(b []byte) error { + var res MetricFieldSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/multi_part.go b/src/models/multi_part.go new file mode 100644 index 0000000..bbe3fe9 --- /dev/null +++ b/src/models/multi_part.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MultiPart multi part +// +// swagger:model MultiPart +type MultiPart struct { + + // body parts + BodyParts []*BodyPart `json:"bodyParts"` + + // content disposition + ContentDisposition *ContentDisposition `json:"contentDisposition,omitempty"` + + // entity + Entity interface{} `json:"entity,omitempty"` + + // headers + Headers map[string][]string `json:"headers,omitempty"` + + // media type + MediaType *MediaType `json:"mediaType,omitempty"` + + // message body workers + MessageBodyWorkers MessageBodyWorkers `json:"messageBodyWorkers,omitempty"` + + // parameterized headers + ParameterizedHeaders map[string][]ParameterizedHeader `json:"parameterizedHeaders,omitempty"` + + // parent + Parent *MultiPart `json:"parent,omitempty"` + + // providers + Providers Providers `json:"providers,omitempty"` +} + +// Validate validates this multi part +func (m *MultiPart) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBodyParts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentDisposition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMediaType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParameterizedHeaders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MultiPart) validateBodyParts(formats strfmt.Registry) error { + if swag.IsZero(m.BodyParts) { // not required + return nil + } + + for i := 0; i < len(m.BodyParts); i++ { + if swag.IsZero(m.BodyParts[i]) { // not required + continue + } + + if m.BodyParts[i] != nil { + if err := m.BodyParts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MultiPart) validateContentDisposition(formats strfmt.Registry) error { + if swag.IsZero(m.ContentDisposition) { // not required + return nil + } + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *MultiPart) validateMediaType(formats strfmt.Registry) error { + if swag.IsZero(m.MediaType) { // not required + return nil + } + + if m.MediaType != nil { + if err := m.MediaType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *MultiPart) validateParameterizedHeaders(formats strfmt.Registry) error { + if swag.IsZero(m.ParameterizedHeaders) { // not required + return nil + } + + for k := range m.ParameterizedHeaders { + + if err := validate.Required("parameterizedHeaders"+"."+k, "body", m.ParameterizedHeaders[k]); err != nil { + return err + } + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *MultiPart) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this multi part based on the context it is used +func (m *MultiPart) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBodyParts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentDisposition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMediaType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParameterizedHeaders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MultiPart) contextValidateBodyParts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BodyParts); i++ { + + if m.BodyParts[i] != nil { + if err := m.BodyParts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bodyParts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MultiPart) contextValidateContentDisposition(ctx context.Context, formats strfmt.Registry) error { + + if m.ContentDisposition != nil { + if err := m.ContentDisposition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contentDisposition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contentDisposition") + } + return err + } + } + + return nil +} + +func (m *MultiPart) contextValidateMediaType(ctx context.Context, formats strfmt.Registry) error { + + if m.MediaType != nil { + if err := m.MediaType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mediaType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mediaType") + } + return err + } + } + + return nil +} + +func (m *MultiPart) contextValidateParameterizedHeaders(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ParameterizedHeaders { + + for i := 0; i < len(m.ParameterizedHeaders[k]); i++ { + + if err := m.ParameterizedHeaders[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameterizedHeaders" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +func (m *MultiPart) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MultiPart) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MultiPart) UnmarshalBinary(b []byte) error { + var res MultiPart + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/object_node.go b/src/models/object_node.go new file mode 100644 index 0000000..295ab00 --- /dev/null +++ b/src/models/object_node.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ObjectNode object node +// +// swagger:model ObjectNode +type ObjectNode interface{} diff --git a/src/models/parameterized_header.go b/src/models/parameterized_header.go new file mode 100644 index 0000000..a09180b --- /dev/null +++ b/src/models/parameterized_header.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ParameterizedHeader parameterized header +// +// swagger:model ParameterizedHeader +type ParameterizedHeader struct { + + // parameters + Parameters map[string]string `json:"parameters,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this parameterized header +func (m *ParameterizedHeader) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this parameterized header based on context it is used +func (m *ParameterizedHeader) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ParameterizedHeader) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ParameterizedHeader) UnmarshalBinary(b []byte) error { + var res ParameterizedHeader + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/partition_offset_info.go b/src/models/partition_offset_info.go new file mode 100644 index 0000000..2619c01 --- /dev/null +++ b/src/models/partition_offset_info.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PartitionOffsetInfo partition offset info +// +// swagger:model PartitionOffsetInfo +type PartitionOffsetInfo struct { + + // availability lag ms map + AvailabilityLagMsMap map[string]string `json:"availabilityLagMsMap,omitempty"` + + // current offsets map + CurrentOffsetsMap map[string]string `json:"currentOffsetsMap,omitempty"` + + // latest upstream offset map + LatestUpstreamOffsetMap map[string]string `json:"latestUpstreamOffsetMap,omitempty"` + + // records lag map + RecordsLagMap map[string]string `json:"recordsLagMap,omitempty"` +} + +// Validate validates this partition offset info +func (m *PartitionOffsetInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this partition offset info based on context it is used +func (m *PartitionOffsetInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PartitionOffsetInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PartitionOffsetInfo) UnmarshalBinary(b []byte) error { + var res PartitionOffsetInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/pinot_task_config.go b/src/models/pinot_task_config.go new file mode 100644 index 0000000..57f53e0 --- /dev/null +++ b/src/models/pinot_task_config.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PinotTaskConfig pinot task config +// +// swagger:model PinotTaskConfig +type PinotTaskConfig struct { + + // configs + Configs map[string]string `json:"configs,omitempty"` + + // table name + TableName string `json:"tableName,omitempty"` + + // task Id + TaskID string `json:"taskId,omitempty"` + + // task type + TaskType string `json:"taskType,omitempty"` +} + +// Validate validates this pinot task config +func (m *PinotTaskConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pinot task config based on context it is used +func (m *PinotTaskConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PinotTaskConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PinotTaskConfig) UnmarshalBinary(b []byte) error { + var res PinotTaskConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/providers.go b/src/models/providers.go new file mode 100644 index 0000000..2f04c76 --- /dev/null +++ b/src/models/providers.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// Providers providers +// +// swagger:model Providers +type Providers interface{} diff --git a/src/models/query_config.go b/src/models/query_config.go new file mode 100644 index 0000000..e290510 --- /dev/null +++ b/src/models/query_config.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// QueryConfig query config +// +// swagger:model QueryConfig +type QueryConfig struct { + + // disable groovy + // Read Only: true + DisableGroovy *bool `json:"disableGroovy,omitempty"` + + // expression override map + // Read Only: true + ExpressionOverrideMap map[string]string `json:"expressionOverrideMap,omitempty"` + + // timeout ms + // Read Only: true + TimeoutMs int64 `json:"timeoutMs,omitempty"` + + // use approximate function + // Read Only: true + UseApproximateFunction *bool `json:"useApproximateFunction,omitempty"` +} + +// Validate validates this query config +func (m *QueryConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this query config based on the context it is used +func (m *QueryConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisableGroovy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExpressionOverrideMap(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimeoutMs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUseApproximateFunction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueryConfig) contextValidateDisableGroovy(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "disableGroovy", "body", m.DisableGroovy); err != nil { + return err + } + + return nil +} + +func (m *QueryConfig) contextValidateExpressionOverrideMap(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *QueryConfig) contextValidateTimeoutMs(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "timeoutMs", "body", int64(m.TimeoutMs)); err != nil { + return err + } + + return nil +} + +func (m *QueryConfig) contextValidateUseApproximateFunction(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "useApproximateFunction", "body", m.UseApproximateFunction); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueryConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueryConfig) UnmarshalBinary(b []byte) error { + var res QueryConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/quota_config.go b/src/models/quota_config.go new file mode 100644 index 0000000..656d1b8 --- /dev/null +++ b/src/models/quota_config.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// QuotaConfig quota config +// +// swagger:model QuotaConfig +type QuotaConfig struct { + + // max queries per second + // Read Only: true + MaxQueriesPerSecond string `json:"maxQueriesPerSecond,omitempty"` + + // storage + // Read Only: true + Storage string `json:"storage,omitempty"` +} + +// Validate validates this quota config +func (m *QuotaConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this quota config based on the context it is used +func (m *QuotaConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMaxQueriesPerSecond(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QuotaConfig) contextValidateMaxQueriesPerSecond(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "maxQueriesPerSecond", "body", string(m.MaxQueriesPerSecond)); err != nil { + return err + } + + return nil +} + +func (m *QuotaConfig) contextValidateStorage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "storage", "body", string(m.Storage)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QuotaConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuotaConfig) UnmarshalBinary(b []byte) error { + var res QuotaConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/rebalance_result.go b/src/models/rebalance_result.go new file mode 100644 index 0000000..11663e9 --- /dev/null +++ b/src/models/rebalance_result.go @@ -0,0 +1,213 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RebalanceResult rebalance result +// +// swagger:model RebalanceResult +type RebalanceResult struct { + + // description + // Read Only: true + Description string `json:"description,omitempty"` + + // instance assignment + // Read Only: true + InstanceAssignment map[string]InstancePartitions `json:"instanceAssignment,omitempty"` + + // segment assignment + // Read Only: true + SegmentAssignment map[string]map[string]string `json:"segmentAssignment,omitempty"` + + // status + // Read Only: true + // Enum: [NO_OP DONE FAILED IN_PROGRESS] + Status string `json:"status,omitempty"` +} + +// Validate validates this rebalance result +func (m *RebalanceResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInstanceAssignment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RebalanceResult) validateInstanceAssignment(formats strfmt.Registry) error { + if swag.IsZero(m.InstanceAssignment) { // not required + return nil + } + + for k := range m.InstanceAssignment { + + if err := validate.Required("instanceAssignment"+"."+k, "body", m.InstanceAssignment[k]); err != nil { + return err + } + if val, ok := m.InstanceAssignment[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("instanceAssignment" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("instanceAssignment" + "." + k) + } + return err + } + } + + } + + return nil +} + +var rebalanceResultTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NO_OP","DONE","FAILED","IN_PROGRESS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + rebalanceResultTypeStatusPropEnum = append(rebalanceResultTypeStatusPropEnum, v) + } +} + +const ( + + // RebalanceResultStatusNOOP captures enum value "NO_OP" + RebalanceResultStatusNOOP string = "NO_OP" + + // RebalanceResultStatusDONE captures enum value "DONE" + RebalanceResultStatusDONE string = "DONE" + + // RebalanceResultStatusFAILED captures enum value "FAILED" + RebalanceResultStatusFAILED string = "FAILED" + + // RebalanceResultStatusINPROGRESS captures enum value "IN_PROGRESS" + RebalanceResultStatusINPROGRESS string = "IN_PROGRESS" +) + +// prop value enum +func (m *RebalanceResult) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, rebalanceResultTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RebalanceResult) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this rebalance result based on the context it is used +func (m *RebalanceResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDescription(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInstanceAssignment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentAssignment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RebalanceResult) contextValidateDescription(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "description", "body", string(m.Description)); err != nil { + return err + } + + return nil +} + +func (m *RebalanceResult) contextValidateInstanceAssignment(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.InstanceAssignment { + + if val, ok := m.InstanceAssignment[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *RebalanceResult) contextValidateSegmentAssignment(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *RebalanceResult) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RebalanceResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RebalanceResult) UnmarshalBinary(b []byte) error { + var res RebalanceResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/replica_group_strategy_config.go b/src/models/replica_group_strategy_config.go new file mode 100644 index 0000000..7cbf70d --- /dev/null +++ b/src/models/replica_group_strategy_config.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReplicaGroupStrategyConfig replica group strategy config +// +// swagger:model ReplicaGroupStrategyConfig +type ReplicaGroupStrategyConfig struct { + + // num instances per partition + // Required: true + // Read Only: true + NumInstancesPerPartition int32 `json:"numInstancesPerPartition"` + + // partition column + // Read Only: true + PartitionColumn string `json:"partitionColumn,omitempty"` +} + +// Validate validates this replica group strategy config +func (m *ReplicaGroupStrategyConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNumInstancesPerPartition(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReplicaGroupStrategyConfig) validateNumInstancesPerPartition(formats strfmt.Registry) error { + + if err := validate.Required("numInstancesPerPartition", "body", int32(m.NumInstancesPerPartition)); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this replica group strategy config based on the context it is used +func (m *ReplicaGroupStrategyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNumInstancesPerPartition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePartitionColumn(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReplicaGroupStrategyConfig) contextValidateNumInstancesPerPartition(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numInstancesPerPartition", "body", int32(m.NumInstancesPerPartition)); err != nil { + return err + } + + return nil +} + +func (m *ReplicaGroupStrategyConfig) contextValidatePartitionColumn(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "partitionColumn", "body", string(m.PartitionColumn)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReplicaGroupStrategyConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReplicaGroupStrategyConfig) UnmarshalBinary(b []byte) error { + var res ReplicaGroupStrategyConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/routing_config.go b/src/models/routing_config.go new file mode 100644 index 0000000..6329dba --- /dev/null +++ b/src/models/routing_config.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RoutingConfig routing config +// +// swagger:model RoutingConfig +type RoutingConfig struct { + + // instance selector type + // Read Only: true + InstanceSelectorType string `json:"instanceSelectorType,omitempty"` + + // routing table builder name + // Read Only: true + RoutingTableBuilderName string `json:"routingTableBuilderName,omitempty"` + + // segment pruner types + // Read Only: true + SegmentPrunerTypes []string `json:"segmentPrunerTypes"` +} + +// Validate validates this routing config +func (m *RoutingConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this routing config based on the context it is used +func (m *RoutingConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInstanceSelectorType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoutingTableBuilderName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentPrunerTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoutingConfig) contextValidateInstanceSelectorType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "instanceSelectorType", "body", string(m.InstanceSelectorType)); err != nil { + return err + } + + return nil +} + +func (m *RoutingConfig) contextValidateRoutingTableBuilderName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "routingTableBuilderName", "body", string(m.RoutingTableBuilderName)); err != nil { + return err + } + + return nil +} + +func (m *RoutingConfig) contextValidateSegmentPrunerTypes(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentPrunerTypes", "body", []string(m.SegmentPrunerTypes)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RoutingConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoutingConfig) UnmarshalBinary(b []byte) error { + var res RoutingConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/schema.go b/src/models/schema.go new file mode 100644 index 0000000..1170d57 --- /dev/null +++ b/src/models/schema.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Schema schema +// +// swagger:model Schema +type Schema struct { + + // date time field specs + DateTimeFieldSpecs []*DateTimeFieldSpec `json:"dateTimeFieldSpecs"` + + // dimension field specs + DimensionFieldSpecs []*DimensionFieldSpec `json:"dimensionFieldSpecs"` + + // metric field specs + MetricFieldSpecs []*MetricFieldSpec `json:"metricFieldSpecs"` + + // primary key columns + PrimaryKeyColumns []string `json:"primaryKeyColumns"` + + // schema name + SchemaName string `json:"schemaName,omitempty"` + + // time field spec + TimeFieldSpec *TimeFieldSpec `json:"timeFieldSpec,omitempty"` +} + +// Validate validates this schema +func (m *Schema) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDateTimeFieldSpecs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDimensionFieldSpecs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMetricFieldSpecs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeFieldSpec(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Schema) validateDateTimeFieldSpecs(formats strfmt.Registry) error { + if swag.IsZero(m.DateTimeFieldSpecs) { // not required + return nil + } + + for i := 0; i < len(m.DateTimeFieldSpecs); i++ { + if swag.IsZero(m.DateTimeFieldSpecs[i]) { // not required + continue + } + + if m.DateTimeFieldSpecs[i] != nil { + if err := m.DateTimeFieldSpecs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dateTimeFieldSpecs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dateTimeFieldSpecs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Schema) validateDimensionFieldSpecs(formats strfmt.Registry) error { + if swag.IsZero(m.DimensionFieldSpecs) { // not required + return nil + } + + for i := 0; i < len(m.DimensionFieldSpecs); i++ { + if swag.IsZero(m.DimensionFieldSpecs[i]) { // not required + continue + } + + if m.DimensionFieldSpecs[i] != nil { + if err := m.DimensionFieldSpecs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dimensionFieldSpecs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dimensionFieldSpecs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Schema) validateMetricFieldSpecs(formats strfmt.Registry) error { + if swag.IsZero(m.MetricFieldSpecs) { // not required + return nil + } + + for i := 0; i < len(m.MetricFieldSpecs); i++ { + if swag.IsZero(m.MetricFieldSpecs[i]) { // not required + continue + } + + if m.MetricFieldSpecs[i] != nil { + if err := m.MetricFieldSpecs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metricFieldSpecs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("metricFieldSpecs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Schema) validateTimeFieldSpec(formats strfmt.Registry) error { + if swag.IsZero(m.TimeFieldSpec) { // not required + return nil + } + + if m.TimeFieldSpec != nil { + if err := m.TimeFieldSpec.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timeFieldSpec") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timeFieldSpec") + } + return err + } + } + + return nil +} + +// ContextValidate validate this schema based on the context it is used +func (m *Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDateTimeFieldSpecs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDimensionFieldSpecs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMetricFieldSpecs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimeFieldSpec(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Schema) contextValidateDateTimeFieldSpecs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DateTimeFieldSpecs); i++ { + + if m.DateTimeFieldSpecs[i] != nil { + if err := m.DateTimeFieldSpecs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dateTimeFieldSpecs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dateTimeFieldSpecs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Schema) contextValidateDimensionFieldSpecs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DimensionFieldSpecs); i++ { + + if m.DimensionFieldSpecs[i] != nil { + if err := m.DimensionFieldSpecs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dimensionFieldSpecs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dimensionFieldSpecs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Schema) contextValidateMetricFieldSpecs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MetricFieldSpecs); i++ { + + if m.MetricFieldSpecs[i] != nil { + if err := m.MetricFieldSpecs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metricFieldSpecs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("metricFieldSpecs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Schema) contextValidateTimeFieldSpec(ctx context.Context, formats strfmt.Registry) error { + + if m.TimeFieldSpec != nil { + if err := m.TimeFieldSpec.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timeFieldSpec") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timeFieldSpec") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Schema) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Schema) UnmarshalBinary(b []byte) error { + var res Schema + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_assignment_config.go b/src/models/segment_assignment_config.go new file mode 100644 index 0000000..75a4a9d --- /dev/null +++ b/src/models/segment_assignment_config.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SegmentAssignmentConfig segment assignment config +// +// swagger:model SegmentAssignmentConfig +type SegmentAssignmentConfig struct { + + // assignment strategy + AssignmentStrategy string `json:"assignmentStrategy,omitempty"` +} + +// Validate validates this segment assignment config +func (m *SegmentAssignmentConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this segment assignment config based on context it is used +func (m *SegmentAssignmentConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentAssignmentConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentAssignmentConfig) UnmarshalBinary(b []byte) error { + var res SegmentAssignmentConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_consumer_info.go b/src/models/segment_consumer_info.go new file mode 100644 index 0000000..0964848 --- /dev/null +++ b/src/models/segment_consumer_info.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentConsumerInfo segment consumer info +// +// swagger:model SegmentConsumerInfo +type SegmentConsumerInfo struct { + + // consumer state + // Read Only: true + ConsumerState string `json:"consumerState,omitempty"` + + // last consumed timestamp + // Read Only: true + LastConsumedTimestamp int64 `json:"lastConsumedTimestamp,omitempty"` + + // partition offset info + // Read Only: true + PartitionOffsetInfo *PartitionOffsetInfo `json:"partitionOffsetInfo,omitempty"` + + // partition to offset map + // Read Only: true + PartitionToOffsetMap map[string]string `json:"partitionToOffsetMap,omitempty"` + + // segment name + // Read Only: true + SegmentName string `json:"segmentName,omitempty"` +} + +// Validate validates this segment consumer info +func (m *SegmentConsumerInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePartitionOffsetInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentConsumerInfo) validatePartitionOffsetInfo(formats strfmt.Registry) error { + if swag.IsZero(m.PartitionOffsetInfo) { // not required + return nil + } + + if m.PartitionOffsetInfo != nil { + if err := m.PartitionOffsetInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("partitionOffsetInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("partitionOffsetInfo") + } + return err + } + } + + return nil +} + +// ContextValidate validate this segment consumer info based on the context it is used +func (m *SegmentConsumerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConsumerState(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastConsumedTimestamp(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePartitionOffsetInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePartitionToOffsetMap(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentConsumerInfo) contextValidateConsumerState(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "consumerState", "body", string(m.ConsumerState)); err != nil { + return err + } + + return nil +} + +func (m *SegmentConsumerInfo) contextValidateLastConsumedTimestamp(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "lastConsumedTimestamp", "body", int64(m.LastConsumedTimestamp)); err != nil { + return err + } + + return nil +} + +func (m *SegmentConsumerInfo) contextValidatePartitionOffsetInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.PartitionOffsetInfo != nil { + if err := m.PartitionOffsetInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("partitionOffsetInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("partitionOffsetInfo") + } + return err + } + } + + return nil +} + +func (m *SegmentConsumerInfo) contextValidatePartitionToOffsetMap(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *SegmentConsumerInfo) contextValidateSegmentName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentName", "body", string(m.SegmentName)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentConsumerInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentConsumerInfo) UnmarshalBinary(b []byte) error { + var res SegmentConsumerInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_debug_info.go b/src/models/segment_debug_info.go new file mode 100644 index 0000000..959b006 --- /dev/null +++ b/src/models/segment_debug_info.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentDebugInfo segment debug info +// +// swagger:model SegmentDebugInfo +type SegmentDebugInfo struct { + + // segment name + // Read Only: true + SegmentName string `json:"segmentName,omitempty"` + + // server state + // Read Only: true + ServerState map[string]SegmentState `json:"serverState,omitempty"` +} + +// Validate validates this segment debug info +func (m *SegmentDebugInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServerState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentDebugInfo) validateServerState(formats strfmt.Registry) error { + if swag.IsZero(m.ServerState) { // not required + return nil + } + + for k := range m.ServerState { + + if err := validate.Required("serverState"+"."+k, "body", m.ServerState[k]); err != nil { + return err + } + if val, ok := m.ServerState[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serverState" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serverState" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this segment debug info based on the context it is used +func (m *SegmentDebugInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSegmentName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServerState(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentDebugInfo) contextValidateSegmentName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentName", "body", string(m.SegmentName)); err != nil { + return err + } + + return nil +} + +func (m *SegmentDebugInfo) contextValidateServerState(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ServerState { + + if val, ok := m.ServerState[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentDebugInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentDebugInfo) UnmarshalBinary(b []byte) error { + var res SegmentDebugInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_error_info.go b/src/models/segment_error_info.go new file mode 100644 index 0000000..a240cc3 --- /dev/null +++ b/src/models/segment_error_info.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentErrorInfo segment error info +// +// swagger:model SegmentErrorInfo +type SegmentErrorInfo struct { + + // error message + // Read Only: true + ErrorMessage string `json:"errorMessage,omitempty"` + + // stack trace + // Read Only: true + StackTrace string `json:"stackTrace,omitempty"` + + // timestamp + // Read Only: true + Timestamp string `json:"timestamp,omitempty"` +} + +// Validate validates this segment error info +func (m *SegmentErrorInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this segment error info based on the context it is used +func (m *SegmentErrorInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrorMessage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStackTrace(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimestamp(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentErrorInfo) contextValidateErrorMessage(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "errorMessage", "body", string(m.ErrorMessage)); err != nil { + return err + } + + return nil +} + +func (m *SegmentErrorInfo) contextValidateStackTrace(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "stackTrace", "body", string(m.StackTrace)); err != nil { + return err + } + + return nil +} + +func (m *SegmentErrorInfo) contextValidateTimestamp(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "timestamp", "body", string(m.Timestamp)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentErrorInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentErrorInfo) UnmarshalBinary(b []byte) error { + var res SegmentErrorInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_partition_config.go b/src/models/segment_partition_config.go new file mode 100644 index 0000000..08776b3 --- /dev/null +++ b/src/models/segment_partition_config.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentPartitionConfig segment partition config +// +// swagger:model SegmentPartitionConfig +type SegmentPartitionConfig struct { + + // column partition map + // Required: true + // Read Only: true + ColumnPartitionMap map[string]ColumnPartitionConfig `json:"columnPartitionMap"` +} + +// Validate validates this segment partition config +func (m *SegmentPartitionConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColumnPartitionMap(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentPartitionConfig) validateColumnPartitionMap(formats strfmt.Registry) error { + + if err := validate.Required("columnPartitionMap", "body", m.ColumnPartitionMap); err != nil { + return err + } + + for k := range m.ColumnPartitionMap { + + if err := validate.Required("columnPartitionMap"+"."+k, "body", m.ColumnPartitionMap[k]); err != nil { + return err + } + if val, ok := m.ColumnPartitionMap[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("columnPartitionMap" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("columnPartitionMap" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this segment partition config based on the context it is used +func (m *SegmentPartitionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateColumnPartitionMap(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentPartitionConfig) contextValidateColumnPartitionMap(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("columnPartitionMap", "body", m.ColumnPartitionMap); err != nil { + return err + } + + for k := range m.ColumnPartitionMap { + + if val, ok := m.ColumnPartitionMap[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentPartitionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentPartitionConfig) UnmarshalBinary(b []byte) error { + var res SegmentPartitionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_size_details.go b/src/models/segment_size_details.go new file mode 100644 index 0000000..d9b02e6 --- /dev/null +++ b/src/models/segment_size_details.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentSizeDetails segment size details +// +// swagger:model SegmentSizeDetails +type SegmentSizeDetails struct { + + // estimated size in bytes + EstimatedSizeInBytes int64 `json:"estimatedSizeInBytes,omitempty"` + + // reported size in bytes + ReportedSizeInBytes int64 `json:"reportedSizeInBytes,omitempty"` + + // server info + ServerInfo map[string]SegmentSizeInfo `json:"serverInfo,omitempty"` +} + +// Validate validates this segment size details +func (m *SegmentSizeDetails) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServerInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentSizeDetails) validateServerInfo(formats strfmt.Registry) error { + if swag.IsZero(m.ServerInfo) { // not required + return nil + } + + for k := range m.ServerInfo { + + if err := validate.Required("serverInfo"+"."+k, "body", m.ServerInfo[k]); err != nil { + return err + } + if val, ok := m.ServerInfo[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serverInfo" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serverInfo" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this segment size details based on the context it is used +func (m *SegmentSizeDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServerInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentSizeDetails) contextValidateServerInfo(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ServerInfo { + + if val, ok := m.ServerInfo[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentSizeDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentSizeDetails) UnmarshalBinary(b []byte) error { + var res SegmentSizeDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_size_info.go b/src/models/segment_size_info.go new file mode 100644 index 0000000..954fa46 --- /dev/null +++ b/src/models/segment_size_info.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentSizeInfo segment size info +// +// swagger:model SegmentSizeInfo +type SegmentSizeInfo struct { + + // disk size in bytes + // Read Only: true + DiskSizeInBytes int64 `json:"diskSizeInBytes,omitempty"` + + // segment name + // Read Only: true + SegmentName string `json:"segmentName,omitempty"` +} + +// Validate validates this segment size info +func (m *SegmentSizeInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this segment size info based on the context it is used +func (m *SegmentSizeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDiskSizeInBytes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentSizeInfo) contextValidateDiskSizeInBytes(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "diskSizeInBytes", "body", int64(m.DiskSizeInBytes)); err != nil { + return err + } + + return nil +} + +func (m *SegmentSizeInfo) contextValidateSegmentName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentName", "body", string(m.SegmentName)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentSizeInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentSizeInfo) UnmarshalBinary(b []byte) error { + var res SegmentSizeInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segment_state.go b/src/models/segment_state.go new file mode 100644 index 0000000..b9ded88 --- /dev/null +++ b/src/models/segment_state.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentState segment state +// +// swagger:model SegmentState +type SegmentState struct { + + // consumer info + // Read Only: true + ConsumerInfo *SegmentConsumerInfo `json:"consumerInfo,omitempty"` + + // error info + // Read Only: true + ErrorInfo *SegmentErrorInfo `json:"errorInfo,omitempty"` + + // external view + // Read Only: true + ExternalView string `json:"externalView,omitempty"` + + // ideal state + // Read Only: true + IdealState string `json:"idealState,omitempty"` + + // segment size + // Read Only: true + SegmentSize string `json:"segmentSize,omitempty"` +} + +// Validate validates this segment state +func (m *SegmentState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConsumerInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrorInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentState) validateConsumerInfo(formats strfmt.Registry) error { + if swag.IsZero(m.ConsumerInfo) { // not required + return nil + } + + if m.ConsumerInfo != nil { + if err := m.ConsumerInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("consumerInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consumerInfo") + } + return err + } + } + + return nil +} + +func (m *SegmentState) validateErrorInfo(formats strfmt.Registry) error { + if swag.IsZero(m.ErrorInfo) { // not required + return nil + } + + if m.ErrorInfo != nil { + if err := m.ErrorInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errorInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errorInfo") + } + return err + } + } + + return nil +} + +// ContextValidate validate this segment state based on the context it is used +func (m *SegmentState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConsumerInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateErrorInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExternalView(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIdealState(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentSize(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentState) contextValidateConsumerInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.ConsumerInfo != nil { + if err := m.ConsumerInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("consumerInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consumerInfo") + } + return err + } + } + + return nil +} + +func (m *SegmentState) contextValidateErrorInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.ErrorInfo != nil { + if err := m.ErrorInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errorInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errorInfo") + } + return err + } + } + + return nil +} + +func (m *SegmentState) contextValidateExternalView(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "externalView", "body", string(m.ExternalView)); err != nil { + return err + } + + return nil +} + +func (m *SegmentState) contextValidateIdealState(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "idealState", "body", string(m.IdealState)); err != nil { + return err + } + + return nil +} + +func (m *SegmentState) contextValidateSegmentSize(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentSize", "body", string(m.SegmentSize)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentState) UnmarshalBinary(b []byte) error { + var res SegmentState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/segments_validation_and_retention_config.go b/src/models/segments_validation_and_retention_config.go new file mode 100644 index 0000000..69e15e8 --- /dev/null +++ b/src/models/segments_validation_and_retention_config.go @@ -0,0 +1,256 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SegmentsValidationAndRetentionConfig segments validation and retention config +// +// swagger:model SegmentsValidationAndRetentionConfig +type SegmentsValidationAndRetentionConfig struct { + + // completion config + CompletionConfig *CompletionConfig `json:"completionConfig,omitempty"` + + // crypter class name + CrypterClassName string `json:"crypterClassName,omitempty"` + + // deleted segments retention period + DeletedSegmentsRetentionPeriod string `json:"deletedSegmentsRetentionPeriod,omitempty"` + + // minimize data movement + MinimizeDataMovement bool `json:"minimizeDataMovement,omitempty"` + + // peer segment download scheme + PeerSegmentDownloadScheme string `json:"peerSegmentDownloadScheme,omitempty"` + + // replica group strategy config + ReplicaGroupStrategyConfig *ReplicaGroupStrategyConfig `json:"replicaGroupStrategyConfig,omitempty"` + + // replicas per partition + ReplicasPerPartition string `json:"replicasPerPartition,omitempty"` + + // replication + Replication string `json:"replication,omitempty"` + + // retention time unit + RetentionTimeUnit string `json:"retentionTimeUnit,omitempty"` + + // retention time value + RetentionTimeValue string `json:"retentionTimeValue,omitempty"` + + // schema name + SchemaName string `json:"schemaName,omitempty"` + + // segment assignment strategy + SegmentAssignmentStrategy string `json:"segmentAssignmentStrategy,omitempty"` + + // segment push frequency + SegmentPushFrequency string `json:"segmentPushFrequency,omitempty"` + + // segment push type + SegmentPushType string `json:"segmentPushType,omitempty"` + + // time column name + TimeColumnName string `json:"timeColumnName,omitempty"` + + // time type + // Enum: [NANOSECONDS MICROSECONDS MILLISECONDS SECONDS MINUTES HOURS DAYS] + TimeType string `json:"timeType,omitempty"` +} + +// Validate validates this segments validation and retention config +func (m *SegmentsValidationAndRetentionConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletionConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaGroupStrategyConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentsValidationAndRetentionConfig) validateCompletionConfig(formats strfmt.Registry) error { + if swag.IsZero(m.CompletionConfig) { // not required + return nil + } + + if m.CompletionConfig != nil { + if err := m.CompletionConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("completionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("completionConfig") + } + return err + } + } + + return nil +} + +func (m *SegmentsValidationAndRetentionConfig) validateReplicaGroupStrategyConfig(formats strfmt.Registry) error { + if swag.IsZero(m.ReplicaGroupStrategyConfig) { // not required + return nil + } + + if m.ReplicaGroupStrategyConfig != nil { + if err := m.ReplicaGroupStrategyConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaGroupStrategyConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaGroupStrategyConfig") + } + return err + } + } + + return nil +} + +var segmentsValidationAndRetentionConfigTypeTimeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + segmentsValidationAndRetentionConfigTypeTimeTypePropEnum = append(segmentsValidationAndRetentionConfigTypeTimeTypePropEnum, v) + } +} + +const ( + + // SegmentsValidationAndRetentionConfigTimeTypeNANOSECONDS captures enum value "NANOSECONDS" + SegmentsValidationAndRetentionConfigTimeTypeNANOSECONDS string = "NANOSECONDS" + + // SegmentsValidationAndRetentionConfigTimeTypeMICROSECONDS captures enum value "MICROSECONDS" + SegmentsValidationAndRetentionConfigTimeTypeMICROSECONDS string = "MICROSECONDS" + + // SegmentsValidationAndRetentionConfigTimeTypeMILLISECONDS captures enum value "MILLISECONDS" + SegmentsValidationAndRetentionConfigTimeTypeMILLISECONDS string = "MILLISECONDS" + + // SegmentsValidationAndRetentionConfigTimeTypeSECONDS captures enum value "SECONDS" + SegmentsValidationAndRetentionConfigTimeTypeSECONDS string = "SECONDS" + + // SegmentsValidationAndRetentionConfigTimeTypeMINUTES captures enum value "MINUTES" + SegmentsValidationAndRetentionConfigTimeTypeMINUTES string = "MINUTES" + + // SegmentsValidationAndRetentionConfigTimeTypeHOURS captures enum value "HOURS" + SegmentsValidationAndRetentionConfigTimeTypeHOURS string = "HOURS" + + // SegmentsValidationAndRetentionConfigTimeTypeDAYS captures enum value "DAYS" + SegmentsValidationAndRetentionConfigTimeTypeDAYS string = "DAYS" +) + +// prop value enum +func (m *SegmentsValidationAndRetentionConfig) validateTimeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, segmentsValidationAndRetentionConfigTypeTimeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SegmentsValidationAndRetentionConfig) validateTimeType(formats strfmt.Registry) error { + if swag.IsZero(m.TimeType) { // not required + return nil + } + + // value enum + if err := m.validateTimeTypeEnum("timeType", "body", m.TimeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this segments validation and retention config based on the context it is used +func (m *SegmentsValidationAndRetentionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCompletionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplicaGroupStrategyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SegmentsValidationAndRetentionConfig) contextValidateCompletionConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.CompletionConfig != nil { + if err := m.CompletionConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("completionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("completionConfig") + } + return err + } + } + + return nil +} + +func (m *SegmentsValidationAndRetentionConfig) contextValidateReplicaGroupStrategyConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.ReplicaGroupStrategyConfig != nil { + if err := m.ReplicaGroupStrategyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicaGroupStrategyConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicaGroupStrategyConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SegmentsValidationAndRetentionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SegmentsValidationAndRetentionConfig) UnmarshalBinary(b []byte) error { + var res SegmentsValidationAndRetentionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/server_reload_controller_job_status_response.go b/src/models/server_reload_controller_job_status_response.go new file mode 100644 index 0000000..26aa9e6 --- /dev/null +++ b/src/models/server_reload_controller_job_status_response.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServerReloadControllerJobStatusResponse server reload controller job status response +// +// swagger:model ServerReloadControllerJobStatusResponse +type ServerReloadControllerJobStatusResponse struct { + + // estimated time remaining in minutes + EstimatedTimeRemainingInMinutes float64 `json:"estimatedTimeRemainingInMinutes,omitempty"` + + // metadata + Metadata map[string]string `json:"metadata,omitempty"` + + // success count + SuccessCount int32 `json:"successCount,omitempty"` + + // time elapsed in minutes + TimeElapsedInMinutes float64 `json:"timeElapsedInMinutes,omitempty"` + + // total segment count + TotalSegmentCount int32 `json:"totalSegmentCount,omitempty"` + + // total server calls failed + TotalServerCallsFailed int32 `json:"totalServerCallsFailed,omitempty"` + + // total servers queried + TotalServersQueried int32 `json:"totalServersQueried,omitempty"` +} + +// Validate validates this server reload controller job status response +func (m *ServerReloadControllerJobStatusResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this server reload controller job status response based on context it is used +func (m *ServerReloadControllerJobStatusResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ServerReloadControllerJobStatusResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServerReloadControllerJobStatusResponse) UnmarshalBinary(b []byte) error { + var res ServerReloadControllerJobStatusResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/star_tree_index_config.go b/src/models/star_tree_index_config.go new file mode 100644 index 0000000..b4647c7 --- /dev/null +++ b/src/models/star_tree_index_config.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StarTreeIndexConfig star tree index config +// +// swagger:model StarTreeIndexConfig +type StarTreeIndexConfig struct { + + // dimensions split order + // Required: true + // Read Only: true + DimensionsSplitOrder []string `json:"dimensionsSplitOrder"` + + // function column pairs + // Required: true + // Read Only: true + FunctionColumnPairs []string `json:"functionColumnPairs"` + + // max leaf records + // Read Only: true + MaxLeafRecords int32 `json:"maxLeafRecords,omitempty"` + + // skip star node creation for dimensions + // Read Only: true + SkipStarNodeCreationForDimensions []string `json:"skipStarNodeCreationForDimensions"` +} + +// Validate validates this star tree index config +func (m *StarTreeIndexConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDimensionsSplitOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFunctionColumnPairs(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StarTreeIndexConfig) validateDimensionsSplitOrder(formats strfmt.Registry) error { + + if err := validate.Required("dimensionsSplitOrder", "body", m.DimensionsSplitOrder); err != nil { + return err + } + + return nil +} + +func (m *StarTreeIndexConfig) validateFunctionColumnPairs(formats strfmt.Registry) error { + + if err := validate.Required("functionColumnPairs", "body", m.FunctionColumnPairs); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this star tree index config based on the context it is used +func (m *StarTreeIndexConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDimensionsSplitOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFunctionColumnPairs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxLeafRecords(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSkipStarNodeCreationForDimensions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StarTreeIndexConfig) contextValidateDimensionsSplitOrder(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "dimensionsSplitOrder", "body", []string(m.DimensionsSplitOrder)); err != nil { + return err + } + + return nil +} + +func (m *StarTreeIndexConfig) contextValidateFunctionColumnPairs(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "functionColumnPairs", "body", []string(m.FunctionColumnPairs)); err != nil { + return err + } + + return nil +} + +func (m *StarTreeIndexConfig) contextValidateMaxLeafRecords(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "maxLeafRecords", "body", int32(m.MaxLeafRecords)); err != nil { + return err + } + + return nil +} + +func (m *StarTreeIndexConfig) contextValidateSkipStarNodeCreationForDimensions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "skipStarNodeCreationForDimensions", "body", []string(m.SkipStarNodeCreationForDimensions)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StarTreeIndexConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StarTreeIndexConfig) UnmarshalBinary(b []byte) error { + var res StarTreeIndexConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/start_replace_segments_request.go b/src/models/start_replace_segments_request.go new file mode 100644 index 0000000..f1976bf --- /dev/null +++ b/src/models/start_replace_segments_request.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StartReplaceSegmentsRequest start replace segments request +// +// swagger:model StartReplaceSegmentsRequest +type StartReplaceSegmentsRequest struct { + + // segments from + // Read Only: true + SegmentsFrom []string `json:"segmentsFrom"` + + // segments to + // Read Only: true + SegmentsTo []string `json:"segmentsTo"` +} + +// Validate validates this start replace segments request +func (m *StartReplaceSegmentsRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this start replace segments request based on the context it is used +func (m *StartReplaceSegmentsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSegmentsFrom(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentsTo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StartReplaceSegmentsRequest) contextValidateSegmentsFrom(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentsFrom", "body", []string(m.SegmentsFrom)); err != nil { + return err + } + + return nil +} + +func (m *StartReplaceSegmentsRequest) contextValidateSegmentsTo(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentsTo", "body", []string(m.SegmentsTo)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StartReplaceSegmentsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StartReplaceSegmentsRequest) UnmarshalBinary(b []byte) error { + var res StartReplaceSegmentsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/stream_ingestion_config.go b/src/models/stream_ingestion_config.go new file mode 100644 index 0000000..bf9b294 --- /dev/null +++ b/src/models/stream_ingestion_config.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StreamIngestionConfig stream ingestion config +// +// swagger:model StreamIngestionConfig +type StreamIngestionConfig struct { + + // stream config maps + // Read Only: true + StreamConfigMaps []map[string]string `json:"streamConfigMaps"` +} + +// Validate validates this stream ingestion config +func (m *StreamIngestionConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this stream ingestion config based on the context it is used +func (m *StreamIngestionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStreamConfigMaps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StreamIngestionConfig) contextValidateStreamConfigMaps(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "streamConfigMaps", "body", []map[string]string(m.StreamConfigMaps)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StreamIngestionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StreamIngestionConfig) UnmarshalBinary(b []byte) error { + var res StreamIngestionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/string_result_response.go b/src/models/string_result_response.go new file mode 100644 index 0000000..1dc6794 --- /dev/null +++ b/src/models/string_result_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StringResultResponse string result response +// +// swagger:model StringResultResponse +type StringResultResponse struct { + + // result + Result string `json:"result,omitempty"` +} + +// Validate validates this string result response +func (m *StringResultResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this string result response based on context it is used +func (m *StringResultResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *StringResultResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StringResultResponse) UnmarshalBinary(b []byte) error { + var res StringResultResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/subtask_debug_info.go b/src/models/subtask_debug_info.go new file mode 100644 index 0000000..d7386e7 --- /dev/null +++ b/src/models/subtask_debug_info.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SubtaskDebugInfo subtask debug info +// +// swagger:model SubtaskDebugInfo +type SubtaskDebugInfo struct { + + // finish time + FinishTime string `json:"finishTime,omitempty"` + + // info + Info string `json:"info,omitempty"` + + // participant + Participant string `json:"participant,omitempty"` + + // start time + StartTime string `json:"startTime,omitempty"` + + // state + // Enum: [INIT RUNNING STOPPED COMPLETED TIMED_OUT TASK_ERROR TASK_ABORTED ERROR DROPPED] + State string `json:"state,omitempty"` + + // task config + TaskConfig *PinotTaskConfig `json:"taskConfig,omitempty"` + + // task Id + TaskID string `json:"taskId,omitempty"` +} + +// Validate validates this subtask debug info +func (m *SubtaskDebugInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaskConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var subtaskDebugInfoTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INIT","RUNNING","STOPPED","COMPLETED","TIMED_OUT","TASK_ERROR","TASK_ABORTED","ERROR","DROPPED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + subtaskDebugInfoTypeStatePropEnum = append(subtaskDebugInfoTypeStatePropEnum, v) + } +} + +const ( + + // SubtaskDebugInfoStateINIT captures enum value "INIT" + SubtaskDebugInfoStateINIT string = "INIT" + + // SubtaskDebugInfoStateRUNNING captures enum value "RUNNING" + SubtaskDebugInfoStateRUNNING string = "RUNNING" + + // SubtaskDebugInfoStateSTOPPED captures enum value "STOPPED" + SubtaskDebugInfoStateSTOPPED string = "STOPPED" + + // SubtaskDebugInfoStateCOMPLETED captures enum value "COMPLETED" + SubtaskDebugInfoStateCOMPLETED string = "COMPLETED" + + // SubtaskDebugInfoStateTIMEDOUT captures enum value "TIMED_OUT" + SubtaskDebugInfoStateTIMEDOUT string = "TIMED_OUT" + + // SubtaskDebugInfoStateTASKERROR captures enum value "TASK_ERROR" + SubtaskDebugInfoStateTASKERROR string = "TASK_ERROR" + + // SubtaskDebugInfoStateTASKABORTED captures enum value "TASK_ABORTED" + SubtaskDebugInfoStateTASKABORTED string = "TASK_ABORTED" + + // SubtaskDebugInfoStateERROR captures enum value "ERROR" + SubtaskDebugInfoStateERROR string = "ERROR" + + // SubtaskDebugInfoStateDROPPED captures enum value "DROPPED" + SubtaskDebugInfoStateDROPPED string = "DROPPED" +) + +// prop value enum +func (m *SubtaskDebugInfo) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, subtaskDebugInfoTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SubtaskDebugInfo) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +func (m *SubtaskDebugInfo) validateTaskConfig(formats strfmt.Registry) error { + if swag.IsZero(m.TaskConfig) { // not required + return nil + } + + if m.TaskConfig != nil { + if err := m.TaskConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taskConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("taskConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this subtask debug info based on the context it is used +func (m *SubtaskDebugInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTaskConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SubtaskDebugInfo) contextValidateTaskConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TaskConfig != nil { + if err := m.TaskConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taskConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("taskConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SubtaskDebugInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubtaskDebugInfo) UnmarshalBinary(b []byte) error { + var res SubtaskDebugInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/success_response.go b/src/models/success_response.go new file mode 100644 index 0000000..80a1cd6 --- /dev/null +++ b/src/models/success_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SuccessResponse success response +// +// swagger:model SuccessResponse +type SuccessResponse struct { + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this success response +func (m *SuccessResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this success response based on context it is used +func (m *SuccessResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SuccessResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SuccessResponse) UnmarshalBinary(b []byte) error { + var res SuccessResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_and_schema_config.go b/src/models/table_and_schema_config.go new file mode 100644 index 0000000..f39a815 --- /dev/null +++ b/src/models/table_and_schema_config.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TableAndSchemaConfig table and schema config +// +// swagger:model TableAndSchemaConfig +type TableAndSchemaConfig struct { + + // schema + // Read Only: true + Schema *Schema `json:"schema,omitempty"` + + // table config + // Required: true + // Read Only: true + TableConfig *TableConfig `json:"tableConfig"` +} + +// Validate validates this table and schema config +func (m *TableAndSchemaConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSchema(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTableConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableAndSchemaConfig) validateSchema(formats strfmt.Registry) error { + if swag.IsZero(m.Schema) { // not required + return nil + } + + if m.Schema != nil { + if err := m.Schema.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schema") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("schema") + } + return err + } + } + + return nil +} + +func (m *TableAndSchemaConfig) validateTableConfig(formats strfmt.Registry) error { + + if err := validate.Required("tableConfig", "body", m.TableConfig); err != nil { + return err + } + + if m.TableConfig != nil { + if err := m.TableConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tableConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tableConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this table and schema config based on the context it is used +func (m *TableAndSchemaConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSchema(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTableConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableAndSchemaConfig) contextValidateSchema(ctx context.Context, formats strfmt.Registry) error { + + if m.Schema != nil { + if err := m.Schema.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schema") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("schema") + } + return err + } + } + + return nil +} + +func (m *TableAndSchemaConfig) contextValidateTableConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TableConfig != nil { + if err := m.TableConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tableConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tableConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableAndSchemaConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableAndSchemaConfig) UnmarshalBinary(b []byte) error { + var res TableAndSchemaConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_config.go b/src/models/table_config.go new file mode 100644 index 0000000..4df22fb --- /dev/null +++ b/src/models/table_config.go @@ -0,0 +1,989 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TableConfig table config +// +// swagger:model TableConfig +type TableConfig struct { + + // dedup config + DedupConfig *DedupConfig `json:"dedupConfig,omitempty"` + + // dimension table config + DimensionTableConfig *DimensionTableConfig `json:"dimensionTableConfig,omitempty"` + + // field config list + FieldConfigList []*FieldConfig `json:"fieldConfigList"` + + // ingestion config + IngestionConfig *IngestionConfig `json:"ingestionConfig,omitempty"` + + // instance assignment config map + InstanceAssignmentConfigMap map[string]InstanceAssignmentConfig `json:"instanceAssignmentConfigMap,omitempty"` + + // instance partitions map + InstancePartitionsMap map[string]string `json:"instancePartitionsMap,omitempty"` + + // is dim table + // Read Only: true + IsDimTable *bool `json:"isDimTable,omitempty"` + + // metadata + Metadata *TableCustomConfig `json:"metadata,omitempty"` + + // query + Query *QueryConfig `json:"query,omitempty"` + + // quota + Quota *QuotaConfig `json:"quota,omitempty"` + + // routing + Routing *RoutingConfig `json:"routing,omitempty"` + + // segment assignment config map + SegmentAssignmentConfigMap map[string]SegmentAssignmentConfig `json:"segmentAssignmentConfigMap,omitempty"` + + // segments config + SegmentsConfig *SegmentsValidationAndRetentionConfig `json:"segmentsConfig,omitempty"` + + // table index config + TableIndexConfig *IndexingConfig `json:"tableIndexConfig,omitempty"` + + // table name + // Read Only: true + TableName string `json:"tableName,omitempty"` + + // table type + // Read Only: true + // Enum: [OFFLINE REALTIME] + TableType string `json:"tableType,omitempty"` + + // task + Task *TableTaskConfig `json:"task,omitempty"` + + // tenants + Tenants *TenantConfig `json:"tenants,omitempty"` + + // tier configs + TierConfigs []*TierConfig `json:"tierConfigs"` + + // tuner configs + TunerConfigs []*TunerConfig `json:"tunerConfigs"` + + // upsert config + UpsertConfig *UpsertConfig `json:"upsertConfig,omitempty"` +} + +// Validate validates this table config +func (m *TableConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDedupConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDimensionTableConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFieldConfigList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIngestionConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceAssignmentConfigMap(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuota(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouting(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSegmentAssignmentConfigMap(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSegmentsConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTableIndexConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTableType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTask(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenants(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTierConfigs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTunerConfigs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpsertConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableConfig) validateDedupConfig(formats strfmt.Registry) error { + if swag.IsZero(m.DedupConfig) { // not required + return nil + } + + if m.DedupConfig != nil { + if err := m.DedupConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dedupConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dedupConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateDimensionTableConfig(formats strfmt.Registry) error { + if swag.IsZero(m.DimensionTableConfig) { // not required + return nil + } + + if m.DimensionTableConfig != nil { + if err := m.DimensionTableConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dimensionTableConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dimensionTableConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateFieldConfigList(formats strfmt.Registry) error { + if swag.IsZero(m.FieldConfigList) { // not required + return nil + } + + for i := 0; i < len(m.FieldConfigList); i++ { + if swag.IsZero(m.FieldConfigList[i]) { // not required + continue + } + + if m.FieldConfigList[i] != nil { + if err := m.FieldConfigList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fieldConfigList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fieldConfigList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) validateIngestionConfig(formats strfmt.Registry) error { + if swag.IsZero(m.IngestionConfig) { // not required + return nil + } + + if m.IngestionConfig != nil { + if err := m.IngestionConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ingestionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ingestionConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateInstanceAssignmentConfigMap(formats strfmt.Registry) error { + if swag.IsZero(m.InstanceAssignmentConfigMap) { // not required + return nil + } + + for k := range m.InstanceAssignmentConfigMap { + + if err := validate.Required("instanceAssignmentConfigMap"+"."+k, "body", m.InstanceAssignmentConfigMap[k]); err != nil { + return err + } + if val, ok := m.InstanceAssignmentConfigMap[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("instanceAssignmentConfigMap" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("instanceAssignmentConfigMap" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) validateMetadata(formats strfmt.Registry) error { + if swag.IsZero(m.Metadata) { // not required + return nil + } + + if m.Metadata != nil { + if err := m.Metadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("metadata") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateQuery(formats strfmt.Registry) error { + if swag.IsZero(m.Query) { // not required + return nil + } + + if m.Query != nil { + if err := m.Query.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("query") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("query") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateQuota(formats strfmt.Registry) error { + if swag.IsZero(m.Quota) { // not required + return nil + } + + if m.Quota != nil { + if err := m.Quota.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("quota") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("quota") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateRouting(formats strfmt.Registry) error { + if swag.IsZero(m.Routing) { // not required + return nil + } + + if m.Routing != nil { + if err := m.Routing.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routing") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("routing") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateSegmentAssignmentConfigMap(formats strfmt.Registry) error { + if swag.IsZero(m.SegmentAssignmentConfigMap) { // not required + return nil + } + + for k := range m.SegmentAssignmentConfigMap { + + if err := validate.Required("segmentAssignmentConfigMap"+"."+k, "body", m.SegmentAssignmentConfigMap[k]); err != nil { + return err + } + if val, ok := m.SegmentAssignmentConfigMap[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("segmentAssignmentConfigMap" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("segmentAssignmentConfigMap" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) validateSegmentsConfig(formats strfmt.Registry) error { + if swag.IsZero(m.SegmentsConfig) { // not required + return nil + } + + if m.SegmentsConfig != nil { + if err := m.SegmentsConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("segmentsConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("segmentsConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateTableIndexConfig(formats strfmt.Registry) error { + if swag.IsZero(m.TableIndexConfig) { // not required + return nil + } + + if m.TableIndexConfig != nil { + if err := m.TableIndexConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tableIndexConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tableIndexConfig") + } + return err + } + } + + return nil +} + +var tableConfigTypeTableTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["OFFLINE","REALTIME"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + tableConfigTypeTableTypePropEnum = append(tableConfigTypeTableTypePropEnum, v) + } +} + +const ( + + // TableConfigTableTypeOFFLINE captures enum value "OFFLINE" + TableConfigTableTypeOFFLINE string = "OFFLINE" + + // TableConfigTableTypeREALTIME captures enum value "REALTIME" + TableConfigTableTypeREALTIME string = "REALTIME" +) + +// prop value enum +func (m *TableConfig) validateTableTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, tableConfigTypeTableTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TableConfig) validateTableType(formats strfmt.Registry) error { + if swag.IsZero(m.TableType) { // not required + return nil + } + + // value enum + if err := m.validateTableTypeEnum("tableType", "body", m.TableType); err != nil { + return err + } + + return nil +} + +func (m *TableConfig) validateTask(formats strfmt.Registry) error { + if swag.IsZero(m.Task) { // not required + return nil + } + + if m.Task != nil { + if err := m.Task.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("task") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateTenants(formats strfmt.Registry) error { + if swag.IsZero(m.Tenants) { // not required + return nil + } + + if m.Tenants != nil { + if err := m.Tenants.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenants") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenants") + } + return err + } + } + + return nil +} + +func (m *TableConfig) validateTierConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.TierConfigs) { // not required + return nil + } + + for i := 0; i < len(m.TierConfigs); i++ { + if swag.IsZero(m.TierConfigs[i]) { // not required + continue + } + + if m.TierConfigs[i] != nil { + if err := m.TierConfigs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tierConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tierConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) validateTunerConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.TunerConfigs) { // not required + return nil + } + + for i := 0; i < len(m.TunerConfigs); i++ { + if swag.IsZero(m.TunerConfigs[i]) { // not required + continue + } + + if m.TunerConfigs[i] != nil { + if err := m.TunerConfigs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tunerConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tunerConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) validateUpsertConfig(formats strfmt.Registry) error { + if swag.IsZero(m.UpsertConfig) { // not required + return nil + } + + if m.UpsertConfig != nil { + if err := m.UpsertConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("upsertConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("upsertConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this table config based on the context it is used +func (m *TableConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDedupConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDimensionTableConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFieldConfigList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIngestionConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInstanceAssignmentConfigMap(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIsDimTable(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateQuery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateQuota(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRouting(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentAssignmentConfigMap(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentsConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTableIndexConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTableName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTableType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTask(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenants(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTierConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTunerConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpsertConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableConfig) contextValidateDedupConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.DedupConfig != nil { + if err := m.DedupConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dedupConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dedupConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateDimensionTableConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.DimensionTableConfig != nil { + if err := m.DimensionTableConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dimensionTableConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dimensionTableConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateFieldConfigList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.FieldConfigList); i++ { + + if m.FieldConfigList[i] != nil { + if err := m.FieldConfigList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fieldConfigList" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fieldConfigList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) contextValidateIngestionConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.IngestionConfig != nil { + if err := m.IngestionConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ingestionConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ingestionConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateInstanceAssignmentConfigMap(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.InstanceAssignmentConfigMap { + + if val, ok := m.InstanceAssignmentConfigMap[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *TableConfig) contextValidateIsDimTable(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "isDimTable", "body", m.IsDimTable); err != nil { + return err + } + + return nil +} + +func (m *TableConfig) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.Metadata != nil { + if err := m.Metadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("metadata") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateQuery(ctx context.Context, formats strfmt.Registry) error { + + if m.Query != nil { + if err := m.Query.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("query") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("query") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateQuota(ctx context.Context, formats strfmt.Registry) error { + + if m.Quota != nil { + if err := m.Quota.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("quota") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("quota") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateRouting(ctx context.Context, formats strfmt.Registry) error { + + if m.Routing != nil { + if err := m.Routing.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routing") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("routing") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateSegmentAssignmentConfigMap(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.SegmentAssignmentConfigMap { + + if val, ok := m.SegmentAssignmentConfigMap[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *TableConfig) contextValidateSegmentsConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SegmentsConfig != nil { + if err := m.SegmentsConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("segmentsConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("segmentsConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateTableIndexConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TableIndexConfig != nil { + if err := m.TableIndexConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tableIndexConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tableIndexConfig") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateTableName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tableName", "body", string(m.TableName)); err != nil { + return err + } + + return nil +} + +func (m *TableConfig) contextValidateTableType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tableType", "body", string(m.TableType)); err != nil { + return err + } + + return nil +} + +func (m *TableConfig) contextValidateTask(ctx context.Context, formats strfmt.Registry) error { + + if m.Task != nil { + if err := m.Task.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("task") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateTenants(ctx context.Context, formats strfmt.Registry) error { + + if m.Tenants != nil { + if err := m.Tenants.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenants") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenants") + } + return err + } + } + + return nil +} + +func (m *TableConfig) contextValidateTierConfigs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TierConfigs); i++ { + + if m.TierConfigs[i] != nil { + if err := m.TierConfigs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tierConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tierConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) contextValidateTunerConfigs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TunerConfigs); i++ { + + if m.TunerConfigs[i] != nil { + if err := m.TunerConfigs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tunerConfigs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tunerConfigs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TableConfig) contextValidateUpsertConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.UpsertConfig != nil { + if err := m.UpsertConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("upsertConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("upsertConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableConfig) UnmarshalBinary(b []byte) error { + var res TableConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_custom_config.go b/src/models/table_custom_config.go new file mode 100644 index 0000000..73e440b --- /dev/null +++ b/src/models/table_custom_config.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TableCustomConfig table custom config +// +// swagger:model TableCustomConfig +type TableCustomConfig struct { + + // custom configs + // Read Only: true + CustomConfigs map[string]string `json:"customConfigs,omitempty"` +} + +// Validate validates this table custom config +func (m *TableCustomConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this table custom config based on the context it is used +func (m *TableCustomConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableCustomConfig) contextValidateCustomConfigs(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *TableCustomConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableCustomConfig) UnmarshalBinary(b []byte) error { + var res TableCustomConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_size_details.go b/src/models/table_size_details.go new file mode 100644 index 0000000..ff710b6 --- /dev/null +++ b/src/models/table_size_details.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TableSizeDetails table size details +// +// swagger:model TableSizeDetails +type TableSizeDetails struct { + + // estimated size in bytes + EstimatedSizeInBytes int64 `json:"estimatedSizeInBytes,omitempty"` + + // offline segments + OfflineSegments *TableSubTypeSizeDetails `json:"offlineSegments,omitempty"` + + // realtime segments + RealtimeSegments *TableSubTypeSizeDetails `json:"realtimeSegments,omitempty"` + + // reported size in bytes + ReportedSizeInBytes int64 `json:"reportedSizeInBytes,omitempty"` + + // table name + TableName string `json:"tableName,omitempty"` +} + +// Validate validates this table size details +func (m *TableSizeDetails) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOfflineSegments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRealtimeSegments(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableSizeDetails) validateOfflineSegments(formats strfmt.Registry) error { + if swag.IsZero(m.OfflineSegments) { // not required + return nil + } + + if m.OfflineSegments != nil { + if err := m.OfflineSegments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("offlineSegments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("offlineSegments") + } + return err + } + } + + return nil +} + +func (m *TableSizeDetails) validateRealtimeSegments(formats strfmt.Registry) error { + if swag.IsZero(m.RealtimeSegments) { // not required + return nil + } + + if m.RealtimeSegments != nil { + if err := m.RealtimeSegments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("realtimeSegments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("realtimeSegments") + } + return err + } + } + + return nil +} + +// ContextValidate validate this table size details based on the context it is used +func (m *TableSizeDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOfflineSegments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRealtimeSegments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableSizeDetails) contextValidateOfflineSegments(ctx context.Context, formats strfmt.Registry) error { + + if m.OfflineSegments != nil { + if err := m.OfflineSegments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("offlineSegments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("offlineSegments") + } + return err + } + } + + return nil +} + +func (m *TableSizeDetails) contextValidateRealtimeSegments(ctx context.Context, formats strfmt.Registry) error { + + if m.RealtimeSegments != nil { + if err := m.RealtimeSegments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("realtimeSegments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("realtimeSegments") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableSizeDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableSizeDetails) UnmarshalBinary(b []byte) error { + var res TableSizeDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_sub_type_size_details.go b/src/models/table_sub_type_size_details.go new file mode 100644 index 0000000..5262980 --- /dev/null +++ b/src/models/table_sub_type_size_details.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TableSubTypeSizeDetails table sub type size details +// +// swagger:model TableSubTypeSizeDetails +type TableSubTypeSizeDetails struct { + + // estimated size in bytes + EstimatedSizeInBytes int64 `json:"estimatedSizeInBytes,omitempty"` + + // missing segments + MissingSegments int32 `json:"missingSegments,omitempty"` + + // reported size in bytes + ReportedSizeInBytes int64 `json:"reportedSizeInBytes,omitempty"` + + // segments + Segments map[string]SegmentSizeDetails `json:"segments,omitempty"` +} + +// Validate validates this table sub type size details +func (m *TableSubTypeSizeDetails) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSegments(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableSubTypeSizeDetails) validateSegments(formats strfmt.Registry) error { + if swag.IsZero(m.Segments) { // not required + return nil + } + + for k := range m.Segments { + + if err := validate.Required("segments"+"."+k, "body", m.Segments[k]); err != nil { + return err + } + if val, ok := m.Segments[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("segments" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("segments" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this table sub type size details based on the context it is used +func (m *TableSubTypeSizeDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSegments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableSubTypeSizeDetails) contextValidateSegments(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Segments { + + if val, ok := m.Segments[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableSubTypeSizeDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableSubTypeSizeDetails) UnmarshalBinary(b []byte) error { + var res TableSubTypeSizeDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_task_config.go b/src/models/table_task_config.go new file mode 100644 index 0000000..9c09540 --- /dev/null +++ b/src/models/table_task_config.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TableTaskConfig table task config +// +// swagger:model TableTaskConfig +type TableTaskConfig struct { + + // task type configs map + // Read Only: true + TaskTypeConfigsMap map[string]map[string]string `json:"taskTypeConfigsMap,omitempty"` +} + +// Validate validates this table task config +func (m *TableTaskConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this table task config based on the context it is used +func (m *TableTaskConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTaskTypeConfigsMap(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableTaskConfig) contextValidateTaskTypeConfigsMap(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *TableTaskConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableTaskConfig) UnmarshalBinary(b []byte) error { + var res TableTaskConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_tier_details.go b/src/models/table_tier_details.go new file mode 100644 index 0000000..217e803 --- /dev/null +++ b/src/models/table_tier_details.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TableTierDetails table tier details +// +// swagger:model TableTierDetails +type TableTierDetails struct { + + // Storage tiers of segments for the given table + // Read Only: true + SegmentTiers map[string]map[string]string `json:"segmentTiers,omitempty"` + + // Name of table to look for segment storage tiers + // Read Only: true + TableName string `json:"tableName,omitempty"` +} + +// Validate validates this table tier details +func (m *TableTierDetails) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this table tier details based on the context it is used +func (m *TableTierDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSegmentTiers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTableName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableTierDetails) contextValidateSegmentTiers(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *TableTierDetails) contextValidateTableName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tableName", "body", string(m.TableName)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableTierDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableTierDetails) UnmarshalBinary(b []byte) error { + var res TableTierDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_view.go b/src/models/table_view.go new file mode 100644 index 0000000..c773fc6 --- /dev/null +++ b/src/models/table_view.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TableView table view +// +// swagger:model TableView +type TableView struct { + + // o f f l i n e + OFFLINE map[string]map[string]string `json:"OFFLINE,omitempty"` + + // r e a l t i m e + REALTIME map[string]map[string]string `json:"REALTIME,omitempty"` +} + +// Validate validates this table view +func (m *TableView) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this table view based on context it is used +func (m *TableView) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TableView) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableView) UnmarshalBinary(b []byte) error { + var res TableView + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/table_write_config.go b/src/models/table_write_config.go new file mode 100644 index 0000000..270e140 --- /dev/null +++ b/src/models/table_write_config.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TableWriteConfig table write config +// +// swagger:model TableWriteConfig +type TableWriteConfig struct { + + // encoder class + EncoderClass string `json:"encoderClass,omitempty"` + + // encoder config + EncoderConfig map[string]string `json:"encoderConfig,omitempty"` + + // partition columns + PartitionColumns []string `json:"partitionColumns"` + + // producer config + ProducerConfig map[string]string `json:"producerConfig,omitempty"` + + // producer type + ProducerType string `json:"producerType,omitempty"` + + // topic + Topic string `json:"topic,omitempty"` +} + +// Validate validates this table write config +func (m *TableWriteConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this table write config based on context it is used +func (m *TableWriteConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TableWriteConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableWriteConfig) UnmarshalBinary(b []byte) error { + var res TableWriteConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tag_override_config.go b/src/models/tag_override_config.go new file mode 100644 index 0000000..a241977 --- /dev/null +++ b/src/models/tag_override_config.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TagOverrideConfig tag override config +// +// swagger:model TagOverrideConfig +type TagOverrideConfig struct { + + // realtime completed + // Read Only: true + RealtimeCompleted string `json:"realtimeCompleted,omitempty"` + + // realtime consuming + // Read Only: true + RealtimeConsuming string `json:"realtimeConsuming,omitempty"` +} + +// Validate validates this tag override config +func (m *TagOverrideConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this tag override config based on the context it is used +func (m *TagOverrideConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRealtimeCompleted(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRealtimeConsuming(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TagOverrideConfig) contextValidateRealtimeCompleted(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "realtimeCompleted", "body", string(m.RealtimeCompleted)); err != nil { + return err + } + + return nil +} + +func (m *TagOverrideConfig) contextValidateRealtimeConsuming(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "realtimeConsuming", "body", string(m.RealtimeConsuming)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TagOverrideConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TagOverrideConfig) UnmarshalBinary(b []byte) error { + var res TagOverrideConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/task_count.go b/src/models/task_count.go new file mode 100644 index 0000000..f48b995 --- /dev/null +++ b/src/models/task_count.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskCount task count +// +// swagger:model TaskCount +type TaskCount struct { + + // completed + Completed int32 `json:"completed,omitempty"` + + // error + Error int32 `json:"error,omitempty"` + + // running + Running int32 `json:"running,omitempty"` + + // total + Total int32 `json:"total,omitempty"` + + // unknown + Unknown int32 `json:"unknown,omitempty"` + + // waiting + Waiting int32 `json:"waiting,omitempty"` +} + +// Validate validates this task count +func (m *TaskCount) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this task count based on context it is used +func (m *TaskCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaskCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskCount) UnmarshalBinary(b []byte) error { + var res TaskCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/task_debug_info.go b/src/models/task_debug_info.go new file mode 100644 index 0000000..563208b --- /dev/null +++ b/src/models/task_debug_info.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TaskDebugInfo task debug info +// +// swagger:model TaskDebugInfo +type TaskDebugInfo struct { + + // execution start time + ExecutionStartTime string `json:"executionStartTime,omitempty"` + + // finish time + FinishTime string `json:"finishTime,omitempty"` + + // start time + StartTime string `json:"startTime,omitempty"` + + // subtask count + SubtaskCount *TaskCount `json:"subtaskCount,omitempty"` + + // subtask infos + SubtaskInfos []*SubtaskDebugInfo `json:"subtaskInfos"` + + // task state + // Enum: [NOT_STARTED IN_PROGRESS STOPPED STOPPING FAILED COMPLETED ABORTED TIMED_OUT TIMING_OUT FAILING] + TaskState string `json:"taskState,omitempty"` +} + +// Validate validates this task debug info +func (m *TaskDebugInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSubtaskCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubtaskInfos(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaskState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskDebugInfo) validateSubtaskCount(formats strfmt.Registry) error { + if swag.IsZero(m.SubtaskCount) { // not required + return nil + } + + if m.SubtaskCount != nil { + if err := m.SubtaskCount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subtaskCount") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subtaskCount") + } + return err + } + } + + return nil +} + +func (m *TaskDebugInfo) validateSubtaskInfos(formats strfmt.Registry) error { + if swag.IsZero(m.SubtaskInfos) { // not required + return nil + } + + for i := 0; i < len(m.SubtaskInfos); i++ { + if swag.IsZero(m.SubtaskInfos[i]) { // not required + continue + } + + if m.SubtaskInfos[i] != nil { + if err := m.SubtaskInfos[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subtaskInfos" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subtaskInfos" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var taskDebugInfoTypeTaskStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + taskDebugInfoTypeTaskStatePropEnum = append(taskDebugInfoTypeTaskStatePropEnum, v) + } +} + +const ( + + // TaskDebugInfoTaskStateNOTSTARTED captures enum value "NOT_STARTED" + TaskDebugInfoTaskStateNOTSTARTED string = "NOT_STARTED" + + // TaskDebugInfoTaskStateINPROGRESS captures enum value "IN_PROGRESS" + TaskDebugInfoTaskStateINPROGRESS string = "IN_PROGRESS" + + // TaskDebugInfoTaskStateSTOPPED captures enum value "STOPPED" + TaskDebugInfoTaskStateSTOPPED string = "STOPPED" + + // TaskDebugInfoTaskStateSTOPPING captures enum value "STOPPING" + TaskDebugInfoTaskStateSTOPPING string = "STOPPING" + + // TaskDebugInfoTaskStateFAILED captures enum value "FAILED" + TaskDebugInfoTaskStateFAILED string = "FAILED" + + // TaskDebugInfoTaskStateCOMPLETED captures enum value "COMPLETED" + TaskDebugInfoTaskStateCOMPLETED string = "COMPLETED" + + // TaskDebugInfoTaskStateABORTED captures enum value "ABORTED" + TaskDebugInfoTaskStateABORTED string = "ABORTED" + + // TaskDebugInfoTaskStateTIMEDOUT captures enum value "TIMED_OUT" + TaskDebugInfoTaskStateTIMEDOUT string = "TIMED_OUT" + + // TaskDebugInfoTaskStateTIMINGOUT captures enum value "TIMING_OUT" + TaskDebugInfoTaskStateTIMINGOUT string = "TIMING_OUT" + + // TaskDebugInfoTaskStateFAILING captures enum value "FAILING" + TaskDebugInfoTaskStateFAILING string = "FAILING" +) + +// prop value enum +func (m *TaskDebugInfo) validateTaskStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, taskDebugInfoTypeTaskStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TaskDebugInfo) validateTaskState(formats strfmt.Registry) error { + if swag.IsZero(m.TaskState) { // not required + return nil + } + + // value enum + if err := m.validateTaskStateEnum("taskState", "body", m.TaskState); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this task debug info based on the context it is used +func (m *TaskDebugInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSubtaskCount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubtaskInfos(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskDebugInfo) contextValidateSubtaskCount(ctx context.Context, formats strfmt.Registry) error { + + if m.SubtaskCount != nil { + if err := m.SubtaskCount.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subtaskCount") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subtaskCount") + } + return err + } + } + + return nil +} + +func (m *TaskDebugInfo) contextValidateSubtaskInfos(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SubtaskInfos); i++ { + + if m.SubtaskInfos[i] != nil { + if err := m.SubtaskInfos[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subtaskInfos" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subtaskInfos" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskDebugInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskDebugInfo) UnmarshalBinary(b []byte) error { + var res TaskDebugInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tenant.go b/src/models/tenant.go new file mode 100644 index 0000000..3b91a03 --- /dev/null +++ b/src/models/tenant.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Tenant tenant +// +// swagger:model Tenant +type Tenant struct { + + // number of instances + // Read Only: true + NumberOfInstances int32 `json:"numberOfInstances,omitempty"` + + // offline instances + // Read Only: true + OfflineInstances int32 `json:"offlineInstances,omitempty"` + + // realtime instances + // Read Only: true + RealtimeInstances int32 `json:"realtimeInstances,omitempty"` + + // tenant name + // Required: true + // Read Only: true + TenantName string `json:"tenantName"` + + // tenant role + // Required: true + // Read Only: true + // Enum: [SERVER BROKER MINION] + TenantRole string `json:"tenantRole"` +} + +// Validate validates this tenant +func (m *Tenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTenantName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantRole(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tenant) validateTenantName(formats strfmt.Registry) error { + + if err := validate.RequiredString("tenantName", "body", m.TenantName); err != nil { + return err + } + + return nil +} + +var tenantTypeTenantRolePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERVER","BROKER","MINION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + tenantTypeTenantRolePropEnum = append(tenantTypeTenantRolePropEnum, v) + } +} + +const ( + + // TenantTenantRoleSERVER captures enum value "SERVER" + TenantTenantRoleSERVER string = "SERVER" + + // TenantTenantRoleBROKER captures enum value "BROKER" + TenantTenantRoleBROKER string = "BROKER" + + // TenantTenantRoleMINION captures enum value "MINION" + TenantTenantRoleMINION string = "MINION" +) + +// prop value enum +func (m *Tenant) validateTenantRoleEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, tenantTypeTenantRolePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Tenant) validateTenantRole(formats strfmt.Registry) error { + + if err := validate.RequiredString("tenantRole", "body", m.TenantRole); err != nil { + return err + } + + // value enum + if err := m.validateTenantRoleEnum("tenantRole", "body", m.TenantRole); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this tenant based on the context it is used +func (m *Tenant) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNumberOfInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfflineInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRealtimeInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenantName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenantRole(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tenant) contextValidateNumberOfInstances(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "numberOfInstances", "body", int32(m.NumberOfInstances)); err != nil { + return err + } + + return nil +} + +func (m *Tenant) contextValidateOfflineInstances(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "offlineInstances", "body", int32(m.OfflineInstances)); err != nil { + return err + } + + return nil +} + +func (m *Tenant) contextValidateRealtimeInstances(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "realtimeInstances", "body", int32(m.RealtimeInstances)); err != nil { + return err + } + + return nil +} + +func (m *Tenant) contextValidateTenantName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tenantName", "body", string(m.TenantName)); err != nil { + return err + } + + return nil +} + +func (m *Tenant) contextValidateTenantRole(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tenantRole", "body", string(m.TenantRole)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Tenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Tenant) UnmarshalBinary(b []byte) error { + var res Tenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tenant_config.go b/src/models/tenant_config.go new file mode 100644 index 0000000..0691fba --- /dev/null +++ b/src/models/tenant_config.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TenantConfig tenant config +// +// swagger:model TenantConfig +type TenantConfig struct { + + // broker + // Read Only: true + Broker string `json:"broker,omitempty"` + + // server + // Read Only: true + Server string `json:"server,omitempty"` + + // tag override config + // Read Only: true + TagOverrideConfig *TagOverrideConfig `json:"tagOverrideConfig,omitempty"` +} + +// Validate validates this tenant config +func (m *TenantConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTagOverrideConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantConfig) validateTagOverrideConfig(formats strfmt.Registry) error { + if swag.IsZero(m.TagOverrideConfig) { // not required + return nil + } + + if m.TagOverrideConfig != nil { + if err := m.TagOverrideConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagOverrideConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tagOverrideConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this tenant config based on the context it is used +func (m *TenantConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBroker(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTagOverrideConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantConfig) contextValidateBroker(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "broker", "body", string(m.Broker)); err != nil { + return err + } + + return nil +} + +func (m *TenantConfig) contextValidateServer(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "server", "body", string(m.Server)); err != nil { + return err + } + + return nil +} + +func (m *TenantConfig) contextValidateTagOverrideConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TagOverrideConfig != nil { + if err := m.TagOverrideConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagOverrideConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tagOverrideConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenantConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantConfig) UnmarshalBinary(b []byte) error { + var res TenantConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tenant_metadata.go b/src/models/tenant_metadata.go new file mode 100644 index 0000000..77b454a --- /dev/null +++ b/src/models/tenant_metadata.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TenantMetadata tenant metadata +// +// swagger:model TenantMetadata +type TenantMetadata struct { + + // broker instances + // Unique: true + BrokerInstances []string `json:"BrokerInstances"` + + // offline server instances + // Unique: true + OfflineServerInstances []string `json:"OfflineServerInstances"` + + // realtime server instances + // Unique: true + RealtimeServerInstances []string `json:"RealtimeServerInstances"` + + // server instances + // Unique: true + ServerInstances []string `json:"ServerInstances"` + + // tenant name + TenantName string `json:"tenantName,omitempty"` +} + +// Validate validates this tenant metadata +func (m *TenantMetadata) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBrokerInstances(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfflineServerInstances(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRealtimeServerInstances(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServerInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantMetadata) validateBrokerInstances(formats strfmt.Registry) error { + if swag.IsZero(m.BrokerInstances) { // not required + return nil + } + + if err := validate.UniqueItems("BrokerInstances", "body", m.BrokerInstances); err != nil { + return err + } + + return nil +} + +func (m *TenantMetadata) validateOfflineServerInstances(formats strfmt.Registry) error { + if swag.IsZero(m.OfflineServerInstances) { // not required + return nil + } + + if err := validate.UniqueItems("OfflineServerInstances", "body", m.OfflineServerInstances); err != nil { + return err + } + + return nil +} + +func (m *TenantMetadata) validateRealtimeServerInstances(formats strfmt.Registry) error { + if swag.IsZero(m.RealtimeServerInstances) { // not required + return nil + } + + if err := validate.UniqueItems("RealtimeServerInstances", "body", m.RealtimeServerInstances); err != nil { + return err + } + + return nil +} + +func (m *TenantMetadata) validateServerInstances(formats strfmt.Registry) error { + if swag.IsZero(m.ServerInstances) { // not required + return nil + } + + if err := validate.UniqueItems("ServerInstances", "body", m.ServerInstances); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this tenant metadata based on context it is used +func (m *TenantMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TenantMetadata) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantMetadata) UnmarshalBinary(b []byte) error { + var res TenantMetadata + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tenants_list.go b/src/models/tenants_list.go new file mode 100644 index 0000000..f098a53 --- /dev/null +++ b/src/models/tenants_list.go @@ -0,0 +1,94 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TenantsList tenants list +// +// swagger:model TenantsList +type TenantsList struct { + + // b r o k e r t e n a n t s + // Unique: true + BROKERTENANTS []string `json:"BROKER_TENANTS"` + + // s e r v e r t e n a n t s + // Unique: true + SERVERTENANTS []string `json:"SERVER_TENANTS"` +} + +// Validate validates this tenants list +func (m *TenantsList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBROKERTENANTS(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSERVERTENANTS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantsList) validateBROKERTENANTS(formats strfmt.Registry) error { + if swag.IsZero(m.BROKERTENANTS) { // not required + return nil + } + + if err := validate.UniqueItems("BROKER_TENANTS", "body", m.BROKERTENANTS); err != nil { + return err + } + + return nil +} + +func (m *TenantsList) validateSERVERTENANTS(formats strfmt.Registry) error { + if swag.IsZero(m.SERVERTENANTS) { // not required + return nil + } + + if err := validate.UniqueItems("SERVER_TENANTS", "body", m.SERVERTENANTS); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this tenants list based on context it is used +func (m *TenantsList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TenantsList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantsList) UnmarshalBinary(b []byte) error { + var res TenantsList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tier_config.go b/src/models/tier_config.go new file mode 100644 index 0000000..2dd2f12 --- /dev/null +++ b/src/models/tier_config.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TierConfig tier config +// +// swagger:model TierConfig +type TierConfig struct { + + // name + // Required: true + // Read Only: true + Name string `json:"name"` + + // segment age + // Read Only: true + SegmentAge string `json:"segmentAge,omitempty"` + + // segment list + // Read Only: true + SegmentList []string `json:"segmentList"` + + // segment selector type + // Required: true + // Read Only: true + SegmentSelectorType string `json:"segmentSelectorType"` + + // server tag + // Read Only: true + ServerTag string `json:"serverTag,omitempty"` + + // storage type + // Required: true + // Read Only: true + StorageType string `json:"storageType"` + + // tier backend + // Read Only: true + TierBackend string `json:"tierBackend,omitempty"` + + // tier backend properties + // Read Only: true + TierBackendProperties map[string]string `json:"tierBackendProperties,omitempty"` +} + +// Validate validates this tier config +func (m *TierConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSegmentSelectorType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TierConfig) validateName(formats strfmt.Registry) error { + + if err := validate.RequiredString("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) validateSegmentSelectorType(formats strfmt.Registry) error { + + if err := validate.RequiredString("segmentSelectorType", "body", m.SegmentSelectorType); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) validateStorageType(formats strfmt.Registry) error { + + if err := validate.RequiredString("storageType", "body", m.StorageType); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this tier config based on the context it is used +func (m *TierConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentAge(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSegmentSelectorType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServerTag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTierBackend(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTierBackendProperties(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TierConfig) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "name", "body", string(m.Name)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateSegmentAge(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentAge", "body", string(m.SegmentAge)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateSegmentList(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentList", "body", []string(m.SegmentList)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateSegmentSelectorType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "segmentSelectorType", "body", string(m.SegmentSelectorType)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateServerTag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "serverTag", "body", string(m.ServerTag)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateStorageType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "storageType", "body", string(m.StorageType)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateTierBackend(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "tierBackend", "body", string(m.TierBackend)); err != nil { + return err + } + + return nil +} + +func (m *TierConfig) contextValidateTierBackendProperties(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *TierConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TierConfig) UnmarshalBinary(b []byte) error { + var res TierConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/time_field_spec.go b/src/models/time_field_spec.go new file mode 100644 index 0000000..2f467db --- /dev/null +++ b/src/models/time_field_spec.go @@ -0,0 +1,256 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TimeFieldSpec time field spec +// +// swagger:model TimeFieldSpec +type TimeFieldSpec struct { + + // data type + // Enum: [INT LONG FLOAT DOUBLE BIG_DECIMAL BOOLEAN TIMESTAMP STRING JSON BYTES STRUCT MAP LIST] + DataType string `json:"dataType,omitempty"` + + // default null value + DefaultNullValue interface{} `json:"defaultNullValue,omitempty"` + + // default null value string + DefaultNullValueString string `json:"defaultNullValueString,omitempty"` + + // incoming granularity spec + IncomingGranularitySpec *TimeGranularitySpec `json:"incomingGranularitySpec,omitempty"` + + // max length + MaxLength int32 `json:"maxLength,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // outgoing granularity spec + OutgoingGranularitySpec *TimeGranularitySpec `json:"outgoingGranularitySpec,omitempty"` + + // single value field + SingleValueField bool `json:"singleValueField,omitempty"` + + // transform function + TransformFunction string `json:"transformFunction,omitempty"` + + // virtual column provider + VirtualColumnProvider string `json:"virtualColumnProvider,omitempty"` +} + +// Validate validates this time field spec +func (m *TimeFieldSpec) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDataType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIncomingGranularitySpec(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOutgoingGranularitySpec(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var timeFieldSpecTypeDataTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + timeFieldSpecTypeDataTypePropEnum = append(timeFieldSpecTypeDataTypePropEnum, v) + } +} + +const ( + + // TimeFieldSpecDataTypeINT captures enum value "INT" + TimeFieldSpecDataTypeINT string = "INT" + + // TimeFieldSpecDataTypeLONG captures enum value "LONG" + TimeFieldSpecDataTypeLONG string = "LONG" + + // TimeFieldSpecDataTypeFLOAT captures enum value "FLOAT" + TimeFieldSpecDataTypeFLOAT string = "FLOAT" + + // TimeFieldSpecDataTypeDOUBLE captures enum value "DOUBLE" + TimeFieldSpecDataTypeDOUBLE string = "DOUBLE" + + // TimeFieldSpecDataTypeBIGDECIMAL captures enum value "BIG_DECIMAL" + TimeFieldSpecDataTypeBIGDECIMAL string = "BIG_DECIMAL" + + // TimeFieldSpecDataTypeBOOLEAN captures enum value "BOOLEAN" + TimeFieldSpecDataTypeBOOLEAN string = "BOOLEAN" + + // TimeFieldSpecDataTypeTIMESTAMP captures enum value "TIMESTAMP" + TimeFieldSpecDataTypeTIMESTAMP string = "TIMESTAMP" + + // TimeFieldSpecDataTypeSTRING captures enum value "STRING" + TimeFieldSpecDataTypeSTRING string = "STRING" + + // TimeFieldSpecDataTypeJSON captures enum value "JSON" + TimeFieldSpecDataTypeJSON string = "JSON" + + // TimeFieldSpecDataTypeBYTES captures enum value "BYTES" + TimeFieldSpecDataTypeBYTES string = "BYTES" + + // TimeFieldSpecDataTypeSTRUCT captures enum value "STRUCT" + TimeFieldSpecDataTypeSTRUCT string = "STRUCT" + + // TimeFieldSpecDataTypeMAP captures enum value "MAP" + TimeFieldSpecDataTypeMAP string = "MAP" + + // TimeFieldSpecDataTypeLIST captures enum value "LIST" + TimeFieldSpecDataTypeLIST string = "LIST" +) + +// prop value enum +func (m *TimeFieldSpec) validateDataTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, timeFieldSpecTypeDataTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TimeFieldSpec) validateDataType(formats strfmt.Registry) error { + if swag.IsZero(m.DataType) { // not required + return nil + } + + // value enum + if err := m.validateDataTypeEnum("dataType", "body", m.DataType); err != nil { + return err + } + + return nil +} + +func (m *TimeFieldSpec) validateIncomingGranularitySpec(formats strfmt.Registry) error { + if swag.IsZero(m.IncomingGranularitySpec) { // not required + return nil + } + + if m.IncomingGranularitySpec != nil { + if err := m.IncomingGranularitySpec.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incomingGranularitySpec") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incomingGranularitySpec") + } + return err + } + } + + return nil +} + +func (m *TimeFieldSpec) validateOutgoingGranularitySpec(formats strfmt.Registry) error { + if swag.IsZero(m.OutgoingGranularitySpec) { // not required + return nil + } + + if m.OutgoingGranularitySpec != nil { + if err := m.OutgoingGranularitySpec.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("outgoingGranularitySpec") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("outgoingGranularitySpec") + } + return err + } + } + + return nil +} + +// ContextValidate validate this time field spec based on the context it is used +func (m *TimeFieldSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIncomingGranularitySpec(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOutgoingGranularitySpec(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TimeFieldSpec) contextValidateIncomingGranularitySpec(ctx context.Context, formats strfmt.Registry) error { + + if m.IncomingGranularitySpec != nil { + if err := m.IncomingGranularitySpec.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incomingGranularitySpec") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incomingGranularitySpec") + } + return err + } + } + + return nil +} + +func (m *TimeFieldSpec) contextValidateOutgoingGranularitySpec(ctx context.Context, formats strfmt.Registry) error { + + if m.OutgoingGranularitySpec != nil { + if err := m.OutgoingGranularitySpec.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("outgoingGranularitySpec") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("outgoingGranularitySpec") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TimeFieldSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TimeFieldSpec) UnmarshalBinary(b []byte) error { + var res TimeFieldSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/time_granularity_spec.go b/src/models/time_granularity_spec.go new file mode 100644 index 0000000..0dd8bf5 --- /dev/null +++ b/src/models/time_granularity_spec.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TimeGranularitySpec time granularity spec +// +// swagger:model TimeGranularitySpec +type TimeGranularitySpec struct { + + // data type + // Enum: [INT LONG FLOAT DOUBLE BIG_DECIMAL BOOLEAN TIMESTAMP STRING JSON BYTES STRUCT MAP LIST] + DataType string `json:"dataType,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // time format + TimeFormat string `json:"timeFormat,omitempty"` + + // time type + // Enum: [NANOSECONDS MICROSECONDS MILLISECONDS SECONDS MINUTES HOURS DAYS] + TimeType string `json:"timeType,omitempty"` + + // time unit size + TimeUnitSize int32 `json:"timeUnitSize,omitempty"` +} + +// Validate validates this time granularity spec +func (m *TimeGranularitySpec) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDataType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var timeGranularitySpecTypeDataTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + timeGranularitySpecTypeDataTypePropEnum = append(timeGranularitySpecTypeDataTypePropEnum, v) + } +} + +const ( + + // TimeGranularitySpecDataTypeINT captures enum value "INT" + TimeGranularitySpecDataTypeINT string = "INT" + + // TimeGranularitySpecDataTypeLONG captures enum value "LONG" + TimeGranularitySpecDataTypeLONG string = "LONG" + + // TimeGranularitySpecDataTypeFLOAT captures enum value "FLOAT" + TimeGranularitySpecDataTypeFLOAT string = "FLOAT" + + // TimeGranularitySpecDataTypeDOUBLE captures enum value "DOUBLE" + TimeGranularitySpecDataTypeDOUBLE string = "DOUBLE" + + // TimeGranularitySpecDataTypeBIGDECIMAL captures enum value "BIG_DECIMAL" + TimeGranularitySpecDataTypeBIGDECIMAL string = "BIG_DECIMAL" + + // TimeGranularitySpecDataTypeBOOLEAN captures enum value "BOOLEAN" + TimeGranularitySpecDataTypeBOOLEAN string = "BOOLEAN" + + // TimeGranularitySpecDataTypeTIMESTAMP captures enum value "TIMESTAMP" + TimeGranularitySpecDataTypeTIMESTAMP string = "TIMESTAMP" + + // TimeGranularitySpecDataTypeSTRING captures enum value "STRING" + TimeGranularitySpecDataTypeSTRING string = "STRING" + + // TimeGranularitySpecDataTypeJSON captures enum value "JSON" + TimeGranularitySpecDataTypeJSON string = "JSON" + + // TimeGranularitySpecDataTypeBYTES captures enum value "BYTES" + TimeGranularitySpecDataTypeBYTES string = "BYTES" + + // TimeGranularitySpecDataTypeSTRUCT captures enum value "STRUCT" + TimeGranularitySpecDataTypeSTRUCT string = "STRUCT" + + // TimeGranularitySpecDataTypeMAP captures enum value "MAP" + TimeGranularitySpecDataTypeMAP string = "MAP" + + // TimeGranularitySpecDataTypeLIST captures enum value "LIST" + TimeGranularitySpecDataTypeLIST string = "LIST" +) + +// prop value enum +func (m *TimeGranularitySpec) validateDataTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, timeGranularitySpecTypeDataTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TimeGranularitySpec) validateDataType(formats strfmt.Registry) error { + if swag.IsZero(m.DataType) { // not required + return nil + } + + // value enum + if err := m.validateDataTypeEnum("dataType", "body", m.DataType); err != nil { + return err + } + + return nil +} + +var timeGranularitySpecTypeTimeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + timeGranularitySpecTypeTimeTypePropEnum = append(timeGranularitySpecTypeTimeTypePropEnum, v) + } +} + +const ( + + // TimeGranularitySpecTimeTypeNANOSECONDS captures enum value "NANOSECONDS" + TimeGranularitySpecTimeTypeNANOSECONDS string = "NANOSECONDS" + + // TimeGranularitySpecTimeTypeMICROSECONDS captures enum value "MICROSECONDS" + TimeGranularitySpecTimeTypeMICROSECONDS string = "MICROSECONDS" + + // TimeGranularitySpecTimeTypeMILLISECONDS captures enum value "MILLISECONDS" + TimeGranularitySpecTimeTypeMILLISECONDS string = "MILLISECONDS" + + // TimeGranularitySpecTimeTypeSECONDS captures enum value "SECONDS" + TimeGranularitySpecTimeTypeSECONDS string = "SECONDS" + + // TimeGranularitySpecTimeTypeMINUTES captures enum value "MINUTES" + TimeGranularitySpecTimeTypeMINUTES string = "MINUTES" + + // TimeGranularitySpecTimeTypeHOURS captures enum value "HOURS" + TimeGranularitySpecTimeTypeHOURS string = "HOURS" + + // TimeGranularitySpecTimeTypeDAYS captures enum value "DAYS" + TimeGranularitySpecTimeTypeDAYS string = "DAYS" +) + +// prop value enum +func (m *TimeGranularitySpec) validateTimeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, timeGranularitySpecTypeTimeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TimeGranularitySpec) validateTimeType(formats strfmt.Registry) error { + if swag.IsZero(m.TimeType) { // not required + return nil + } + + // value enum + if err := m.validateTimeTypeEnum("timeType", "body", m.TimeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this time granularity spec based on context it is used +func (m *TimeGranularitySpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TimeGranularitySpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TimeGranularitySpec) UnmarshalBinary(b []byte) error { + var res TimeGranularitySpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/timestamp_config.go b/src/models/timestamp_config.go new file mode 100644 index 0000000..ba7d0cf --- /dev/null +++ b/src/models/timestamp_config.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TimestampConfig timestamp config +// +// swagger:model TimestampConfig +type TimestampConfig struct { + + // granularities + // Read Only: true + Granularities []string `json:"granularities"` +} + +// Validate validates this timestamp config +func (m *TimestampConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGranularities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var timestampConfigGranularitiesItemsEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["MILLISECOND","SECOND","MINUTE","HOUR","DAY","WEEK","MONTH","QUARTER","YEAR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + timestampConfigGranularitiesItemsEnum = append(timestampConfigGranularitiesItemsEnum, v) + } +} + +func (m *TimestampConfig) validateGranularitiesItemsEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, timestampConfigGranularitiesItemsEnum, true); err != nil { + return err + } + return nil +} + +func (m *TimestampConfig) validateGranularities(formats strfmt.Registry) error { + if swag.IsZero(m.Granularities) { // not required + return nil + } + + for i := 0; i < len(m.Granularities); i++ { + + // value enum + if err := m.validateGranularitiesItemsEnum("granularities"+"."+strconv.Itoa(i), "body", m.Granularities[i]); err != nil { + return err + } + + } + + return nil +} + +// ContextValidate validate this timestamp config based on the context it is used +func (m *TimestampConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGranularities(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TimestampConfig) contextValidateGranularities(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "granularities", "body", []string(m.Granularities)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TimestampConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TimestampConfig) UnmarshalBinary(b []byte) error { + var res TimestampConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/transform_config.go b/src/models/transform_config.go new file mode 100644 index 0000000..0381955 --- /dev/null +++ b/src/models/transform_config.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransformConfig transform config +// +// swagger:model TransformConfig +type TransformConfig struct { + + // column name + // Read Only: true + ColumnName string `json:"columnName,omitempty"` + + // transform function + // Read Only: true + TransformFunction string `json:"transformFunction,omitempty"` +} + +// Validate validates this transform config +func (m *TransformConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validate this transform config based on the context it is used +func (m *TransformConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateColumnName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformFunction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransformConfig) contextValidateColumnName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "columnName", "body", string(m.ColumnName)); err != nil { + return err + } + + return nil +} + +func (m *TransformConfig) contextValidateTransformFunction(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "transformFunction", "body", string(m.TransformFunction)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransformConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransformConfig) UnmarshalBinary(b []byte) error { + var res TransformConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/tuner_config.go b/src/models/tuner_config.go new file mode 100644 index 0000000..4bbfabe --- /dev/null +++ b/src/models/tuner_config.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TunerConfig tuner config +// +// swagger:model TunerConfig +type TunerConfig struct { + + // name + // Required: true + Name *string `json:"name"` + + // tuner properties + TunerProperties map[string]string `json:"tunerProperties,omitempty"` +} + +// Validate validates this tuner config +func (m *TunerConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TunerConfig) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this tuner config based on context it is used +func (m *TunerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TunerConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TunerConfig) UnmarshalBinary(b []byte) error { + var res TunerConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/upsert_config.go b/src/models/upsert_config.go new file mode 100644 index 0000000..f3a646e --- /dev/null +++ b/src/models/upsert_config.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpsertConfig upsert config +// +// swagger:model UpsertConfig +type UpsertConfig struct { + + // comparison column + ComparisonColumn string `json:"comparisonColumn,omitempty"` + + // default partial upsert strategy + // Enum: [APPEND IGNORE INCREMENT MAX MIN OVERWRITE UNION] + DefaultPartialUpsertStrategy string `json:"defaultPartialUpsertStrategy,omitempty"` + + // enable snapshot + EnableSnapshot bool `json:"enableSnapshot,omitempty"` + + // hash function + // Enum: [NONE MD5 MURMUR3] + HashFunction string `json:"hashFunction,omitempty"` + + // metadata manager class + MetadataManagerClass string `json:"metadataManagerClass,omitempty"` + + // metadata manager configs + MetadataManagerConfigs map[string]string `json:"metadataManagerConfigs,omitempty"` + + // mode + // Required: true + // Read Only: true + // Enum: [FULL PARTIAL NONE] + Mode string `json:"mode"` + + // partial upsert strategies + PartialUpsertStrategies map[string]string `json:"partialUpsertStrategies,omitempty"` +} + +// Validate validates this upsert config +func (m *UpsertConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDefaultPartialUpsertStrategy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHashFunction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePartialUpsertStrategies(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var upsertConfigTypeDefaultPartialUpsertStrategyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["APPEND","IGNORE","INCREMENT","MAX","MIN","OVERWRITE","UNION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + upsertConfigTypeDefaultPartialUpsertStrategyPropEnum = append(upsertConfigTypeDefaultPartialUpsertStrategyPropEnum, v) + } +} + +const ( + + // UpsertConfigDefaultPartialUpsertStrategyAPPEND captures enum value "APPEND" + UpsertConfigDefaultPartialUpsertStrategyAPPEND string = "APPEND" + + // UpsertConfigDefaultPartialUpsertStrategyIGNORE captures enum value "IGNORE" + UpsertConfigDefaultPartialUpsertStrategyIGNORE string = "IGNORE" + + // UpsertConfigDefaultPartialUpsertStrategyINCREMENT captures enum value "INCREMENT" + UpsertConfigDefaultPartialUpsertStrategyINCREMENT string = "INCREMENT" + + // UpsertConfigDefaultPartialUpsertStrategyMAX captures enum value "MAX" + UpsertConfigDefaultPartialUpsertStrategyMAX string = "MAX" + + // UpsertConfigDefaultPartialUpsertStrategyMIN captures enum value "MIN" + UpsertConfigDefaultPartialUpsertStrategyMIN string = "MIN" + + // UpsertConfigDefaultPartialUpsertStrategyOVERWRITE captures enum value "OVERWRITE" + UpsertConfigDefaultPartialUpsertStrategyOVERWRITE string = "OVERWRITE" + + // UpsertConfigDefaultPartialUpsertStrategyUNION captures enum value "UNION" + UpsertConfigDefaultPartialUpsertStrategyUNION string = "UNION" +) + +// prop value enum +func (m *UpsertConfig) validateDefaultPartialUpsertStrategyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, upsertConfigTypeDefaultPartialUpsertStrategyPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpsertConfig) validateDefaultPartialUpsertStrategy(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultPartialUpsertStrategy) { // not required + return nil + } + + // value enum + if err := m.validateDefaultPartialUpsertStrategyEnum("defaultPartialUpsertStrategy", "body", m.DefaultPartialUpsertStrategy); err != nil { + return err + } + + return nil +} + +var upsertConfigTypeHashFunctionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NONE","MD5","MURMUR3"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + upsertConfigTypeHashFunctionPropEnum = append(upsertConfigTypeHashFunctionPropEnum, v) + } +} + +const ( + + // UpsertConfigHashFunctionNONE captures enum value "NONE" + UpsertConfigHashFunctionNONE string = "NONE" + + // UpsertConfigHashFunctionMD5 captures enum value "MD5" + UpsertConfigHashFunctionMD5 string = "MD5" + + // UpsertConfigHashFunctionMURMUR3 captures enum value "MURMUR3" + UpsertConfigHashFunctionMURMUR3 string = "MURMUR3" +) + +// prop value enum +func (m *UpsertConfig) validateHashFunctionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, upsertConfigTypeHashFunctionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpsertConfig) validateHashFunction(formats strfmt.Registry) error { + if swag.IsZero(m.HashFunction) { // not required + return nil + } + + // value enum + if err := m.validateHashFunctionEnum("hashFunction", "body", m.HashFunction); err != nil { + return err + } + + return nil +} + +var upsertConfigTypeModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FULL","PARTIAL","NONE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + upsertConfigTypeModePropEnum = append(upsertConfigTypeModePropEnum, v) + } +} + +const ( + + // UpsertConfigModeFULL captures enum value "FULL" + UpsertConfigModeFULL string = "FULL" + + // UpsertConfigModePARTIAL captures enum value "PARTIAL" + UpsertConfigModePARTIAL string = "PARTIAL" + + // UpsertConfigModeNONE captures enum value "NONE" + UpsertConfigModeNONE string = "NONE" +) + +// prop value enum +func (m *UpsertConfig) validateModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, upsertConfigTypeModePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpsertConfig) validateMode(formats strfmt.Registry) error { + + if err := validate.RequiredString("mode", "body", m.Mode); err != nil { + return err + } + + // value enum + if err := m.validateModeEnum("mode", "body", m.Mode); err != nil { + return err + } + + return nil +} + +// additional properties value enum +var upsertConfigPartialUpsertStrategiesValueEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["APPEND","IGNORE","INCREMENT","MAX","MIN","OVERWRITE","UNION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + upsertConfigPartialUpsertStrategiesValueEnum = append(upsertConfigPartialUpsertStrategiesValueEnum, v) + } +} + +func (m *UpsertConfig) validatePartialUpsertStrategiesValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, upsertConfigPartialUpsertStrategiesValueEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpsertConfig) validatePartialUpsertStrategies(formats strfmt.Registry) error { + if swag.IsZero(m.PartialUpsertStrategies) { // not required + return nil + } + + for k := range m.PartialUpsertStrategies { + + // value enum + if err := m.validatePartialUpsertStrategiesValueEnum("partialUpsertStrategies"+"."+k, "body", m.PartialUpsertStrategies[k]); err != nil { + return err + } + + } + + return nil +} + +// ContextValidate validate this upsert config based on the context it is used +func (m *UpsertConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpsertConfig) contextValidateMode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mode", "body", string(m.Mode)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpsertConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpsertConfig) UnmarshalBinary(b []byte) error { + var res UpsertConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/models/write_payload.go b/src/models/write_payload.go new file mode 100644 index 0000000..1139c97 --- /dev/null +++ b/src/models/write_payload.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// WritePayload write payload +// +// swagger:model WritePayload +type WritePayload struct { + + // column names + ColumnNames []string `json:"columnNames"` + + // rows + Rows [][]interface{} `json:"rows"` + + // values + Values []map[string]interface{} `json:"values"` +} + +// Validate validates this write payload +func (m *WritePayload) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this write payload based on context it is used +func (m *WritePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WritePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritePayload) UnmarshalBinary(b []byte) error { + var res WritePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/swagger.json b/src/swagger.json new file mode 100644 index 0000000..aa434e1 --- /dev/null +++ b/src/swagger.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"description":"APIs for accessing Pinot Controller information","version":"1.0","title":"Pinot Controller API","contact":{"name":"https://github.com/apache/pinot"}},"basePath":"/","tags":[{"name":"AtomicIngestion"},{"name":"ClusterHealth"},{"name":"Tuner"},{"name":"Cluster"},{"name":"User"},{"name":"Broker"},{"name":"AppConfigs"},{"name":"Auth"},{"name":"Health"},{"name":"Logger"},{"name":"PeriodicTask"},{"name":"Table"},{"name":"Instance"},{"name":"Leader"},{"name":"Query"},{"name":"Schema"},{"name":"Segment"},{"name":"Tenant"},{"name":"Task"},{"name":"Upsert"},{"name":"Version"},{"name":"WriteApi"},{"name":"Zookeeper"}],"schemes":["https"],"paths":{"/segments/{tableName}/endDataIngestRequest":{"post":{"tags":["AtomicIngestion"],"summary":"Mark the end of data ingestion to upload multiple segments","description":"","operationId":"endDataIngestRequest","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"tableType","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"taskType","in":"query","description":"Task type","required":true,"type":"string"},{"name":"checkpointEntryKey","in":"query","description":"Key of checkpoint entry","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/segments/{tableName}/startDataIngestRequest":{"post":{"tags":["AtomicIngestion"],"summary":"Mark the start of data ingestion to upload multiple segments","description":"","operationId":"startDataIngestRequest","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"tableType","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"taskType","in":"query","description":"Task type","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/clusterHealth":{"get":{"tags":["ClusterHealth"],"summary":"Get cached cluster health details","description":"","operationId":"getClusterHealthDetails","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ClusterHealthResponse"}}}}},"/tuner/{tableName}":{"get":{"tags":["Tuner"],"summary":"Apply tuner(s) to a table","description":"","operationId":"tuneTable","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"post":{"tags":["Tuner"],"summary":"Apply specific tuner to a table","description":"","operationId":"tuneTable_1","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/debug/segments/{tableName}/{segmentName}":{"get":{"tags":["Cluster"],"summary":"Get debug information for segment.","description":"Debug information for segment.","operationId":"getSegmentDebugInfo","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table (with type)","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Segment not found"},"500":{"description":"Internal server error"}}}},"/debug/tables/{tableName}":{"get":{"tags":["Cluster"],"summary":"Get debug information for table.","description":"Debug information for table.","operationId":"getTableDebugInfo","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"verbosity","in":"query","description":"Verbosity of debug information","required":false,"type":"integer","default":0,"format":"int32"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/users":{"get":{"tags":["User"],"summary":"List all uses in cluster","description":"List all users in cluster","operationId":"listUers","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"post":{"tags":["User"],"summary":"Add a user","description":"Add a user","operationId":"addUser","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/users/{username}":{"get":{"tags":["User"],"summary":"Get an user in cluster","description":"Get an user in cluster","operationId":"getUser","produces":["application/json"],"parameters":[{"name":"username","in":"path","required":true,"type":"string"},{"name":"component","in":"query","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"put":{"tags":["User"],"summary":"Update user config for a user","description":"Update user config for user","operationId":"updateUserConfig","produces":["application/json"],"parameters":[{"name":"username","in":"path","required":true,"type":"string"},{"name":"component","in":"query","required":false,"type":"string"},{"name":"passwordChanged","in":"query","required":false,"type":"boolean"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}},"delete":{"tags":["User"],"summary":"Delete a user","description":"Delete a user","operationId":"deleteUser","produces":["application/json"],"parameters":[{"name":"username","in":"path","required":true,"type":"string"},{"name":"component","in":"query","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/brokers":{"get":{"tags":["Broker"],"summary":"List tenants and tables to brokers mappings","description":"List tenants and tables to brokers mappings","operationId":"listBrokersMapping","produces":["application/json"],"parameters":[{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}},"/brokers/tenants":{"get":{"tags":["Broker"],"summary":"List tenants to brokers mappings","description":"List tenants to brokers mappings","operationId":"getTenantsToBrokersMapping","produces":["application/json"],"parameters":[{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"/brokers/tables":{"get":{"tags":["Broker"],"summary":"List tables to brokers mappings","description":"List tables to brokers mappings","operationId":"getTablesToBrokersMapping","produces":["application/json"],"parameters":[{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"/brokers/tenants/{tenantName}":{"get":{"tags":["Broker"],"summary":"List brokers for a given tenant","description":"List brokers for a given tenant","operationId":"getBrokersForTenant","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Name of the tenant","required":true,"type":"string"},{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"}}}}}},"/v2/brokers/tenants/{tenantName}":{"get":{"tags":["Broker"],"summary":"List brokers for a given tenant","description":"List brokers for a given tenant","operationId":"getBrokersForTenantV2","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Name of the tenant","required":true,"type":"string"},{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/InstanceInfo"}}}}}},"/brokers/tables/{tableName}":{"get":{"tags":["Broker"],"summary":"List brokers for a given table","description":"List brokers for a given table","operationId":"getBrokersForTable","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"}}}}}},"/v2/brokers/tables/{tableName}":{"get":{"tags":["Broker"],"summary":"List brokers for a given table","description":"List brokers for a given table","operationId":"getBrokersForTableV2","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/InstanceInfo"}}}}}},"/v2/brokers":{"get":{"tags":["Broker"],"summary":"List tenants and tables to brokers mappings","description":"List tenants and tables to brokers mappings","operationId":"listBrokersMappingV2","produces":["application/json"],"parameters":[{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/InstanceInfo"}}}}}}}},"/v2/brokers/tenants":{"get":{"tags":["Broker"],"summary":"List tenants to brokers mappings","description":"List tenants to brokers mappings","operationId":"getTenantsToBrokersMappingV2","produces":["application/json"],"parameters":[{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/InstanceInfo"}}}}}}},"/v2/brokers/tables":{"get":{"tags":["Broker"],"summary":"List tables to brokers mappings","description":"List tables to brokers mappings","operationId":"getTablesToBrokersMappingV2","produces":["application/json"],"parameters":[{"name":"state","in":"query","description":"ONLINE|OFFLINE","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/InstanceInfo"}}}}}}},"/brokers/instances/{instanceName}/qps":{"post":{"tags":["Broker"],"summary":"Enable/disable the query rate limiting for a broker instance","description":"Enable/disable the query rate limiting for a broker instance","operationId":"toggleQueryRateLimiting","consumes":["text/plain"],"produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Broker instance name","required":true,"type":"string","x-example":"Broker_my.broker.com_30000"},{"name":"state","in":"query","description":"ENABLE|DISABLE","required":true,"type":"string","enum":["ENABLE","DISABLE"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"400":{"description":"Bad Request"},"404":{"description":"Instance not found"},"500":{"description":"Internal error"}}}},"/cluster/configs":{"get":{"tags":["Cluster"],"summary":"List cluster configurations","description":"List cluster level configurations","operationId":"listClusterConfigs","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"}}},"post":{"tags":["Cluster"],"summary":"Update cluster configuration","description":"","operationId":"updateClusterConfig","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Server error updating configuration"}}}},"/cluster/configs/{configName}":{"delete":{"tags":["Cluster"],"summary":"Delete cluster configuration","description":"","operationId":"deleteClusterConfig","produces":["application/json"],"parameters":[{"name":"configName","in":"path","description":"Name of the config to delete","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Server error deleting configuration"}}}},"/cluster/info":{"get":{"tags":["Cluster"],"summary":"Get cluster Info","description":"Get cluster Info","operationId":"getClusterInfo","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"}}}},"/appconfigs":{"get":{"tags":["AppConfigs"],"operationId":"getAppConfigs","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","headers":{},"schema":{"type":"string"}}}}},"/auth/info":{"get":{"tags":["Auth"],"summary":"Retrieve auth workflow info","description":"","operationId":"info","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Auth workflow info provided"}}}},"/auth/verify":{"get":{"tags":["Auth"],"summary":"Check whether authentication is enabled","description":"","operationId":"verify","produces":["application/json"],"parameters":[{"name":"tableName","in":"query","description":"Table name without type","required":false,"type":"string"},{"name":"accessType","in":"query","description":"API access type","required":false,"type":"string","enum":["CREATE","READ","UPDATE","DELETE"]},{"name":"endpointUrl","in":"query","description":"Endpoint URL","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Verification result provided"},"500":{"description":"Verification error"}}}},"/pinot-controller/admin":{"get":{"tags":["Health"],"summary":"Check controller health","description":"","operationId":"checkHealthLegacy","produces":["text/plain"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Good"}}}},"/health":{"get":{"tags":["Health"],"summary":"Check controller health","description":"","operationId":"checkHealth","produces":["text/plain"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Good"}}}},"/loggers/{loggerName}":{"get":{"tags":["Logger"],"summary":"Get logger configs","description":"Return logger info","operationId":"getLogger","produces":["application/json"],"parameters":[{"name":"loggerName","in":"path","description":"Logger name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"put":{"tags":["Logger"],"summary":"Set logger level","description":"Set logger level for a given logger","operationId":"setLoggerLevel","produces":["application/json"],"parameters":[{"name":"loggerName","in":"path","description":"Logger name","required":true,"type":"string"},{"name":"level","in":"query","description":"Logger level","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/loggers":{"get":{"tags":["Logger"],"summary":"Get all the loggers","description":"Return all the logger names","operationId":"getLoggers","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"}}}}}},"/loggers/files":{"get":{"tags":["Logger"],"summary":"Get all local log files","description":"","operationId":"getLocalLogFiles","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}},"/loggers/download":{"get":{"tags":["Logger"],"summary":"Download a log file","description":"","operationId":"downloadLogFile","produces":["application/octet-stream"],"parameters":[{"name":"filePath","in":"query","description":"Log file path","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/loggers/instances":{"get":{"tags":["Logger"],"summary":"Collect log files from all the instances","description":"","operationId":"getLogFilesFromAllInstances","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"array","uniqueItems":true,"items":{"type":"string"}}}}}}},"/loggers/instances/{instanceName}":{"get":{"tags":["Logger"],"summary":"Collect log files from a given instance","description":"","operationId":"getLogFilesFromInstance","produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance Name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}},"/loggers/instances/{instanceName}/download":{"get":{"tags":["Logger"],"summary":"Download a log file from a given instance","description":"","operationId":"downloadLogFileFromInstance","produces":["application/octet-stream"],"parameters":[{"name":"instanceName","in":"path","description":"Instance Name","required":true,"type":"string"},{"name":"filePath","in":"query","description":"Log file path","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/periodictask/names":{"get":{"tags":["PeriodicTask"],"summary":"Get comma-delimited list of all available periodic task names.","description":"","operationId":"getPeriodicTaskNames","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"}}}}}},"/periodictask/run":{"get":{"tags":["PeriodicTask"],"summary":"Run periodic task against table. If table name is missing, task will run against all tables.","description":"","operationId":"runPeriodicTask","produces":["application/json"],"parameters":[{"name":"taskname","in":"query","description":"Periodic task name","required":true,"type":"string"},{"name":"tableName","in":"query","description":"Name of the table","required":false,"type":"string"},{"name":"type","in":"query","description":"OFFLINE | REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/ingestFromURI":{"post":{"tags":["Table"],"summary":"Ingest from the given URI","description":"Creates a segment using file at the given URI and pushes it to Pinot. \n All steps happen on the controller. This API is NOT meant for production environments/large input files. \nExample usage (query params need encoding):\n```\ncurl -X POST \"http://localhost:9000/ingestFromURI?tableNameWithType=foo_OFFLINE\n&batchConfigMapStr={\n \"inputFormat\":\"json\",\n \"input.fs.className\":\"org.apache.pinot.plugin.filesystem.S3PinotFS\",\n \"input.fs.prop.region\":\"us-central\",\n \"input.fs.prop.accessKey\":\"foo\",\n \"input.fs.prop.secretKey\":\"bar\"\n}\n&sourceURIStr=s3://test.bucket/path/to/json/data/data.json\"\n```","operationId":"ingestFromURI","consumes":["multipart/form-data"],"produces":["application/json"],"parameters":[{"name":"tableNameWithType","in":"query","description":"Name of the table to upload the file to","required":true,"type":"string"},{"name":"batchConfigMapStr","in":"query","description":"Batch config Map as json string. Must pass inputFormat, and optionally input FS properties. e.g. {\"inputFormat\":\"json\"}","required":true,"type":"string"},{"name":"sourceURIStr","in":"query","description":"URI of file to upload","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/ingestFromFile":{"post":{"tags":["Table"],"summary":"Ingest a file","description":"Creates a segment using given file and pushes it to Pinot. \n All steps happen on the controller. This API is NOT meant for production environments/large input files. \n Example usage (query params need encoding):\n```\ncurl -X POST -F file=@data.json -H \"Content-Type: multipart/form-data\" \"http://localhost:9000/ingestFromFile?tableNameWithType=foo_OFFLINE&\nbatchConfigMapStr={\n \"inputFormat\":\"csv\",\n \"recordReader.prop.delimiter\":\"|\"\n}\" \n```","operationId":"ingestFromFile","consumes":["multipart/form-data"],"produces":["application/json"],"parameters":[{"name":"tableNameWithType","in":"query","description":"Name of the table to upload the file to","required":true,"type":"string"},{"name":"batchConfigMapStr","in":"query","description":"Batch config Map as json string. Must pass inputFormat, and optionally record reader properties. e.g. {\"inputFormat\":\"json\"}","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/FormDataMultiPart"}}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/tables/{tableName}/assignInstances":{"post":{"tags":["Table"],"summary":"Assign server instances to a table","description":"","operationId":"assignInstances","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|CONSUMING|COMPLETED","required":false,"type":"string","enum":["OFFLINE","CONSUMING","COMPLETED"]},{"name":"dryRun","in":"query","description":"Whether to do dry-run","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/InstancePartitions"}}}}}},"/tables/{tableName}/instancePartitions":{"get":{"tags":["Table"],"summary":"Get the instance partitions","description":"","operationId":"getInstancePartitions","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|CONSUMING|COMPLETED","required":false,"type":"string","enum":["OFFLINE","CONSUMING","COMPLETED"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/InstancePartitions"}}}}},"put":{"tags":["Table"],"summary":"Create/update the instance partitions","description":"","operationId":"setInstancePartitions","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/InstancePartitions"}}}}},"delete":{"tags":["Table"],"summary":"Remove the instance partitions","description":"","operationId":"removeInstancePartitions","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|CONSUMING|COMPLETED","required":false,"type":"string","enum":["OFFLINE","CONSUMING","COMPLETED"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tables/{tableName}/replaceInstance":{"post":{"tags":["Table"],"summary":"Replace an instance in the instance partitions","description":"","operationId":"replaceInstance","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|CONSUMING|COMPLETED","required":false,"type":"string","enum":["OFFLINE","CONSUMING","COMPLETED"]},{"name":"oldInstanceId","in":"query","description":"Old instance to be replaced","required":true,"type":"string"},{"name":"newInstanceId","in":"query","description":"New instance to replace with","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/InstancePartitions"}}}}}},"/instances/{instanceName}":{"get":{"tags":["Instance"],"summary":"Get instance information","description":"","operationId":"getInstance","produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance name","required":true,"type":"string","x-example":"Server_a.b.com_20000 | Broker_my.broker.com_30000"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Instance not found"},"500":{"description":"Internal error"}}},"put":{"tags":["Instance"],"summary":"Update the specified instance","description":"Update specified instance with given instance config","operationId":"updateInstance","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance name","required":true,"type":"string","x-example":"Server_a.b.com_20000 | Broker_my.broker.com_30000"},{"name":"updateBrokerResource","in":"query","description":"Whether to update broker resource for broker instance","required":false,"type":"boolean","default":false},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/Instance"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal error"}}},"delete":{"tags":["Instance"],"summary":"Drop an instance","description":"Drop an instance","operationId":"dropInstance","consumes":["text/plain"],"produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance name","required":true,"type":"string","x-example":"Server_a.b.com_20000 | Broker_my.broker.com_30000"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Instance not found"},"409":{"description":"Instance cannot be dropped"},"500":{"description":"Internal error"}}}},"/instances":{"get":{"tags":["Instance"],"summary":"List all instances","description":"","operationId":"getAllInstances","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal error"}}},"post":{"tags":["Instance"],"summary":"Create a new instance","description":"Creates a new instance with given instance config","operationId":"addInstance","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"updateBrokerResource","in":"query","description":"Whether to update broker resource for broker instance","required":false,"type":"boolean","default":false},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/Instance"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"409":{"description":"Instance already exists"},"500":{"description":"Internal error"}}}},"/instances/{instanceName}/updateBrokerResource":{"post":{"tags":["Instance"],"summary":"Update the tables served by the specified broker instance in the broker resource","description":"Broker resource should be updated when a new broker instance is added, or the tags for an existing broker are changed. Updating broker resource requires reading all the table configs, which can be costly for large cluster. Consider updating broker resource for each table individually.","operationId":"updateBrokerResource","produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance name","required":true,"type":"string","x-example":"Broker_my.broker.com_30000"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"400":{"description":"Bad Request"},"404":{"description":"Instance not found"},"500":{"description":"Internal error"}}}},"/instances/{instanceName}/updateTags":{"put":{"tags":["Instance"],"summary":"Update the tags of the specified instance","description":"Update the tags of the specified instance","operationId":"updateInstanceTags","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance name","required":true,"type":"string","x-example":"Server_a.b.com_20000 | Broker_my.broker.com_30000"},{"name":"tags","in":"query","description":"Comma separated tags list","required":true,"type":"string"},{"name":"updateBrokerResource","in":"query","description":"Whether to update broker resource for broker instance","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"400":{"description":"Bad Request"},"404":{"description":"Instance not found"},"500":{"description":"Internal error"}}}},"/instances/{instanceName}/state":{"post":{"tags":["Instance"],"summary":"Enable/disable/drop an instance","description":"Enable/disable/drop an instance","operationId":"toggleInstanceState","consumes":["text/plain"],"produces":["application/json"],"parameters":[{"name":"instanceName","in":"path","description":"Instance name","required":true,"type":"string","x-example":"Server_a.b.com_20000 | Broker_my.broker.com_30000"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"400":{"description":"Bad Request"},"404":{"description":"Instance not found"},"409":{"description":"Instance cannot be dropped"},"500":{"description":"Internal error"}}}},"/leader/tables":{"get":{"tags":["Leader"],"summary":"Gets leaders for all tables","description":"Gets leaders for all tables","operationId":"getLeadersForAllTables","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/LeadControllerResponse"}}}}},"/leader/tables/{tableName}":{"get":{"tags":["Leader"],"summary":"Gets leader for a given table","description":"Gets leader for a given table","operationId":"getLeaderForTable","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/LeadControllerResponse"}}}}},"/tables/{tableName}/consumingSegmentsInfo":{"get":{"tags":["Table"],"summary":"Returns state of consuming segments","description":"Gets the status of consumers from all servers.Note that the partitionToOffsetMap has been deprecated and will be removed in the next release. The info is now embedded within each partition's state as currentOffsetsMap.","operationId":"getConsumingSegmentsInfo","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Realtime table name with or without type","required":true,"type":"string","x-example":"myTable | myTable_REALTIME"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/tables/forceCommitStatus/{jobId}":{"get":{"tags":["Table"],"summary":"Get status for a submitted force commit operation","description":"Get status for a submitted force commit operation","operationId":"getForceCommitJobStatus","produces":["application/json"],"parameters":[{"name":"jobId","in":"path","description":"Force commit job id","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/JsonNode"}}}}},"/tables/{tableName}/forceCommit":{"post":{"tags":["Table"],"summary":"Force commit the current consuming segments","description":"Force commit the current segments in consuming state and restart consumption. This should be used after schema/table config changes. Please note that this is an asynchronous operation, and 200 response does not mean it has actually been done already","operationId":"forceCommit","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/tables/{tableName}/pauseConsumption":{"post":{"tags":["Table"],"summary":"Pause consumption of a realtime table","description":"Pause the consumption of a realtime table","operationId":"pauseConsumption","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/tables/{tableName}/resumeConsumption":{"post":{"tags":["Table"],"summary":"Resume consumption of a realtime table","description":"Resume the consumption for a realtime table. ConsumeFrom parameter indicates from which offsets consumption should resume. If consumeFrom parameter is not provided, consumption continues based on the offsets in segment ZK metadata, and in case the offsets are already gone, the first available offsets are picked to minimize the data loss.","operationId":"resumeConsumption","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"consumeFrom","in":"query","description":"smallest | largest","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/tables/{tableName}/pauseStatus":{"get":{"tags":["Table"],"summary":"Return pause status of a realtime table","description":"Return pause status of a realtime table along with list of consuming segments.","operationId":"getPauseStatus","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/query/{brokerId}/{queryId}":{"delete":{"tags":["Query"],"summary":"Cancel a query as identified by the queryId","description":"No effect if no query exists for the given queryId on the requested broker. Query may continue to run for a short while after calling cancel as it's done in a non-blocking manner. The cancel method can be called multiple times.","operationId":"cancelQuery","produces":["application/json"],"parameters":[{"name":"brokerId","in":"path","description":"Broker that's running the query","required":true,"type":"string"},{"name":"queryId","in":"path","description":"QueryId as assigned by the broker","required":true,"type":"integer","format":"int64"},{"name":"timeoutMs","in":"query","description":"Timeout for servers to respond the cancel request","required":false,"type":"integer","default":3000,"format":"int32"},{"name":"verbose","in":"query","description":"Return verbose responses for troubleshooting","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"},"404":{"description":"Query not found on the requested broker"}}}},"/queries":{"get":{"tags":["Query"],"summary":"Get running queries from all brokers","description":"The queries are returned with brokers running them","operationId":"getRunningQueries","produces":["application/json"],"parameters":[{"name":"timeoutMs","in":"query","description":"Timeout for brokers to return running queries","required":false,"type":"integer","default":3000,"format":"int32"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"}}}},"/schemas/{schemaName}":{"get":{"tags":["Schema"],"summary":"Get a schema","description":"Gets a schema by name","operationId":"getSchema","produces":["application/json"],"parameters":[{"name":"schemaName","in":"path","description":"Schema name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Schema not found"},"500":{"description":"Internal error"}}},"put":{"tags":["Schema"],"summary":"Update a schema","description":"Updates a schema","operationId":"updateSchema_1","produces":["application/json"],"parameters":[{"name":"schemaName","in":"path","description":"Name of the schema","required":true,"type":"string"},{"name":"reload","in":"query","description":"Whether to reload the table if the new schema is backward compatible","required":false,"type":"boolean","default":false},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/FormDataMultiPart"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Successfully updated schema"},"404":{"description":"Schema not found"},"400":{"description":"Missing or invalid request body"},"500":{"description":"Internal error"}}},"delete":{"tags":["Schema"],"summary":"Delete a schema","description":"Deletes a schema by name","operationId":"deleteSchema","produces":["application/json"],"parameters":[{"name":"schemaName","in":"path","description":"Schema name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Successfully deleted schema"},"404":{"description":"Schema not found"},"409":{"description":"Schema is in use"},"500":{"description":"Error deleting schema"}}}},"/schemas":{"get":{"tags":["Schema"],"summary":"List all schema names","description":"Lists all schema names","operationId":"listSchemaNames","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"post":{"tags":["Schema"],"summary":"Add a new schema","description":"Adds a new schema","operationId":"addSchema_1","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"override","in":"query","description":"Whether to override the schema if the schema exists","required":false,"type":"boolean","default":true},{"name":"force","in":"query","description":"Whether to force overriding the schema if the schema exists","required":false,"type":"boolean","default":false},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Successfully created schema"},"409":{"description":"Schema already exists"},"400":{"description":"Missing or invalid request body"},"500":{"description":"Internal error"}}}},"/schemas/validate":{"post":{"tags":["Schema"],"summary":"Validate schema","description":"This API returns the schema that matches the one you get from 'GET /schema/{schemaName}'. This allows us to validate schema before apply.","operationId":"validateSchema_1","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Successfully validated schema"},"400":{"description":"Missing or invalid request body"},"500":{"description":"Internal error"}}}},"/segments/{tableName}":{"get":{"tags":["Segment"],"summary":"List all segments. An optional 'excludeReplacedSegments' parameter is used to get the list of segments which has not yet been replaced (determined by segment lineage entries) and can be queried from the table. The value is false by default.","description":"List all segments","operationId":"getSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"excludeReplacedSegments","in":"query","description":"Whether to exclude replaced segments in the response, which have been replaced specified in the segment lineage entries and cannot be queried from the table","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"delete":{"tags":["Segment"],"summary":"Delete all segments","description":"Delete all segments","operationId":"deleteAllSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"retention","in":"query","description":"Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableName}/delete":{"post":{"tags":["Segment"],"summary":"Delete the segments in the JSON array payload","description":"Delete the segments in the JSON array payload","operationId":"deleteSegments","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"retention","in":"query","description":"Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention","required":false,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableName}/{segmentName}":{"get":{"tags":["Segment"],"summary":"Download a segment","description":"Download a segment","operationId":"downloadSegment","produces":["application/octet-stream"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}},"delete":{"tags":["Segment"],"summary":"Delete a segment","description":"Delete a segment","operationId":"deleteSegment","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"retention","in":"query","description":"Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the table config, then to cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableName}/reload":{"post":{"tags":["Segment"],"summary":"Reload all segments","description":"Reload all segments","operationId":"reloadAllSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"forceDownload","in":"query","description":"Whether to force server to download segment","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableName}/{segmentName}/reload":{"post":{"tags":["Segment"],"summary":"Reload a segment","description":"Reload a segment","operationId":"reloadSegment","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"forceDownload","in":"query","description":"Whether to force server to download segment","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableNameWithType}/{segmentName}/reset":{"post":{"tags":["Segment"],"summary":"Resets a segment by first disabling it, waiting for external view to stabilize, and finally enabling it again","description":"Resets a segment by disabling and then enabling it","operationId":"resetSegment","produces":["application/json"],"parameters":[{"name":"tableNameWithType","in":"path","description":"Name of the table with type","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"targetInstance","in":"query","description":"Name of the target instance to reset","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableNameWithType}/reset":{"post":{"tags":["Segment"],"summary":"Resets all segments (when errorSegmentsOnly = false) or segments with Error state (when errorSegmentsOnly = true) of the table, by first disabling them, waiting for external view to stabilize, and finally enabling them","description":"Resets segments by disabling and then enabling them","operationId":"resetSegments","produces":["application/json"],"parameters":[{"name":"tableNameWithType","in":"path","description":"Name of the table with type","required":true,"type":"string"},{"name":"targetInstance","in":"query","description":"Name of the target instance to reset","required":false,"type":"string"},{"name":"errorSegmentsOnly","in":"query","description":"Whether to reset only segments with error state","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableName}/servers":{"get":{"tags":["Segment"],"summary":"Get a map from server to segments hosted by the server","description":"Get a map from server to segments hosted by the server","operationId":"getServerToSegmentsMap","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}}}}}},"/segments/{tableName}/lineage":{"get":{"tags":["Segment"],"summary":"List segment lineage","description":"List segment lineage in chronologically sorted order","operationId":"listSegmentLineage","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/tables/{tableName}/segments":{"get":{"tags":["Segment"],"summary":"Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead)","description":"Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead)","operationId":"getServerToSegmentsMapDeprecated1","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"state","in":"query","description":"MUST be null","required":false,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"/tables/{tableName}/segments/metadata":{"get":{"tags":["Segment"],"summary":"Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead)","description":"Get a map from server to segments hosted by the server (deprecated, use 'GET /segments/{tableName}/servers' instead)","operationId":"getServerToSegmentsMapDeprecated2","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"state","in":"query","description":"MUST be null","required":false,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"/segments/{tableName}/crc":{"get":{"tags":["Segment"],"summary":"Get a map from segment to CRC of the segment (only apply to OFFLINE table)","description":"Get a map from segment to CRC of the segment (only apply to OFFLINE table)","operationId":"getSegmentToCrcMap","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/tables/{tableName}/segments/crc":{"get":{"tags":["Segment"],"summary":"Get a map from segment to CRC of the segment (deprecated, use 'GET /segments/{tableName}/crc' instead)","description":"Get a map from segment to CRC of the segment (deprecated, use 'GET /segments/{tableName}/crc' instead)","operationId":"getSegmentToCrcMapDeprecated","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/tables/{tableName}/segments/{segmentName}/metadata":{"get":{"tags":["Segment"],"summary":"Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead)","description":"Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead)","operationId":"getSegmentMetadataDeprecated1","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/tables/{tableName}/segments/{segmentName}":{"get":{"tags":["Segment"],"summary":"Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead)","description":"Get the metadata for a segment (deprecated, use 'GET /segments/{tableName}/{segmentName}/metadata' instead)","operationId":"getSegmentMetadataDeprecated2","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"state","in":"query","description":"MUST be null","required":false,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/tables/{tableName}/segments/{segmentName}/reload":{"get":{"tags":["Segment"],"summary":"Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead)","description":"Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead)","operationId":"reloadSegmentDeprecated2","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}},"post":{"tags":["Segment"],"summary":"Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead)","description":"Reload a segment (deprecated, use 'POST /segments/{tableName}/{segmentName}/reload' instead)","operationId":"reloadSegmentDeprecated1","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/segmentReloadStatus/{jobId}":{"get":{"tags":["Segment"],"summary":"Get status for a submitted reload operation","description":"Get status for a submitted reload operation","operationId":"getReloadJobStatus","produces":["application/json"],"parameters":[{"name":"jobId","in":"path","description":"Reload job id","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ServerReloadControllerJobStatusResponse"}}}}},"/tables/{tableName}/segments/reload":{"get":{"tags":["Segment"],"summary":"Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead)","description":"Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead)","operationId":"reloadAllSegmentsDeprecated2","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}},"post":{"tags":["Segment"],"summary":"Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead)","description":"Reload all segments (deprecated, use 'POST /segments/{tableName}/reload' instead)","operationId":"reloadAllSegmentsDeprecated1","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/segments/{tableName}/metadata":{"get":{"tags":["Segment"],"summary":"Get the server metadata for all table segments","description":"Get the server metadata for all table segments","operationId":"getServerMetadata","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"columns","in":"query","description":"Columns name","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/segments/{tableName}/tiers":{"get":{"tags":["Segment"],"summary":"Get storage tier for all segments in the given table","description":"Get storage tier for all segments in the given table","operationId":"getTableTiers","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"},"404":{"description":"Table not found"}}}},"/segments/{tableName}/{segmentName}/tiers":{"get":{"tags":["Segment"],"summary":"Get storage tiers for the given segment","description":"Get storage tiers for the given segment","operationId":"getSegmentTiers","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"},"404":{"description":"Table or segment not found"}}}},"/segments/{tableName}/select":{"get":{"tags":["Segment"],"summary":"Get the selected segments given the (inclusive) start and (exclusive) end timestamps in milliseconds. These timestamps will be compared against the minmax values of the time column in each segment. If the table is a refresh use case, the value of start and end timestamp is voided, since there is no time column for refresh use case; instead, the whole qualified segments will be returned. If no timestamps are provided, all the qualified segments will be returned. For the segments that partially belong to the time range, the boolean flag 'excludeOverlapping' is introduced in order for user to determine whether to exclude this kind of segments in the response.","description":"Get the selected segments given the start and end timestamps in milliseconds","operationId":"getSelectedSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"startTimestamp","in":"query","description":"Start timestamp (inclusive)","required":false,"type":"string"},{"name":"endTimestamp","in":"query","description":"End timestamp (exclusive)","required":false,"type":"string"},{"name":"excludeOverlapping","in":"query","description":"Whether to exclude the segments overlapping with the timestamps, false by default","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}},"/segments/{tableNameWithType}/updateZKTimeInterval":{"post":{"tags":["Segment"],"summary":"Update the start and end time of the segments based on latest schema","description":"Update the start and end time of the segments based on latest schema","operationId":"updateTimeIntervalZK","produces":["application/json"],"parameters":[{"name":"tableNameWithType","in":"path","description":"Table name with type","required":true,"type":"string","x-example":"myTable_REALTIME"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/segments/{tableName}/{segmentName}/metadata":{"get":{"tags":["Segment"],"summary":"Get the metadata for a segment","description":"Get the metadata for a segment","operationId":"getSegmentMetadata","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"segmentName","in":"path","description":"Name of the segment","required":true,"type":"string"},{"name":"columns","in":"query","description":"Columns name","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"object"}}}}}},"/segments/{tableName}/startReplaceSegments":{"post":{"tags":["Segment"],"summary":"Start to replace segments","description":"Start to replace segments","operationId":"startReplaceSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"forceCleanup","in":"query","description":"Force cleanup","required":false,"type":"boolean","default":false},{"in":"body","name":"body","description":"Fields belonging to start replace segment request","required":true,"schema":{"$ref":"#/definitions/StartReplaceSegmentsRequest"}}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/segments/{tableName}/endReplaceSegments":{"post":{"tags":["Segment"],"summary":"End to replace segments","description":"End to replace segments","operationId":"endReplaceSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"segmentLineageEntryId","in":"query","description":"Segment lineage entry id returned by startReplaceSegments API","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/segments/{tableName}/revertReplaceSegments":{"post":{"tags":["Segment"],"summary":"Revert segments replacement","description":"Revert segments replacement","operationId":"revertReplaceSegments","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"segmentLineageEntryId","in":"query","description":"Segment lineage entry id to revert","required":true,"type":"string"},{"name":"forceRevert","in":"query","description":"Force revert in case the user knows that the lineage entry is interrupted","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/segments":{"post":{"tags":["Segment"],"summary":"Upload a segment","description":"Upload a segment as binary","operationId":"uploadSegmentAsMultiPart","consumes":["multipart/form-data"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/FormDataMultiPart"}},{"name":"tableName","in":"query","description":"Name of the table","required":false,"type":"string"},{"name":"tableType","in":"query","description":"Type of the table","required":false,"type":"string","default":"OFFLINE"},{"name":"enableParallelPushProtection","in":"query","description":"Whether to enable parallel push protection","required":false,"type":"boolean","default":false},{"name":"allowRefresh","in":"query","description":"Whether to refresh if the segment already exists","required":false,"type":"boolean","default":true}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Successfully uploaded segment"},"400":{"description":"Bad Request"},"403":{"description":"Segment validation fails"},"409":{"description":"Segment already exists or another parallel push in progress"},"410":{"description":"Segment to refresh does not exist"},"412":{"description":"CRC check fails"},"500":{"description":"Internal error"}}}},"/v2/segments":{"post":{"tags":["Segment"],"summary":"Upload a segment","description":"Upload a segment as binary","operationId":"uploadSegmentAsMultiPartV2","consumes":["multipart/form-data"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/FormDataMultiPart"}},{"name":"tableName","in":"query","description":"Name of the table","required":false,"type":"string"},{"name":"tableType","in":"query","description":"Type of the table","required":false,"type":"string","default":"OFFLINE"},{"name":"enableParallelPushProtection","in":"query","description":"Whether to enable parallel push protection","required":false,"type":"boolean","default":false},{"name":"allowRefresh","in":"query","description":"Whether to refresh if the segment already exists","required":false,"type":"boolean","default":true}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Successfully uploaded segment"},"400":{"description":"Bad Request"},"403":{"description":"Segment validation fails"},"409":{"description":"Segment already exists or another parallel push in progress"},"410":{"description":"Segment to refresh does not exist"},"412":{"description":"CRC check fails"},"500":{"description":"Internal error"}}}},"/tables/{tableName}/indexingConfigs":{"put":{"tags":["Table"],"summary":"Update table indexing configuration","description":"","operationId":"updateIndexingConfig","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name (without type)","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Server error updating configuration"}}}},"/tables/{tableName}/livebrokers":{"get":{"tags":["Table"],"summary":"List the brokers serving a table","description":"List live brokers of the given table based on EV","operationId":"getLiveBrokersForTable","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name (with or without type)","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/tables/{tableName}/instances":{"get":{"tags":["Table"],"summary":"List table instances","description":"List instances of the given table","operationId":"getTableInstances","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name without type","required":true,"type":"string"},{"name":"type","in":"query","description":"Instance type","required":false,"type":"string","x-example":"broker","enum":["BROKER","SERVER"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/tables/livebrokers":{"get":{"tags":["Table"],"summary":"List tables to live brokers mappings","description":"List tables to live brokers mappings based on EV","operationId":"getLiveBrokers","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"}}}},"/tables/{tableName}/metadataConfigs":{"put":{"tags":["Table"],"summary":"Update table metadata","description":"Updates table configuration","operationId":"updateTableMetadata","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"},"404":{"description":"Table not found"}}}},"/tables/{tableName}/rebalance":{"post":{"tags":["Table"],"summary":"Rebalances a table (reassign instances and segments for a table)","description":"Rebalances a table (reassign instances and segments for a table)","operationId":"rebalance","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table to rebalance","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":true,"type":"string"},{"name":"dryRun","in":"query","description":"Whether to rebalance table in dry-run mode","required":false,"type":"boolean","default":false},{"name":"reassignInstances","in":"query","description":"Whether to reassign instances before reassigning segments","required":false,"type":"boolean","default":false},{"name":"includeConsuming","in":"query","description":"Whether to reassign CONSUMING segments for real-time table","required":false,"type":"boolean","default":false},{"name":"bootstrap","in":"query","description":"Whether to rebalance table in bootstrap mode (regardless of minimum segment movement, reassign all segments in a round-robin fashion as if adding new segments to an empty table)","required":false,"type":"boolean","default":false},{"name":"downtime","in":"query","description":"Whether to allow downtime for the rebalance","required":false,"type":"boolean","default":false},{"name":"minAvailableReplicas","in":"query","description":"For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of replicas allowed to be unavailable if value is negative","required":false,"type":"integer","default":1,"format":"int32"},{"name":"bestEfforts","in":"query","description":"Whether to use best-efforts to rebalance (not fail the rebalance when the no-downtime contract cannot be achieved)","required":false,"type":"boolean","default":false},{"name":"externalViewCheckIntervalInMs","in":"query","description":"How often to check if external view converges with ideal states","required":false,"type":"integer","default":1000,"format":"int64"},{"name":"externalViewStabilizationTimeoutInMs","in":"query","description":"How long to wait till external view converges with ideal states","required":false,"type":"integer","default":3600000,"format":"int64"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/RebalanceResult"}}}}},"/tables/{tableName}":{"get":{"tags":["Table"],"summary":"Get/Enable/Disable/Drop a table","description":"Get/Enable/Disable/Drop a table. If table name is the only parameter specified , the tableconfig will be printed","operationId":"alterTableStateOrListTableConfig","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"state","in":"query","description":"enable|disable|drop","required":false,"type":"string"},{"name":"type","in":"query","description":"realtime|offline","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"put":{"tags":["Table"],"summary":"Updates table config for a table","description":"Updates table config for a table","operationId":"updateTableConfig","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table to update","required":true,"type":"string"},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ConfigSuccessResponse"}}}},"delete":{"tags":["Table"],"summary":"Deletes a table","description":"Deletes a table","operationId":"deleteTable","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table to delete","required":true,"type":"string"},{"name":"type","in":"query","description":"realtime|offline","required":false,"type":"string"},{"name":"retention","in":"query","description":"Retention period for the table segments (e.g. 12h, 3d); If not set, the retention period will default to the first config that's not null: the cluster setting, then '7d'. Using 0d or -1d will instantly delete segments without retention","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tables/{tableName}/stats":{"get":{"tags":["Table"],"summary":"table stats","description":"Provides metadata info/stats about the table.","operationId":"getTableStats","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"realtime|offline","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tables/{tableName}/state":{"get":{"tags":["Table"],"summary":"Get current table state","description":"Get current table state","operationId":"getTableState","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table to get its state","required":true,"type":"string"},{"name":"type","in":"query","description":"realtime|offline","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tables/validateTableAndSchema":{"post":{"tags":["Table"],"summary":"Validate table config for a table along with specified schema","description":"Deprecated. Use /tableConfigs/validate instead.Validate given table config and schema. If specified schema is null, attempt to retrieve schema using the table name. This API returns the table config that matches the one you get from 'GET /tables/{tableName}'. This allows us to validate table config before apply.","operationId":"validateTableAndSchema","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/TableAndSchemaConfig"}},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tables/{tableName}/status":{"get":{"tags":["Table"],"summary":"table status","description":"Provides status of the table including ingestion status","operationId":"getTableStatus","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"realtime|offline","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tables/{tableName}/metadata":{"get":{"tags":["Table"],"summary":"Get the aggregate metadata of all segments for a table","description":"Get the aggregate metadata of all segments for a table","operationId":"getTableAggregateMetadata","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"columns","in":"query","description":"Columns name","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/table/{tableName}/jobs":{"get":{"tags":["Table"],"summary":"Get list of controller jobs for this table","description":"Get list of controller jobs for this table","operationId":"getControllerJobs","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"type","in":"query","description":"OFFLINE|REALTIME","required":false,"type":"string"},{"name":"jobTypes","in":"query","description":"Comma separated list of job types","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"/tables/{tableName}/timeBoundary":{"post":{"tags":["Table"],"summary":"Set hybrid table query time boundary based on offline segments' metadata","description":"Set hybrid table query time boundary based on offline segments' metadata","operationId":"setTimeBoundary","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the hybrid table (without type suffix)","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}},"delete":{"tags":["Table"],"summary":"Delete hybrid table query time boundary","description":"Delete hybrid table query time boundary","operationId":"deleteTimeBoundary","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the hybrid table (without type suffix)","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tables/recommender":{"put":{"tags":["Table"],"summary":"Recommend config","description":"Recommend a config with input json","operationId":"recommendConfig","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tables":{"get":{"tags":["Table"],"summary":"Lists all tables in cluster","description":"Lists all tables in cluster","operationId":"listTables","produces":["application/json"],"parameters":[{"name":"type","in":"query","description":"realtime|offline","required":false,"type":"string"},{"name":"taskType","in":"query","description":"Task type","required":false,"type":"string"},{"name":"sortType","in":"query","description":"name|creationTime|lastModifiedTime","required":false,"type":"string"},{"name":"sortAsc","in":"query","description":"true|false","required":false,"type":"boolean","default":true}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"post":{"tags":["Table"],"summary":"Adds a table","description":"Adds a table","operationId":"addTable","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ConfigSuccessResponse"}}}}},"/tables/validate":{"post":{"tags":["Table"],"summary":"Validate table config for a table","description":"This API returns the table config that matches the one you get from 'GET /tables/{tableName}'. This allows us to validate table config before apply.","operationId":"checkTableConfig","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ObjectNode"}}}}},"/tables/{tableName}/schema":{"get":{"tags":["Schema"],"summary":"Get table schema","description":"Read table schema","operationId":"getTableSchema","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name (without type)","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"}}}},"/tables/{tableName}/segmentConfigs":{"put":{"tags":["Table"],"summary":"Update segments configuration","description":"Updates segmentsConfig section (validation and retention) of a table","operationId":"put","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/tables/{tableName}/rebuildBrokerResourceFromHelixTags":{"post":{"tags":["Table","Tenant"],"summary":"Rebuild broker resource for table","description":"when new brokers are added","operationId":"rebuildBrokerResource","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name (with type)","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"400":{"description":"Bad request: table name has to be with table type"},"500":{"description":"Internal error rebuilding broker resource or serializing response"}}}},"/tasks/task/{taskName}/runtime/config":{"get":{"tags":["Task"],"summary":"Get the task runtime config for the given task","description":"","operationId":"getTaskConfig","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/tasks/scheduler/information":{"get":{"tags":["Task"],"summary":"Fetch cron scheduler information","description":"","operationId":"getCronSchedulerInformation","parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"object"}}}}}},"/tasks/scheduler/jobKeys":{"get":{"tags":["Task"],"summary":"Fetch cron scheduler job keys","description":"","operationId":"getCronSchedulerJobKeys","parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/JobKey"}}}}}},"/tasks/scheduler/jobDetails":{"get":{"tags":["Task"],"summary":"Fetch cron scheduler job keys","description":"","operationId":"getCronSchedulerJobDetails","parameters":[{"name":"tableName","in":"query","description":"Table name (with type suffix)","required":false,"type":"string"},{"name":"taskType","in":"query","description":"Task type","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"object"}}}}}},"/tasks/execute":{"post":{"tags":["Task"],"summary":"Execute a task on minion","description":"","operationId":"executeAdhocTask","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/AdhocTaskConfig"}}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/tasks/scheduletasks":{"put":{"tags":["Task"],"summary":"Schedule tasks (deprecated)","description":"","operationId":"scheduleTasksDeprecated","parameters":[],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/tasks/{taskType}/cleanup":{"put":{"tags":["Task"],"summary":"Clean up finished tasks (COMPLETED, FAILED) for the given task type","description":"","operationId":"cleanUpTasks","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/cleanuptasks/{taskType}":{"put":{"tags":["Task"],"summary":"Clean up finished tasks (COMPLETED, FAILED) for the given task type (deprecated)","description":"","operationId":"cleanUpTasksDeprecated","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/{taskType}/stop":{"put":{"tags":["Task"],"summary":"Stop all running/pending tasks (as well as the task queue) for the given task type","description":"","operationId":"stopTasks","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/{taskType}/resume":{"put":{"tags":["Task"],"summary":"Resume all stopped tasks (as well as the task queue) for the given task type","description":"","operationId":"resumeTasks","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/taskqueue/{taskType}":{"put":{"tags":["Task"],"summary":"Stop/resume a task queue (deprecated)","description":"","operationId":"toggleTaskQueueState","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"state","in":"query","description":"state","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}},"delete":{"tags":["Task"],"summary":"Delete a task queue (deprecated)","description":"","operationId":"deleteTaskQueue","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"forceDelete","in":"query","description":"Whether to force delete the task queue (expert only option, enable with cautious","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/{taskType}":{"delete":{"tags":["Task"],"summary":"Delete all tasks (as well as the task queue) for the given task type","description":"","operationId":"deleteTasks","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"forceDelete","in":"query","description":"Whether to force deleting the tasks (expert only option, enable with cautious","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/taskqueuestate/{taskType}":{"get":{"tags":["Task"],"summary":"Get the state (task queue state) for the given task type (deprecated)","description":"","operationId":"getTaskQueueStateDeprecated","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/StringResultResponse"}}}}},"/tasks/tasktypes":{"get":{"tags":["Task"],"summary":"List all task types","description":"","operationId":"listTaskTypes","parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}},"/tasks/generator/{tableNameWithType}/{taskType}/debug":{"get":{"tags":["Task"],"summary":"Fetch task generation information for the recent runs of the given task for the given table","description":"","operationId":"getTaskGenerationDebugInto","produces":["application/json"],"parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"tableNameWithType","in":"path","description":"Table name with type","required":true,"type":"string"},{"name":"localOnly","in":"query","description":"Whether to only lookup local cache for logs","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tasks/tasks/{taskType}":{"get":{"tags":["Task"],"summary":"List all tasks for the given task type (deprecated)","description":"","operationId":"getTasksDeprecated","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}},"/tasks/taskstates/{taskType}":{"get":{"tags":["Task"],"summary":"Get a map from task to task state for the given task type (deprecated)","description":"","operationId":"getTaskStatesDeprecated","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]}}}}}},"/tasks/taskstate/{taskName}":{"get":{"tags":["Task"],"summary":"Get the task state for the given task (deprecated)","description":"","operationId":"getTaskStateDeprecated","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/StringResultResponse"}}}}},"/tasks/taskconfig/{taskName}":{"get":{"tags":["Task"],"summary":"Get the task config (a list of child task configs) for the given task (deprecated)","description":"","operationId":"getTaskConfigsDeprecated","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"}],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/PinotTaskConfig"}}}}}},"/tasks/task/{taskName}/config":{"get":{"tags":["Task"],"summary":"Get the task config (a list of child task configs) for the given task","description":"","operationId":"getTaskConfigs","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/PinotTaskConfig"}}}}}},"/tasks/task/{taskName}":{"delete":{"tags":["Task"],"summary":"Delete a single task given its task name","description":"","operationId":"deleteTask","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"},{"name":"forceDelete","in":"query","description":"Whether to force deleting the task (expert only option, enable with cautious","required":false,"type":"boolean","default":false}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/taskqueues":{"get":{"tags":["Task"],"summary":"List all task queues (deprecated)","description":"","operationId":"getTaskQueues","parameters":[],"security":[{"oauth":[]}],"deprecated":true,"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}},"/tasks/{taskType}/state":{"get":{"tags":["Task"],"summary":"Get the state (task queue state) for the given task type","description":"","operationId":"getTaskQueueState","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]}}}}},"/tasks/task/{taskName}/state":{"get":{"tags":["Task"],"summary":"Get the task state for the given task","description":"","operationId":"getTaskState","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]}}}}},"/tasks/{taskType}/tasks":{"get":{"tags":["Task"],"summary":"List all tasks for the given task type","description":"","operationId":"getTasks","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}}},"/tasks/{taskType}/taskstates":{"get":{"tags":["Task"],"summary":"Get a map from task to task state for the given task type","description":"","operationId":"getTaskStates","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]}}}}}},"/tasks/subtask/{taskName}/state":{"get":{"tags":["Task"],"summary":"Get the states of all the sub tasks for the given task","description":"","operationId":"getSubtaskStates","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string","enum":["INIT","RUNNING","STOPPED","COMPLETED","TIMED_OUT","TASK_ERROR","TASK_ABORTED","ERROR","DROPPED"]}}}}}},"/tasks/subtask/{taskName}/config":{"get":{"tags":["Task"],"summary":"Get the configs of specified sub tasks for the given task","description":"","operationId":"getSubtaskConfigs","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"},{"name":"subtaskNames","in":"query","description":"Sub task names separated by comma","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/PinotTaskConfig"}}}}}},"/tasks/subtask/{taskName}/progress":{"get":{"tags":["Task"],"summary":"Get progress of specified sub tasks for the given task tracked by minion worker in memory","description":"","operationId":"getSubtaskProgress","produces":["application/json"],"parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"},{"name":"subtaskNames","in":"query","description":"Sub task names separated by comma","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tasks/subtask/workers/progress":{"get":{"tags":["Task"],"summary":"Get progress of all subtasks with specified state tracked by minion worker in memory","description":"","operationId":"getSubtaskOnWorkerProgress","produces":["application/json"],"parameters":[{"name":"subTaskState","in":"query","description":"Subtask state (UNKNOWN,IN_PROGRESS,SUCCEEDED,CANCELLED,ERROR)","required":true,"type":"string"},{"name":"minionWorkerIds","in":"query","description":"Minion worker IDs separated by comma","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Internal server error"}}}},"/tasks/{taskType}/{tableNameWithType}/state":{"get":{"tags":["Task"],"summary":"List all tasks for the given task type","description":"","operationId":"getTaskStatesByTable","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"tableNameWithType","in":"path","description":"Table name with type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]}}}}}},"/tasks/{taskType}/taskcounts":{"get":{"tags":["Task"],"summary":"Fetch count of sub-tasks for each of the tasks for the given task type","description":"","operationId":"getTaskCounts","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/TaskCount"}}}}}},"/tasks/{taskType}/debug":{"get":{"tags":["Task"],"summary":"Fetch information for all the tasks for the given task type","description":"","operationId":"getTasksDebugInfo","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"verbosity","in":"query","description":"verbosity (Prints information for all the tasks for the given task type.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks)","required":false,"type":"integer","default":0,"format":"int32"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/TaskDebugInfo"}}}}}},"/tasks/{taskType}/{tableNameWithType}/debug":{"get":{"tags":["Task"],"summary":"Fetch information for all the tasks for the given task type and table","description":"","operationId":"getTasksDebugInfo_1","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"tableNameWithType","in":"path","description":"Table name with type","required":true,"type":"string"},{"name":"verbosity","in":"query","description":"verbosity (Prints information for all the tasks for the given task type and table.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks)","required":false,"type":"integer","default":0,"format":"int32"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/TaskDebugInfo"}}}}}},"/tasks/task/{taskName}/debug":{"get":{"tags":["Task"],"summary":"Fetch information for the given task name","description":"","operationId":"getTaskDebugInfo","parameters":[{"name":"taskName","in":"path","description":"Task name","required":true,"type":"string"},{"name":"verbosity","in":"query","description":"verbosity (Prints information for the given task name.By default, only prints subtask details for running and error tasks. Value of > 0 prints subtask details for all tasks)","required":false,"type":"integer","default":0,"format":"int32"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/TaskDebugInfo"}}}}},"/tasks/{taskType}/{tableNameWithType}/metadata":{"get":{"tags":["Task"],"summary":"Get task metadata for the given task type and table","description":"","operationId":"getTaskMetadataByTable","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"tableNameWithType","in":"path","description":"Table name with type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"delete":{"tags":["Task"],"summary":"Delete task metadata for the given task type and table","description":"","operationId":"deleteTaskMetadataByTable","parameters":[{"name":"taskType","in":"path","description":"Task type","required":true,"type":"string"},{"name":"tableNameWithType","in":"path","description":"Table name with type","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tasks/schedule":{"post":{"tags":["Task"],"summary":"Schedule tasks and return a map from task type to task name scheduled","description":"","operationId":"scheduleTasks","parameters":[{"name":"taskType","in":"query","description":"Task type","required":false,"type":"string"},{"name":"tableName","in":"query","description":"Table name (with type suffix)","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"string"}}}}}},"/tenants":{"get":{"tags":["Tenant"],"summary":"List all tenants","description":"","operationId":"getAllTenants","produces":["application/json"],"parameters":[{"name":"type","in":"query","description":"Tenant type","required":false,"type":"string","enum":["BROKER","SERVER"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Error reading tenants list"}}},"post":{"tags":["Tenant"],"summary":" Create a tenant","description":"","operationId":"createTenant","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/Tenant"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Error creating tenant"}}},"put":{"tags":["Tenant"],"summary":"Update a tenant","description":"","operationId":"updateTenant","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/Tenant"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Failed to update the tenant"}}}},"/tenants/{tenantName}":{"get":{"tags":["Tenant"],"summary":"List instance for a tenant, or enable/disable/drop a tenant","description":"","operationId":"listInstanceOrToggleTenantState","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Tenant name","required":true,"type":"string"},{"name":"type","in":"query","description":"Tenant type (server|broker)","required":false,"type":"string"},{"name":"tableType","in":"query","description":"Table type (offline|realtime)","required":false,"type":"string"},{"name":"state","in":"query","description":"state","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Error reading tenants list"}}},"delete":{"tags":["Tenant"],"summary":"Delete a tenant","description":"","operationId":"deleteTenant","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Tenant name","required":true,"type":"string"},{"name":"type","in":"query","description":"Tenant type","required":true,"type":"string","enum":["SERVER","BROKER"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"400":{"description":"Tenant can not be deleted"},"404":{"description":"Tenant not found"},"500":{"description":"Error deleting tenant"}}}},"/tenants/{tenantName}/tables":{"get":{"tags":["Tenant"],"summary":"List tables on a a server tenant","description":"","operationId":"getTablesOnTenant","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Tenant name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"500":{"description":"Error reading list"}}}},"/tenants/{tenantName}/metadata":{"get":{"tags":["Tenant"],"summary":"Get tenant information","description":"","operationId":"getTenantMetadata","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Tenant name","required":true,"type":"string"},{"name":"type","in":"query","description":"tenant type","required":false,"type":"string","enum":["SERVER","BROKER"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/TenantMetadata"}},"404":{"description":"Tenant not found"},"500":{"description":"Server error reading tenant information"}}},"post":{"tags":["Tenant"],"summary":"Change tenant state","description":"","operationId":"changeTenantState","produces":["application/json"],"parameters":[{"name":"tenantName","in":"path","description":"Tenant name","required":true,"type":"string"},{"name":"type","in":"query","description":"tenant type","required":false,"type":"string","enum":["SERVER","BROKER"]},{"name":"state","in":"query","description":"state","required":true,"type":"string","enum":["enable","disable","drop"]}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"404":{"description":"Tenant not found"},"500":{"description":"Server error reading tenant information"}}}},"/upsert/estimateHeapUsage":{"post":{"tags":["Upsert"],"summary":"Estimate memory usage for an upsert table","description":"This API returns the estimated heap usage based on primary key column stats. This allows us to estimate table size before onboarding.","operationId":"estimateHeapUsage","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}},{"name":"cardinality","in":"query","description":"cardinality","required":true,"type":"integer","format":"int64"},{"name":"primaryKeySize","in":"query","description":"primaryKeySize","required":false,"type":"integer","default":-1,"format":"int32"},{"name":"numPartitions","in":"query","description":"numPartitions","required":false,"type":"integer","default":-1,"format":"int32"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/version":{"get":{"tags":["Version"],"summary":"Get version number of Pinot components","description":"","operationId":"getVersionNumber","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"}}}},"/tableConfigs/{tableName}":{"get":{"tags":["Table"],"summary":"Get the TableConfigs for a given raw tableName","description":"Get the TableConfigs for a given raw tableName","operationId":"getConfig","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Raw table name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"put":{"tags":["Table"],"summary":"Update the TableConfigs provided by the tableConfigsStr json","description":"Update the TableConfigs provided by the tableConfigsStr json","operationId":"updateConfig","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"TableConfigs name i.e. raw table name","required":true,"type":"string"},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"},{"name":"reload","in":"query","description":"Reload the table if the new schema is backward compatible","required":false,"type":"boolean","default":false},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ConfigSuccessResponse"}}}},"delete":{"tags":["Table"],"summary":"Delete the TableConfigs","description":"Delete the TableConfigs","operationId":"deleteConfig","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"TableConfigs name i.e. raw table name","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SuccessResponse"}}}}},"/tableConfigs":{"get":{"tags":["Table"],"summary":"Lists all TableConfigs in cluster","description":"Lists all TableConfigs in cluster","operationId":"listConfigs","produces":["application/json"],"parameters":[],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}},"post":{"tags":["Table"],"summary":"Add the TableConfigs using the tableConfigsStr json","description":"Add the TableConfigs using the tableConfigsStr json","operationId":"addConfig","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ConfigSuccessResponse"}}}}},"/tableConfigs/validate":{"post":{"tags":["Table"],"summary":"Validate the TableConfigs","description":"Validate the TableConfigs","operationId":"validateConfig","produces":["application/json"],"parameters":[{"in":"body","name":"body","required":false,"schema":{"type":"string"}},{"name":"validationTypesToSkip","in":"query","description":"comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}}}}},"/tables/{tableName}/size":{"get":{"tags":["Table"],"summary":"Read table sizes","description":"Get table size details. Table size is the size of untarred segments including replication","operationId":"getTableSize","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Table name without type","required":true,"type":"string","x-example":"myTable | myTable_OFFLINE"},{"name":"detailed","in":"query","description":"Get detailed information","required":false,"type":"boolean","default":true}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/tables/{tableName}/idealstate":{"get":{"tags":["Table"],"summary":"Get table ideal state","description":"Get table ideal state","operationId":"getIdealState","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"tableType","in":"query","description":"realtime|offline","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/TableView"}}}}},"/tables/{tableName}/externalview":{"get":{"tags":["Table"],"summary":"Get table external view","description":"Get table external view","operationId":"getExternalView","produces":["application/json"],"parameters":[{"name":"tableName","in":"path","description":"Name of the table","required":true,"type":"string"},{"name":"tableType","in":"query","description":"realtime|offline","required":false,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/TableView"}}}}},"/v1/write/config/{table}":{"get":{"tags":["WriteApi"],"summary":"Get table config for write operation","description":"Gets a config for specific table. May contain Kafka producer configs","operationId":"getWriteConfig","produces":["application/json"],"parameters":[{"name":"table","in":"path","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}},"put":{"tags":["WriteApi"],"summary":"Update table config for write operation","description":"Gets a config for specific table. May contain Kafka producer configs","operationId":"updateWriteConfig","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"table","in":"path","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/TableWriteConfig"}}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/v1/write/{table}":{"post":{"tags":["WriteApi"],"summary":"Insert By POST Payload","description":"Insert records into a table","operationId":"insert","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"table","in":"path","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/WritePayload"}}],"security":[{"oauth":[]}],"responses":{"default":{"description":"successful operation"}}}},"/zk/delete":{"delete":{"tags":["Zookeeper"],"summary":"Delete the znode at this path","description":"","operationId":"delete","produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"204":{"description":"No Content"},"500":{"description":"Internal server error"}}}},"/zk/stat":{"get":{"tags":["Zookeeper"],"summary":"Get the stat","description":" Use this api to fetch additional details of a znode such as creation time, modified time, numChildren etc ","operationId":"stat","produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"Table not found"},"500":{"description":"Internal server error"}}}},"/zk/ls":{"get":{"tags":["Zookeeper"],"summary":"List the child znodes","description":"","operationId":"ls","produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"500":{"description":"Internal server error"}}}},"/zk/getChildren":{"get":{"tags":["Zookeeper"],"summary":"Get all child znodes","description":"","operationId":"getChildren","produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"204":{"description":"No Content"},"500":{"description":"Internal server error"}}}},"/zk/get":{"get":{"tags":["Zookeeper"],"summary":"Get content of the znode","description":"","operationId":"getData","produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"204":{"description":"No Content"},"500":{"description":"Internal server error"}}}},"/zk/putChildren":{"put":{"tags":["Zookeeper"],"summary":"Update the content of multiple znRecord node under the same path","description":"","operationId":"putChildren","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper path of parent, must start with /","required":true,"type":"string"},{"name":"data","in":"query","description":"Content","required":false,"type":"string"},{"name":"expectedVersion","in":"query","description":"expectedVersion","required":false,"type":"integer","default":-1,"format":"int32"},{"name":"accessOption","in":"query","description":"accessOption","required":false,"type":"integer","default":1,"format":"int32"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"204":{"description":"No Content"},"500":{"description":"Internal server error"}}}},"/zk/put":{"put":{"tags":["Zookeeper"],"summary":"Update the content of the node","description":"","operationId":"putData","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"},{"name":"data","in":"query","description":"Content","required":false,"type":"string"},{"name":"expectedVersion","in":"query","description":"expectedVersion","required":false,"type":"integer","default":-1,"format":"int32"},{"name":"accessOption","in":"query","description":"accessOption","required":false,"type":"integer","default":1,"format":"int32"},{"in":"body","name":"body","required":false,"schema":{"type":"string"}}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"204":{"description":"No Content"},"500":{"description":"Internal server error"}}}},"/zk/lsl":{"get":{"tags":["Zookeeper"],"summary":"List the child znodes along with Stats","description":"","operationId":"lsl","produces":["application/json"],"parameters":[{"name":"path","in":"query","description":"Zookeeper Path, must start with /","required":true,"type":"string"}],"security":[{"oauth":[]}],"responses":{"200":{"description":"Success"},"404":{"description":"ZK Path not found"},"500":{"description":"Internal server error"}}}}},"securityDefinitions":{"oauth":{"description":"","type":"apiKey","name":"Authorization","in":"header"}},"definitions":{"ClusterHealthResponse":{"type":"object","properties":{"unhealthyServerCount":{"type":"integer","format":"int64"},"tableToMisconfiguredSegmentCount":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}},"tableToErrorSegmentsCount":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}},"tableToSegmentsWitHMissingColumnsCount":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}}}},"PartitionOffsetInfo":{"type":"object","properties":{"currentOffsetsMap":{"type":"object","additionalProperties":{"type":"string"}},"latestUpstreamOffsetMap":{"type":"object","additionalProperties":{"type":"string"}},"recordsLagMap":{"type":"object","additionalProperties":{"type":"string"}},"availabilityLagMsMap":{"type":"object","additionalProperties":{"type":"string"}}}},"SegmentConsumerInfo":{"type":"object","properties":{"segmentName":{"type":"string","readOnly":true},"consumerState":{"type":"string","readOnly":true},"lastConsumedTimestamp":{"type":"integer","format":"int64","readOnly":true},"partitionToOffsetMap":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}},"partitionOffsetInfo":{"readOnly":true,"$ref":"#/definitions/PartitionOffsetInfo"}}},"SegmentDebugInfo":{"type":"object","properties":{"segmentName":{"type":"string","readOnly":true},"serverState":{"type":"object","readOnly":true,"additionalProperties":{"$ref":"#/definitions/SegmentState"}}}},"SegmentErrorInfo":{"type":"object","properties":{"timestamp":{"type":"string","readOnly":true},"errorMessage":{"type":"string","readOnly":true},"stackTrace":{"type":"string","readOnly":true}}},"SegmentState":{"type":"object","properties":{"idealState":{"type":"string","readOnly":true},"externalView":{"type":"string","readOnly":true},"segmentSize":{"type":"string","readOnly":true},"consumerInfo":{"readOnly":true,"$ref":"#/definitions/SegmentConsumerInfo"},"errorInfo":{"readOnly":true,"$ref":"#/definitions/SegmentErrorInfo"}}},"SuccessResponse":{"type":"object","properties":{"status":{"type":"string"}}},"InstanceInfo":{"type":"object","properties":{"port":{"type":"integer","format":"int32"},"host":{"type":"string"},"instanceName":{"type":"string"}}},"AuthWorkflowInfo":{"type":"object","properties":{"workflow":{"type":"string"}}},"BodyPart":{"type":"object","properties":{"contentDisposition":{"$ref":"#/definitions/ContentDisposition"},"entity":{"type":"object"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"mediaType":{"$ref":"#/definitions/MediaType"},"messageBodyWorkers":{"$ref":"#/definitions/MessageBodyWorkers"},"parent":{"$ref":"#/definitions/MultiPart"},"providers":{"$ref":"#/definitions/Providers"},"parameterizedHeaders":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/ParameterizedHeader"}}}}},"ContentDisposition":{"type":"object","properties":{"type":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"type":"string"}},"fileName":{"type":"string"},"creationDate":{"type":"string","format":"date-time"},"modificationDate":{"type":"string","format":"date-time"},"readDate":{"type":"string","format":"date-time"},"size":{"type":"integer","format":"int64"}}},"FormDataBodyPart":{"type":"object","properties":{"contentDisposition":{"$ref":"#/definitions/ContentDisposition"},"entity":{"type":"object"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"mediaType":{"$ref":"#/definitions/MediaType"},"messageBodyWorkers":{"$ref":"#/definitions/MessageBodyWorkers"},"parent":{"$ref":"#/definitions/MultiPart"},"providers":{"$ref":"#/definitions/Providers"},"name":{"type":"string"},"value":{"type":"string"},"simple":{"type":"boolean"},"formDataContentDisposition":{"$ref":"#/definitions/FormDataContentDisposition"},"parameterizedHeaders":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/ParameterizedHeader"}}}}},"FormDataContentDisposition":{"type":"object","properties":{"type":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"type":"string"}},"fileName":{"type":"string"},"creationDate":{"type":"string","format":"date-time"},"modificationDate":{"type":"string","format":"date-time"},"readDate":{"type":"string","format":"date-time"},"size":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"FormDataMultiPart":{"type":"object","properties":{"contentDisposition":{"$ref":"#/definitions/ContentDisposition"},"entity":{"type":"object"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"mediaType":{"$ref":"#/definitions/MediaType"},"messageBodyWorkers":{"$ref":"#/definitions/MessageBodyWorkers"},"parent":{"$ref":"#/definitions/MultiPart"},"providers":{"$ref":"#/definitions/Providers"},"bodyParts":{"type":"array","items":{"$ref":"#/definitions/BodyPart"}},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/FormDataBodyPart"}}},"parameterizedHeaders":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/ParameterizedHeader"}}}}},"MediaType":{"type":"object","properties":{"type":{"type":"string"},"subtype":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"type":"string"}},"wildcardSubtype":{"type":"boolean"},"wildcardType":{"type":"boolean"}}},"MessageBodyWorkers":{"type":"object"},"MultiPart":{"type":"object","properties":{"contentDisposition":{"$ref":"#/definitions/ContentDisposition"},"entity":{"type":"object"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"mediaType":{"$ref":"#/definitions/MediaType"},"messageBodyWorkers":{"$ref":"#/definitions/MessageBodyWorkers"},"parent":{"$ref":"#/definitions/MultiPart"},"providers":{"$ref":"#/definitions/Providers"},"bodyParts":{"type":"array","items":{"$ref":"#/definitions/BodyPart"}},"parameterizedHeaders":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/ParameterizedHeader"}}}}},"ParameterizedHeader":{"type":"object","properties":{"value":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"type":"string"}}}},"Providers":{"type":"object"},"InstancePartitions":{"type":"object","properties":{"instancePartitionsName":{"type":"string","readOnly":true},"partitionToInstancesMap":{"type":"object","readOnly":true,"additionalProperties":{"type":"array","items":{"type":"string"}}}}},"Instance":{"type":"object","required":["host","port","type"],"properties":{"host":{"type":"string","readOnly":true},"port":{"type":"integer","format":"int32","readOnly":true},"type":{"type":"string","readOnly":true,"enum":["CONTROLLER","BROKER","SERVER","MINION"]},"tags":{"type":"array","readOnly":true,"items":{"type":"string"}},"pools":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer","format":"int32"}},"grpcPort":{"type":"integer","format":"int32","readOnly":true},"adminPort":{"type":"integer","format":"int32","readOnly":true},"queryServicePort":{"type":"integer","format":"int32","readOnly":true},"queryMailboxPort":{"type":"integer","format":"int32","readOnly":true},"queriesDisabled":{"type":"boolean","readOnly":true}}},"Instances":{"type":"object","properties":{"instances":{"type":"array","readOnly":true,"items":{"type":"string"}}}},"LeadControllerEntry":{"type":"object","properties":{"tableNames":{"type":"array","readOnly":true,"items":{"type":"string"}},"leadControllerId":{"type":"string","readOnly":true}}},"LeadControllerResponse":{"type":"object","properties":{"leadControllerResourceEnabled":{"type":"boolean"},"leadControllerEntryMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/LeadControllerEntry"}}}},"ConsumingSegmentInfo":{"type":"object","properties":{"serverName":{"type":"string"},"consumerState":{"type":"string"},"lastConsumedTimestamp":{"type":"integer","format":"int64"},"partitionToOffsetMap":{"type":"object","additionalProperties":{"type":"string"}},"partitionOffsetInfo":{"$ref":"#/definitions/PartitionOffsetInfo"}}},"ConsumingSegmentsInfoMap":{"type":"object","properties":{"_segmentToConsumingInfoMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/ConsumingSegmentInfo"}}}}},"JsonNode":{"type":"object"},"ConfigSuccessResponse":{"type":"object","properties":{"unrecognizedProperties":{"type":"object","additionalProperties":{"type":"object"}},"status":{"type":"string"}}},"ServerReloadControllerJobStatusResponse":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"type":"string"}},"successCount":{"type":"integer","format":"int32"},"totalSegmentCount":{"type":"integer","format":"int32"},"totalServersQueried":{"type":"integer","format":"int32"},"totalServerCallsFailed":{"type":"integer","format":"int32"},"timeElapsedInMinutes":{"type":"number","format":"double"},"estimatedTimeRemainingInMinutes":{"type":"number","format":"double"}}},"TableTierDetails":{"type":"object","properties":{"tableName":{"type":"string","description":"Name of table to look for segment storage tiers","readOnly":true},"segmentTiers":{"type":"object","description":"Storage tiers of segments for the given table","readOnly":true,"additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}},"StartReplaceSegmentsRequest":{"type":"object","properties":{"segmentsFrom":{"type":"array","readOnly":true,"items":{"type":"string"}},"segmentsTo":{"type":"array","readOnly":true,"items":{"type":"string"}}}},"RebalanceResult":{"type":"object","properties":{"status":{"type":"string","readOnly":true,"enum":["NO_OP","DONE","FAILED","IN_PROGRESS"]},"description":{"type":"string","readOnly":true},"instanceAssignment":{"type":"object","readOnly":true,"additionalProperties":{"$ref":"#/definitions/InstancePartitions"}},"segmentAssignment":{"type":"object","readOnly":true,"additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}},"AggregationConfig":{"type":"object","properties":{"columnName":{"type":"string","readOnly":true},"aggregationFunction":{"type":"string","readOnly":true}}},"BatchIngestionConfig":{"type":"object","properties":{"batchConfigMaps":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},"segmentIngestionType":{"type":"string"},"segmentIngestionFrequency":{"type":"string"},"consistentDataPush":{"type":"boolean"}}},"BloomFilterConfig":{"type":"object","properties":{"fpp":{"type":"number","format":"double","readOnly":true},"maxSizeInBytes":{"type":"integer","format":"int32","readOnly":true},"loadOnHeap":{"type":"boolean","readOnly":true}}},"ColumnPartitionConfig":{"type":"object","required":["functionName","numPartitions"],"properties":{"functionName":{"type":"string","readOnly":true},"numPartitions":{"type":"integer","format":"int32","readOnly":true},"functionConfig":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"CompletionConfig":{"type":"object","required":["completionMode"],"properties":{"completionMode":{"type":"string","readOnly":true}}},"ComplexTypeConfig":{"type":"object","properties":{"fieldsToUnnest":{"type":"array","readOnly":true,"items":{"type":"string"}},"delimiter":{"type":"string","readOnly":true},"collectionNotUnnestedToJson":{"type":"string","readOnly":true,"enum":["NONE","NON_PRIMITIVE","ALL"]},"prefixesToRename":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"DateTimeFieldSpec":{"type":"object","properties":{"format":{"type":"string"},"sampleValue":{"type":"object"},"granularity":{"type":"string"},"singleValueField":{"type":"boolean"},"name":{"type":"string"},"maxLength":{"type":"integer","format":"int32"},"dataType":{"type":"string","enum":["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]},"transformFunction":{"type":"string"},"defaultNullValue":{"type":"object"},"virtualColumnProvider":{"type":"string"},"defaultNullValueString":{"type":"string"}}},"DedupConfig":{"type":"object","required":["dedupEnabled"],"properties":{"dedupEnabled":{"type":"boolean","readOnly":true},"hashFunction":{"type":"string","readOnly":true,"enum":["NONE","MD5","MURMUR3"]}}},"DimensionFieldSpec":{"type":"object","properties":{"name":{"type":"string"},"maxLength":{"type":"integer","format":"int32"},"dataType":{"type":"string","enum":["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]},"transformFunction":{"type":"string"},"defaultNullValue":{"type":"object"},"singleValueField":{"type":"boolean"},"virtualColumnProvider":{"type":"string"},"defaultNullValueString":{"type":"string"}}},"DimensionTableConfig":{"type":"object","required":["disablePreload"],"properties":{"disablePreload":{"type":"boolean","readOnly":true}}},"FieldConfig":{"type":"object","required":["name"],"properties":{"name":{"type":"string","readOnly":true},"encodingType":{"type":"string","readOnly":true,"enum":["RAW","DICTIONARY"]},"indexType":{"type":"string","readOnly":true,"enum":["INVERTED","SORTED","TEXT","FST","H3","JSON","TIMESTAMP","RANGE"]},"indexTypes":{"type":"array","readOnly":true,"items":{"type":"string","enum":["INVERTED","SORTED","TEXT","FST","H3","JSON","TIMESTAMP","RANGE"]}},"compressionCodec":{"type":"string","readOnly":true,"enum":["PASS_THROUGH","SNAPPY","ZSTANDARD","LZ4"]},"timestampConfig":{"readOnly":true,"$ref":"#/definitions/TimestampConfig"},"properties":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"FilterConfig":{"type":"object","properties":{"filterFunction":{"type":"string","readOnly":true}}},"IndexingConfig":{"type":"object","properties":{"segmentNameGeneratorType":{"type":"string"},"streamConfigs":{"type":"object","additionalProperties":{"type":"string"}},"invertedIndexColumns":{"type":"array","items":{"type":"string"}},"noDictionaryColumns":{"type":"array","items":{"type":"string"}},"rangeIndexColumns":{"type":"array","items":{"type":"string"}},"rangeIndexVersion":{"type":"integer","format":"int32"},"fstindexType":{"type":"string","enum":["LUCENE","NATIVE"]},"jsonIndexColumns":{"type":"array","items":{"type":"string"}},"jsonIndexConfigs":{"type":"object","additionalProperties":{"$ref":"#/definitions/JsonIndexConfig"}},"autoGeneratedInvertedIndex":{"type":"boolean"},"createInvertedIndexDuringSegmentGeneration":{"type":"boolean"},"sortedColumn":{"type":"array","items":{"type":"string"}},"bloomFilterColumns":{"type":"array","items":{"type":"string"}},"bloomFilterConfigs":{"type":"object","additionalProperties":{"$ref":"#/definitions/BloomFilterConfig"}},"loadMode":{"type":"string"},"segmentFormatVersion":{"type":"string"},"columnMinMaxValueGeneratorMode":{"type":"string"},"noDictionaryConfig":{"type":"object","additionalProperties":{"type":"string"}},"onHeapDictionaryColumns":{"type":"array","items":{"type":"string"}},"varLengthDictionaryColumns":{"type":"array","items":{"type":"string"}},"enableDefaultStarTree":{"type":"boolean"},"starTreeIndexConfigs":{"type":"array","items":{"$ref":"#/definitions/StarTreeIndexConfig"}},"enableDynamicStarTreeCreation":{"type":"boolean"},"segmentPartitionConfig":{"$ref":"#/definitions/SegmentPartitionConfig"},"aggregateMetrics":{"type":"boolean"},"nullHandlingEnabled":{"type":"boolean"},"optimizeDictionary":{"type":"boolean"},"optimizeDictionaryForMetrics":{"type":"boolean"},"noDictionarySizeRatioThreshold":{"type":"number","format":"double"}}},"IngestionConfig":{"type":"object","properties":{"streamIngestionConfig":{"$ref":"#/definitions/StreamIngestionConfig"},"batchIngestionConfig":{"$ref":"#/definitions/BatchIngestionConfig"},"filterConfig":{"$ref":"#/definitions/FilterConfig"},"transformConfigs":{"type":"array","items":{"$ref":"#/definitions/TransformConfig"}},"complexTypeConfig":{"$ref":"#/definitions/ComplexTypeConfig"},"aggregationConfigs":{"type":"array","items":{"$ref":"#/definitions/AggregationConfig"}},"continueOnError":{"type":"boolean"},"rowTimeValueCheck":{"type":"boolean"},"segmentTimeValueCheck":{"type":"boolean"}}},"InstanceAssignmentConfig":{"type":"object","required":["replicaGroupPartitionConfig","tagPoolConfig"],"properties":{"tagPoolConfig":{"readOnly":true,"$ref":"#/definitions/InstanceTagPoolConfig"},"constraintConfig":{"readOnly":true,"$ref":"#/definitions/InstanceConstraintConfig"},"replicaGroupPartitionConfig":{"readOnly":true,"$ref":"#/definitions/InstanceReplicaGroupPartitionConfig"},"partitionSelector":{"type":"string","readOnly":true,"enum":["FD_AWARE_INSTANCE_PARTITION_SELECTOR","INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR"]}}},"InstanceConstraintConfig":{"type":"object","required":["constraints"],"properties":{"constraints":{"type":"array","readOnly":true,"items":{"type":"string"}}}},"InstanceReplicaGroupPartitionConfig":{"type":"object","properties":{"replicaGroupBased":{"type":"boolean","readOnly":true},"numInstances":{"type":"integer","format":"int32","readOnly":true},"numReplicaGroups":{"type":"integer","format":"int32","readOnly":true},"numInstancesPerReplicaGroup":{"type":"integer","format":"int32","readOnly":true},"numPartitions":{"type":"integer","format":"int32","readOnly":true},"numInstancesPerPartition":{"type":"integer","format":"int32","readOnly":true},"minimizeDataMovement":{"type":"boolean","readOnly":true}}},"InstanceTagPoolConfig":{"type":"object","required":["tag"],"properties":{"tag":{"type":"string","readOnly":true},"poolBased":{"type":"boolean","readOnly":true},"numPools":{"type":"integer","format":"int32","readOnly":true},"pools":{"type":"array","readOnly":true,"items":{"type":"integer","format":"int32"}}}},"JsonIndexConfig":{"type":"object","properties":{"maxLevels":{"type":"integer","format":"int32"},"excludeArray":{"type":"boolean"},"excludeFields":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"disableCrossArrayUnnest":{"type":"boolean"},"includePaths":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"excludePaths":{"type":"array","uniqueItems":true,"items":{"type":"string"}}}},"MetricFieldSpec":{"type":"object","properties":{"singleValueField":{"type":"boolean"},"name":{"type":"string"},"maxLength":{"type":"integer","format":"int32"},"dataType":{"type":"string","enum":["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]},"transformFunction":{"type":"string"},"defaultNullValue":{"type":"object"},"virtualColumnProvider":{"type":"string"},"defaultNullValueString":{"type":"string"}}},"QueryConfig":{"type":"object","properties":{"timeoutMs":{"type":"integer","format":"int64","readOnly":true},"disableGroovy":{"type":"boolean","readOnly":true},"useApproximateFunction":{"type":"boolean","readOnly":true},"expressionOverrideMap":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"QuotaConfig":{"type":"object","properties":{"storage":{"type":"string","readOnly":true},"maxQueriesPerSecond":{"type":"string","readOnly":true}}},"ReplicaGroupStrategyConfig":{"type":"object","required":["numInstancesPerPartition"],"properties":{"partitionColumn":{"type":"string","readOnly":true},"numInstancesPerPartition":{"type":"integer","format":"int32","readOnly":true}}},"RoutingConfig":{"type":"object","properties":{"routingTableBuilderName":{"type":"string","readOnly":true},"segmentPrunerTypes":{"type":"array","readOnly":true,"items":{"type":"string"}},"instanceSelectorType":{"type":"string","readOnly":true}}},"Schema":{"type":"object","properties":{"schemaName":{"type":"string"},"metricFieldSpecs":{"type":"array","items":{"$ref":"#/definitions/MetricFieldSpec"}},"dateTimeFieldSpecs":{"type":"array","items":{"$ref":"#/definitions/DateTimeFieldSpec"}},"timeFieldSpec":{"$ref":"#/definitions/TimeFieldSpec"},"primaryKeyColumns":{"type":"array","items":{"type":"string"}},"dimensionFieldSpecs":{"type":"array","items":{"$ref":"#/definitions/DimensionFieldSpec"}}}},"SegmentAssignmentConfig":{"type":"object","properties":{"assignmentStrategy":{"type":"string"}}},"SegmentPartitionConfig":{"type":"object","required":["columnPartitionMap"],"properties":{"columnPartitionMap":{"type":"object","readOnly":true,"additionalProperties":{"$ref":"#/definitions/ColumnPartitionConfig"}}}},"SegmentsValidationAndRetentionConfig":{"type":"object","properties":{"timeType":{"type":"string","enum":["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]},"schemaName":{"type":"string"},"replication":{"type":"string"},"retentionTimeUnit":{"type":"string"},"retentionTimeValue":{"type":"string"},"replicasPerPartition":{"type":"string"},"deletedSegmentsRetentionPeriod":{"type":"string"},"segmentPushFrequency":{"type":"string"},"segmentPushType":{"type":"string"},"segmentAssignmentStrategy":{"type":"string"},"timeColumnName":{"type":"string"},"replicaGroupStrategyConfig":{"$ref":"#/definitions/ReplicaGroupStrategyConfig"},"completionConfig":{"$ref":"#/definitions/CompletionConfig"},"peerSegmentDownloadScheme":{"type":"string"},"crypterClassName":{"type":"string"},"minimizeDataMovement":{"type":"boolean"}}},"StarTreeIndexConfig":{"type":"object","required":["dimensionsSplitOrder","functionColumnPairs"],"properties":{"dimensionsSplitOrder":{"type":"array","readOnly":true,"items":{"type":"string"}},"skipStarNodeCreationForDimensions":{"type":"array","readOnly":true,"items":{"type":"string"}},"functionColumnPairs":{"type":"array","readOnly":true,"items":{"type":"string"}},"maxLeafRecords":{"type":"integer","format":"int32","readOnly":true}}},"StreamIngestionConfig":{"type":"object","properties":{"streamConfigMaps":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":{"type":"string"}}}}},"TableAndSchemaConfig":{"type":"object","required":["tableConfig"],"properties":{"tableConfig":{"readOnly":true,"$ref":"#/definitions/TableConfig"},"schema":{"readOnly":true,"$ref":"#/definitions/Schema"}}},"TableConfig":{"type":"object","properties":{"tableName":{"type":"string","readOnly":true},"tableType":{"type":"string","readOnly":true,"enum":["OFFLINE","REALTIME"]},"segmentsConfig":{"$ref":"#/definitions/SegmentsValidationAndRetentionConfig"},"tenants":{"$ref":"#/definitions/TenantConfig"},"tableIndexConfig":{"$ref":"#/definitions/IndexingConfig"},"metadata":{"$ref":"#/definitions/TableCustomConfig"},"quota":{"$ref":"#/definitions/QuotaConfig"},"task":{"$ref":"#/definitions/TableTaskConfig"},"routing":{"$ref":"#/definitions/RoutingConfig"},"query":{"$ref":"#/definitions/QueryConfig"},"instanceAssignmentConfigMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/InstanceAssignmentConfig"}},"fieldConfigList":{"type":"array","items":{"$ref":"#/definitions/FieldConfig"}},"upsertConfig":{"$ref":"#/definitions/UpsertConfig"},"dedupConfig":{"$ref":"#/definitions/DedupConfig"},"dimensionTableConfig":{"$ref":"#/definitions/DimensionTableConfig"},"ingestionConfig":{"$ref":"#/definitions/IngestionConfig"},"tierConfigs":{"type":"array","items":{"$ref":"#/definitions/TierConfig"}},"isDimTable":{"type":"boolean","readOnly":true},"tunerConfigs":{"type":"array","items":{"$ref":"#/definitions/TunerConfig"}},"instancePartitionsMap":{"type":"object","additionalProperties":{"type":"string"}},"segmentAssignmentConfigMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/SegmentAssignmentConfig"}}}},"TableCustomConfig":{"type":"object","properties":{"customConfigs":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"TableTaskConfig":{"type":"object","properties":{"taskTypeConfigsMap":{"type":"object","readOnly":true,"additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}},"TagOverrideConfig":{"type":"object","properties":{"realtimeConsuming":{"type":"string","readOnly":true},"realtimeCompleted":{"type":"string","readOnly":true}}},"TenantConfig":{"type":"object","properties":{"broker":{"type":"string","readOnly":true},"server":{"type":"string","readOnly":true},"tagOverrideConfig":{"readOnly":true,"$ref":"#/definitions/TagOverrideConfig"}}},"TierConfig":{"type":"object","required":["name","segmentSelectorType","storageType"],"properties":{"name":{"type":"string","readOnly":true},"segmentSelectorType":{"type":"string","readOnly":true},"segmentAge":{"type":"string","readOnly":true},"segmentList":{"type":"array","readOnly":true,"items":{"type":"string"}},"storageType":{"type":"string","readOnly":true},"serverTag":{"type":"string","readOnly":true},"tierBackend":{"type":"string","readOnly":true},"tierBackendProperties":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"TimeFieldSpec":{"type":"object","properties":{"name":{"type":"string"},"incomingGranularitySpec":{"$ref":"#/definitions/TimeGranularitySpec"},"dataType":{"type":"string","enum":["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]},"outgoingGranularitySpec":{"$ref":"#/definitions/TimeGranularitySpec"},"singleValueField":{"type":"boolean"},"maxLength":{"type":"integer","format":"int32"},"transformFunction":{"type":"string"},"defaultNullValue":{"type":"object"},"virtualColumnProvider":{"type":"string"},"defaultNullValueString":{"type":"string"}}},"TimeGranularitySpec":{"type":"object","properties":{"name":{"type":"string"},"dataType":{"type":"string","enum":["INT","LONG","FLOAT","DOUBLE","BIG_DECIMAL","BOOLEAN","TIMESTAMP","STRING","JSON","BYTES","STRUCT","MAP","LIST"]},"timeType":{"type":"string","enum":["NANOSECONDS","MICROSECONDS","MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"]},"timeUnitSize":{"type":"integer","format":"int32"},"timeFormat":{"type":"string"}}},"TimestampConfig":{"type":"object","properties":{"granularities":{"type":"array","readOnly":true,"items":{"type":"string","enum":["MILLISECOND","SECOND","MINUTE","HOUR","DAY","WEEK","MONTH","QUARTER","YEAR"]}}}},"TransformConfig":{"type":"object","properties":{"columnName":{"type":"string","readOnly":true},"transformFunction":{"type":"string","readOnly":true}}},"TunerConfig":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"tunerProperties":{"type":"object","additionalProperties":{"type":"string"}}}},"UpsertConfig":{"type":"object","required":["mode"],"properties":{"mode":{"type":"string","readOnly":true,"enum":["FULL","PARTIAL","NONE"]},"partialUpsertStrategies":{"type":"object","additionalProperties":{"type":"string","enum":["APPEND","IGNORE","INCREMENT","MAX","MIN","OVERWRITE","UNION"]}},"defaultPartialUpsertStrategy":{"type":"string","enum":["APPEND","IGNORE","INCREMENT","MAX","MIN","OVERWRITE","UNION"]},"comparisonColumn":{"type":"string"},"hashFunction":{"type":"string","enum":["NONE","MD5","MURMUR3"]},"enableSnapshot":{"type":"boolean"},"metadataManagerClass":{"type":"string"},"metadataManagerConfigs":{"type":"object","additionalProperties":{"type":"string"}}}},"ObjectNode":{"type":"object"},"JobKey":{"type":"object","properties":{"name":{"type":"string"},"group":{"type":"string"}}},"AdhocTaskConfig":{"type":"object","required":["tableName","taskType"],"properties":{"taskType":{"type":"string","readOnly":true},"tableName":{"type":"string","readOnly":true},"taskName":{"type":"string","readOnly":true},"taskConfigs":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"}}}},"StringResultResponse":{"type":"object","properties":{"result":{"type":"string"}}},"PinotTaskConfig":{"type":"object","properties":{"tableName":{"type":"string"},"configs":{"type":"object","additionalProperties":{"type":"string"}},"taskId":{"type":"string"},"taskType":{"type":"string"}}},"TaskCount":{"type":"object","properties":{"total":{"type":"integer","format":"int32"},"completed":{"type":"integer","format":"int32"},"running":{"type":"integer","format":"int32"},"waiting":{"type":"integer","format":"int32"},"error":{"type":"integer","format":"int32"},"unknown":{"type":"integer","format":"int32"}}},"SubtaskDebugInfo":{"type":"object","properties":{"taskId":{"type":"string"},"state":{"type":"string","enum":["INIT","RUNNING","STOPPED","COMPLETED","TIMED_OUT","TASK_ERROR","TASK_ABORTED","ERROR","DROPPED"]},"startTime":{"type":"string"},"finishTime":{"type":"string"},"participant":{"type":"string"},"info":{"type":"string"},"taskConfig":{"$ref":"#/definitions/PinotTaskConfig"}}},"TaskDebugInfo":{"type":"object","properties":{"taskState":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","STOPPED","STOPPING","FAILED","COMPLETED","ABORTED","TIMED_OUT","TIMING_OUT","FAILING"]},"subtaskCount":{"$ref":"#/definitions/TaskCount"},"startTime":{"type":"string"},"executionStartTime":{"type":"string"},"finishTime":{"type":"string"},"subtaskInfos":{"type":"array","items":{"$ref":"#/definitions/SubtaskDebugInfo"}}}},"Tenant":{"type":"object","required":["tenantName","tenantRole"],"properties":{"tenantRole":{"type":"string","readOnly":true,"enum":["SERVER","BROKER","MINION"]},"tenantName":{"type":"string","readOnly":true},"numberOfInstances":{"type":"integer","format":"int32","readOnly":true},"offlineInstances":{"type":"integer","format":"int32","readOnly":true},"realtimeInstances":{"type":"integer","format":"int32","readOnly":true}}},"TenantsList":{"type":"object","properties":{"SERVER_TENANTS":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"BROKER_TENANTS":{"type":"array","uniqueItems":true,"items":{"type":"string"}}}},"TenantMetadata":{"type":"object","properties":{"ServerInstances":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"OfflineServerInstances":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"RealtimeServerInstances":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"BrokerInstances":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"tenantName":{"type":"string"}}},"SegmentSizeDetails":{"type":"object","properties":{"reportedSizeInBytes":{"type":"integer","format":"int64"},"estimatedSizeInBytes":{"type":"integer","format":"int64"},"serverInfo":{"type":"object","additionalProperties":{"$ref":"#/definitions/SegmentSizeInfo"}}}},"SegmentSizeInfo":{"type":"object","properties":{"segmentName":{"type":"string","readOnly":true},"diskSizeInBytes":{"type":"integer","format":"int64","readOnly":true}}},"TableSizeDetails":{"type":"object","properties":{"tableName":{"type":"string"},"reportedSizeInBytes":{"type":"integer","format":"int64"},"estimatedSizeInBytes":{"type":"integer","format":"int64"},"offlineSegments":{"$ref":"#/definitions/TableSubTypeSizeDetails"},"realtimeSegments":{"$ref":"#/definitions/TableSubTypeSizeDetails"}}},"TableSubTypeSizeDetails":{"type":"object","properties":{"reportedSizeInBytes":{"type":"integer","format":"int64"},"estimatedSizeInBytes":{"type":"integer","format":"int64"},"missingSegments":{"type":"integer","format":"int32"},"segments":{"type":"object","additionalProperties":{"$ref":"#/definitions/SegmentSizeDetails"}}}},"TableView":{"type":"object","properties":{"OFFLINE":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}},"REALTIME":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}},"TableWriteConfig":{"type":"object","properties":{"topic":{"type":"string"},"producerConfig":{"type":"object","additionalProperties":{"type":"string"}},"encoderConfig":{"type":"object","additionalProperties":{"type":"string"}},"encoderClass":{"type":"string"},"producerType":{"type":"string"},"partitionColumns":{"type":"array","items":{"type":"string"}}}},"WritePayload":{"type":"object","properties":{"values":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}},"columnNames":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":"object"}}}}}}} \ No newline at end of file