// ConvertSelectXcodeVersion ...
func ConvertSelectXcodeVersion(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewSelectXcodeVersionStepID
	inputConversionMap := map[string]string{
		"version_channel_id": "SELECT_XCODE_VERSION_CHANNEL_ID",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertRemoteBashScriptRunner ...
func ConvertRemoteBashScriptRunner(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewRemoteBashScriptRunnerStepID
	inputConversionMap := map[string]string{
		"script_url": "DOWNLOAD_SCRIPT_URL",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// Convertfastlane ...
func Convertfastlane(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewFastlaneStepID
	inputConversionMap := map[string]string{
		"lane":     "fastlane_action",
		"work_dir": "work_dir",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertCocoapodsFlavorBitrise ...
func ConvertCocoapodsFlavorBitrise(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewCocospodsInstallStepID
	inputConversionMap := map[string]string{
		"source_root_path":    "BITRISE_SOURCE_DIR",
		"is_update_cocoapods": "IS_UPDATE_COCOAPODS",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertRubyScriptWithGemfile ...
func ConvertRubyScriptWithGemfile(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewRubyScriptWithGemfileStepID
	inputConversionMap := map[string]string{
		"gemfile_content": "GEMFILE_CONTENT",
		"ruby_content":    "__INPUT_FILE__",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertActivateSSHKeyFlavorBitrise ...
func ConvertActivateSSHKeyFlavorBitrise(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewActivateSSHKeyStepID
	inputConversionMap := map[string]string{
		"ssh_rsa_private_key":        "SSH_RSA_PRIVATE_KEY",
		"ssh_key_save_path":          "SSH_KEY_SAVE_PATH",
		"is_remove_other_identities": "IS_REMOVE_OTHER_IDENTITIES",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertCertificateAndProfileInstaller ...
func ConvertCertificateAndProfileInstaller(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewCertificateAndProfileInstallerStepID
	inputConversionMap := map[string]string{
		"certificate_url":          "certificate_url",
		"certificate_passphrase":   "certificate_passphrase",
		"provisioning_profile_url": "provisioning_profile_url",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertGenericScriptRunner ...
func ConvertGenericScriptRunner(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewScriptStepID
	inputConversionMap := map[string]string{
		"content":          "GENERIC_SCRIPT_RUNNER_CONTENT",
		"runner_bin":       "GENERIC_SCRIPT_RUNNER_BIN",
		"working_dir":      "GENERIC_SCRIPT_RUNNER_WORKING_DIR",
		"script_file_path": "GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertItunesConnectDeployWithShenzhenFlavorBitrise ...
func ConvertItunesConnectDeployWithShenzhenFlavorBitrise(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewItunesConnectDeployWithShenzhenFlavorBitriseStepID
	inputConversionMap := map[string]string{
		"ipa_path":       "STEP_SHENZHEN_DEPLOY_IPA_PATH",
		"itunescon_user": "******",
		"password":       "******",
		"app_id":         "STEP_SHENZHEN_DEPLOY_ITUNESCON_APP_ID",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertAmazonS3Uploader ...
func ConvertAmazonS3Uploader(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewAmazonS3UploaderStepID
	inputConversionMap := map[string]string{
		"access_key_id":     "AWS_ACCESS_KEY_ID",
		"secret_access_key": "AWS_SECRET_ACCESS_KEY",
		"upload_bucket":     "S3_UPLOAD_BUCKET",
		"upload_local_path": "S3_UPLOAD_LOCAL_PATH",
		"acl_control":       "S3_ACL_CONTROL",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertMailgunEmail ...
func ConvertMailgunEmail(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewMailgunEmailStepID
	inputConversionMap := map[string]string{
		"api_key": "MAILGUN_API_KEY",
		"domain":  "MAILGUN_DOMAIN",
		"send_to": "MAILGUN_SEND_TO",
		"subject": "MAILGUN_EMAIL_SUBJECT",
		"message": "MAILGUN_EMAIL_MESSAGE",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertFtpUpload ...
func ConvertFtpUpload(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewFtpUploadStepID
	inputConversionMap := map[string]string{
		"hostname":           "FTP_HOSTNAME",
		"username":           "******",
		"password":           "******",
		"upload_source_path": "FTP_UPLOAD_SOURCE_PATH",
		"upload_target_path": "FTP_UPLOAD_TARGET_PATH",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertItunesConnectDeployWithDeliverFlavorBitrise ...
func ConvertItunesConnectDeployWithDeliverFlavorBitrise(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewItunesConnectDeployWithDeliverFlavorBitriseStepID
	inputConversionMap := map[string]string{
		"ipa_path":        "STEP_DELIVER_DEPLOY_IPA_PATH",
		"itunescon_user":  "******",
		"password":        "******",
		"app_id":          "STEP_DELIVER_DEPLOY_ITUNESCON_APP_ID",
		"submit_for_beta": "STEP_DELIVER_DEPLOY_IS_SUBMIT_FOR_BETA",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertGitCloneFlavorBitriseSSH ...
func ConvertGitCloneFlavorBitriseSSH(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewGitCloneFlavorBitriseStepID
	inputConversionMap := map[string]string{
		"repository_url":       "GIT_REPOSITORY_URL",
		"commit":               "BITRISE_GIT_COMMIT",
		"tag":                  "BITRISE_GIT_TAG",
		"branch":               "BITRISE_GIT_BRANCH",
		"clone_into_dir":       "BITRISE_SOURCE_DIR",
		"auth_ssh_private_key": "AUTH_SSH_PRIVATE_KEY",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertFabricCrashlyticsBetaDeploy ...
func ConvertFabricCrashlyticsBetaDeploy(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewFabricCrashlyticsBetaDeployStepID
	inputConversionMap := map[string]string{
		"api_key":            "STEP_CRASHLYTICS_API_KEY",
		"build_secret":       "STEP_CRASHLYTICS_BUILD_SECRET",
		"ipa_path":           "STEP_CRASHLYTICS_IPA_PATH",
		"email_list":         "STEP_CRASHLYTICS_EMAIL_LIST",
		"group_aliases_list": "STEP_CRASHLYTICS_GROUP_ALIASES_LIST",
		"notification":       "STEP_CRASHLYTICS_NOTIFICATION",
		"release_notes":      "STEP_CRASHLYTICS_RELEASE_NOTES",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertAmazonS3DeployFlavorBitrise ...
func ConvertAmazonS3DeployFlavorBitrise(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewAmazonS3DeployFlavorBitriseStepID
	inputConversionMap := map[string]string{
		"ipa_path":          "BITRISE_IPA_PATH",
		"dsym_path":         "BITRISE_DSYM_PATH",
		"app_slug":          "BITRISE_APP_SLUG",
		"build_slug":        "BITRISE_BUILD_SLUG",
		"aws_access_key":    "S3_DEPLOY_AWS_ACCESS_KEY",
		"aws_secret_key":    "S3_DEPLOY_AWS_SECRET_KEY",
		"bucket_name":       "S3_BUCKET_NAME",
		"path_in_bucket":    "S3_PATH_IN_BUCKET",
		"file_access_level": "S3_FILE_ACCESS_LEVEL",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertTestfairyDeploy ...
func ConvertTestfairyDeploy(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewTestfairyDeployStepID
	inputConversionMap := map[string]string{
		"api_key":           "TESTFAIRY_API_KEY",
		"ipa_path":          "TESTFAIRY_IPA_PATH",
		"dsym_path":         "TESTFAIRY_DSYM_PATH",
		"tester_groups":     "TESTFAIRY_TESTER_GROUPS",
		"notify":            "TESTFAIRY_NOTIFY",
		"auto_update":       "TESTFAIRY_AUTO_UPDATE",
		"max_test_duration": "TESTFAIRY_MAX_TEST_DURATION",
		"video_recording":   "TESTFAIRY_VIDEO_RECORDING",
		"comment":           "TESTFAIRY_COMMENT",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertGitClone ...
func ConvertGitClone(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewGitCloneStepID
	inputConversionMap := map[string]string{
		"repository_url":       "GIT_REPOSITORY_URL",
		"commit":               "BITRISE_GIT_COMMIT",
		"tag":                  "BITRISE_GIT_TAG",
		"branch":               "BITRISE_GIT_BRANCH",
		"pull_request_id":      "BITRISE_PULL_REQUEST",
		"clone_into_dir":       "BITRISE_SOURCE_DIR",
		"auth_user":            "******",
		"auth_password":        "******",
		"auth_ssh_private_key": "AUTH_SSH_PRIVATE_KEY",
		"is_expose_outputs":    "GIT_CLONE_IS_EXPORT_OUTPUTS",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertBashScriptRunner ...
func ConvertBashScriptRunner(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewScriptStepID

	inputConversionMap := map[string]string{}

	_, found, err := utils.GetInputByKey(convertedWorkflowStep.Inputs, "content")
	if err != nil {
		return []bitriseModels.StepListItemModel{}, err
	}
	if found {
		inputConversionMap = map[string]string{
			"content":     "content",
			"working_dir": "BASH_SCRIPT_WORKING_DIR",
		}
	} else {
		inputConversionMap = map[string]string{
			"content":     "__INPUT_FILE__",
			"working_dir": "BASH_SCRIPT_WORKING_DIR",
		}
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}
// ConvertRandomQuote ...
func ConvertRandomQuote(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewRandomQuoteStepID
	inputConversionMap := map[string]string{}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}