// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation
import Get
import URLQueryEncoder

extension Paths {
    public static var session: Session {
        Session(path: "/api/session")
    }

    public struct Session {
        /// Path: `/api/session`
        public let path: String

        /// Get Me
        public var get: Request<GetResponse> {
            Request(path: path, method: "GET", id: "studio_api_bots_api_get_me")
        }

        /// Response
        public struct GetResponse: Decodable, Equatable {
            public var loggedInSessionResponse: GenAPI.LoggedInSessionResponse?
            public var unauthenticatedSessionResponse: GenAPI.UnauthenticatedSessionResponse?

            public init(loggedInSessionResponse: GenAPI.LoggedInSessionResponse? = nil, unauthenticatedSessionResponse: GenAPI.UnauthenticatedSessionResponse? = nil) {
                self.loggedInSessionResponse = loggedInSessionResponse
                self.unauthenticatedSessionResponse = unauthenticatedSessionResponse
            }

            public init(from decoder: Decoder) throws {
                let container = try decoder.singleValueContainer()
                self.loggedInSessionResponse = try? container.decode(GenAPI.LoggedInSessionResponse.self)
                self.unauthenticatedSessionResponse = try? container.decode(GenAPI.UnauthenticatedSessionResponse.self)
            }
        }
    }
}
