getComponentDescriptorsByTypes method

Future<List<ComponentDescriptor>> getComponentDescriptorsByTypes(
  1. List<ComponentType> componentTypes, {
  2. RuleChainType ruleChainType = RuleChainType.CORE,
  3. RequestConfig? requestConfig,
})

Implementation

Future<List<ComponentDescriptor>> getComponentDescriptorsByTypes(
    List<ComponentType> componentTypes,
    {RuleChainType ruleChainType = RuleChainType.CORE,
    RequestConfig? requestConfig}) async {
  var response = await _tbClient.get<List<dynamic>>('/api/components',
      queryParameters: {
        'componentTypes':
            componentTypes.map((e) => e.toShortString()).join(','),
        'ruleChainType': ruleChainType.toShortString()
      },
      options: defaultHttpOptionsFromConfig(requestConfig));
  return response.data!.map((e) => ComponentDescriptor.fromJson(e)).toList();
}