// PathParams returns the base path parameters of a.
182969
func (a *APIDefinition) PathParams() *AttributeDefinition {
	names := ExtractWildcards(a.BasePath)
	obj := make(Object)
	for _, n := range names {
		obj[n] = a.Params.Type.ToObject()[n]
	}
	return &AttributeDefinition{Type: obj}
}
807929
func _getResourceParams(r *raml.Resource, params []string) []string {
	if r == nil {
		return params
	}

	matches := reResourceParam.FindAllString(r.URI, -1)
	for _, match := range matches {
		matchEscaped := commons.NormalizeIdentifier(match[1 : len(match)-1])
		params = append(params, matchEscaped)
	}

	return _getResourceParams(r.Parent, params)
}
24522
func (w *WebService) Param(parameter *Parameter) *WebService {
	if w.pathParameters == nil {
		w.pathParameters = []*Parameter{}
	}
	w.pathParameters = append(w.pathParameters, parameter)
	return w
}
839282
func StringParams(params map[string]string) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		q := req.URL.Query()
		for k, v := range params {
			q.Set(k, v)
		}
		req.URL.RawQuery = q.Encode()
		return req, nil
	}
}
457724
func (w *WebService) PathParameter(name, description string) *Parameter {
	return PathParameter(name, description)
}
177296
func Params(req *http.Request) httprouter.Params {
	if value, ok := httpcontext.GetOk(req, paramsKey); ok {
		if params, ok := value.(httprouter.Params); ok {
			return params
		}
	}
	return httprouter.Params{}
}
947200
func (config AudioConfig) params() (map[string]string, error) {
	params, _ := config.BaseFile.params()

	if config.Duration != 0 {
		params["duration"] = strconv.Itoa(config.Duration)
	}

	if config.Performer != "" {
		params["performer"] = config.Performer
	}
	if config.Title != "" {
		params["title"] = config.Title
	}
	if config.Caption != "" {
		params["caption"] = config.Caption
		if config.ParseMode != "" {
			params["parse_mode"] = config.ParseMode
		}
	}

	return params, nil
}
1020385
func (cmd *CLI) Params() values.Map {
	params := make(values.Map)
	for param, value := range cmd.paramValues {
		params[param.Name] = value
	}
	return params
}
635713
func (b *Binding) ExplicitParams() []string {
	var result []string
	if b.Body != nil {
		result = append(result, b.Body.FieldPath.String())
	}
	for _, p := range b.PathParams {
		result = append(result, p.FieldPath.String())
	}
	return result
}
748483
func pathToMap(path string, data map[string]interface{}) map[string]interface{} {
	if path == "." {
		return data
	}
	ap := strings.Split(path, ".")
	if len(ap) == 0 {
		return nil
	}
	n := []map[string]interface{}{}
	// created nested map for each key, adding to slice
	for _, v := range ap {
		nm := make(map[string]interface{})
		nm[v] = make(map[string]interface{})
		n = append(n, nm)
	}
	// find the last key (map) and set our data
	for i, d := range n {
		for k := range d {
			z := i + 1
			if z == len(n) {
				n[i][k] = data
				break
			}
			n[i][k] = n[z]
		}
	}

	return n[0]
}
750556
func (r *Request) Params(params map[string]string) *Request {
	r.Use(url.Params(params))
	return r
}
550284
func (p *Parameter) findParam(idx int) (string, error) {
	index := len(p.names) - 1
	urlPath := p.path
	pathLen := len(p.path)
	node := p.node

	for node != nil {
		if node.text[0] == ':' {
			ctn := lastIndexByte(urlPath, '/')
			if ctn == -1 {
				return "", fmt.Errorf("Parameter not found")
			}
			pathLen = ctn + 1
			if index == idx {
				return urlPath[pathLen:], nil
			}
			index--
		} else {
			pathLen -= len(node.text)
		}
		urlPath = urlPath[0:pathLen]
		node = node.parent
	}
	return "", fmt.Errorf("Parameter not found")
}
1067681
func (file BaseFile) params() (map[string]string, error) {
	params := make(map[string]string)

	if file.ChannelUsername != "" {
		params["chat_id"] = file.ChannelUsername
	} else {
		params["chat_id"] = strconv.FormatInt(file.ChatID, 10)
	}

	if file.ReplyToMessageID != 0 {
		params["reply_to_message_id"] = strconv.Itoa(file.ReplyToMessageID)
	}

	if file.ReplyMarkup != nil {
		data, err := json.Marshal(file.ReplyMarkup)
		if err != nil {
			return params, err
		}

		params["reply_markup"] = string(data)
	}

	if file.MimeType != "" {
		params["mime_type"] = file.MimeType
	}

	if file.FileSize > 0 {
		params["file_size"] = strconv.Itoa(file.FileSize)
	}

	params["disable_notification"] = strconv.FormatBool(file.DisableNotification)

	return params, nil
}
608554
func PathAppend(paths ...[]*Path) []*Path {
	result := make([]*Path, 0, 10)
	for _, ps := range paths {
		result = append(result, ps...)
	}

	return result
}
178068
func DecodeParams(src map[string]string) map[string]string {
	results := make(map[string]string, len(src))
	for key, param := range src {
		encoded, err := url.QueryUnescape(param)
		if err != nil {
			encoded = param
		}
		results[key] = encoded
	}
	return results
}
812934
func (r *Router) PathPrefix(tpl string) *Route {
	return r.NewRoute().PathPrefix(tpl)
}
864346
func FetchParams(r *http.Request) httprouter.Params {
	ctx := r.Context()
	return ctx.Value(params).(httprouter.Params)
}