package errors

/*
	Error message and suggestions message associated with them
*/

const (
	// format
	prefixFormat = "%s: %s"

	// admin commands
	BadResourceIDErrorMsg  = "failed parsing resource id: please ensure resource id begins with \"u-\""
	BadEmailFormatErrorMsg = "invalid email structure"

	// api-key commands
	BadServiceAccountIDErrorMsg         = `failed to parse service account id: ensure service account id begins with "sa-"`
	UnableToStoreAPIKeyErrorMsg         = "unable to store API key locally"
	NonKafkaNotImplementedErrorMsg      = "command not yet available for non-Kafka cluster resources"
	RefuseToOverrideSecretErrorMsg      = "refusing to overwrite existing secret for API Key \"%s\""
	RefuseToOverrideSecretSuggestions   = "If you would like to override the existing secret stored for API key \"%s\", use `--force` flag."
	APIKeyUseFailedErrorMsg             = "unable to set active API key"
	APIKeyUseFailedSuggestions          = "If you did not create this API key with the CLI or created it on another computer, you must first store the API key and secret locally with `confluent api-key store %s <secret>`."
	APIKeyNotValidForClusterErrorMsg    = "The provided API key does not belong to the target cluster."
	APIKeyNotValidForClusterSuggestions = "Specify the cluster this API key belongs to using the `--resource` flag. Alternatively, first execute the `confluent kafka cluster use` command to set the context to the proper cluster for this key and retry the `confluent api-key store` command."
	APIKeyNotFoundSuggestions           = "Ensure the API key you are trying to store exists and has not been deleted, or create a new API key via `confluent api-key create`."
	ServiceAccountNotFoundErrorMsg      = "service account \"%s\" not found"
	ServiceAccountNotFoundSuggestions   = "List service accounts with `confluent service-account list`."

	// audit-log command
	EnsureCPSixPlusSuggestions        = "Ensure that you are running against MDS with CP 6.0+."
	UnableToAccessEndpointErrorMsg    = "unable to access endpoint"
	UnableToAccessEndpointSuggestions = EnsureCPSixPlusSuggestions
	AuditLogsNotEnabledErrorMsg       = "Audit Logs are not enabled for this organization."
	MalformedConfigErrorMsg           = "bad input file: the audit log configuration for cluster %q uses invalid JSON: %v"

	// login command
	NoEnvironmentFoundErrorMsg                  = "no environment found for authenticated user"
	UnneccessaryUrlFlagForCloudLoginErrorMsg    = "there is no need to pass the url flag if you are logging in to Confluent Cloud"
	UnneccessaryUrlFlagForCloudLoginSuggestions = "Log in to Confluent Cloud with `confluent login`"
	SSOCredentialsDoNotMatchLoginCredentials    = "expected SSO credentials for %s but got credentials for %s"
	SSOCredentialsDoNotMatchSuggestions         = "Please re-login and use the same email at the prompt and in the SSO portal."

	// confluent cluster commands
	FetchClusterMetadataErrorMsg     = "unable to fetch cluster metadata: %s - %s"
	AccessClusterRegistryErrorMsg    = "unable to access Cluster Registry"
	AccessClusterRegistrySuggestions = EnsureCPSixPlusSuggestions
	MustSpecifyOneClusterIDErrorMsg  = "must specify at least one cluster ID"
	ProtocolNotSupportedErrorMsg     = "protocol %s is currently not supported"

	// connect and connector-catalog commands
	EmptyConfigFileErrorMsg            = "connector config file \"%s\" is empty"
	MissingRequiredConfigsErrorMsg     = "required configs \"name\" and \"connector.class\" missing from connector config file \"%s\""
	InvalidCloudErrorMsg               = "error defining plugin on given Kafka cluster"
	ConnectLogEventsNotEnabledErrorMsg = "Connect Log Events are not enabled for this organization."

	// environment command
	EnvNotFoundErrorMsg    = "environment \"%s\" not found"
	EnvNotFoundSuggestions = "List available environments with `confluent environment list`."
	EnvSwitchErrorMsg      = "failed to switch environment: failed to save config"

	// iam acl & kafka acl commands
	UnableToPerformAclErrorMsg    = "unable to %s ACLs: %s"
	UnableToPerformAclSuggestions = "Ensure that you're running against MDS with CP 5.4+."
	MustSetAllowOrDenyErrorMsg    = "--allow or --deny must be set when adding or deleting an ACL"
	OnlySetAllowOrDenyErrorMsg    = "only --allow or --deny may be set when adding or deleting an ACL"
	MustSetResourceTypeErrorMsg   = "exactly one resource type (%v) must be set"
	InvalidOperationValueErrorMsg = "invalid operation value: %s"
	ExactlyOneSetErrorMsg         = "exactly one of %v must be set"
	UserIdNotValidErrorMsg        = "can't map user id to a valid service account"

	// iam rbac role commands
	UnknownRoleErrorMsg    = "unknown role \"%s\""
	UnknownRoleSuggestions = "The available roles are: %s"

	// iam rbac role-binding commands
	PrincipalFormatErrorMsg         = "incorrect principal format specified"
	PrincipalFormatSuggestions      = "Principal must be specified in this format: \"<Principal Type>:<Principal Name>\".\nFor example, \"User:u-xxxxxx\" or \"User:sa-xxxxxx\"."
	ResourceFormatErrorMsg          = "incorrect resource format specified"
	ResourceFormatSuggestions       = "Resource must be specified in this format: `<Resource Type>:<Resource Name>`."
	LookUpRoleErrorMsg              = "failed to lookup role \"%s\""
	LookUpRoleSuggestions           = "To check for valid roles, use `confluent iam rbac role list`."
	InvalidResourceTypeErrorMsg     = "invalid resource type \"%s\""
	InvalidResourceTypeSuggestions  = "The available resource types are: %s"
	SpecifyKafkaIDErrorMsg          = "must also specify a --kafka-cluster-id to uniquely identify the scope"
	SpecifyCloudClusterErrorMsg     = "must specify cloud-cluster flag to indicate role binding scope"
	SpecifyEnvironmentErrorMsg      = "must specify environment flag to indicate role binding scope"
	BothClusterNameAndScopeErrorMsg = "cannot specify both cluster name and cluster scope"
	SpecifyClusterErrorMsg          = "must specify either cluster ID to indicate role binding scope or the cluster name"
	MoreThanOneNonKafkaErrorMsg     = "cannot specify more than one non-Kafka cluster ID for a scope"
	PrincipalOrRoleRequiredErrorMsg = "must specify either principal or role"
	HTTPStatusCodeErrorMsg          = "no error but received HTTP status code %d"
	HTTPStatusCodeSuggestions       = "Please file a support ticket with details."
	UnauthorizedErrorMsg            = "user is unauthorized to perform this action"
	UnauthorizedSuggestions         = "Check the user's privileges by running `ccloud iam rolebinding list`.\nGive the user the appropriate permissions using `ccloud iam rolebinding create`."

	// iam service-account commands
	ServiceNameInUseErrorMsg    = `service name "%s" is already in use`
	ServiceNameInUseSuggestions = "To list all service account, use `confluent iam service-account list`."

	// init command
	CannotBeEmptyErrorMsg         = "%s cannot be empty"
	UnknownCredentialTypeErrorMsg = "credential type %d unknown"

	// kafka client-config package
	FetchConfigFileErrorMsg               = "failed to get config file: error code %d"
	WriteConfigFileErrorMsg               = "failed to write config file"
	KafkaCredsValidationFailedErrorMsg    = "failed to validate Kafka API credential"
	KafkaCredsValidationFailedSuggestions = "Verify that the correct Kafka API credential is used.\n" +
		"If you are using the stored Kafka API credential, verify that the secret is correct. If incorrect, override with `confluent api-key store -f`.\n" +
		"If you are using the flags, verify that the correct Kafka API credential is passed to `--api-key` and `--api-secret`."
	SRCredsValidationFailedErrorMsg    = "failed to validate Schema Registry API credential"
	SRCredsValidationFailedSuggestions = "Verify that the correct Schema Registry API credential is passed to `--sr-apikey` and --sr-apisecret`."

	// kafka cluster commands
	ListTopicSuggestions                          = "To list topics for the cluster \"%s\", use `confluent kafka topic list --cluster %s`."
	FailedToRenderKeyPolicyErrorMsg               = "BYOK error: failed to render key policy"
	FailedToReadConfirmationErrorMsg              = "BYOK error: failed to read your confirmation"
	FailedToReadClusterResizeConfirmationErrorMsg = "Cluster resize error: failed to read your confirmation"
	AuthorizeAccountsErrorMsg                     = "BYOK error: please authorize the key for the accounts (%s)x"
	AuthorizeIdentityErrorMsg                     = "BYOK error: please authorize the key for the identity (%s)"
	CKUOnlyForDedicatedErrorMsg                   = "specifying `--cku` flag is valid only for dedicated Kafka cluster creation"
	BYOKSupportErrorMsg                           = "BYOK is available on AWS and GCP."
	CKUMoreThanZeroErrorMsg                       = "`--cku` value must be greater than 0"
	CKUMoreThanOneErrorMsg                        = "`--cku` value must be greater than 1 for High Durability"
	ClusterResizeNotSupported                     = "cluster resize is only supported on dedicated clusters"
	CloudRegionNotAvailableErrorMsg               = "\"%s\" is not an available region for \"%s\""
	CloudRegionNotAvailableSuggestions            = "To view a list of available regions for \"%s\", use `confluent kafka region list --cloud %s`."
	CloudProviderNotAvailableErrorMsg             = "\"%s\" is not an available cloud provider"
	CloudProviderNotAvailableSuggestions          = "To view a list of available cloud providers and regions, use `confluent kafka region list`."
	TopicDoesNotExistOrMissingACLsErrorMsg        = "topic \"%s\" does not exist or your api key does not have the ACLs required to describe it"
	TopicDoesNotExistOrMissingACLsSuggestions     = "To list topics for the cluster \"%s\", use `confluent kafka topic list --cluster %s`.\nTo list ACLs use `confluent kafka acl list --cluster %s`."
	InvalidAvailableFlagErrorMsg                  = "invalid value \"%s\" for `--availability` flag"
	InvalidAvailableFlagSuggestions               = "Allowed values for `--availability` flag are: %s, %s."
	InvalidTypeFlagErrorMsg                       = "invalid value \"%s\" for `--type` flag"
	InvalidTypeFlagSuggestions                    = "Allowed values for `--type` flag are: %s, %s, %s."
	NameOrCKUFlagErrorMsg                         = "must either specify --name with non-empty value or --cku (for dedicated clusters) with positive integer"
	NonEmptyNameErrorMsg                          = "`--name` flag value must not be emtpy"
	KafkaClusterNotFoundErrorMsg                  = "kafka cluster \"%s\" not found"
	KafkaClusterStillProvisioningErrorMsg         = "Your cluster is still provisioning, so it can't be updated yet.  Please retry in a few minutes."
	KafkaClusterUpdateFailedSuggestions           = "A cluster can't be updated while still provisioning.  If you just created this cluster, retry in a few minutes."
	KafkaClusterExpandingErrorMsg                 = "Your cluster is expanding. Please wait for that operation to complete before updating again."
	KafkaClusterShrinkingErrorMsg                 = "Your cluster is shrinking. Please wait for that operation to complete before updating again."
	KafkaClusterDeletingErrorMsg                  = "Your cluster is in the process of being deleted. Cannot initiate cluster resize."
	ChooseRightEnvironmentSuggestions             = "Ensure the cluster ID you entered is valid.\n" +
		"Ensure the cluster you are specifying belongs to the currently selected environment with `confluent kafka cluster list`, `confluent environment list`, and `confluent environment use`."
	UnknownTopicErrorMsg      = `unknown topic "%s"`
	MdsUrlNotFoundSuggestions = "Pass the `--url` flag or set the `CONFLUENT_PLATFORM_MDS_URL` environment variable."

	// kafka topic commands
	FailedToCreateProducerMsg            = "failed to create producer: %v"
	FailedToCreateConsumerMsg            = "failed to create consumer: %v"
	FailedToCreateAdminClientMsg         = "failed to create confluent-kafka-go admin client: %v"
	InvalidSecurityProtocolErrorMsg      = "security protocol not supported: %v"
	TopicExistsOnPremErrorMsg            = "topic \"%s\" already exists for the Kafka cluster"
	TopicExistsOnPremSuggestions         = "To list topics for the cluster, use `confluent kafka topic list --url <url>`."
	FailedToProduceErrorMsg              = "failed to produce offset %d: %s\n"
	FailedToFindSchemaIDErrorMsg         = "failed to find schema ID in topic data"
	MissingKeyErrorMsg                   = "missing key in message"
	UnknownValueFormatErrorMsg           = "unknown value schema format"
	TopicExistsErrorMsg                  = "topic \"%s\" already exists for Kafka cluster \"%s\""
	TopicExistsSuggestions               = ListTopicSuggestions
	NoAPISecretStoredOrPassedMsg         = "no API secret for API key \"%s\" of resource \"%s\" passed via flag or stored in local CLI state"
	NoAPISecretStoredOrPassedSuggestions = "Pass the API secret with flag \"--api-secret\" or store with `confluent api-key store %s --resource %s`."
	PassedSecretButNotKeyErrorMsg        = "no API key specified"
	PassedSecretButNotKeySuggestions     = "Use the \"api-key\" flag to specify an API key."
	ProducingToCompactedTopicErrorMsg    = "producer has detected an INVALID_RECORD error for topic %s"
	ProducingToCompactedTopicSuggestions = "If the topic has schema validation enabled, ensure you are producing with a schema-enabled producer.\n" +
		"If your topic is compacted, ensure you are producing a record with a key."

	// Cluster Link commands
	EmptyConfigErrorMsg = "Config file name is empty or config file is empty."

	// serialization/deserialization commands
	JsonSchemaInvalidErrorMsg         = "the JSON schema is invalid"
	JsonDocumentInvalidErrorMsg       = "the JSON document is invalid"
	AvroReferenceNotSupportedErrorMsg = "avro reference not supported in cloud CLI"
	ProtoSchemaInvalidErrorMsg        = "the protobuf schema is invalid"
	ProtoDocumentInvalidErrorMsg      = "the protobuf document is invalid"

	// ksql commands
	KsqlDBNoServiceAccountErrorMsg = "ACLs do not need to be configured for the ksqlDB app, \"%s\", because it was created with user-level access to the Kafka cluster"
	KsqlDBTerminateClusterMsg      = "Failed to terminate ksqlDB app \"%s\" due to \"%s\".\n"

	// local commands
	NoServicesRunningErrorMsg = "no services running"
	TopNotAvailableErrorMsg   = "top command not available on platform: %s"
	InvalidConnectorErrorMsg  = "invalid connector: %s"
	FailedToStartErrorMsg     = "%s failed to start"
	FailedToStopErrorMsg      = "%s failed to stop"
	JavaRequirementErrorMsg   = "the Confluent CLI requires Java version 1.8 or 1.11.\n" +
		"See https://docs.confluent.io/current/installation/versions-interoperability.html\n" +
		"If you have multiple versions of Java installed, you may need to set JAVA_HOME to the version you want Confluent to use."
	NoLogFoundErrorMsg       = "no log found: to run %s, use \"confluent local services %s start\""
	MacVersionErrorMsg       = "macOS version >= %s is required (detected: %s)"
	JavaExecNotFondErrorMsg  = "could not find java executable, please install java or set JAVA_HOME"
	NothingToDestroyErrorMsg = "nothing to destroy"

	// schema-registry commands
	InvalidSchemaRegistryLocationErrorMsg    = "invalid input for flag `--geo`"
	InvalidSchemaRegistryLocationSuggestions = `Geo must be either "us", "eu", or "apac".`
	CompatibilityOrModeErrorMsg              = "must pass either `--compatibility` or `--mode` flag"
	BothSchemaAndSubjectErrorMsg             = "cannot specify both schema ID and subject/version"
	SchemaOrSubjectErrorMsg                  = "must specify either schema ID or subject/version"
	SchemaIntegerErrorMsg                    = "invalid schema ID \"%s\""
	SchemaIntegerSuggestions                 = "Schema ID must be an integer."
	SchemaNotFoundErrorMsg                   = "schema registry subject or version not found"
	SchemaNotFoundSuggestions                = "List available subjects with `confluent schema-registry subject list`.\n" +
		"List available versions with `confluent schema-registry subject describe`"
	NoSubjectLevelConfigErrorMsg = `subject "%s" does not have subject-level compatibility configured`

	// secret commands
	EnterInputTypeErrorMsg    = "enter %s"
	PipeInputTypeErrorMsg     = "pipe %s over stdin"
	SpecifyPassphraseErrorMsg = "specify `--passphrase -` if you intend to pipe your passphrase over stdin"
	PipePassphraseErrorMsg    = "pipe your passphrase over stdin"

	// update command
	UpdateClientFailurePrefix      = "update client failure"
	UpdateClientFailureSuggestions = "Please submit a support ticket.\n" +
		"In the meantime, see link for other ways to download the latest CLI version:\n" +
		"https://docs.confluent.io/current/cli/installing.html"
	ReadingYesFlagErrorMsg              = "error reading `--yes` flag as bool"
	CheckingForUpdateErrorMsg           = "error checking for updates"
	UpdateBinaryErrorMsg                = "error updating CLI binary"
	ObtainingReleaseNotesErrorMsg       = "error obtaining release notes: %s"
	ReleaseNotesVersionCheckErrorMsg    = "unable to perform release notes and binary version check: %s"
	ReleaseNotesVersionMismatchErrorMsg = "binary version (v%s) and latest release notes version (v%s) mismatch"

	// auth package
	NoReaderForCustomCertErrorMsg    = "no reader specified for reading custom certificates"
	ReadCertErrorMsg                 = "failed to read certificate"
	CaCertNotSpecifiedErrorMsg       = "no CA certificate specified"
	SSLCaCertSuggestion              = "Please specify `--ca-location` to enable SSL verification.\n"
	SRCaCertSuggestion               = "Please specify `--ca-location` to enable schema registry client.\n"
	NoCertsAppendedErrorMsg          = "no certs appended, using system certs only"
	WriteToNetrcFileErrorMsg         = "unable to write to netrc file \"%s\""
	NetrcCredentialsNotFoundErrorMsg = "login credentials not found in netrc file \"%s\""
	CreateNetrcFileErrorMsg          = "unable to create netrc file \"%s\""
	FailedToObtainedUserSSOErrorMsg  = "unable to obtain SSO info for user \"%s\""
	NonSSOUserErrorMsg               = "tried to obtain SSO token for non SSO user \"%s\""
	NoCredentialsFoundErrorMsg       = "no credentials found"
	NoURLEnvVarErrorMsg              = "no URL env var"
	InvalidInputFormatErrorMsg       = "\"%s\" is not of valid format for field \"%s\""

	// cmd package
	FindKafkaNoClientErrorMsg = "unable to obtain Kafka cluster information for cluster \"%s\": no client"
	InvalidAPIKeyErrorMsg     = "invalid API key \"%s\" for resource \"%s\""
	InvalidAPIKeySuggestions  = "To list API key that belongs to resource \"%s\", use `confluent api-key list --resource %s`.\n" +
		"To create new API key for resource \"%s\", use `confluent api-key create --resource %s`."
	SRNotEnabledErrorMsg    = "Schema Registry not enabled"
	SRNotEnabledSuggestions = "Schema Registry must be enabled for the environment in order to run the command.\n" +
		"You can enable Schema Registry for this environment with `confluent schema-registry cluster enable`."
	EnvironmentNotFoundErrorMsg = "environment \"%s\" not found in context \"%s\""
	MalformedJWTNoExprErrorMsg  = "malformed JWT claims: no expiration"

	// config package
	CorruptedConfigErrorPrefix = "corrupted CLI config"
	CorruptedConfigSuggestions = "Your CLI config file \"%s\" is corrupted.\n" +
		"Remove config file, and run `confluent login` or `confluent context create`.\n" +
		"Unfortunately, your active CLI state will be lost as a result.\n" +
		"Please file a support ticket with details about your config file to help us address this issue.\n" +
		"Please rerun the command with the verbosity flag `-vvvv` and attach the output with the support ticket."
	UnableToCreateConfigErrorMsg       = "unable to create config"
	UnableToReadConfigErrorMsg         = "unable to read config file \"%s\""
	ConfigNotUpToDateErrorMsg          = "config version v%s not up to date with the latest version v%s"
	InvalidConfigVersionErrorMsg       = "invalid config version v%s"
	ParseConfigErrorMsg                = "unable to parse config file \"%s\""
	NoNameContextErrorMsg              = "one of the existing contexts has no name"
	MissingKafkaClusterContextErrorMsg = "context \"%s\" missing KafkaClusterContext"
	MarshalConfigErrorMsg              = "unable to marshal config"
	CreateConfigDirectoryErrorMsg      = "unable to create config directory: %s"
	CreateConfigFileErrorMsg           = "unable to write config to file: %s"
	CurrentContextNotExistErrorMsg     = "the current context \"%s\" does not exist"
	ContextDoesNotExistErrorMsg        = `context "%s" does not exist`
	ContextAlreadyExistsErrorMsg       = `context "%s" already exists`
	CredentialNotFoundErrorMsg         = "credential \"%s\" not found"
	PlatformNotFoundErrorMsg           = "platform \"%s\" not found"
	NoNameCredentialErrorMsg           = "credential must have a name"
	NoNamePlatformErrorMsg             = "platform must have a name"
	UnspecifiedPlatformErrorMsg        = "context \"%s\" has corrupted platform"
	UnspecifiedCredentialErrorMsg      = "context \"%s\" has corrupted credentials"
	ContextStateMismatchErrorMsg       = "context state mismatch for context \"%s\""
	ContextStateNotMappedErrorMsg      = "context state mapping error for context \"%s\""
	DeleteUserAuthErrorMsg             = "unable to delete user auth"

	// local package
	ConfluentHomeNotFoundErrorMsg         = "could not find %s in CONFLUENT_HOME"
	SetConfluentHomeErrorMsg              = "set environment variable CONFLUENT_HOME"
	KafkaScriptFormatNotSupportedErrorMsg = "format %s is not supported in this version"
	KafkaScriptInvalidFormatErrorMsg      = "invalid format: %s"

	// secret package
	EncryptPlainTextErrorMsg           = "failed to encrypt the plain text"
	DecryptCypherErrorMsg              = "failed to decrypt the cipher"
	DataCorruptedErrorMsg              = "failed to decrypt the cipher: data is corrupted"
	ConfigNotInJAASErrorMsg            = "the configuration \"%s\" not present in JAAS configuration"
	OperationNotSupportedErrorMsg      = "the operation \"%s\" is not supported"
	InvalidJAASConfigErrorMsg          = "invalid JAAS configuration: %s"
	ExpectedConfigNameErrorMsg         = "expected a configuration name but received \"%s\""
	LoginModuleControlFlagErrorMsg     = "login module control flag is not specified"
	ConvertPropertiesToJAASErrorMsg    = "failed to convert the properties to a JAAS configuration"
	ValueNotSpecifiedForKeyErrorMsg    = "value is not specified for the key \"%s\""
	MissSemicolonErrorMsg              = "configuration not terminated with a ';'"
	EmptyPassphraseErrorMsg            = "master key passphrase cannot be empty"
	AlreadyGeneratedErrorMsg           = "master key is already generated"
	AlreadyGeneratedSuggestions        = "You can rotate the key with `confluent secret file rotate`."
	InvalidConfigFilePathErrorMsg      = "invalid config file path \"%s\""
	InvalidSecretFilePathErrorMsg      = "invalid secrets file path \"%s\""
	UnwrapDataKeyErrorMsg              = "failed to unwrap the data key: invalid master key or corrupted data key"
	DecryptConfigErrorMsg              = "failed to decrypt config \"%s\": corrupted data"
	SecretConfigFileMissingKeyErrorMsg = "missing config key \"%s\" in secret config file"
	IncorrectPassphraseErrorMsg        = "authentication failure: incorrect master key passphrase"
	SamePassphraseErrorMsg             = "new master key passphrase may not be the same as the previous passphrase"
	EmptyNewConfigListErrorMsg         = "add failed: empty list of new configs"
	EmptyUpdateConfigListErrorMsg      = "update failed: empty list of update configs"
	ConfigKeyNotEncryptedErrorMsg      = "configuration key \"%s\" is not encrypted"
	FileTypeNotSupportedErrorMsg       = "file type \"%s\" currently not supported"
	ConfigKeyNotInJSONErrorMsg         = "configuration key \"%s\" not present in JSON configuration file"
	MasterKeyNotExportedErrorMsg       = "master key is not exported in `%s` environment variable"
	MasterKeyNotExportedSuggestions    = "Set the environment variable `%s` to the master key and execute this command again."
	ConfigKeyNotPresentErrorMsg        = "configuration key \"%s\" not present in the configuration file"
	InvalidJSONFileFormatErrorMsg      = "invalid json file format"
	InvalidFilePathErrorMsg            = "invalid file path \"%s\""
	UnsupportedFileFormatErrorMsg      = "unsupported file format for file \"%s\""
	InvalidAlgorithmErrorMsg           = "invalid algorithm \"%s\""

	// sso package
	StartHTTPServerErrorMsg            = "unable to start HTTP server"
	AuthServerRunningErrorMsg          = "CLI HTTP auth server encountered error while running: %s\n"
	AuthServerShutdownErrorMsg         = "CLI HTTP auth server encountered error while shutting down: %s\n"
	BrowserAuthTimedOutErrorMsg        = "timed out while waiting for browser authentication to occur"
	BrowserAuthTimedOutSuggestions     = "Try logging in again."
	LoginFailedCallbackURLErrorMsg     = "authentication callback URL either did not contain a state parameter in query string, or the state parameter was invalid; login will fail"
	LoginFailedQueryStringErrorMsg     = "authentication callback URL did not contain code parameter in query string; login will fail"
	PastedInputErrorMsg                = "pasted input had invalid format"
	LoginFailedStateParamErrorMsg      = "authentication code either did not contain a state parameter or the state parameter was invalid; login will fail"
	OpenWebBrowserErrorMsg             = "unable to open web browser for authorization"
	GenerateRandomSSOProviderErrorMsg  = "unable to generate random bytes for SSO provider state"
	GenerateRandomCodeVerifierErrorMsg = "unable to generate random bytes for code verifier"
	ComputeHashErrorMsg                = "unable to compute hash for code challenge"
	FmtMissingOAuthFieldErrorMsg       = `oauth token response body did not contain field "%s"`
	ConstructOAuthRequestErrorMsg      = "failed to construct oauth token request"
	UnmarshalOAuthTokenErrorMsg        = "failed to unmarshal response body in oauth token request"

	// update package
	ParseVersionErrorMsg            = "unable to parse %s version %s"
	TouchLastCheckFileErrorMsg      = "unable to touch last check file"
	GetTempDirErrorMsg              = "unable to get temp dir for %s"
	DownloadVersionErrorMsg         = "unable to download %s version %s to %s"
	MoveFileErrorMsg                = "unable to move %s to %s"
	MoveRestoreErrorMsg             = "unable to move (restore) %s to %s"
	CopyErrorMsg                    = "unable to copy %s to %s"
	ChmodErrorMsg                   = "unable to chmod 0755 %s"
	SepNonEmptyErrorMsg             = "sep must be a non-empty string"
	NoVersionsErrorMsg              = "no versions found"
	GetBinaryVersionsErrorMsg       = "unable to get available binary versions"
	GetReleaseNotesVersionsErrorMsg = "unable to get available release notes versions"
	UnexpectedS3ResponseErrorMsg    = "received unexpected response from S3: %s"
	MissingRequiredParamErrorMsg    = "missing required parameter: %s"
	ListingS3BucketErrorMsg         = "error listing s3 bucket"
	FindingCredsErrorMsg            = "error while finding credentials"
	EmptyAccessKeyIDErrorMsg        = "access key id is empty for %s"
	AWSCredsExpiredErrorMsg         = "AWS credentials in profile %s are expired"
	FindAWSCredsErrorMsg            = "failed to find AWS credentials in profiles: %s"

	// Flag Errors
	FlagRequiredErrorMsg              = "must use at least one of the following flags: %s"
	ProhibitedFlagCombinationErrorMsg = "cannot use `--%s` and `--%s` flags at the same time"
	InvalidFlagValueErrorMsg          = "invalid value \"%s\" for flag `--%s`"
	InvalidFlagValueSuggestions       = "The possible values for flag `%s` are: %s."

	// catcher
	CCloudBackendErrorPrefix           = "Confluent Cloud backend error"
	UnexpectedBackendOutputPrefix      = "unexpected CCloud backend output"
	UnexpectedBackendOutputSuggestions = "Please submit a support ticket."
	BackendUnmarshallingErrorMsg       = "protobuf unmarshalling error"
	ResourceNotFoundErrorMsg           = "resource \"%s\" not found"
	ResourceNotFoundSuggestions        = "Check that the resource \"%s\" exists.\n" +
		"To list Kafka clusters, use `confluent kafka cluster list`.\n" +
		"To check schema-registry cluster info, use `confluent schema-registry cluster describe`.\n" +
		"To list KSQL clusters, use `confluent ksql app list`."
	KafkaNotFoundErrorMsg         = "Kafka cluster \"%s\" not found"
	KafkaNotFoundSuggestions      = "To list Kafka clusters, use `confluent kafka cluster list`."
	KSQLNotFoundSuggestions       = "To list KSQL clusters, use `confluent ksql app list`."
	SRNotFoundSuggestions         = "Check the schema-registry cluster ID with `confluent schema-registry cluster describe`."
	KafkaNotReadyErrorMsg         = "Kafka cluster \"%s\" not ready"
	KafkaNotReadySuggestions      = "It may take up to 5 minutes for a recently created Kafka cluster to be ready."
	NoKafkaSelectedErrorMsg       = "no Kafka cluster selected"
	NoKafkaSelectedSuggestions    = "You must pass `--cluster` flag with the command or set an active kafka in your context with `confluent kafka cluster use`."
	NoKafkaForDescribeSuggestions = "You must provide the cluster ID argument or set an active kafka in your context with `ccloud kafka cluster use`."
	NoAPISecretStoredErrorMsg     = "no API secret for API key \"%s\" of resource \"%s\" stored in local CLI state"
	NoAPISecretStoredSuggestions  = "Store the API secret with `confluent api-key store %s --resource %s`."
	InvalidCkuErrorMsg            = "cku must be greater than 1 for multi-zone dedicated cluster"
	InvalidClusterConfigErrorMsg  = "cluster configuration is invalid"

	// Kafka REST Proxy errors
	InternalServerErrorMsg            = "Internal server error"
	UnknownErrorMsg                   = "Unknown error"
	InternalServerErrorSuggestions    = "Please check the status of your Kafka cluster or submit a support ticket"
	EmptyResponseMsg                  = "Empty server response"
	KafkaRestErrorMsg                 = "Kafka REST request failed: %s %s: %s"
	KafkaRestConnectionMsg            = "Unable to establish Kafka REST connection: %s: %s"
	KafkaRestUnexpectedStatusMsg      = "Kafka REST request failed: %s: Unexpected HTTP Status: %d"
	KafkaRestCertErrorSuggestions     = "To specify a CA certificate, please use the \"ca-cert-path\" flag or set \"CONFLUENT_PLATFORM_CA_CERT_PATH\""
	MDSTokenNotFoundMsg               = "No session token found, please enter user credentials. To avoid being prompted, run \"confluent login\"."
	KafkaRestUrlNotFoundErrorMsg      = "Kafka REST URL not found"
	KafkaRestUrlNotFoundSuggestions   = "Pass \"url\" flag or set CONFLUENT_REST_URL environment variable."
	NoClustersFoundErrorMsg           = "No clusters found"
	NoClustersFoundSuggestions        = "Please check the status of your cluster and the Kafka REST bootstrap.servers configuration"
	NeedClientCertAndKeyPathsErrorMsg = "Must set \"client-cert-path\" and \"client-key-path\" flags together"
	InvalidMDSToken                   = "Invalid MDS token"
	InvalidMDSTokenSuggestions        = "Re-login with \"confluent login\"."

	// Special error handling
	avoidTimeoutSuggestion      = "To avoid session timeouts, you can save credentials to netrc file with `confluent login --save`."
	NotLoggedInErrorMsg         = "not logged in"
	AuthTokenSuggestion         = "You must be logged in to retrieve an oauthbearer token.\n" + "An oauthbearer token is required to authenticate OAUTHBEARER mechanism and schema registry.\n"
	OnPremConfigGuideSuggestion = "See configuration and produce/consume command guide: https://docs.confluent.io/confluent-cli/current/cp-produce-consume.html.\n"
	NotLoggedInSuggestions      = "You must be logged in to run this command.\n" +
		avoidTimeoutSuggestion
	SRNotAuthenticatedErrorMsg     = "not logged in, or no Schema Registry endpoint specified"
	SREndpointNotSpecifiedErrorMsg = "no Schema Registry endpoint specified"
	SRClientNotValidatedErrorMsg   = "failed to validate schema registry client with token."
	SRNotAuthenticatedSuggestions  = "You must specify the endpoint for a Schema Registry cluster (--sr-endpoint) or be logged in using `confluent login` to run this command.\n" +
		avoidTimeoutSuggestion
	CorruptedTokenErrorMsg    = "corrupted auth token"
	CorruptedTokenSuggestions = "Please log in again.\n" +
		avoidTimeoutSuggestion
	ExpiredTokenErrorMsg    = "expired token"
	ExpiredTokenSuggestions = "Your session has timed out, you need to log in again.\n" +
		avoidTimeoutSuggestion
	InvalidEmailErrorMsg    = "user \"%s\" not found"
	InvalidEmailSuggestions = "Check the email credential.\n" +
		"If the email is correct, check that you have successfully verified your email.\n" +
		"If the problem persists, please submit a support ticket.\n" +
		avoidTimeoutSuggestion
	InvalidLoginURLMsg               = "invalid URL value, see structure: http(s)://<domain/hostname/ip>:<port>/.\n"
	InvalidLoginErrorMsg             = "incorrect email or password"
	SuspendedOrganizationSuggestions = "Your organization has been suspended, please contact support if you want to unsuspend it."
	CCloudInvalidLoginSuggestions    = avoidTimeoutSuggestion
	NoAPIKeySelectedErrorMsg         = "no API key selected for resource \"%s\""
	NoAPIKeySelectedSuggestions      = "Select an API key for resource \"%s\" with `confluent api-key use <API_KEY> --resource %s`.\n" +
		"To do so, you must have either already created or stored an API key for the resource.\n" +
		"To create an API key, use `confluent api-key create --resource %s`.\n" +
		"To store an existing API key, use `confluent api-key store --resource %s`."

	// Flag parsing errors
	EnvironmentFlagWithApiLoginErrorMsg = "\"environment\" flag should not be passed for API key context"
	ClusterFlagWithApiLoginErrorMsg     = "\"cluster\" flag should not be passed for API key context, cluster is inferred"

	// Partition command errors
	SpecifyParitionIdWithTopicErrorMsg = "must specify topic along with partition ID"

	// Broker commands
	MustSpecifyAllOrBrokerIDErrorMsg = "must pass broker ID argument or specify `--all` flag"
	OnlySpecifyAllOrBrokerIDErrorMsg = "only specify broker ID argument OR `--all` flag"
	InvalidBrokerTaskTypeErrorMsg    = "invalid broker task type"
	InvalidBrokerTaskTypeSuggestions = "Valid broker task types are `remove-broker` and `add-broker`."

	// Replica commands
	MustEnterValidFlagComboErrorMsg      = "must pass a valid flag combination"
	ValidReplicaFlagsSuggestions         = "Valid flag combinations are: `--broker`, or `--topic` and `--partition`, or all three flags."
	MustSpecifyTopicAndPartitionErrorMsg = "must provide topic and partition flags together"

	// Special error types
	GenericOpenAPIErrorMsg       = "metadata service backend error: %s: %s"
	ParsedGenericOpenAPIErrorMsg = "metadata service backend error: %s"

	// LaunchDarkly errors
	UnsupportedCustomAttributeErrorMsg = `attribute "%s" is not one of the supported LaunchDarkly targeting values`
)
