// GetParams returns nested param
320337
func (json *JSON) GetParams(name string) (Params, bool) {
	if value := json.fetch(name); value.IsObject() {
		return &JSON{Result: value}, true
	}

	return nil, false
}
1372859
func (c *Context) Param(name string) (v string) {
	return c.param.Get(name)
}
1036261
func (c *DOM) GetAttributesWithParams(v *DOMGetAttributesParams) ([]string, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.getAttributes", Params: v})
	if err != nil {
		return nil, err
	}

	var chromeData struct {
		Result struct {
			Attributes []string
		}
	}

	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}

	return chromeData.Result.Attributes, nil
}
24117
func (k *Key) Params() backend.Params {
	return backend.Params{
		Content:    k.Content,
		Authority:  k.Authority,
		FormatSpec: config.FormatSpec{k.Formatter, k.FormatData},
	}
}
1186071
func (o CoordinateOptions) getParameters() (params map[string]string, err error) {
	// coordinate requires at least a latitude and longitude - others are option
	if !o.Latitude.Valid || !o.Longitude.Valid {
		return nil, errors.New("latitude and longitude are required fields for a coordinate based search")
	}

	ll := fmt.Sprintf("%v,%v", o.Latitude.Float64, o.Longitude.Float64)
	if o.Accuracy.Valid {
		ll += fmt.Sprintf(",%v", o.Accuracy.Float64)
	}
	if o.Altitude.Valid {
		ll += fmt.Sprintf(",%v", o.Altitude.Float64)
	}
	if o.AltitudeAccuracy.Valid {
		ll += fmt.Sprintf(",%v", o.AltitudeAccuracy.Float64)
	}

	return map[string]string{
		"ll": ll,
	}, nil
}
224592
func (csr SummaryPerformanceRequest) GetParams() (params map[string]string) {
	params = make(map[string]string)

	if csr.Resolution != "" {
		params["resolution"] = csr.Resolution
	}

	if csr.IncludeUptime {
		params["includeuptime"] = "true"
	}

	return
}
1020385
func (cmd *CLI) Params() values.Map {
	params := make(values.Map)
	for param, value := range cmd.paramValues {
		params[param.Name] = value
	}
	return params
}
111852
func GetParameter(s string, params interface{}) (interface{}, bool) {
	if params == nil {
		return nil, false
	}

	if paramsValue := reflect.ValueOf(params); paramsValue.Kind() == reflect.Slice {
		if paramsValueSliceLength := paramsValue.Len(); paramsValueSliceLength > 0 {

			if p := strings.SplitN(s, ".", 2); len(p) > 1 {
				index, err := strconv.ParseUint(p[0], 10, 64)

				if err != nil || paramsValueSliceLength <= int(index) {
					return nil, false
				}

				return GetParameter(p[1], params.([]interface{})[index])
			}

			index, err := strconv.ParseUint(s, 10, 64)

			if err != nil || paramsValueSliceLength <= int(index) {
				return nil, false
			}

			return params.([]interface{})[index], true
		}

		return nil, false
	}

	if p := strings.SplitN(s, ".", 2); len(p) > 1 {
		if paramsValue := reflect.ValueOf(params); paramsValue.Kind() == reflect.Map {
			if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
				return GetParameter(p[1], pValue)
			}
		} else {
			return nil, false
		}
	} else {
		if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
			return pValue, true
		}
	}

	return nil, false
}
526920
func (p urlParams) Get(key string) (param string) {

	for i := 0; i < len(p); i++ {
		if p[i].key == key {
			param = p[i].value
			return
		}
	}

	return
}
977207
func (r *request) GetQueryParams() url.Values {
	var result = make(url.Values)
	for key, value := range r.query {
		result[key] = append([]string{}, value...)
	}
	return result
}
424573
func (l *Client) GetEntityParams(entitytype, fieldname, fieldval string, fields []string, params url.Values) (*Entity, error) {
	res := ApiResp{}
	data := Entity{}
	entFields := make(map[string]interface{})
	toAppend := ""
	endpointParams := map[string]string{}

	// handle optional endpointParams
	if entitytype == "" {
		entitytype = "user"
	}

	toAppend = fmt.Sprintf("/%s", ":entitytype")
	endpointParams["entitytype"] = entitytype

	if fieldname != "" {
		toAppend = fmt.Sprintf("%s/%s", toAppend, ":fieldname")
		endpointParams["fieldname"] = fieldname

		if fieldval != "" {
			toAppend = fmt.Sprintf("%s/%s", toAppend, ":fieldval")
			endpointParams["fieldval"] = fieldval
		}
	}
	// build dynamic endpoint
	endpoint := fmt.Sprintf("%s%s", entityEndpoint, toAppend)

	// if there are also fields, add them
	if len(fields) > 0 {
		params.Add("fields", strings.Join(fields, ","))
	}

	// make the request
	entityUrl := parseLyticsURL(endpoint, endpointParams)
	err := l.Get(entityUrl, params, nil, &res, &entFields)
	if err != nil {
		return nil, err
	}
	data.Meta = res.Meta
	data.Fields = entFields
	return &data, nil
}
1345994
func (f *filesystem) Params() (FilesystemParams, bool) {
	if f.doc.Params == nil {
		return FilesystemParams{}, false
	}
	return *f.doc.Params, true
}
195575
func Get(urlStr string, params map[string]interface{}) (*HttpResponse, error) {
	resp, err := DefaultClient.Get(URLWithParams(urlStr, params).String())
	if err == nil {
		return &HttpResponse{*resp}, nil
	} else {
		CloseResponse(resp)
		return nil, err
	}
}
407143
func (o *LocationOptions) getParameters() (params map[string]string, err error) {
	params = make(map[string]string)

	// location is a required field
	if o.Location == "" {
		return params, errors.New("to perform a location based search, the location property must contain an area within to search.  For coordinate based searches, use the CoordinateOption class")
	}
	params["location"] = o.Location

	// if coordinates are specified add those to the parameters hash
	if o.CoordinateOptions != nil &&
		o.CoordinateOptions.Latitude.Valid &&
		o.CoordinateOptions.Longitude.Valid {
		params["cll"] = fmt.Sprintf("%v,%v", o.CoordinateOptions.Latitude.Float64, o.CoordinateOptions.Longitude.Float64)
	}

	return params, nil
}
718259
func (o *GeneralOptions) getParameters() (params map[string]string, err error) {
	ps := make(map[string]string)
	if o.Term != "" {
		ps["term"] = o.Term
	}
	if o.Limit.Valid {
		ps["limit"] = fmt.Sprintf("%v", o.Limit.Int64)
	}
	if o.Offset.Valid {
		ps["offset"] = fmt.Sprintf("%v", o.Offset.Int64)
	}
	if o.Sort.Valid {
		ps["sort"] = fmt.Sprintf("%v", o.Sort.Int64)
	}
	if o.CategoryFilter != "" {
		ps["category_filter"] = o.CategoryFilter
	}
	if o.RadiusFilter.Valid {
		ps["radius_filter"] = fmt.Sprintf("%v", o.RadiusFilter.Float64)
	}
	if o.DealsFilter.Valid {
		ps["deals_filter"] = fmt.Sprintf("%v", o.DealsFilter.Bool)
	}
	return ps, nil
}
750556
func (r *Request) Params(params map[string]string) *Request {
	r.Use(url.Params(params))
	return r
}
1288037
func ParseParams(params *Params, req *Request) {
	params.Query = req.GetQuery()

	// Parse the body depending on the content type.
	switch req.ContentType {
	case "application/x-www-form-urlencoded":
		// Typical form.
		var err error
		if params.Form, err = req.GetForm(); err != nil {
			paramsLogger.Warn("ParseParams: Error parsing request body", "error", err)
		}

	case "multipart/form-data":
		// Multipart form.
		if mp, err := req.GetMultipartForm(); err != nil {
			paramsLogger.Warn("ParseParams: parsing request body:", "error", err)
		} else {
			params.Form = mp.GetValues()
			params.Files = mp.GetFiles()
		}
	case "application/json":
		fallthrough
	case "text/json":
		if body := req.GetBody(); body != nil {
			if content, err := ioutil.ReadAll(body); err == nil {
				// We wont bind it until we determine what we are binding too
				params.JSON = content
			} else {
				paramsLogger.Error("ParseParams: Failed to ready request body bytes", "error", err)
			}
		} else {
			paramsLogger.Info("ParseParams: Json post received with empty body")
		}
	}

	params.Values = params.calcValues()
}