code: public Observable<ServiceResponse<SearchResponse>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
          if (query == null) {
              throw new IllegalArgumentException("Parameter query is required and cannot be null.");
          }
          final String acceptLanguage = searchOptionalParameter != null ? searchOptionalParameter.acceptLanguage() : null;
          final String pragma = searchOptionalParameter != null ? searchOptionalParameter.pragma() : null;
          final String userAgent = searchOptionalParameter != null ? searchOptionalParameter.userAgent() : this.client.userAgent();
          final String clientId = searchOptionalParameter != null ? searchOptionalParameter.clientId() : null;
          final String clientIp = searchOptionalParameter != null ? searchOptionalParameter.clientIp() : null;
          final String location = searchOptionalParameter != null ? searchOptionalParameter.location() : null;
          final String countryCode = searchOptionalParameter != null ? searchOptionalParameter.countryCode() : null;
          final String market = searchOptionalParameter != null ? searchOptionalParameter.market() : null;
          final List<AnswerType> responseFilter = searchOptionalParameter != null ? searchOptionalParameter.responseFilter() : null;
          final List<ResponseFormat> responseFormat = searchOptionalParameter != null ? searchOptionalParameter.responseFormat() : null;
          final SafeSearch safeSearch = searchOptionalParameter != null ? searchOptionalParameter.safeSearch() : null;
          final String setLang = searchOptionalParameter != null ? searchOptionalParameter.setLang() : null;
  
          return searchWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, responseFilter, responseFormat, safeSearch, setLang);
      }
docs: The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc.
  
  @param query The user's search term.
  @param searchOptionalParameter the object representing the optional parameters to be set before calling this API
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the observable to the SearchResponse object