in aws-amplifyuibuilder-component/src/main/java/software/amazon/amplifyuibuilder/component/Translator.java [219:245]
public static Map<String, ComponentBindingPropertiesValue> translateBindingPropertiesFromCFNToSDK(Map<String, software.amazon.amplifyuibuilder.component.ComponentBindingPropertiesValue> bindingProperties) {
if (bindingProperties == null) {
return null;
}
Map<String, ComponentBindingPropertiesValue> translated = new HashMap<>();
bindingProperties.forEach((k, v) -> {
ComponentBindingPropertiesValue.Builder bindingPropertiesValue = ComponentBindingPropertiesValue.builder();
// ComponentBindingPropertiesValue is flattened to include properties of many types.
// See StudioComponent.bindingProperties type in https://code.amazon.com/packages/AmplifyStudioCommon/blobs/mainline/--/src/types/index.ts
bindingPropertiesValue.type(v.getType());
bindingPropertiesValue.defaultValue(v.getDefaultValue());
software.amazon.amplifyuibuilder.component.ComponentBindingPropertiesValueProperties valueProperties = v.getBindingProperties();
if (valueProperties != null) {
ComponentBindingPropertiesValueProperties.Builder bindingPropertiesValueProperties = ComponentBindingPropertiesValueProperties.builder();
bindingPropertiesValueProperties.bucket(valueProperties.getBucket());
bindingPropertiesValueProperties.field(valueProperties.getField());
bindingPropertiesValueProperties.key(valueProperties.getKey());
bindingPropertiesValueProperties.model(valueProperties.getModel());
bindingPropertiesValueProperties.predicates(translatePredicatesFromCFNToSDK(valueProperties.getPredicates()));
bindingPropertiesValueProperties.userAttribute(valueProperties.getUserAttribute());
bindingPropertiesValue.bindingProperties(bindingPropertiesValueProperties.build());
}
translated.put(k, bindingPropertiesValue.build());
});
return translated;
}