Get a query rule

@param objectID       the objectID of the query rule to get
@param requestOptions Options to pass to this request
481527
public JSONObject getRule(String objectID, RequestOptions requestOptions) throws AlgoliaException {
    if (objectID == null || objectID.length() == 0) {
      throw new AlgoliaException("Invalid objectID");
    }
    try {
      return client.getRequest("/1/indexes/" + encodedIndexName + "/rules/" + URLEncoder.encode(objectID, "UTF-8"), true, requestOptions);
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
645269
function addOptions(queryOptions, options) {
	const {transaction, logging} = options;
	if (transaction !== undefined) queryOptions.transaction = transaction;
	if (logging !== undefined) queryOptions.logging = logging;
	return queryOptions;
}
775707
function queryRequest(queryOptions) {

    if (!queryOptions) {
        return;
    }

    var options = util._extend({}, queryOptions);

    if (options.query && options.query.length) {
        options.query = '&sq=' + encodeURIComponent(options.query);
    }

    if (options.sort) {
        options.orderBy = '&orderby=column:' + options.sort;
        delete options.sort;
    }

    if (options.descending) {
        options.reverse = '&reverse=true';
        delete options.descending;
    }

    return options;
}
952936
function getRoles (queryOptions) {
  return sendQuery(
    queryOptions,
    queryHelper.addQuery(
      queryHelper.emptyQuery(),
      'getRoles',
      {}
    ),
    (resolve, reject, responseName, response) => {
      if (responseName !== 'ROLES_RESPONSE') {
        const error = JSON.stringify(response.toObject().errorResponse)
        return reject(new Error(`Query response error: expected=ROLES_RESPONSE, actual=${responseName}\nReason: ${error}`))
      }

      const roles = response.getRolesResponse().toObject().rolesList
      resolve(roles)
    }
  )
}
408066
public SearchRequestBuilder getSearchRequestBuilder(
            QueryBuilder queryBuilder,
            AggregationBuilder[] aggregationBuilders, String... indices) {
        return getSearchRequestBuilder(indices, null, queryBuilder,
                aggregationBuilders);
    }
1250780
public Map<String, String> getUriVariablesForQueryWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, QueryParams params) {

        Map<String, String> uriVariables = params.getParameterMap();

        this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);

        return uriVariables;
    }
1135136
public @NotNull OptionalInt findOptionalInt(@NotNull @SQL String sql, Object... args) {
        return findOptionalInt(SqlQuery.query(sql, args));
    }
1253278
public ServiceCall<Collection> getCollection(GetCollectionOptions getCollectionOptions) {
    Validator.notNull(getCollectionOptions, "getCollectionOptions cannot be null");
    String[] pathSegments = { "v1/environments", "collections" };
    String[] pathParameters = { getCollectionOptions.environmentId(), getCollectionOptions.collectionId() };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
        pathParameters));
    builder.query("version", versionDate);
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getCollection");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Collection.class));
  }
325376
public function isQuery($id=false,$filter=null,$filterOptions=array())
		{
			if(!$id)
			{
				return (isset($_SERVER['REQUEST_METHOD']) && strtoupper($_SERVER['REQUEST_METHOD']) == 'GET') ? true : false;
			}
			else
			{
				if(isset($_GET[$id]))
				{
					return $filter ? filter_var($_GET[$id],$filter,$filterOptions) : true;
				}
				else
				{
					return false;
				}
			}
		}
363194
public JSONObject getSettings(RequestOptions requestOptions) throws AlgoliaException {
    return client.getRequest("/1/indexes/" + encodedIndexName + "/settings?getVersion=2", false, requestOptions);
  }
508924
public String query(String paramName, String defaultValue) {
        return this.request.query(paramName, defaultValue);
    }
344483
def delete_object(objectID, request_options = {})
      raise ArgumentError.new('objectID must not be blank') if objectID.nil? || objectID == ''
      client.delete(Protocol.object_uri(name, objectID), :write, request_options)
    end
1136616
@Override
	public <T> Optional<T> queryForObject(String collection, Query query, Class<T> clazz, RequestMethod method) {

		Assert.notNull(collection, "Collection must not be null!");
		Assert.notNull(query, "Query must not be 'null'.");
		Assert.notNull(clazz, "Target class must not be 'null'.");

		query.setPageRequest(PageRequest.of(0, 1));
		QueryResponse response = querySolr(collection, query, clazz, method);

		if (response.getResults().size() > 0) {
			if (response.getResults().size() > 1) {
				LOGGER.warn("More than 1 result found for singe result query ('{}'), returning first entry in list", query);
			}
			return Optional.ofNullable(convertSolrDocumentListToBeans(response.getResults(), clazz).get(0));
		}
		return Optional.empty();
	}
328582
function(filterIndex, options) {
      if (options === undefined) {
        throw new Error('Request filter at index ' + filterIndex + ' returned nothing; it must return the filtered request options');
      } else if (!_.isObject(options)) {
        throw new Error('Expected request filter at index ' + filterIndex + ' to return the request options as an object, got ' + typeof(options));
      }

      return options;
    }
903208
public TransportApiResult<List<Line>> getLines(LineQueryOptions options)
    {
    	if (options == null)
    	{
    		options = LineQueryOptions.defaultQueryOptions();
    	}
    	
    	return TransportApiClientCalls.getLines(tokenComponent, settings, options, null, null, null);
    }
324020
@InterfaceAudience.Private
    public List<QueryRow> query(QueryOptions options) throws CouchbaseLiteException {
        if (options == null)
            options = new QueryOptions();
        if (groupOrReduce(options))
            return viewStore.reducedQuery(options);
        else
            return viewStore.regularQuery(options);
    }
900023
public JSONObject searchRules(RuleQuery query) throws AlgoliaException, JSONException {
    return this.searchRules(query, RequestOptions.empty);
  }