// NewTopicSettingsCmd returns the Kafka Topics Settings
NewTopicSettingsCmd returns the Kafka Topics Settings
// NewTopicSettingsCmd returns the Kafka Topics Settings
func NewTopicSettingsCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use: "topic-settings",
		Long: heredoc.Doc(`
			View/Update the Topic Settings for Kafka Topics.
			View the settings for Kafka Topic. Settings restict tenants from overloading the Kafka Cluster(s).
			The settings can be imported/exported to different Kafka Cluster to allow for best GitOps practices.
			Note that you need to use either JSON or YAML format.
		`),
		Example: heredoc.Doc(`
			$ lenses-cli topic-settings --output="JSON"
			$ lenses-cli topic-settings --output="YAML"
		`),
		SilenceErrors:    true,
		TraverseChildren: true,
		RunE: func(cmd *cobra.Command, args []string) error {
			settings, err := config.Client.GetTopicSettings()
			if err != nil {
				return errors.Wrap(err, utils.RED("✘ Error"))
			}
			outputFlagValue := strings.ToUpper(bite.GetOutPutFlag(cmd))
			if outputFlagValue != "JSON" && outputFlagValue != "YAML" {
				fmt.Println(utils.YELLOW("! Plesese use JSON or YAML output to see the object\n"))
			}
			return bite.PrintObject(cmd, settings)
		},
		PostRun: func(cmd *cobra.Command, args []string) {
			fmt.Println(utils.Green("✓ Read Topic Settings"))
		},
	}
	cmd.AddCommand(UpdateTopicSettingsCmd())
	return cmd
}
func NewTopicSettingsCmd ( ) * cobra . Command { cmd := & cobra . Command { Use : " " , Long : heredoc . Doc ( `
			View/Update the Topic Settings for Kafka Topics.

			View the settings for Kafka Topic. Settings restict tenants from overloading the Kafka Cluster(s).
			The settings can be imported/exported to different Kafka Cluster to allow for best GitOps practices.
			
			Note that you need to use either JSON or YAML format.
		` ) , Example : heredoc . Doc ( `
			$ lenses-cli topic-settings --output="JSON"
			$ lenses-cli topic-settings --output="YAML"
		` ) , SilenceErrors : true , TraverseChildren : true , RunE : func ( cmd * cobra . Command , args [ ] string ) error { settings , err := config . Client . GetTopicSettings ( ) if err != nil { return errors . Wrap ( err , utils . RED ( " ) } outputFlagValue := strings . ToUpper ( bite . GetOutPutFlag ( cmd ) ) if outputFlagValue != " " && outputFlagValue != " " { fmt . Println ( utils . YELLOW ( " \n " ) ) } return bite . PrintObject ( cmd , settings ) } , PostRun : func ( cmd * cobra . Command , args [ ] string ) { fmt . Println ( utils . Green ( " ) } , } cmd . AddCommand ( UpdateTopicSettingsCmd ( ) ) return cmd }
NewTopicSettingsCmd returns the Kafka Topics Settings
NewTopicSettingsCmd returns the Kafka Topics Settings