| 457 | } |
| 458 | |
| 459 | func mapControlType(promptType string) (resources.ControlType, error) { |
| 460 | switch promptType { |
| 461 | case PromptTypeText: |
| 462 | return resources.ControlTypeSingleLineText, nil |
| 463 | case PromptTypeMultiText: |
| 464 | return resources.ControlTypeMultiLineText, nil |
| 465 | case PromptTypeCheckbox: |
| 466 | return resources.ControlTypeCheckbox, nil |
| 467 | case PromptTypeDropdown: |
| 468 | return resources.ControlTypeSelect, nil |
| 469 | default: |
| 470 | return "", fmt.Errorf("unknown prompt type '%s', valid values are '%s','%s','%s', '%s'", promptType, PromptTypeText, PromptTypeMultiText, PromptTypeCheckbox, PromptTypeDropdown) |
| 471 | } |
| 472 | } |