2022-08-31 06:18:14 +00:00
|
|
|
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
|
|
|
|
package ogent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"strings"
|
|
|
|
|
2022-08-31 07:49:08 +00:00
|
|
|
"github.com/ogen-go/ogen/uri"
|
2022-08-31 06:18:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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
|
2022-08-31 07:49:08 +00:00
|
|
|
if rawPath := r.URL.RawPath; rawPath != "" {
|
|
|
|
if normalized, ok := uri.NormalizeEscapedPath(rawPath); ok {
|
|
|
|
elem = normalized
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if prefix := s.cfg.Prefix; len(prefix) > 0 {
|
|
|
|
if strings.HasPrefix(elem, prefix) {
|
|
|
|
// Cut prefix from the path.
|
|
|
|
elem = strings.TrimPrefix(elem, prefix)
|
|
|
|
} else {
|
|
|
|
// Prefix doesn't match.
|
|
|
|
s.notFound(w, r)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
if len(elem) == 0 {
|
|
|
|
s.notFound(w, r)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
args := [1]string{}
|
2022-08-31 07:49:08 +00:00
|
|
|
|
2022-08-31 06:18:14 +00:00
|
|
|
// Static code generated router with unwrapped path search.
|
2022-08-31 07:49:08 +00:00
|
|
|
switch {
|
|
|
|
default:
|
2022-08-31 06:18:14 +00:00
|
|
|
if len(elem) == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2022-08-31 07:49:08 +00:00
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2022-08-31 07:49:08 +00:00
|
|
|
case 'c': // Prefix: "cards"
|
|
|
|
if l := len("cards"); len(elem) >= l && elem[0:l] == "cards" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2022-08-31 07:49:08 +00:00
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListCardRequest([0]string{}, w, r)
|
|
|
|
case "POST":
|
|
|
|
s.handleCreateCardRequest([0]string{}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET,POST")
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
|
|
|
|
return
|
|
|
|
}
|
2022-08-31 07:49:08 +00:00
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
// Param: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "DELETE":
|
|
|
|
s.handleDeleteCardRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "GET":
|
|
|
|
s.handleReadCardRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "PATCH":
|
|
|
|
s.handleUpdateCardRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "DELETE,GET,PATCH")
|
|
|
|
}
|
|
|
|
|
|
|
|
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 'd': // Prefix: "d"
|
|
|
|
if l := len("d"); len(elem) >= l && elem[0:l] == "d" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "PUT":
|
|
|
|
s.handleDrawDoneRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "PUT")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
case 'o': // Prefix: "owner"
|
|
|
|
if l := len("owner"); len(elem) >= l && elem[0:l] == "owner" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleReadCardOwnerRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'g': // Prefix: "groups"
|
|
|
|
if l := len("groups"); len(elem) >= l && elem[0:l] == "groups" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2022-08-31 07:49:08 +00:00
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListGroupRequest([0]string{}, w, r)
|
|
|
|
case "POST":
|
|
|
|
s.handleCreateGroupRequest([0]string{}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET,POST")
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
|
|
|
|
return
|
|
|
|
}
|
2022-08-31 07:49:08 +00:00
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
// Param: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "DELETE":
|
|
|
|
s.handleDeleteGroupRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "GET":
|
|
|
|
s.handleReadGroupRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "PATCH":
|
|
|
|
s.handleUpdateGroupRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "DELETE,GET,PATCH")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/users"
|
|
|
|
if l := len("/users"); len(elem) >= l && elem[0:l] == "/users" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListGroupUsersRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 06:05:14 +00:00
|
|
|
case 'm': // Prefix: "mas"
|
|
|
|
if l := len("mas"); len(elem) >= l && elem[0:l] == "mas" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2022-08-31 07:49:08 +00:00
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
2023-04-05 06:05:14 +00:00
|
|
|
s.handleListMaRequest([0]string{}, w, r)
|
2022-08-31 07:49:08 +00:00
|
|
|
case "POST":
|
2023-04-05 06:05:14 +00:00
|
|
|
s.handleCreateMaRequest([0]string{}, w, r)
|
2022-08-31 07:49:08 +00:00
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET,POST")
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
|
|
|
|
return
|
|
|
|
}
|
2022-08-31 07:49:08 +00:00
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
// Param: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "DELETE":
|
2023-04-05 06:05:14 +00:00
|
|
|
s.handleDeleteMaRequest([1]string{
|
2022-08-31 07:49:08 +00:00
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "GET":
|
2023-04-05 06:05:14 +00:00
|
|
|
s.handleReadMaRequest([1]string{
|
2022-08-31 07:49:08 +00:00
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "PATCH":
|
2023-04-05 06:05:14 +00:00
|
|
|
s.handleUpdateMaRequest([1]string{
|
2022-08-31 07:49:08 +00:00
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "DELETE,GET,PATCH")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2023-04-05 06:05:14 +00:00
|
|
|
case '/': // Prefix: "/owner"
|
|
|
|
if l := len("/owner"); len(elem) >= l && elem[0:l] == "/owner" {
|
2022-08-31 07:49:08 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2023-04-05 06:05:14 +00:00
|
|
|
// Leaf node.
|
2022-08-31 07:49:08 +00:00
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
2023-04-05 06:05:14 +00:00
|
|
|
s.handleReadMaOwnerRequest([1]string{
|
2022-08-31 07:49:08 +00:00
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
2024-04-10 21:11:26 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 's': // Prefix: "sevs"
|
|
|
|
if l := len("sevs"); len(elem) >= l && elem[0:l] == "sevs" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListSevRequest([0]string{}, w, r)
|
|
|
|
case "POST":
|
|
|
|
s.handleCreateSevRequest([0]string{}, 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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "DELETE":
|
|
|
|
s.handleDeleteSevRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "GET":
|
|
|
|
s.handleReadSevRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "PATCH":
|
|
|
|
s.handleUpdateSevRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "DELETE,GET,PATCH")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/owner"
|
|
|
|
if l := len("/owner"); len(elem) >= l && elem[0:l] == "/owner" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleReadSevOwnerRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
2023-04-05 06:05:14 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'u': // Prefix: "u"
|
|
|
|
if l := len("u"); len(elem) >= l && elem[0:l] == "u" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case 'e': // Prefix: "es"
|
|
|
|
if l := len("es"); len(elem) >= l && elem[0:l] == "es" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListUeRequest([0]string{}, w, r)
|
|
|
|
case "POST":
|
|
|
|
s.handleCreateUeRequest([0]string{}, 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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "DELETE":
|
|
|
|
s.handleDeleteUeRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "GET":
|
|
|
|
s.handleReadUeRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "PATCH":
|
|
|
|
s.handleUpdateUeRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "DELETE,GET,PATCH")
|
|
|
|
}
|
|
|
|
|
2022-08-31 07:49:08 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2023-04-05 06:05:14 +00:00
|
|
|
case '/': // Prefix: "/owner"
|
|
|
|
if l := len("/owner"); len(elem) >= l && elem[0:l] == "/owner" {
|
2022-08-31 07:49:08 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
2023-04-05 06:05:14 +00:00
|
|
|
case "GET":
|
|
|
|
s.handleReadUeOwnerRequest([1]string{
|
2022-08-31 07:49:08 +00:00
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
2023-04-05 06:05:14 +00:00
|
|
|
s.notAllowed(w, r, "GET")
|
2022-08-31 07:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 06:05:14 +00:00
|
|
|
case 's': // Prefix: "sers"
|
|
|
|
if l := len("sers"); len(elem) >= l && elem[0:l] == "sers" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListUserRequest([0]string{}, w, r)
|
|
|
|
case "POST":
|
|
|
|
s.handleCreateUserRequest([0]string{}, 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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "DELETE":
|
|
|
|
s.handleDeleteUserRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "GET":
|
|
|
|
s.handleReadUserRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
case "PATCH":
|
|
|
|
s.handleUpdateUserRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "DELETE,GET,PATCH")
|
|
|
|
}
|
|
|
|
|
|
|
|
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: "card"
|
|
|
|
if l := len("card"); len(elem) >= l && elem[0:l] == "card" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListUserCardRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/start"
|
|
|
|
if l := len("/start"); len(elem) >= l && elem[0:l] == "/start" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "PATCH":
|
|
|
|
s.handleDrawStartRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "PATCH")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'm': // Prefix: "ma"
|
|
|
|
if l := len("ma"); len(elem) >= l && elem[0:l] == "ma" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListUserMaRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
2024-04-10 21:11:26 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
case 's': // Prefix: "sev"
|
|
|
|
if l := len("sev"); len(elem) >= l && elem[0:l] == "sev" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListUserSevRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
2023-04-05 06:05:14 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
case 'u': // Prefix: "ue"
|
|
|
|
if l := len("ue"); len(elem) >= l && elem[0:l] == "ue" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
// Leaf node.
|
|
|
|
switch r.Method {
|
|
|
|
case "GET":
|
|
|
|
s.handleListUserUeRequest([1]string{
|
|
|
|
args[0],
|
|
|
|
}, w, r)
|
|
|
|
default:
|
|
|
|
s.notAllowed(w, r, "GET")
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-31 07:49:08 +00:00
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s.notFound(w, r)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Route is route object.
|
|
|
|
type Route struct {
|
2022-08-31 07:49:08 +00:00
|
|
|
name 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
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OperationID returns OpenAPI operationId.
|
|
|
|
func (r Route) OperationID() string {
|
2022-08-31 07:49:08 +00:00
|
|
|
return r.operationID
|
|
|
|
}
|
|
|
|
|
|
|
|
// PathPattern returns OpenAPI path.
|
|
|
|
func (r Route) PathPattern() string {
|
|
|
|
return r.pathPattern
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Args returns parsed arguments.
|
|
|
|
func (r Route) Args() []string {
|
|
|
|
return r.args[:r.count]
|
|
|
|
}
|
|
|
|
|
|
|
|
// FindRoute finds Route for given method and path.
|
2022-08-31 07:49:08 +00:00
|
|
|
//
|
|
|
|
// 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) {
|
2022-08-31 06:18:14 +00:00
|
|
|
var (
|
2022-08-31 07:49:08 +00:00
|
|
|
elem = u.Path
|
|
|
|
args = r.args
|
2022-08-31 06:18:14 +00:00
|
|
|
)
|
2022-08-31 07:49:08 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Static code generated router with unwrapped path search.
|
2022-08-31 07:49:08 +00:00
|
|
|
switch {
|
|
|
|
default:
|
2022-08-31 06:18:14 +00:00
|
|
|
if len(elem) == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2022-08-31 07:49:08 +00:00
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2022-08-31 07:49:08 +00:00
|
|
|
case 'c': // Prefix: "cards"
|
|
|
|
if l := len("cards"); len(elem) >= l && elem[0:l] == "cards" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2022-08-31 07:49:08 +00:00
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
r.name = "ListCard"
|
|
|
|
r.operationID = "listCard"
|
|
|
|
r.pathPattern = "/cards"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
case "POST":
|
|
|
|
r.name = "CreateCard"
|
|
|
|
r.operationID = "createCard"
|
|
|
|
r.pathPattern = "/cards"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
2022-08-31 07:49:08 +00:00
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
// Param: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "DELETE":
|
|
|
|
r.name = "DeleteCard"
|
|
|
|
r.operationID = "deleteCard"
|
|
|
|
r.pathPattern = "/cards/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "GET":
|
|
|
|
r.name = "ReadCard"
|
|
|
|
r.operationID = "readCard"
|
|
|
|
r.pathPattern = "/cards/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "PATCH":
|
|
|
|
r.name = "UpdateCard"
|
|
|
|
r.operationID = "updateCard"
|
|
|
|
r.pathPattern = "/cards/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
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 'd': // Prefix: "d"
|
|
|
|
if l := len("d"); len(elem) >= l && elem[0:l] == "d" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "PUT":
|
|
|
|
// Leaf: DrawDone
|
|
|
|
r.name = "DrawDone"
|
|
|
|
r.operationID = "drawDone"
|
|
|
|
r.pathPattern = "/cards/{id}/d"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'o': // Prefix: "owner"
|
|
|
|
if l := len("owner"); len(elem) >= l && elem[0:l] == "owner" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
// Leaf: ReadCardOwner
|
|
|
|
r.name = "ReadCardOwner"
|
|
|
|
r.operationID = "readCardOwner"
|
|
|
|
r.pathPattern = "/cards/{id}/owner"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'g': // Prefix: "groups"
|
|
|
|
if l := len("groups"); len(elem) >= l && elem[0:l] == "groups" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2022-08-31 07:49:08 +00:00
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
r.name = "ListGroup"
|
|
|
|
r.operationID = "listGroup"
|
|
|
|
r.pathPattern = "/groups"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
case "POST":
|
|
|
|
r.name = "CreateGroup"
|
|
|
|
r.operationID = "createGroup"
|
|
|
|
r.pathPattern = "/groups"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
2022-08-31 07:49:08 +00:00
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/"
|
|
|
|
if l := len("/"); len(elem) >= l && elem[0:l] == "/" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
// Param: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "DELETE":
|
|
|
|
r.name = "DeleteGroup"
|
|
|
|
r.operationID = "deleteGroup"
|
|
|
|
r.pathPattern = "/groups/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "GET":
|
|
|
|
r.name = "ReadGroup"
|
|
|
|
r.operationID = "readGroup"
|
|
|
|
r.pathPattern = "/groups/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "PATCH":
|
|
|
|
r.name = "UpdateGroup"
|
|
|
|
r.operationID = "updateGroup"
|
|
|
|
r.pathPattern = "/groups/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/users"
|
|
|
|
if l := len("/users"); len(elem) >= l && elem[0:l] == "/users" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
// Leaf: ListGroupUsers
|
|
|
|
r.name = "ListGroupUsers"
|
|
|
|
r.operationID = "listGroupUsers"
|
|
|
|
r.pathPattern = "/groups/{id}/users"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 06:05:14 +00:00
|
|
|
case 'm': // Prefix: "mas"
|
|
|
|
if l := len("mas"); len(elem) >= l && elem[0:l] == "mas" {
|
2022-08-31 06:18:14 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
2022-08-31 07:49:08 +00:00
|
|
|
switch method {
|
|
|
|
case "GET":
|
2023-04-05 06:05:14 +00:00
|
|
|
r.name = "ListMa"
|
|
|
|
r.operationID = "listMa"
|
|
|
|
r.pathPattern = "/mas"
|
2022-08-31 07:49:08 +00:00
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
case "POST":
|
2023-04-05 06:05:14 +00:00
|
|
|
r.name = "CreateMa"
|
|
|
|
r.operationID = "createMa"
|
|
|
|
r.pathPattern = "/mas"
|
2022-08-31 07:49:08 +00:00
|
|
|
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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "DELETE":
|
2023-04-05 06:05:14 +00:00
|
|
|
r.name = "DeleteMa"
|
|
|
|
r.operationID = "deleteMa"
|
|
|
|
r.pathPattern = "/mas/{id}"
|
2022-08-31 07:49:08 +00:00
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "GET":
|
2023-04-05 06:05:14 +00:00
|
|
|
r.name = "ReadMa"
|
|
|
|
r.operationID = "readMa"
|
|
|
|
r.pathPattern = "/mas/{id}"
|
2022-08-31 07:49:08 +00:00
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "PATCH":
|
2023-04-05 06:05:14 +00:00
|
|
|
r.name = "UpdateMa"
|
|
|
|
r.operationID = "updateMa"
|
|
|
|
r.pathPattern = "/mas/{id}"
|
2022-08-31 07:49:08 +00:00
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2023-04-05 06:05:14 +00:00
|
|
|
case '/': // Prefix: "/owner"
|
|
|
|
if l := len("/owner"); len(elem) >= l && elem[0:l] == "/owner" {
|
2022-08-31 07:49:08 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
2023-04-05 06:05:14 +00:00
|
|
|
// Leaf: ReadMaOwner
|
|
|
|
r.name = "ReadMaOwner"
|
|
|
|
r.operationID = "readMaOwner"
|
|
|
|
r.pathPattern = "/mas/{id}/owner"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-04-10 21:11:26 +00:00
|
|
|
case 's': // Prefix: "sevs"
|
|
|
|
if l := len("sevs"); len(elem) >= l && elem[0:l] == "sevs" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
r.name = "ListSev"
|
|
|
|
r.operationID = "listSev"
|
|
|
|
r.pathPattern = "/sevs"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
case "POST":
|
|
|
|
r.name = "CreateSev"
|
|
|
|
r.operationID = "createSev"
|
|
|
|
r.pathPattern = "/sevs"
|
|
|
|
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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "DELETE":
|
|
|
|
r.name = "DeleteSev"
|
|
|
|
r.operationID = "deleteSev"
|
|
|
|
r.pathPattern = "/sevs/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "GET":
|
|
|
|
r.name = "ReadSev"
|
|
|
|
r.operationID = "readSev"
|
|
|
|
r.pathPattern = "/sevs/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "PATCH":
|
|
|
|
r.name = "UpdateSev"
|
|
|
|
r.operationID = "updateSev"
|
|
|
|
r.pathPattern = "/sevs/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/owner"
|
|
|
|
if l := len("/owner"); len(elem) >= l && elem[0:l] == "/owner" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
// Leaf: ReadSevOwner
|
|
|
|
r.name = "ReadSevOwner"
|
|
|
|
r.operationID = "readSevOwner"
|
|
|
|
r.pathPattern = "/sevs/{id}/owner"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 06:05:14 +00:00
|
|
|
case 'u': // Prefix: "u"
|
|
|
|
if l := len("u"); len(elem) >= l && elem[0:l] == "u" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case 'e': // Prefix: "es"
|
|
|
|
if l := len("es"); len(elem) >= l && elem[0:l] == "es" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
r.name = "ListUe"
|
|
|
|
r.operationID = "listUe"
|
|
|
|
r.pathPattern = "/ues"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
case "POST":
|
|
|
|
r.name = "CreateUe"
|
|
|
|
r.operationID = "createUe"
|
|
|
|
r.pathPattern = "/ues"
|
|
|
|
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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "DELETE":
|
|
|
|
r.name = "DeleteUe"
|
|
|
|
r.operationID = "deleteUe"
|
|
|
|
r.pathPattern = "/ues/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "GET":
|
|
|
|
r.name = "ReadUe"
|
|
|
|
r.operationID = "readUe"
|
|
|
|
r.pathPattern = "/ues/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "PATCH":
|
|
|
|
r.name = "UpdateUe"
|
|
|
|
r.operationID = "updateUe"
|
|
|
|
r.pathPattern = "/ues/{id}"
|
2022-08-31 07:49:08 +00:00
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
2023-04-05 06:05:14 +00:00
|
|
|
case '/': // Prefix: "/owner"
|
|
|
|
if l := len("/owner"); len(elem) >= l && elem[0:l] == "/owner" {
|
2022-08-31 07:49:08 +00:00
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
2023-04-05 06:05:14 +00:00
|
|
|
case "GET":
|
|
|
|
// Leaf: ReadUeOwner
|
|
|
|
r.name = "ReadUeOwner"
|
|
|
|
r.operationID = "readUeOwner"
|
|
|
|
r.pathPattern = "/ues/{id}/owner"
|
2022-08-31 07:49:08 +00:00
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 06:05:14 +00:00
|
|
|
case 's': // Prefix: "sers"
|
|
|
|
if l := len("sers"); len(elem) >= l && elem[0:l] == "sers" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
r.name = "ListUser"
|
|
|
|
r.operationID = "listUser"
|
|
|
|
r.pathPattern = "/users"
|
|
|
|
r.args = args
|
|
|
|
r.count = 0
|
|
|
|
return r, true
|
|
|
|
case "POST":
|
|
|
|
r.name = "CreateUser"
|
|
|
|
r.operationID = "createUser"
|
|
|
|
r.pathPattern = "/users"
|
|
|
|
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: "id"
|
|
|
|
// Match until "/"
|
|
|
|
idx := strings.IndexByte(elem, '/')
|
|
|
|
if idx < 0 {
|
|
|
|
idx = len(elem)
|
|
|
|
}
|
|
|
|
args[0] = elem[:idx]
|
|
|
|
elem = elem[idx:]
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "DELETE":
|
|
|
|
r.name = "DeleteUser"
|
|
|
|
r.operationID = "deleteUser"
|
|
|
|
r.pathPattern = "/users/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "GET":
|
|
|
|
r.name = "ReadUser"
|
|
|
|
r.operationID = "readUser"
|
|
|
|
r.pathPattern = "/users/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
case "PATCH":
|
|
|
|
r.name = "UpdateUser"
|
|
|
|
r.operationID = "updateUser"
|
|
|
|
r.pathPattern = "/users/{id}"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
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: "card"
|
|
|
|
if l := len("card"); len(elem) >= l && elem[0:l] == "card" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
r.name = "ListUserCard"
|
|
|
|
r.operationID = "listUserCard"
|
|
|
|
r.pathPattern = "/users/{id}/card"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch elem[0] {
|
|
|
|
case '/': // Prefix: "/start"
|
|
|
|
if l := len("/start"); len(elem) >= l && elem[0:l] == "/start" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "PATCH":
|
|
|
|
// Leaf: DrawStart
|
|
|
|
r.name = "DrawStart"
|
|
|
|
r.operationID = "drawStart"
|
|
|
|
r.pathPattern = "/users/{id}/card/start"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'm': // Prefix: "ma"
|
|
|
|
if l := len("ma"); len(elem) >= l && elem[0:l] == "ma" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
// Leaf: ListUserMa
|
|
|
|
r.name = "ListUserMa"
|
|
|
|
r.operationID = "listUserMa"
|
|
|
|
r.pathPattern = "/users/{id}/ma"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2024-04-10 21:11:26 +00:00
|
|
|
case 's': // Prefix: "sev"
|
|
|
|
if l := len("sev"); len(elem) >= l && elem[0:l] == "sev" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
// Leaf: ListUserSev
|
|
|
|
r.name = "ListUserSev"
|
|
|
|
r.operationID = "listUserSev"
|
|
|
|
r.pathPattern = "/users/{id}/sev"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 06:05:14 +00:00
|
|
|
case 'u': // Prefix: "ue"
|
|
|
|
if l := len("ue"); len(elem) >= l && elem[0:l] == "ue" {
|
|
|
|
elem = elem[l:]
|
|
|
|
} else {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(elem) == 0 {
|
|
|
|
switch method {
|
|
|
|
case "GET":
|
|
|
|
// Leaf: ListUserUe
|
|
|
|
r.name = "ListUserUe"
|
|
|
|
r.operationID = "listUserUe"
|
|
|
|
r.pathPattern = "/users/{id}/ue"
|
|
|
|
r.args = args
|
|
|
|
r.count = 1
|
|
|
|
return r, true
|
|
|
|
default:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-31 06:18:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return r, false
|
|
|
|
}
|