code: public SearchResult<Target> search(String searchTerm, TargetsSearchOptions options) throws WorkspaceApiException {
          try {
              String types = null;
              List<String> typesArray = null;
              if(options.getTypes() != null){
                  typesArray = new ArrayList<>(10);
                  for(TargetType targetType: options.getTypes()){
                      typesArray.add(targetType.getValue());
                  }
                  types = StringUtil.join(typesArray.toArray(new String[typesArray.size()]),",");
              }
              String excludeGroups = options.getExcludeGroups() !=null? StringUtil.join(options.getExcludeGroups(),","):null;
              String restrictGroups = options.getRestrictGroups() !=null? StringUtil.join(options.getRestrictGroups(),","):null;
              String excludeFromGroups = options.getExcludeFromGroups() !=null? StringUtil.join(options.getExcludeFromGroups(),","): null;
              String restrictToGroups = options.getRestrictToGroups() !=null? StringUtil.join (options.getRestrictToGroups(),","): null;
              TargetsResponse response = this.targetsApi.getTargets(searchTerm,
                      options.getFilterName(),
                      types,
                      excludeGroups,
                      restrictGroups,
                      excludeFromGroups,
                      restrictToGroups,
                      options.isDesc()? "desc": null, 
                      options.getLimit() < 1? null: new BigDecimal(options.getLimit()), 
                      options.isExact()? "exact": null);
  
              TargetsResponseData data = response.getData();
  
              List<Target> targets = new ArrayList<>();
              if (data.getTargets() != null) {
                  for (com.genesys.internal.workspace.model.Target t : data.getTargets()) {
                      Target target = Target.fromTarget(t);
                      targets.add(target);
                  }
              }
              return new SearchResult<>(data.getTotalMatches(), targets);
  
          } catch (ApiException e) {
              throw new WorkspaceApiException("searchTargets failed.", e);
          }
      }
docs: Search for targets by the specified search term.
  @param searchTerm The text to search for in targets.
  @param options Options used to refine the search. (optional)
  @return SearchResult<Target>