Is there any way to get a name of parent scope of a type?

Suppose that I define an Endpoints.

enum Endpoints {}

Each endpoint contains of a Request and Response.

extension Endpoints {  
enum Auth {

}
}

extension Endpoints.Auth {
  struct Request {}
  struct Response {}
}

In a router I would like to do the following:

switch request {
case let value as? Endpoints.Auth.Request: return Parent(for: value?).Response()
}
Terms of Service

Privacy Policy

Cookie Policy