// Code generated by ogen, DO NOT EDIT.

package api

import (
	"net/http"
	"net/url"
	"strings"

	"github.com/ogen-go/ogen/uri"
)

func (s *Server) cutPrefix(path string) (string, bool) {
	prefix := s.cfg.Prefix
	if prefix == "" {
		return path, true
	}
	if !strings.HasPrefix(path, prefix) {
		// Prefix doesn't match.
		return "", false
	}
	// Cut prefix from the path.
	return strings.TrimPrefix(path, prefix), true
}

// ServeHTTP serves http request as defined by OpenAPI v3 specification,
// calling handler that matches the path or returning not found error.
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	elem := r.URL.Path
	elemIsEscaped := false
	if rawPath := r.URL.RawPath; rawPath != "" {
		if normalized, ok := uri.NormalizeEscapedPath(rawPath); ok {
			elem = normalized
			elemIsEscaped = strings.ContainsRune(elem, '%')
		}
	}

	elem, ok := s.cutPrefix(elem)
	if !ok || len(elem) == 0 {
		s.notFound(w, r)
		return
	}
	args := [1]string{}

	// Static code generated router with unwrapped path search.
	switch {
	default:
		if len(elem) == 0 {
			break
		}
		switch elem[0] {
		case '/': // Prefix: "/"

			if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
				elem = elem[l:]
			} else {
				break
			}

			if len(elem) == 0 {
				break
			}
			switch elem[0] {
			case 'a': // Prefix: "api/v"

				if l := len("api/v"); len(elem) >= l && elem[0:l] == "api/v" {
					elem = elem[l:]
				} else {
					break
				}

				if len(elem) == 0 {
					break
				}
				switch elem[0] {
				case '2': // Prefix: "2/"

					if l := len("2/"); len(elem) >= l && elem[0:l] == "2/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'b': // Prefix: "buffer/"

						if l := len("buffer/"); len(elem) >= l && elem[0:l] == "buffer/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'g': // Prefix: "goods/task"

							if l := len("goods/task"); len(elem) >= l && elem[0:l] == "goods/task" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleAPIV2BufferGoodsTaskGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 't': // Prefix: "tasks"

							if l := len("tasks"); len(elem) >= l && elem[0:l] == "tasks" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleAPIV2BufferTasksGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						}

					case 'h': // Prefix: "history/"

						if l := len("history/"); len(elem) >= l && elem[0:l] == "history/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'g': // Prefix: "goods/task"

							if l := len("goods/task"); len(elem) >= l && elem[0:l] == "goods/task" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleAPIV2HistoryGoodsTaskGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 't': // Prefix: "tasks"

							if l := len("tasks"); len(elem) >= l && elem[0:l] == "tasks" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleAPIV2HistoryTasksGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						}

					case 'l': // Prefix: "list/goods/"

						if l := len("list/goods/"); len(elem) >= l && elem[0:l] == "list/goods/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'f': // Prefix: "filter"

							if l := len("filter"); len(elem) >= l && elem[0:l] == "filter" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleAPIV2ListGoodsFilterGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 's': // Prefix: "size/nm"

							if l := len("size/nm"); len(elem) >= l && elem[0:l] == "size/nm" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleAPIV2ListGoodsSizeNmGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						}

					case 'q': // Prefix: "quarantine/goods"

						if l := len("quarantine/goods"); len(elem) >= l && elem[0:l] == "quarantine/goods" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch r.Method {
							case "GET":
								s.handleAPIV2QuarantineGoodsGetRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "GET")
							}

							return
						}

					case 'u': // Prefix: "upload/task"

						if l := len("upload/task"); len(elem) >= l && elem[0:l] == "upload/task" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							switch r.Method {
							case "POST":
								s.handleAPIV2UploadTaskPostRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "POST")
							}

							return
						}
						switch elem[0] {
						case '/': // Prefix: "/"

							if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								break
							}
							switch elem[0] {
							case 'c': // Prefix: "club-discount"

								if l := len("club-discount"); len(elem) >= l && elem[0:l] == "club-discount" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch r.Method {
									case "POST":
										s.handleAPIV2UploadTaskClubDiscountPostRequest([0]string{}, elemIsEscaped, w, r)
									default:
										s.notAllowed(w, r, "POST")
									}

									return
								}

							case 's': // Prefix: "size"

								if l := len("size"); len(elem) >= l && elem[0:l] == "size" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch r.Method {
									case "POST":
										s.handleAPIV2UploadTaskSizePostRequest([0]string{}, elemIsEscaped, w, r)
									default:
										s.notAllowed(w, r, "POST")
									}

									return
								}

							}

						}

					}

				case '3': // Prefix: "3/"

					if l := len("3/"); len(elem) >= l && elem[0:l] == "3/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'o': // Prefix: "offices"

						if l := len("offices"); len(elem) >= l && elem[0:l] == "offices" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch r.Method {
							case "GET":
								s.handleAPIV3OfficesGetRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "GET")
							}

							return
						}

					case 's': // Prefix: "stocks/"

						if l := len("stocks/"); len(elem) >= l && elem[0:l] == "stocks/" {
							elem = elem[l:]
						} else {
							break
						}

						// Param: "warehouseId"
						// Leaf parameter, slashes are prohibited
						idx := strings.IndexByte(elem, '/')
						if idx >= 0 {
							break
						}
						args[0] = elem
						elem = ""

						if len(elem) == 0 {
							// Leaf node.
							switch r.Method {
							case "DELETE":
								s.handleAPIV3StocksWarehouseIdDeleteRequest([1]string{
									args[0],
								}, elemIsEscaped, w, r)
							case "POST":
								s.handleAPIV3StocksWarehouseIdPostRequest([1]string{
									args[0],
								}, elemIsEscaped, w, r)
							case "PUT":
								s.handleAPIV3StocksWarehouseIdPutRequest([1]string{
									args[0],
								}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "DELETE,POST,PUT")
							}

							return
						}

					case 'w': // Prefix: "warehouses"

						if l := len("warehouses"); len(elem) >= l && elem[0:l] == "warehouses" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							switch r.Method {
							case "GET":
								s.handleAPIV3WarehousesGetRequest([0]string{}, elemIsEscaped, w, r)
							case "POST":
								s.handleAPIV3WarehousesPostRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "GET,POST")
							}

							return
						}
						switch elem[0] {
						case '/': // Prefix: "/"

							if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
								elem = elem[l:]
							} else {
								break
							}

							// Param: "warehouseId"
							// Leaf parameter, slashes are prohibited
							idx := strings.IndexByte(elem, '/')
							if idx >= 0 {
								break
							}
							args[0] = elem
							elem = ""

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "DELETE":
									s.handleAPIV3WarehousesWarehouseIdDeleteRequest([1]string{
										args[0],
									}, elemIsEscaped, w, r)
								case "PUT":
									s.handleAPIV3WarehousesWarehouseIdPutRequest([1]string{
										args[0],
									}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "DELETE,PUT")
								}

								return
							}

						}

					}

				}

			case 'c': // Prefix: "content/v"

				if l := len("content/v"); len(elem) >= l && elem[0:l] == "content/v" {
					elem = elem[l:]
				} else {
					break
				}

				if len(elem) == 0 {
					break
				}
				switch elem[0] {
				case '2': // Prefix: "2/"

					if l := len("2/"); len(elem) >= l && elem[0:l] == "2/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'b': // Prefix: "barcodes"

						if l := len("barcodes"); len(elem) >= l && elem[0:l] == "barcodes" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch r.Method {
							case "POST":
								s.handleContentV2BarcodesPostRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "POST")
							}

							return
						}

					case 'c': // Prefix: "cards/"

						if l := len("cards/"); len(elem) >= l && elem[0:l] == "cards/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'd': // Prefix: "delete/trash"

							if l := len("delete/trash"); len(elem) >= l && elem[0:l] == "delete/trash" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "POST":
									s.handleContentV2CardsDeleteTrashPostRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "POST")
								}

								return
							}

						case 'e': // Prefix: "error/list"

							if l := len("error/list"); len(elem) >= l && elem[0:l] == "error/list" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2CardsErrorListGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 'l': // Prefix: "limits"

							if l := len("limits"); len(elem) >= l && elem[0:l] == "limits" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2CardsLimitsGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 'r': // Prefix: "recover"

							if l := len("recover"); len(elem) >= l && elem[0:l] == "recover" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "POST":
									s.handleContentV2CardsRecoverPostRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "POST")
								}

								return
							}

						case 'u': // Prefix: "up"

							if l := len("up"); len(elem) >= l && elem[0:l] == "up" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								break
							}
							switch elem[0] {
							case 'd': // Prefix: "date"

								if l := len("date"); len(elem) >= l && elem[0:l] == "date" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch r.Method {
									case "POST":
										s.handleContentV2CardsUpdatePostRequest([0]string{}, elemIsEscaped, w, r)
									default:
										s.notAllowed(w, r, "POST")
									}

									return
								}

							case 'l': // Prefix: "load"

								if l := len("load"); len(elem) >= l && elem[0:l] == "load" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									switch r.Method {
									case "POST":
										s.handleContentV2CardsUploadPostRequest([0]string{}, elemIsEscaped, w, r)
									default:
										s.notAllowed(w, r, "POST")
									}

									return
								}
								switch elem[0] {
								case '/': // Prefix: "/add"

									if l := len("/add"); len(elem) >= l && elem[0:l] == "/add" {
										elem = elem[l:]
									} else {
										break
									}

									if len(elem) == 0 {
										// Leaf node.
										switch r.Method {
										case "POST":
											s.handleContentV2CardsUploadAddPostRequest([0]string{}, elemIsEscaped, w, r)
										default:
											s.notAllowed(w, r, "POST")
										}

										return
									}

								}

							}

						}

					case 'd': // Prefix: "directory/"

						if l := len("directory/"); len(elem) >= l && elem[0:l] == "directory/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'c': // Prefix: "co"

							if l := len("co"); len(elem) >= l && elem[0:l] == "co" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								break
							}
							switch elem[0] {
							case 'l': // Prefix: "lors"

								if l := len("lors"); len(elem) >= l && elem[0:l] == "lors" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch r.Method {
									case "GET":
										s.handleContentV2DirectoryColorsGetRequest([0]string{}, elemIsEscaped, w, r)
									default:
										s.notAllowed(w, r, "GET")
									}

									return
								}

							case 'u': // Prefix: "untries"

								if l := len("untries"); len(elem) >= l && elem[0:l] == "untries" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch r.Method {
									case "GET":
										s.handleContentV2DirectoryCountriesGetRequest([0]string{}, elemIsEscaped, w, r)
									default:
										s.notAllowed(w, r, "GET")
									}

									return
								}

							}

						case 'k': // Prefix: "kinds"

							if l := len("kinds"); len(elem) >= l && elem[0:l] == "kinds" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2DirectoryKindsGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 's': // Prefix: "seasons"

							if l := len("seasons"); len(elem) >= l && elem[0:l] == "seasons" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2DirectorySeasonsGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 't': // Prefix: "tnved"

							if l := len("tnved"); len(elem) >= l && elem[0:l] == "tnved" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2DirectoryTnvedGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 'v': // Prefix: "vat"

							if l := len("vat"); len(elem) >= l && elem[0:l] == "vat" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2DirectoryVatGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						}

					case 'g': // Prefix: "get/cards/"

						if l := len("get/cards/"); len(elem) >= l && elem[0:l] == "get/cards/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'l': // Prefix: "list"

							if l := len("list"); len(elem) >= l && elem[0:l] == "list" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "POST":
									s.handleContentV2GetCardsListPostRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "POST")
								}

								return
							}

						case 't': // Prefix: "trash"

							if l := len("trash"); len(elem) >= l && elem[0:l] == "trash" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "POST":
									s.handleContentV2GetCardsTrashPostRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "POST")
								}

								return
							}

						}

					case 'o': // Prefix: "object/"

						if l := len("object/"); len(elem) >= l && elem[0:l] == "object/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'a': // Prefix: "all"

							if l := len("all"); len(elem) >= l && elem[0:l] == "all" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2ObjectAllGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 'c': // Prefix: "charcs/"

							if l := len("charcs/"); len(elem) >= l && elem[0:l] == "charcs/" {
								elem = elem[l:]
							} else {
								break
							}

							// Param: "subjectId"
							// Leaf parameter, slashes are prohibited
							idx := strings.IndexByte(elem, '/')
							if idx >= 0 {
								break
							}
							args[0] = elem
							elem = ""

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2ObjectCharcsSubjectIdGetRequest([1]string{
										args[0],
									}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						case 'p': // Prefix: "parent/all"

							if l := len("parent/all"); len(elem) >= l && elem[0:l] == "parent/all" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2ObjectParentAllGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						}

					case 't': // Prefix: "tag"

						if l := len("tag"); len(elem) >= l && elem[0:l] == "tag" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case '/': // Prefix: "/nomenclature/link"

							if l := len("/nomenclature/link"); len(elem) >= l && elem[0:l] == "/nomenclature/link" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "POST":
									s.handleContentV2TagNomenclatureLinkPostRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "POST")
								}

								return
							}

						case 's': // Prefix: "s"

							if l := len("s"); len(elem) >= l && elem[0:l] == "s" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch r.Method {
								case "GET":
									s.handleContentV2TagsGetRequest([0]string{}, elemIsEscaped, w, r)
								default:
									s.notAllowed(w, r, "GET")
								}

								return
							}

						}

					}

				case '3': // Prefix: "3/media/"

					if l := len("3/media/"); len(elem) >= l && elem[0:l] == "3/media/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'f': // Prefix: "file"

						if l := len("file"); len(elem) >= l && elem[0:l] == "file" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch r.Method {
							case "POST":
								s.handleContentV3MediaFilePostRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "POST")
							}

							return
						}

					case 's': // Prefix: "save"

						if l := len("save"); len(elem) >= l && elem[0:l] == "save" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch r.Method {
							case "POST":
								s.handleContentV3MediaSavePostRequest([0]string{}, elemIsEscaped, w, r)
							default:
								s.notAllowed(w, r, "POST")
							}

							return
						}

					}

				}

			}

		}
	}
	s.notFound(w, r)
}

// Route is route object.
type Route struct {
	name        string
	summary     string
	operationID string
	pathPattern string
	count       int
	args        [1]string
}

// Name returns ogen operation name.
//
// It is guaranteed to be unique and not empty.
func (r Route) Name() string {
	return r.name
}

// Summary returns OpenAPI summary.
func (r Route) Summary() string {
	return r.summary
}

// OperationID returns OpenAPI operationId.
func (r Route) OperationID() string {
	return r.operationID
}

// PathPattern returns OpenAPI path.
func (r Route) PathPattern() string {
	return r.pathPattern
}

// Args returns parsed arguments.
func (r Route) Args() []string {
	return r.args[:r.count]
}

// FindRoute finds Route for given method and path.
//
// Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.
func (s *Server) FindRoute(method, path string) (Route, bool) {
	return s.FindPath(method, &url.URL{Path: path})
}

// FindPath finds Route for given method and URL.
func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
	var (
		elem = u.Path
		args = r.args
	)
	if rawPath := u.RawPath; rawPath != "" {
		if normalized, ok := uri.NormalizeEscapedPath(rawPath); ok {
			elem = normalized
		}
		defer func() {
			for i, arg := range r.args[:r.count] {
				if unescaped, err := url.PathUnescape(arg); err == nil {
					r.args[i] = unescaped
				}
			}
		}()
	}

	elem, ok := s.cutPrefix(elem)
	if !ok {
		return r, false
	}

	// Static code generated router with unwrapped path search.
	switch {
	default:
		if len(elem) == 0 {
			break
		}
		switch elem[0] {
		case '/': // Prefix: "/"

			if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
				elem = elem[l:]
			} else {
				break
			}

			if len(elem) == 0 {
				break
			}
			switch elem[0] {
			case 'a': // Prefix: "api/v"

				if l := len("api/v"); len(elem) >= l && elem[0:l] == "api/v" {
					elem = elem[l:]
				} else {
					break
				}

				if len(elem) == 0 {
					break
				}
				switch elem[0] {
				case '2': // Prefix: "2/"

					if l := len("2/"); len(elem) >= l && elem[0:l] == "2/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'b': // Prefix: "buffer/"

						if l := len("buffer/"); len(elem) >= l && elem[0:l] == "buffer/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'g': // Prefix: "goods/task"

							if l := len("goods/task"); len(elem) >= l && elem[0:l] == "goods/task" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = APIV2BufferGoodsTaskGetOperation
									r.summary = "Детализация необработанной загрузки"
									r.operationID = ""
									r.pathPattern = "/api/v2/buffer/goods/task"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 't': // Prefix: "tasks"

							if l := len("tasks"); len(elem) >= l && elem[0:l] == "tasks" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = APIV2BufferTasksGetOperation
									r.summary = "Состояние необработанной загрузки"
									r.operationID = ""
									r.pathPattern = "/api/v2/buffer/tasks"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					case 'h': // Prefix: "history/"

						if l := len("history/"); len(elem) >= l && elem[0:l] == "history/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'g': // Prefix: "goods/task"

							if l := len("goods/task"); len(elem) >= l && elem[0:l] == "goods/task" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = APIV2HistoryGoodsTaskGetOperation
									r.summary = "Детализация обработанной загрузки"
									r.operationID = ""
									r.pathPattern = "/api/v2/history/goods/task"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 't': // Prefix: "tasks"

							if l := len("tasks"); len(elem) >= l && elem[0:l] == "tasks" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = APIV2HistoryTasksGetOperation
									r.summary = "Состояние обработанной загрузки"
									r.operationID = ""
									r.pathPattern = "/api/v2/history/tasks"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					case 'l': // Prefix: "list/goods/"

						if l := len("list/goods/"); len(elem) >= l && elem[0:l] == "list/goods/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'f': // Prefix: "filter"

							if l := len("filter"); len(elem) >= l && elem[0:l] == "filter" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = APIV2ListGoodsFilterGetOperation
									r.summary = "Получить товары с ценами"
									r.operationID = ""
									r.pathPattern = "/api/v2/list/goods/filter"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 's': // Prefix: "size/nm"

							if l := len("size/nm"); len(elem) >= l && elem[0:l] == "size/nm" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = APIV2ListGoodsSizeNmGetOperation
									r.summary = "Получить размеры товара с ценами"
									r.operationID = ""
									r.pathPattern = "/api/v2/list/goods/size/nm"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					case 'q': // Prefix: "quarantine/goods"

						if l := len("quarantine/goods"); len(elem) >= l && elem[0:l] == "quarantine/goods" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch method {
							case "GET":
								r.name = APIV2QuarantineGoodsGetOperation
								r.summary = "Получить товары в карантине"
								r.operationID = ""
								r.pathPattern = "/api/v2/quarantine/goods"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}

					case 'u': // Prefix: "upload/task"

						if l := len("upload/task"); len(elem) >= l && elem[0:l] == "upload/task" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							switch method {
							case "POST":
								r.name = APIV2UploadTaskPostOperation
								r.summary = "Установить цены и скидки"
								r.operationID = ""
								r.pathPattern = "/api/v2/upload/task"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}
						switch elem[0] {
						case '/': // Prefix: "/"

							if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								break
							}
							switch elem[0] {
							case 'c': // Prefix: "club-discount"

								if l := len("club-discount"); len(elem) >= l && elem[0:l] == "club-discount" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch method {
									case "POST":
										r.name = APIV2UploadTaskClubDiscountPostOperation
										r.summary = "Установить скидки WB Клуба"
										r.operationID = ""
										r.pathPattern = "/api/v2/upload/task/club-discount"
										r.args = args
										r.count = 0
										return r, true
									default:
										return
									}
								}

							case 's': // Prefix: "size"

								if l := len("size"); len(elem) >= l && elem[0:l] == "size" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch method {
									case "POST":
										r.name = APIV2UploadTaskSizePostOperation
										r.summary = "Установить цены для размеров"
										r.operationID = ""
										r.pathPattern = "/api/v2/upload/task/size"
										r.args = args
										r.count = 0
										return r, true
									default:
										return
									}
								}

							}

						}

					}

				case '3': // Prefix: "3/"

					if l := len("3/"); len(elem) >= l && elem[0:l] == "3/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'o': // Prefix: "offices"

						if l := len("offices"); len(elem) >= l && elem[0:l] == "offices" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch method {
							case "GET":
								r.name = APIV3OfficesGetOperation
								r.summary = "Получить список складов WB"
								r.operationID = ""
								r.pathPattern = "/api/v3/offices"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}

					case 's': // Prefix: "stocks/"

						if l := len("stocks/"); len(elem) >= l && elem[0:l] == "stocks/" {
							elem = elem[l:]
						} else {
							break
						}

						// Param: "warehouseId"
						// Leaf parameter, slashes are prohibited
						idx := strings.IndexByte(elem, '/')
						if idx >= 0 {
							break
						}
						args[0] = elem
						elem = ""

						if len(elem) == 0 {
							// Leaf node.
							switch method {
							case "DELETE":
								r.name = APIV3StocksWarehouseIdDeleteOperation
								r.summary = "Удалить остатки товаров"
								r.operationID = ""
								r.pathPattern = "/api/v3/stocks/{warehouseId}"
								r.args = args
								r.count = 1
								return r, true
							case "POST":
								r.name = APIV3StocksWarehouseIdPostOperation
								r.summary = "Получить остатки товаров"
								r.operationID = ""
								r.pathPattern = "/api/v3/stocks/{warehouseId}"
								r.args = args
								r.count = 1
								return r, true
							case "PUT":
								r.name = APIV3StocksWarehouseIdPutOperation
								r.summary = "Обновить остатки товаров"
								r.operationID = ""
								r.pathPattern = "/api/v3/stocks/{warehouseId}"
								r.args = args
								r.count = 1
								return r, true
							default:
								return
							}
						}

					case 'w': // Prefix: "warehouses"

						if l := len("warehouses"); len(elem) >= l && elem[0:l] == "warehouses" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							switch method {
							case "GET":
								r.name = APIV3WarehousesGetOperation
								r.summary = "Получить список складов продавца"
								r.operationID = ""
								r.pathPattern = "/api/v3/warehouses"
								r.args = args
								r.count = 0
								return r, true
							case "POST":
								r.name = APIV3WarehousesPostOperation
								r.summary = "Создать склад продавца"
								r.operationID = ""
								r.pathPattern = "/api/v3/warehouses"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}
						switch elem[0] {
						case '/': // Prefix: "/"

							if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
								elem = elem[l:]
							} else {
								break
							}

							// Param: "warehouseId"
							// Leaf parameter, slashes are prohibited
							idx := strings.IndexByte(elem, '/')
							if idx >= 0 {
								break
							}
							args[0] = elem
							elem = ""

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "DELETE":
									r.name = APIV3WarehousesWarehouseIdDeleteOperation
									r.summary = "Удалить склад продавца"
									r.operationID = ""
									r.pathPattern = "/api/v3/warehouses/{warehouseId}"
									r.args = args
									r.count = 1
									return r, true
								case "PUT":
									r.name = APIV3WarehousesWarehouseIdPutOperation
									r.summary = "Обновить склад продавца"
									r.operationID = ""
									r.pathPattern = "/api/v3/warehouses/{warehouseId}"
									r.args = args
									r.count = 1
									return r, true
								default:
									return
								}
							}

						}

					}

				}

			case 'c': // Prefix: "content/v"

				if l := len("content/v"); len(elem) >= l && elem[0:l] == "content/v" {
					elem = elem[l:]
				} else {
					break
				}

				if len(elem) == 0 {
					break
				}
				switch elem[0] {
				case '2': // Prefix: "2/"

					if l := len("2/"); len(elem) >= l && elem[0:l] == "2/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'b': // Prefix: "barcodes"

						if l := len("barcodes"); len(elem) >= l && elem[0:l] == "barcodes" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch method {
							case "POST":
								r.name = ContentV2BarcodesPostOperation
								r.summary = "Генерация баркодов"
								r.operationID = ""
								r.pathPattern = "/content/v2/barcodes"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}

					case 'c': // Prefix: "cards/"

						if l := len("cards/"); len(elem) >= l && elem[0:l] == "cards/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'd': // Prefix: "delete/trash"

							if l := len("delete/trash"); len(elem) >= l && elem[0:l] == "delete/trash" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "POST":
									r.name = ContentV2CardsDeleteTrashPostOperation
									r.summary = "Перенос карточек товаров в корзину"
									r.operationID = ""
									r.pathPattern = "/content/v2/cards/delete/trash"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 'e': // Prefix: "error/list"

							if l := len("error/list"); len(elem) >= l && elem[0:l] == "error/list" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2CardsErrorListGetOperation
									r.summary = "Список несозданных карточек товаров с ошибками"
									r.operationID = ""
									r.pathPattern = "/content/v2/cards/error/list"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 'l': // Prefix: "limits"

							if l := len("limits"); len(elem) >= l && elem[0:l] == "limits" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2CardsLimitsGetOperation
									r.summary = "Лимиты карточек товаров"
									r.operationID = ""
									r.pathPattern = "/content/v2/cards/limits"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 'r': // Prefix: "recover"

							if l := len("recover"); len(elem) >= l && elem[0:l] == "recover" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "POST":
									r.name = ContentV2CardsRecoverPostOperation
									r.summary = "Восстановление карточек товаров из корзины"
									r.operationID = ""
									r.pathPattern = "/content/v2/cards/recover"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 'u': // Prefix: "up"

							if l := len("up"); len(elem) >= l && elem[0:l] == "up" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								break
							}
							switch elem[0] {
							case 'd': // Prefix: "date"

								if l := len("date"); len(elem) >= l && elem[0:l] == "date" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch method {
									case "POST":
										r.name = ContentV2CardsUpdatePostOperation
										r.summary = "Редактирование карточек товаров"
										r.operationID = ""
										r.pathPattern = "/content/v2/cards/update"
										r.args = args
										r.count = 0
										return r, true
									default:
										return
									}
								}

							case 'l': // Prefix: "load"

								if l := len("load"); len(elem) >= l && elem[0:l] == "load" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									switch method {
									case "POST":
										r.name = ContentV2CardsUploadPostOperation
										r.summary = "Создание карточек товаров"
										r.operationID = ""
										r.pathPattern = "/content/v2/cards/upload"
										r.args = args
										r.count = 0
										return r, true
									default:
										return
									}
								}
								switch elem[0] {
								case '/': // Prefix: "/add"

									if l := len("/add"); len(elem) >= l && elem[0:l] == "/add" {
										elem = elem[l:]
									} else {
										break
									}

									if len(elem) == 0 {
										// Leaf node.
										switch method {
										case "POST":
											r.name = ContentV2CardsUploadAddPostOperation
											r.summary = "Создание карточек товаров с присоединением"
											r.operationID = ""
											r.pathPattern = "/content/v2/cards/upload/add"
											r.args = args
											r.count = 0
											return r, true
										default:
											return
										}
									}

								}

							}

						}

					case 'd': // Prefix: "directory/"

						if l := len("directory/"); len(elem) >= l && elem[0:l] == "directory/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'c': // Prefix: "co"

							if l := len("co"); len(elem) >= l && elem[0:l] == "co" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								break
							}
							switch elem[0] {
							case 'l': // Prefix: "lors"

								if l := len("lors"); len(elem) >= l && elem[0:l] == "lors" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch method {
									case "GET":
										r.name = ContentV2DirectoryColorsGetOperation
										r.summary = "Цвет"
										r.operationID = ""
										r.pathPattern = "/content/v2/directory/colors"
										r.args = args
										r.count = 0
										return r, true
									default:
										return
									}
								}

							case 'u': // Prefix: "untries"

								if l := len("untries"); len(elem) >= l && elem[0:l] == "untries" {
									elem = elem[l:]
								} else {
									break
								}

								if len(elem) == 0 {
									// Leaf node.
									switch method {
									case "GET":
										r.name = ContentV2DirectoryCountriesGetOperation
										r.summary = "Страна производства"
										r.operationID = ""
										r.pathPattern = "/content/v2/directory/countries"
										r.args = args
										r.count = 0
										return r, true
									default:
										return
									}
								}

							}

						case 'k': // Prefix: "kinds"

							if l := len("kinds"); len(elem) >= l && elem[0:l] == "kinds" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2DirectoryKindsGetOperation
									r.summary = "Пол"
									r.operationID = ""
									r.pathPattern = "/content/v2/directory/kinds"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 's': // Prefix: "seasons"

							if l := len("seasons"); len(elem) >= l && elem[0:l] == "seasons" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2DirectorySeasonsGetOperation
									r.summary = "Сезон"
									r.operationID = ""
									r.pathPattern = "/content/v2/directory/seasons"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 't': // Prefix: "tnved"

							if l := len("tnved"); len(elem) >= l && elem[0:l] == "tnved" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2DirectoryTnvedGetOperation
									r.summary = "ТНВЭД-код"
									r.operationID = ""
									r.pathPattern = "/content/v2/directory/tnved"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 'v': // Prefix: "vat"

							if l := len("vat"); len(elem) >= l && elem[0:l] == "vat" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2DirectoryVatGetOperation
									r.summary = "Ставка НДС"
									r.operationID = ""
									r.pathPattern = "/content/v2/directory/vat"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					case 'g': // Prefix: "get/cards/"

						if l := len("get/cards/"); len(elem) >= l && elem[0:l] == "get/cards/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'l': // Prefix: "list"

							if l := len("list"); len(elem) >= l && elem[0:l] == "list" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "POST":
									r.name = ContentV2GetCardsListPostOperation
									r.summary = "Список карточек товаров"
									r.operationID = ""
									r.pathPattern = "/content/v2/get/cards/list"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 't': // Prefix: "trash"

							if l := len("trash"); len(elem) >= l && elem[0:l] == "trash" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "POST":
									r.name = ContentV2GetCardsTrashPostOperation
									r.summary = "Список карточек товаров в корзине"
									r.operationID = ""
									r.pathPattern = "/content/v2/get/cards/trash"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					case 'o': // Prefix: "object/"

						if l := len("object/"); len(elem) >= l && elem[0:l] == "object/" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case 'a': // Prefix: "all"

							if l := len("all"); len(elem) >= l && elem[0:l] == "all" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2ObjectAllGetOperation
									r.summary = "Список предметов"
									r.operationID = ""
									r.pathPattern = "/content/v2/object/all"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 'c': // Prefix: "charcs/"

							if l := len("charcs/"); len(elem) >= l && elem[0:l] == "charcs/" {
								elem = elem[l:]
							} else {
								break
							}

							// Param: "subjectId"
							// Leaf parameter, slashes are prohibited
							idx := strings.IndexByte(elem, '/')
							if idx >= 0 {
								break
							}
							args[0] = elem
							elem = ""

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2ObjectCharcsSubjectIdGetOperation
									r.summary = "Характеристики предмета"
									r.operationID = ""
									r.pathPattern = "/content/v2/object/charcs/{subjectId}"
									r.args = args
									r.count = 1
									return r, true
								default:
									return
								}
							}

						case 'p': // Prefix: "parent/all"

							if l := len("parent/all"); len(elem) >= l && elem[0:l] == "parent/all" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2ObjectParentAllGetOperation
									r.summary = "Родительские категории товаров"
									r.operationID = ""
									r.pathPattern = "/content/v2/object/parent/all"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					case 't': // Prefix: "tag"

						if l := len("tag"); len(elem) >= l && elem[0:l] == "tag" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							break
						}
						switch elem[0] {
						case '/': // Prefix: "/nomenclature/link"

							if l := len("/nomenclature/link"); len(elem) >= l && elem[0:l] == "/nomenclature/link" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "POST":
									r.name = ContentV2TagNomenclatureLinkPostOperation
									r.summary = "Управление ярлыками в карточке товара"
									r.operationID = ""
									r.pathPattern = "/content/v2/tag/nomenclature/link"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						case 's': // Prefix: "s"

							if l := len("s"); len(elem) >= l && elem[0:l] == "s" {
								elem = elem[l:]
							} else {
								break
							}

							if len(elem) == 0 {
								// Leaf node.
								switch method {
								case "GET":
									r.name = ContentV2TagsGetOperation
									r.summary = "Список ярлыков"
									r.operationID = ""
									r.pathPattern = "/content/v2/tags"
									r.args = args
									r.count = 0
									return r, true
								default:
									return
								}
							}

						}

					}

				case '3': // Prefix: "3/media/"

					if l := len("3/media/"); len(elem) >= l && elem[0:l] == "3/media/" {
						elem = elem[l:]
					} else {
						break
					}

					if len(elem) == 0 {
						break
					}
					switch elem[0] {
					case 'f': // Prefix: "file"

						if l := len("file"); len(elem) >= l && elem[0:l] == "file" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch method {
							case "POST":
								r.name = ContentV3MediaFilePostOperation
								r.summary = "Загрузить медиафайл"
								r.operationID = ""
								r.pathPattern = "/content/v3/media/file"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}

					case 's': // Prefix: "save"

						if l := len("save"); len(elem) >= l && elem[0:l] == "save" {
							elem = elem[l:]
						} else {
							break
						}

						if len(elem) == 0 {
							// Leaf node.
							switch method {
							case "POST":
								r.name = ContentV3MediaSavePostOperation
								r.summary = "Загрузить медиафайлы по ссылкам"
								r.operationID = ""
								r.pathPattern = "/content/v3/media/save"
								r.args = args
								r.count = 0
								return r, true
							default:
								return
							}
						}

					}

				}

			}

		}
	}
	return r, false
}
