code: public Observable<ServiceResponse<TrendingImages>> trendingWithServiceResponseAsync(TrendingOptionalParameter trendingOptionalParameter) {
          final String acceptLanguage = trendingOptionalParameter != null ? trendingOptionalParameter.acceptLanguage() : null;
          final String userAgent = trendingOptionalParameter != null ? trendingOptionalParameter.userAgent() : this.client.userAgent();
          final String clientId = trendingOptionalParameter != null ? trendingOptionalParameter.clientId() : null;
          final String clientIp = trendingOptionalParameter != null ? trendingOptionalParameter.clientIp() : null;
          final String location = trendingOptionalParameter != null ? trendingOptionalParameter.location() : null;
          final String countryCode = trendingOptionalParameter != null ? trendingOptionalParameter.countryCode() : null;
          final String market = trendingOptionalParameter != null ? trendingOptionalParameter.market() : null;
          final SafeSearch safeSearch = trendingOptionalParameter != null ? trendingOptionalParameter.safeSearch() : null;
          final String setLang = trendingOptionalParameter != null ? trendingOptionalParameter.setLang() : null;
  
          return trendingWithServiceResponseAsync(acceptLanguage, userAgent, clientId, clientIp, location, countryCode, market, safeSearch, setLang);
      }
docs: The Image Trending Search API lets you search on Bing and get back a list of images that are trending based on search requests made by others. The images are broken out into different categories. For example, Popular People Searches. For a list of markets that support trending images, see [Trending Images](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-image-search/trending-images).
  
  @param trendingOptionalParameter 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 TrendingImages object