Before the module, I had written a PHP script which uses a mixture of Magento API endpoints to achieve the desired effect. This includes:
- adding the attributes to the configurable
- pulling the attribute values from the simple SKUs
- setting the simples attribute values as options to the configurable
- setting the simples as associated products to the configurable
This works as expected and since writing the script I have now developed a module to achieve all this in 1 API call as the example I initially shown above.
Currently, the module achieves everything the script did except for setting the simple attribute values as options to the configurable. The only reason I cannot do this is because I cannot figure out how I create an OptionInterface from my $simpleOptions variable for use with the function:
Below is a json_encoded dump of the $simpleOptions variable that is populated by the module during processing. The data matches the structure used in my previous script which used the following API endpoint to set the options.