class ConnectionActionHandler {

    @POST
    @Path(value = "/{actionId}")
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties")
    @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = ConnectorDescriptor.class)),
        description = "A map of zero or more action property suggestions keyed by the property name")
    public Response enrichWithMetadata(
        @PathParam("actionId") @Parameter(required = true, example = "io.syndesis:salesforce-create-or-update:latest") final String actionId,
        final Map<String, Object> props) {

        final Map<String, String> properties = new HashMap<>();

        if (props != null) {
            for (Map.Entry<String, Object> entry : props.entrySet()) {
                if (entry.getValue() == null) {
                    properties.put(entry.getKey(), null);
                } else if (entry.getValue() instanceof String[]) {
                    String value = StringUtils.join((String[]) entry.getValue(), ConfigurationProperty.MULTIPLE_SEPARATOR);
                    properties.put(entry.getKey(), value);
                } else if (entry.getValue() instanceof Iterable) {
                    String value = StringUtils.join((Iterable) entry.getValue(), ConfigurationProperty.MULTIPLE_SEPARATOR);
                    properties.put(entry.getKey(), value);
                } else {
                    properties.put(entry.getKey(), entry.getValue().toString());
                }
            }
        }

        final ConnectorAction action = actions.stream()//
            .filter(a -> a.idEquals(actionId))//
            .findAny()//
            .orElseThrow(() -> new EntityNotFoundException("Action with id: " + actionId));

        final ConnectorDescriptor originalDescriptor = action.getDescriptor();

        ConnectorDescriptor.Builder generatedDescriptorBuilder = new ConnectorDescriptor.Builder().createFrom(originalDescriptor);
        action.getProperties().forEach((k, v) -> {
            if (v.getGenerator() != null && v.getDefaultValue() == null) {
                generatedDescriptorBuilder.replaceConfigurationProperty(k, c -> c.defaultValue(RandomValueGenerator.generate(v.getGenerator())));
            }
        });
        ConnectorDescriptor generatedDescriptor = generatedDescriptorBuilder.build();

        if (!action.getTags().contains("dynamic")) {
            return Response.ok().entity(Meta.verbatim(generatedDescriptor)).build();
        }

        final Map<String, String> parameters = encryptionComponent.decrypt(new HashMap<>(properties));
        // put all action parameters with `null` values
        generatedDescriptor.getPropertyDefinitionSteps()
            .forEach(step -> step.getProperties().forEach((k, v) -> parameters.putIfAbsent(k, null)));

        // add the pattern as a property
        if (action.getPattern() != null) {
            parameters.put(action.getPattern().getDeclaringClass().getSimpleName(), action.getPattern().name());
        }
        // lastly put all connection properties
        parameters.putAll(encryptionComponent.decrypt(connection.getConfiguredProperties()));

        final HystrixExecutable<DynamicActionMetadata> meta = createMetadataCommandAction(action, parameters);
        final DynamicActionMetadata dynamicActionMetadata = meta.execute();

        final ConnectorDescriptor enrichedDescriptor = applyMetadataTo(generatedDescriptor, dynamicActionMetadata);

        @SuppressWarnings("unchecked")
        final HystrixInvokableInfo<ConnectorDescriptor> metaInfo = (HystrixInvokableInfo<ConnectorDescriptor>) meta;

        final Meta<ConnectorDescriptor> metaResult = Meta.from(enrichedDescriptor, metaInfo);

        final Status status = metaResult.getData().getType().map(t -> t.status).orElse(Status.OK);

        return Response.status(status).entity(metaResult).build();
    }

    public  ConnectionActionHandler(final ConnectionBase connection, final MetadataConfigurationProperties config,
                                   final EncryptionComponent encryptionComponent);

}