Get a rule

 @param objectID the rule objectID
 @param request_options contains extra parameters to send with your query
322208
def get_rule(objectID, request_options = {})
      client.get(Protocol.rule_uri(name, objectID), :read, request_options)
    end
805244
function queryOptionsToMongo(query, options) {
    var hash = {},
        fields = fieldsToMongo(query[options.keywords.fields]),
        omitFields = omitFieldsToMongo(query[options.keywords.omit]),
        sort = sortToMongo(query[options.keywords.sort]),
        maxLimit = options.maxLimit || 9007199254740992,
        limit = options.maxLimit || 0

    if (fields) hash.fields = fields
    // omit intentionally overwrites fields if both have been specified in the query
    // mongo does not accept mixed true/fals field specifiers for projections
    if (omitFields) hash.fields = omitFields
    if (sort) hash.sort = sort

    if (query[options.keywords.offset]) hash.skip = Number(query[options.keywords.offset])
    if (query[options.keywords.limit]) limit = Math.min(Number(query[options.keywords.limit]), maxLimit)
    if (limit) {
        hash.limit = limit
    } else if (options.maxLimit) {
        hash.limit = maxLimit
    }

    return hash
}
476757
function getSurveys (defOptions, credentials, token, surveyId, callback) {
  var options;
  
  surveyId = surveyId || '';
  
  if (typeof surveyId === 'function') {
    callback = surveyId;
    surveyId = '';
  }
  
  options = {
    method : 'GET',
    uri : `v1/Surveys/${surveyId}`,
  };
  
  return requestWithTokenCheck(defOptions, credentials, token, options, callback);
}
375677
public <T> T fetchObject(String objectId, Class<T> type) {
		URI uri = URIBuilder.fromUri(getBaseGraphApiUrl() + objectId).build();
		return getRestTemplate().getForObject(uri, type);
	}
403851
public JSONObject getObjects(List<String> objectIDs, List<String> attributesToRetrieve, RequestOptions requestOptions) throws AlgoliaException {
    try {
      JSONArray requests = new JSONArray();
      for (String id : objectIDs) {
        JSONObject request = new JSONObject();
        request.put("indexName", this.indexName);
        request.put("objectID", id);
        request.put("attributesToRetrieve", encodeAttributes(attributesToRetrieve, false));
        requests.put(request);
      }
      JSONObject body = new JSONObject();
      body.put("requests", requests);
      return client.postRequest("/1/indexes/*/objects", body.toString(), false, false, requestOptions);
    } catch (JSONException e) {
      throw new AlgoliaException(e.getMessage());
    } catch (UnsupportedEncodingException e) {
      throw new AlgoliaException(e.getMessage());
    }
  }
424458
private  base_resource[] get_request(nitro_service service,options option) throws Exception  
	{
		StringBuilder responseStr = new StringBuilder();
		HttpURLConnection httpURLConnection = null;
		try
		{
			String urlstr;
			String ipaddress = service.get_ipaddress();
			String version = service.get_version();
			String sessionid = service.get_sessionid();
			String objtype = get_object_type();
			String protocol = service.get_protocol();

			// build URL
			urlstr = protocol + "://" + ipaddress + "/nitro/" + version + "/config/" + objtype;

			String name = this.get_object_name();
			if (name != null && name.length() > 0)
			{
				urlstr = urlstr+"/"+nitro_util.encode(nitro_util.encode(name));
			}

			if (option != null || (service.get_warning()!=null && service.get_warning()) )
			{
				String optionstr=null;
				if (option != null)
				{
					optionstr = option.to_string();
					if (optionstr.length() > 0)
					{
						urlstr = urlstr+"?";
						urlstr = urlstr+optionstr;
					}
				}	
				if (service.get_warning()!=null && service.get_warning())
				{					
					if (option != null && optionstr.length() > 0)
					{
						urlstr = urlstr+"&";
					}
					else
					{
						urlstr = urlstr+"?";
					}
					urlstr = urlstr+"warning=yes";
				}
			}
			
			
			URL url = new URL(urlstr);
			httpURLConnection = (HttpURLConnection) url.openConnection();

			httpURLConnection.setRequestMethod("GET");

			httpURLConnection.setRequestProperty("Cookie", "sessionid=" + nitro_util.encode(sessionid));
			if ((option != null) && (option.get_compression()))
				httpURLConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");

			if (httpURLConnection instanceof HttpsURLConnection)
			{
				if (service.get_certvalidation()) {
					SocketFactory sslSocketFactory = SSLSocketFactory.getDefault();
					HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
					secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);	
					if (!service.get_hostnameverification()) {
						/*
						 * override defualt hostNameverifier's verify method
						 * with EmptyHostnameVerifier's verify method to ignore hostname verification check.
						 */
						secured.setHostnameVerifier(new EmptyHostnameVerifier());
					}
				} else {
					SSLContext sslContext = SSLContext.getInstance("SSL");
					//we are using an empty trust manager, because NetScaler currently presents
					//a test certificate not issued by any signing authority, so we need to bypass
					//the credentials check
					sslContext.init(null, new TrustManager[]{new EmptyTrustManager()}, null);
					SocketFactory sslSocketFactory = sslContext.getSocketFactory();
					
					HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
					secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);
					if (!service.get_hostnameverification()) {
						/*
						 * overriding defualt hostNameverifier's verify method
						 * with EmptyHostnameVerifier's verify method to bypass hostname check.
						 */
						secured.setHostnameVerifier(new EmptyHostnameVerifier());
					}
				}
			}
			
			InputStream input;
			try {
				input = httpURLConnection.getInputStream();
			}
			catch (Exception e) {
				input = httpURLConnection.getErrorStream();	
			}
			String contentEncoding = httpURLConnection.getContentEncoding();
			//	get correct input stream for compressed data:
			if (contentEncoding != null)
			{
				if(contentEncoding.equalsIgnoreCase("gzip"))
					input = new GZIPInputStream(input); //reads 2 bytes to determine GZIP stream!
				else if(contentEncoding.equalsIgnoreCase("deflate"))
					input = new InflaterInputStream(input);
			}

			int numOfTotalBytesRead;
			byte [] buffer = new byte[1024];
			while ((numOfTotalBytesRead = input.read(buffer, 0, buffer.length)) != -1)
			{
				responseStr.append(new String(buffer, 0, numOfTotalBytesRead));
			}

			httpURLConnection.disconnect();
			input.close();
		}
		catch (MalformedURLException mue)
		{
			throw mue;
		}
		catch (IOException ioe)
		{
			throw ioe;
			
		}
		catch(Exception e)
		{
			throw e;
		}
		base_resource[] result = get_nitro_response(service, responseStr.toString());
		return result;
	}
807794
def get_rules(scenario_id, **kwargs):
    
    rules = db.DBSession.query(Rule).filter(Rule.scenario_id==scenario_id, Rule.status=='A').all()

    return rules
24780
def get(path, options={}, format=format)
      respond request(:get, path, options, format)
    end
104457
public   String getDocument(String indexName,   String documentId, Map<String, Object> options) throws ElasticSearchException{
		return getDocument(  indexName,  _doc,     documentId,   options);
	}
701047
function processRequestOptions(req, attrNode, context) {
    if ('id' in req) {
        if (context.attrPath.length > 0) {
            throw new RequestError('ID option only allowed at root (in "' + context.attrPath.join('.') + '")');
        }

        // TODO: Cast req.id to defined type and handle composite primaryKey

        attrNode.many = false;

        context.resourceTree.filter = [
            [
                {
                    attribute: context.resourceTree.primaryKey,
                    operator: 'equal',
                    value: req.id
                }
            ]
        ];
    }

    if ('filter' in req) {
        let requestFilter = req.filter.map(andFilter =>
            andFilter.map(filter => {
                let filteredAttrNode = attrNode;
                const subResourceAttrNodes = [];

                let subContext = Object.assign({}, context);
                filter.attribute.forEach(subAttr => {
                    filteredAttrNode = getAttributeWithAuthCheck([subAttr], filteredAttrNode, subContext);
                    if (filteredAttrNode.dataSources) subResourceAttrNodes.push(filteredAttrNode);
                    subContext.attrPath = subContext.attrPath.concat([subAttr]);
                });

                if (!filteredAttrNode.filter) {
                    throw new RequestError(
                        [
                            'Can not filter by attribute "' + filter.attribute.join('.') + '" ',
                            context.attrPath.length > 0 ? '(in "' + context.attrPath.join('.') + '") ' : ''
                        ].join('')
                    );
                }
                if (filteredAttrNode.filter.indexOf(filter.operator) === -1) {
                    throw new RequestError(
                        [
                            'Can not filter by attribute "' + filter.attribute.join('.') + '" ',
                            context.attrPath.length > 0 ? '(in "' + context.attrPath.join('.') + '") ' : '',
                            'with "' + filter.operator + '" ',
                            '(allowed operators: ' + filteredAttrNode.filter.join(', ') + ')'
                        ].join('')
                    );
                }

                const resolvedFilter = {
                    attribute: filteredAttrNode.map.default,
                    operator: filter.operator,
                    value: filter.value
                };
                let parentFilter = resolvedFilter;

                // resolve filter by sub-resources:
                if (subResourceAttrNodes.length > 0) {
                    let subFilter;
                    if (attrNode.subFilters) {
                        attrNode.subFilters.forEach(_subFilter => {
                            if (filter.attribute.join('.') === _subFilter.attribute.join('.')) {
                                subFilter = _subFilter;
                            }
                        });
                    }

                    if (!subFilter) {
                        throw new RequestError(
                            `Can not filter by sub-resource attribute "${filter.attribute.join('.')}"` +
                                (context.attrPath.length > 0 ? ` (in "${context.attrPath.join('.')}")` : '')
                        );
                    }

                    if (subFilter.filter.indexOf(filter.operator) === -1) {
                        throw new RequestError(
                            `Can not filter by sub-resource attribute "${filter.attribute.join('.')}"` +
                                (context.attrPath.length > 0 ? ` (in "${context.attrPath.join('.')}")` : '') +
                                ` with "${filter.operator}" (allowed operators: ${subFilter.filter.join(', ')})`
                        );
                    }

                    if (subFilter.rewriteTo) {
                        const filterAttrNode = getAttribute(subFilter.rewriteTo, attrNode, context);
                        parentFilter.attribute = filterAttrNode.map.default;
                    } else {
                        let filterContext = context;
                        subResourceAttrNodes.forEach(subResourceAttrNode => {
                            let subFilterTree = {
                                dataSources: subResourceAttrNode.dataSources,
                                attributes: [],
                                filter: null,
                                parentKey: subResourceAttrNode.resolvedParentKey,
                                childKey: subResourceAttrNode.resolvedChildKey
                            };

                            // select childKey from DataSource:
                            subResourceAttrNode.childKey.forEach(childKeyAttrPath => {
                                const childKeyAttrNode = getAttribute(childKeyAttrPath, subResourceAttrNode, context);
                                subFilterTree.attributes.push({
                                    dataSourceMap: childKeyAttrNode.map.default,
                                    attrNode: childKeyAttrNode,
                                    fromDataSource: '#current-primary'
                                });
                            });

                            // modify parent-filter to sub-filter:
                            parentFilter.attribute = subResourceAttrNode.resolvedParentKey;
                            parentFilter.operator = 'equal';
                            delete parentFilter.value;
                            const previousParentFilter = parentFilter;

                            // ... then filter sub-resource by given attribute:
                            parentFilter = {
                                attribute: filteredAttrNode.map.default,
                                operator: filter.operator,
                                value: filter.value
                            };
                            subFilterTree.filter = [[parentFilter]];

                            // handle m:n relations with join-table:
                            if (subResourceAttrNode.joinVia) {
                                const joinViaDataSource = subResourceAttrNode.dataSources[subResourceAttrNode.joinVia];

                                const resolvedJoinParentKey = {};
                                resolvedJoinParentKey[subResourceAttrNode.joinVia] =
                                    joinViaDataSource.resolvedJoinParentKey;
                                const resolvedJoinChildKey = {};
                                resolvedJoinChildKey[subResourceAttrNode.joinVia] =
                                    joinViaDataSource.resolvedJoinChildKey;

                                const joinSubFilterTree = {
                                    dataSources: subResourceAttrNode.dataSources,
                                    primaryName: subResourceAttrNode.joinVia,
                                    attributes: [],
                                    filter: [
                                        [
                                            {
                                                attribute: resolvedJoinChildKey,
                                                operator: 'equal',
                                                valueFromSubFilter: 0
                                            }
                                        ]
                                    ],
                                    parentKey: subFilterTree.parentKey,
                                    childKey: resolvedJoinParentKey
                                };

                                subFilterTree.parentKey = resolvedJoinChildKey;

                                // select joinParentKey from DataSource:
                                joinViaDataSource.joinParentKey.forEach(joinParentKeyAttrPath => {
                                    const joinParentKeyAttrNode = getAttribute(
                                        joinParentKeyAttrPath,
                                        subResourceAttrNode,
                                        context
                                    );
                                    joinSubFilterTree.attributes.push({
                                        dataSourceMap: joinParentKeyAttrNode.map.default,
                                        attrNode: joinParentKeyAttrNode,
                                        fromDataSource: subResourceAttrNode.joinVia
                                    });
                                });

                                // link join-sub-filter in between:
                                joinSubFilterTree.subFilters = [subFilterTree];
                                subFilterTree = joinSubFilterTree;
                            }

                            // link sub-filter to parent:
                            if (!filterContext.resourceTree.subFilters) {
                                filterContext.resourceTree.subFilters = [];
                            }

                            previousParentFilter.valueFromSubFilter = filterContext.resourceTree.subFilters.length;
                            filterContext.resourceTree.subFilters.push(subFilterTree);

                            // switch filter-context:
                            filterContext = Object.assign({}, filterContext);
                            filterContext.resourceTree = subFilterTree;
                        });
                    }
                }

                // TODO: Check type of values

                return resolvedFilter;
            })
        );

        if (context.resourceTree.filter) {
            // generate cross product of OR filters:
            const combinedFilter = [];
            requestFilter.forEach(andFilter => {
                context.resourceTree.filter.forEach(andFilter2 => {
                    combinedFilter.push(cloneDeep(andFilter).concat(cloneDeep(andFilter2)));
                });
            });
            requestFilter = combinedFilter;
        }

        context.resourceTree.filter = requestFilter;
    }

    if ('search' in req) {
        context.resourceTree.search = req.search;
    }

    const order = req.order || attrNode.defaultOrder;
    if (order) {
        context.resourceTree.order = order.map(orderPart => {
            let orderedAttrNode = attrNode;
            let subContext = Object.assign({}, context);
            orderPart.attribute.forEach(subAttr => {
                orderedAttrNode = getAttributeWithAuthCheck([subAttr], orderedAttrNode, subContext);
                if (orderedAttrNode.dataSources) {
                    throw new RequestError(
                        `Can not order by sub-resource attribute "${orderPart.attribute.join('.')}"` +
                            (context.attrPath.length > 0 ? ` (in "${context.attrPath.join('.')}")` : '')
                    );
                }
                subContext.attrPath = subContext.attrPath.concat([subAttr]);
            });

            if (!orderedAttrNode.order) {
                throw new RequestError(
                    [
                        'Attribute "' + orderPart.attribute.join('.') + '" ',
                        context.attrPath.length > 0 ? ' (in "' + context.attrPath.join('.') + '") ' : '',
                        'can not be ordered'
                    ].join('')
                );
            }
            if (orderedAttrNode.order.indexOf(orderPart.direction) === -1) {
                throw new RequestError(
                    [
                        'Attribute "' + orderPart.attribute.join('.') + '" ',
                        context.attrPath.length > 0 ? ' (in "' + context.attrPath.join('.') + '")' : '',
                        'can not be ordered "' +
                            orderPart.direction +
                            '" (allowed: ' +
                            orderedAttrNode.order.join(', ') +
                            ')'
                    ].join('')
                );
            }

            orderPart = Object.assign({}, orderPart);
            orderPart.attribute = orderedAttrNode.map.default;

            return orderPart;
        });
    }

    let limit = null;
    if ('limit' in req) {
        if (!attrNode.many) {
            throw new RequestError(
                'Invalid limit on a single resource' +
                    (context.attrPath.length > 0 ? ` (in "${context.attrPath.join('.')}")` : '')
            );
        }
        limit = req.limit;
    } else if (attrNode.many) {
        limit = attrNode.defaultLimit || attrNode.maxLimit || (context.isMainResource ? 10 : null);
    }
    if (attrNode.maxLimit) {
        if (limit === null || limit > attrNode.maxLimit) {
            throw new RequestError(
                `Invalid limit ${limit !== null ? limit : 'unlimited'}, maxLimit is ${attrNode.maxLimit}` +
                    (context.attrPath.length > 0 ? ` (in "${context.attrPath.join('.')}")` : '')
            );
        }
    }
    if (limit !== null) {
        context.resourceTree.limit = limit;
        if (!context.isMainResource && context.isMany) {
            context.resourceTree.limitPerGroup = true;
        }
    }

    if ('page' in req) {
        if (!('limit' in req)) {
            throw new RequestError(
                'Always specify a fixed limit when requesting page' +
                    (context.attrPath.length > 0 ? ` (in "${context.attrPath.join('.')}")` : '')
            );
        }

        context.resourceTree.page = req.page;
    }
}
804685
public JSONObject searchRules(RuleQuery query, RequestOptions requestOptions) throws AlgoliaException, JSONException {
    JSONObject body = new JSONObject();
    if (query.getQuery() != null) {
      body = body.put("query", query.getQuery());
    }
    if (query.getAnchoring() != null) {
      body = body.put("anchoring", query.getAnchoring());
    }
    if (query.getContext() != null) {
      body = body.put("context", query.getContext());
    }
    if (query.getPage() != null) {
      body = body.put("page", query.getPage());
    }
    if (query.getHitsPerPage() != null) {
      body = body.put("hitsPerPage", query.getHitsPerPage());
    }

    return client.postRequest("/1/indexes/" + encodedIndexName + "/rules/search", body.toString(), false, true, requestOptions);
  }
1294965
def get(cls, issue_id):
        
        res = Issue.get(issue_id, IssueType.get(cls.issue_type).issue_type_id)
        return cls(res) if res else None
592653
public static function get($path, RequestOptions $options = null)
  {
    return self::getResponse(RequestMethodEnum::GET, $path, $options);
  }
916149
public JSONObject getObject(String objectID, List<String> attributesToRetrieve, RequestOptions requestOptions) throws AlgoliaException {
    try {
      String params = encodeAttributes(attributesToRetrieve, true);
      return client.getRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8") + params.toString(), false, requestOptions);
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
695641
function buildSingleFilterQueryObject(paginationFilter) {
  return function(submissionQueryField) {
    var fieldQuery = {
    };

    //formId and _id fields are ObjectIds. They must be valid in order to search for them.
    if (submissionQueryField === 'formId' || submissionQueryField === '_id') {
      if (mongoose.Types.ObjectId.isValid(paginationFilter)) {
        //Cannot use $regex when searching for ObjectIDs
        fieldQuery[submissionQueryField] = new mongoose.Types.ObjectId(paginationFilter);
      } else {
        //not a valid objectId, don't want to search for it.
        return null;
      }
    } else {
      fieldQuery[submissionQueryField] = {$regex: paginationFilter, $options: 'i'};
    }

    return fieldQuery;
  };
}
485654
public JSONObject tableResultGet(String requestId, HashMap<String, String> options) {
        AipRequest request = new AipRequest();
        preOperation(request);
        
        request.addBody("request_id", requestId);
        if (options != null) {
            request.addBody(options);
        }
        request.setUri(OcrConsts.TABLE_RESULT_GET);
        postOperation(request);
        return requestServer(request);
    }
754733
def getMetadata(self, objectId=None, **filters):
        
        if objectId is not None:
            filters["urn"] = objectId

        ti = XmlCtsTextInventoryMetadata.parse(self.endpoint.getCapabilities(**filters))
        if objectId:
            return [x for x in [ti] + ti.descendants if x.id == objectId][0]
        return ti