* Transfer a Dagger enum member name into its implemented value. * An enum value A = "a" will be received as "A" by the entrypoint * but should be transformed into "a" to be sent to the function. * If the enum isn't found in the module, it may be a core enum so we keep the value * as is.
(enumName: string, value: string)
| 85 | * as is. |
| 86 | */ |
| 87 | buildEnum(enumName: string, value: string): any { |
| 88 | const enumObject = this.daggerModule.enums[enumName] |
| 89 | if (!enumObject) { |
| 90 | return value |
| 91 | } |
| 92 | |
| 93 | if (!enumObject.values[value]) { |
| 94 | throw new Error(`Enum ${enumName} does not have member ${value}`) |
| 95 | } |
| 96 | |
| 97 | return enumObject.values[value].value |
| 98 | } |
| 99 | |
| 100 | async getResult( |
| 101 | object: string, |