Hello friends! I’m running into some difficulty de...
# dotnet
Hello friends! I’m running into some difficulty deeply converting
style records to
with the facilities in the SDK, specifically Inputs.GetAmiIdsFilterInputArgs to Inputs.GetAmiIdsFilterArgs from the AWS provider. GetAmiIdsFilterInputArgs essentially is a record that’s deeply transformed by codegen to insert
layer everywhere to make it easier for the users to pass outputs in. In my work I need to “unnest” all these inputs back. I found a different way forward but it’s striking me as not exactly elegant and it will make the implementation diverge from what we have in some other language SDKs. So I’d like to solicit feedback here, perhaps I’m missing something obvious.
https://github.com/pulumi/pulumi/pull/7899 is the context with all the gory detail
That's a lot to take in, so rather than try to understand it all I'll just ask some dumb questions... • is this a problem to be solved at compile time or run time? • if codegen is used to create one type, can't it be used to create the other?
Both compile-time and runtime solutions are acceptable here
Codegen doesn’t seem to be smart enough at the moment to be able to create a function that auto-converts between the two types. So I was hoping that runtime can.
The runtime is, it seems, capable of serializing both types to the same underlying structure.
I’d prefer a runtime solution as not to generate too much converter code.