├── project ├── build.properties └── plugins.sbt ├── README.md ├── .gitignore ├── .scalafmt.conf └── src └── main └── scala ├── part1 ├── Data.scala ├── SimpleApp.scala ├── HttpApp.scala ├── PugService.scala └── MyApi.scala ├── part2 ├── Data.scala ├── Query.scala ├── Api2.scala ├── DBService.scala ├── Api1.scala ├── TestApp.scala ├── Api3.scala └── Api4.scala └── client ├── TrainApp.scala ├── bahn.graphql └── TrainClient.scala /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version = 1.3.9 -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.github.ghostdogpr" % "caliban-codegen-sbt" % "2.3.1") 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # caliban-blog-series 2 | 3 | Sample code going with my [blog series](https://medium.com/@ghostdogpr/graphql-in-scala-with-caliban-part-1-8ceb6099c3c2) about [Caliban](https://github.com/ghostdogpr/caliban). 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .idea/ 3 | # vim 4 | *.sw? 5 | 6 | # Ignore [ce]tags files 7 | tags 8 | 9 | .bloop 10 | .metals 11 | *.class 12 | *.log 13 | 14 | vuepress/node_modules/* 15 | *.lock 16 | vuepress/package-lock.json 17 | -------------------------------------------------------------------------------- /.scalafmt.conf: -------------------------------------------------------------------------------- 1 | version = "2.2.1" 2 | 3 | maxColumn = 120 4 | align = most 5 | continuationIndent.defnSite = 2 6 | assumeStandardLibraryStripMargin = true 7 | docstrings = JavaDoc 8 | lineEndings = preserve 9 | includeCurlyBraceInSelectChains = false 10 | danglingParentheses = true 11 | spaces { 12 | inImportCurlyBraces = true 13 | } 14 | optIn.annotationNewlines = true 15 | 16 | rewrite.rules = [SortImports, RedundantBraces] -------------------------------------------------------------------------------- /src/main/scala/part1/Data.scala: -------------------------------------------------------------------------------- 1 | package part1 2 | 3 | import java.net.URL 4 | 5 | object Data { 6 | sealed trait Color 7 | object Color { 8 | case object FAWN extends Color 9 | case object BLACK extends Color 10 | case object OTHER extends Color 11 | } 12 | case class Pug(name: String, nicknames: List[String], pictureUrl: Option[URL], color: Color) 13 | case class PugNotFound(name: String) extends Throwable 14 | } 15 | -------------------------------------------------------------------------------- /src/main/scala/part2/Data.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | object Data { 4 | type ProductId = Int 5 | type OrderId = Int 6 | type CustomerId = Int 7 | type BrandId = Int 8 | 9 | case class Brand(id: BrandId, name: String) 10 | case class Product(id: ProductId, name: String, description: String, brandId: BrandId) 11 | case class Customer(id: CustomerId, firstName: String, lastName: String) 12 | case class Order(id: OrderId, customerId: CustomerId, products: List[(ProductId, Int)]) 13 | } 14 | -------------------------------------------------------------------------------- /src/main/scala/part1/SimpleApp.scala: -------------------------------------------------------------------------------- 1 | package part1 2 | 3 | import caliban.CalibanError.ValidationError 4 | import zio.interop.catz._ 5 | import zio.{ IO, ZIO } 6 | 7 | object SimpleApp extends CatsApp { 8 | 9 | override def run: IO[ValidationError, Unit] = 10 | for { 11 | interpreter <- MyApi.interpreter 12 | result <- interpreter.execute(""" 13 | |{ 14 | | findPug(name: "toto") { 15 | | name 16 | | pictureUrl 17 | | } 18 | |} 19 | |""".stripMargin) 20 | _ <- ZIO.debug(result.data.toString) 21 | } yield () 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/part2/Query.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | object Query { 4 | val orders: String = """ 5 | |{ 6 | | orders(count: 20) { 7 | | id 8 | | customer { 9 | | id 10 | | firstName 11 | | lastName 12 | | } 13 | | products { 14 | | id 15 | | quantity 16 | | details { 17 | | name 18 | | description 19 | | } 20 | | } 21 | | } 22 | |} 23 | |""".stripMargin 24 | } 25 | -------------------------------------------------------------------------------- /src/main/scala/part1/HttpApp.scala: -------------------------------------------------------------------------------- 1 | package part1 2 | 3 | import caliban.Http4sAdapter 4 | import caliban.interop.tapir.HttpInterpreter 5 | import org.http4s.blaze.server.BlazeServerBuilder 6 | import org.http4s.implicits._ 7 | import org.http4s.server.Router 8 | import org.http4s.server.middleware.CORS 9 | import sttp.tapir.json.circe._ 10 | import zio.interop.catz._ 11 | import zio._ 12 | 13 | object HttpApp extends CatsApp { 14 | 15 | override def run: RIO[Scope, Nothing] = 16 | MyApi.interpreter 17 | .flatMap( 18 | interpreter => 19 | BlazeServerBuilder[Task] 20 | .bindHttp(8088, "localhost") 21 | .withHttpApp( 22 | Router[Task]("/api/graphql" -> CORS.policy(Http4sAdapter.makeHttpService(HttpInterpreter(interpreter)))).orNotFound 23 | ) 24 | .resource 25 | .toScopedZIO 26 | ) *> ZIO.never 27 | } 28 | -------------------------------------------------------------------------------- /src/main/scala/part1/PugService.scala: -------------------------------------------------------------------------------- 1 | package part1 2 | 3 | import java.net.URL 4 | import part1.Data.{ Color, Pug, PugNotFound } 5 | import zio.{ IO, UIO, ZIO } 6 | 7 | trait PugService { 8 | def findPug(name: String): IO[PugNotFound, Pug] // GET request 9 | def randomPugPicture: UIO[String] // GET request 10 | def addPug(pug: Pug): UIO[Unit] // POST request 11 | def editPugPicture(name: String, pictureUrl: URL): IO[PugNotFound, Unit] // PUT request 12 | } 13 | 14 | object PugService { 15 | val dummy: PugService = new PugService { 16 | override def findPug(name: String): IO[PugNotFound, Pug] = 17 | ZIO.succeed( 18 | Pug( 19 | "Patrick", 20 | List("Pat"), 21 | Some(new URL("https://m.media-amazon.com/images/I/81tRAIFb9OL._SS500_.jpg")), 22 | Color.FAWN 23 | ) 24 | ) 25 | override def randomPugPicture: UIO[String] = 26 | ZIO.succeed("https://m.media-amazon.com/images/I/81tRAIFb9OL._SS500_.jpg") 27 | override def addPug(pug: Pug): UIO[Unit] = ZIO.unit 28 | override def editPugPicture(name: String, pictureUrl: URL): IO[PugNotFound, Unit] = ZIO.fail(PugNotFound(name)) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/scala/part2/Api2.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | import part2.Data._ 4 | import zio.UIO 5 | 6 | object Api2 { 7 | 8 | case class QueryArgs(count: Int) 9 | case class Query(orders: QueryArgs => UIO[List[OrderView]]) 10 | 11 | case class OrderView(id: OrderId, customer: UIO[Customer], products: List[ProductOrderView]) 12 | case class ProductOrderView(id: ProductId, details: UIO[ProductDetailsView], quantity: Int) 13 | case class ProductDetailsView(name: String, description: String, brand: UIO[Brand]) 14 | 15 | def resolver(dbService: DBService): Query = { 16 | 17 | def getOrders(count: Int): UIO[List[OrderView]] = 18 | dbService 19 | .getLastOrders(count) 20 | .map(_.map(order => OrderView(order.id, dbService.getCustomer(order.customerId), getProducts(order.products)))) 21 | 22 | def getProducts(products: List[(ProductId, Int)]): List[ProductOrderView] = 23 | products.map { 24 | case (productId, quantity) => 25 | ProductOrderView( 26 | productId, 27 | dbService 28 | .getProduct(productId) 29 | .map(p => ProductDetailsView(p.name, p.description, dbService.getBrand(p.brandId))), 30 | quantity 31 | ) 32 | } 33 | 34 | Query(args => getOrders(args.count)) 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/scala/part2/DBService.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | import part2.Data._ 4 | import zio.{ Ref, UIO } 5 | 6 | class DBService(dbHits: Ref[Int]) { 7 | 8 | def getBrand(id: BrandId): UIO[Brand] = 9 | dbHits.update(_ + 1).as(Brand(id, "some brand")) 10 | 11 | def getBrands(ids: List[BrandId]): UIO[List[Brand]] = 12 | dbHits.update(_ + 1).as(ids.map(id => Brand(id, "some brand"))) 13 | 14 | def getProduct(id: ProductId): UIO[Product] = 15 | dbHits.update(_ + 1).as(Product(id, "some product", "product description", id % 10)) 16 | 17 | def getProducts(ids: List[ProductId]): UIO[List[Product]] = 18 | dbHits.update(_ + 1).as(ids.map(id => Product(id, "some product", "product description", id % 10))) 19 | 20 | def getCustomer(id: CustomerId): UIO[Customer] = 21 | dbHits.update(_ + 1).as(Customer(id, "first name", "last name")) 22 | 23 | def getCustomers(ids: List[CustomerId]): UIO[List[Customer]] = 24 | dbHits.update(_ + 1).as(ids.map(id => Customer(id, "first name", "last name"))) 25 | 26 | def getLastOrders(count: Int): UIO[List[Order]] = 27 | dbHits.update(_ + 1).as((1 to count).toList.map(id => Order(id, id % 3, List((id % 5, 1), (id % 2, 1))))) 28 | 29 | val hits: UIO[Int] = dbHits.get 30 | } 31 | 32 | object DBService { 33 | def apply(): UIO[DBService] = 34 | for { 35 | dbHits <- Ref.make(0) 36 | } yield new DBService(dbHits) 37 | } 38 | -------------------------------------------------------------------------------- /src/main/scala/part1/MyApi.scala: -------------------------------------------------------------------------------- 1 | package part1 2 | 3 | import scala.util.Try 4 | import java.net.URL 5 | import caliban.CalibanError.ExecutionError 6 | import caliban._ 7 | import caliban.schema.ArgBuilder.auto._ 8 | import caliban.schema.Schema.auto._ 9 | import caliban.schema.{ ArgBuilder, Schema } 10 | import part1.Data.{ Pug, PugNotFound } 11 | import zio.{ IO, UIO } 12 | 13 | object MyApi { 14 | 15 | // support for URL 16 | implicit val urlSchema: Schema[Any, URL] = Schema.stringSchema.contramap(_.toString) 17 | implicit val urlArgBuilder: ArgBuilder[URL] = ArgBuilder.string.flatMap( 18 | url => Try(new URL(url)).fold(_ => Left(ExecutionError(s"Invalid URL $url")), Right(_)) 19 | ) 20 | 21 | // API definition 22 | case class FindPugArgs(name: String) 23 | case class AddPugArgs(pug: Pug) 24 | case class EditPugPictureArgs(name: String, pictureUrl: URL) 25 | case class Queries(findPug: FindPugArgs => IO[PugNotFound, Pug], randomPugPicture: UIO[String]) 26 | case class Mutations(addPug: AddPugArgs => UIO[Unit], editPugPicture: EditPugPictureArgs => IO[PugNotFound, Unit]) 27 | 28 | // resolvers 29 | val queries = Queries(args => PugService.dummy.findPug(args.name), PugService.dummy.randomPugPicture) 30 | val mutations = 31 | Mutations( 32 | args => PugService.dummy.addPug(args.pug), 33 | args => PugService.dummy.editPugPicture(args.name, args.pictureUrl) 34 | ) 35 | 36 | // interpreter 37 | val interpreter = graphQL(RootResolver(queries, mutations)).interpreter 38 | } 39 | -------------------------------------------------------------------------------- /src/main/scala/client/TrainApp.scala: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import client.TrainClient._ 4 | import sttp.capabilities.WebSockets 5 | import sttp.capabilities.zio.ZioStreams 6 | import sttp.client3._ 7 | import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend 8 | import zio._ 9 | 10 | object TrainApp extends ZIOAppDefault { 11 | 12 | case class Train(`type`: String, platform: String, trainNumber: String, time: String, stops: List[String]) 13 | 14 | def run: Task[List[(String, Boolean, (List[Train], List[Train]))]] = { 15 | 16 | val trainInStation = 17 | (TrainInStation.`type` ~ 18 | TrainInStation.platform ~ 19 | TrainInStation.trainNumber ~ 20 | TrainInStation.time ~ 21 | TrainInStation.stops).mapN(Train) 22 | 23 | val query = 24 | Query.search(Some("Berlin Ostbahnhof")) { 25 | Searchable.stations { 26 | Station.name ~ 27 | Station.hasWiFi ~ 28 | Station.timetable { 29 | Timetable.nextDepatures { 30 | trainInStation 31 | } ~ 32 | Timetable.nextArrivals { 33 | trainInStation 34 | } 35 | } 36 | } 37 | } 38 | 39 | val uri = uri"https://api.deutschebahn.com/free1bahnql/v1/graphql" 40 | 41 | ZIO 42 | .serviceWithZIO[SttpBackend[Task, ZioStreams with WebSockets]](_.send(query.toRequest(uri))) 43 | .map(_.body) 44 | .absolve 45 | .tap(res => ZIO.debug(s"Result: $res")) 46 | .provide(AsyncHttpClientZioBackend.layer()) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/scala/part2/Api1.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | import part2.Data._ 4 | import zio.{ UIO, ZIO } 5 | 6 | object Api1 { 7 | 8 | case class QueryArgs(count: Int) 9 | case class Query(orders: QueryArgs => UIO[List[OrderView]]) 10 | 11 | case class OrderView(id: OrderId, customer: Customer, products: List[ProductOrderView]) 12 | case class ProductOrderView(id: ProductId, details: ProductDetailsView, quantity: Int) 13 | case class ProductDetailsView(name: String, description: String, brand: Brand) 14 | 15 | def resolver(dbService: DBService): Query = { 16 | 17 | def getOrders(count: Int): UIO[List[OrderView]] = 18 | dbService 19 | .getLastOrders(count) 20 | .flatMap( 21 | ZIO.foreach(_)( 22 | order => 23 | for { 24 | customer <- dbService.getCustomer(order.customerId) 25 | products <- getProducts(order.products) 26 | } yield OrderView(order.id, customer, products) 27 | ) 28 | ) 29 | 30 | def getProducts(products: List[(ProductId, Int)]): UIO[List[ProductOrderView]] = 31 | ZIO.foreach(products) { 32 | case (productId, quantity) => 33 | dbService 34 | .getProduct(productId) 35 | .flatMap( 36 | product => 37 | dbService 38 | .getBrand(product.brandId) 39 | .map(brand => ProductDetailsView(product.name, product.description, brand)) 40 | ) 41 | .map(details => ProductOrderView(productId, details, quantity)) 42 | } 43 | 44 | Query(args => getOrders(args.count)) 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/scala/part2/TestApp.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | import caliban.CalibanError.ValidationError 4 | import caliban._ 5 | import caliban.schema.ArgBuilder.auto._ 6 | import caliban.schema.Schema.auto._ 7 | import caliban.RootResolver 8 | import zio.{ IO, ZIO, ZIOAppDefault } 9 | 10 | object TestApp extends ZIOAppDefault { 11 | 12 | val test1: IO[ValidationError, Int] = 13 | for { 14 | dbService <- DBService() 15 | resolver = Api1.resolver(dbService) 16 | api = graphQL(RootResolver(resolver)) 17 | interpreter <- api.interpreter 18 | _ <- interpreter.execute(Query.orders) 19 | dbHits <- dbService.hits 20 | _ <- ZIO.debug(s"Naive Approach - DB Hits: $dbHits") 21 | } yield 0 22 | 23 | val test2: IO[ValidationError, Int] = 24 | for { 25 | dbService <- DBService() 26 | resolver = Api2.resolver(dbService) 27 | api = graphQL(RootResolver(resolver)) 28 | interpreter <- api.interpreter 29 | _ <- interpreter.execute(Query.orders) 30 | dbHits <- dbService.hits 31 | _ <- ZIO.debug(s"Nested Effects - DB Hits: $dbHits") 32 | } yield 0 33 | 34 | val test3: IO[ValidationError, Int] = 35 | for { 36 | dbService <- DBService() 37 | resolver = Api3.resolver(dbService) 38 | api = graphQL(RootResolver(resolver)) 39 | interpreter <- api.interpreter 40 | _ <- interpreter.execute(Query.orders) 41 | dbHits <- dbService.hits 42 | _ <- ZIO.debug(s"ZQuery - DB Hits: $dbHits") 43 | } yield 0 44 | 45 | val test4: IO[ValidationError, Int] = 46 | for { 47 | dbService <- DBService() 48 | resolver = Api4.resolver(dbService) 49 | api = graphQL(RootResolver(resolver)) 50 | interpreter <- api.interpreter 51 | _ <- interpreter.execute(Query.orders) 52 | dbHits <- dbService.hits 53 | _ <- ZIO.debug(s"ZQuery with Batch - DB Hits: $dbHits") 54 | } yield 0 55 | 56 | override def run: IO[ValidationError, Int] = 57 | test1 *> test2 *> test3 *> test4 58 | } 59 | -------------------------------------------------------------------------------- /src/main/scala/part2/Api3.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | import part2.Data._ 4 | import zio.query.{ DataSource, Request, ZQuery } 5 | 6 | object Api3 { 7 | 8 | type MyQuery[+A] = ZQuery[Any, Nothing, A] 9 | 10 | case class QueryArgs(count: Int) 11 | case class Query(orders: QueryArgs => MyQuery[List[OrderView]]) 12 | 13 | case class OrderView(id: OrderId, customer: MyQuery[Customer], products: List[ProductOrderView]) 14 | case class ProductOrderView(id: ProductId, details: MyQuery[ProductDetailsView], quantity: Int) 15 | case class ProductDetailsView(name: String, description: String, brand: MyQuery[Brand]) 16 | 17 | def resolver(dbService: DBService): Query = { 18 | 19 | case class GetCustomer(id: CustomerId) extends Request[Nothing, Customer] 20 | val CustomerDataSource: DataSource[Any, GetCustomer] = 21 | DataSource.fromFunctionZIO("CustomerDataSource")(req => dbService.getCustomer(req.id)) 22 | def getCustomer(id: CustomerId): MyQuery[Customer] = ZQuery.fromRequest(GetCustomer(id))(CustomerDataSource) 23 | 24 | case class GetProduct(id: ProductId) extends Request[Nothing, Product] 25 | val ProductDataSource: DataSource[Any, GetProduct] = 26 | DataSource.fromFunctionZIO("ProductDataSource")(req => dbService.getProduct(req.id)) 27 | def getProduct(id: ProductId): MyQuery[Product] = ZQuery.fromRequest(GetProduct(id))(ProductDataSource) 28 | 29 | case class GetBrand(id: BrandId) extends Request[Nothing, Brand] 30 | val BrandDataSource: DataSource[Any, GetBrand] = 31 | DataSource.fromFunctionZIO("BrandDataSource")(req => dbService.getBrand(req.id)) 32 | def getBrand(id: BrandId): MyQuery[Brand] = ZQuery.fromRequest(GetBrand(id))(BrandDataSource) 33 | 34 | def getOrders(count: Int): MyQuery[List[OrderView]] = 35 | ZQuery 36 | .fromZIO(dbService.getLastOrders(count)) 37 | .map(_.map(order => OrderView(order.id, getCustomer(order.customerId), getProducts(order.products)))) 38 | 39 | def getProducts(products: List[(ProductId, Int)]): List[ProductOrderView] = 40 | products.map { 41 | case (productId, quantity) => 42 | ProductOrderView( 43 | productId, 44 | getProduct(productId).map(p => ProductDetailsView(p.name, p.description, getBrand(p.brandId))), 45 | quantity 46 | ) 47 | } 48 | 49 | Query(args => getOrders(args.count)) 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/scala/part2/Api4.scala: -------------------------------------------------------------------------------- 1 | package part2 2 | 3 | import part2.Data._ 4 | import zio.Chunk 5 | import zio.query.{ DataSource, Request, ZQuery } 6 | 7 | object Api4 { 8 | 9 | type MyQuery[+A] = ZQuery[Any, Nothing, A] 10 | 11 | case class QueryArgs(count: Int) 12 | case class Query(orders: QueryArgs => MyQuery[List[OrderView]]) 13 | 14 | case class OrderView(id: OrderId, customer: MyQuery[Customer], products: List[ProductOrderView]) 15 | case class ProductOrderView(id: ProductId, details: MyQuery[ProductDetailsView], quantity: Int) 16 | case class ProductDetailsView(name: String, description: String, brand: MyQuery[Brand]) 17 | 18 | def resolver(dbService: DBService): Query = { 19 | 20 | case class GetCustomer(id: CustomerId) extends Request[Nothing, Customer] 21 | val CustomerDataSource: DataSource[Any, GetCustomer] = 22 | DataSource.fromFunctionBatchedZIO("CustomerDataSource")( 23 | requests => dbService.getCustomers(requests.map(_.id).toList).map(Chunk.fromIterable) 24 | ) 25 | def getCustomer(id: CustomerId): MyQuery[Customer] = ZQuery.fromRequest(GetCustomer(id))(CustomerDataSource) 26 | 27 | case class GetProduct(id: ProductId) extends Request[Nothing, Product] 28 | val ProductDataSource: DataSource[Any, GetProduct] = 29 | DataSource.fromFunctionBatchedZIO("ProductDataSource")( 30 | requests => dbService.getProducts(requests.map(_.id).toList).map(Chunk.fromIterable) 31 | ) 32 | def getProduct(id: ProductId): MyQuery[Product] = ZQuery.fromRequest(GetProduct(id))(ProductDataSource) 33 | 34 | case class GetBrand(id: BrandId) extends Request[Nothing, Brand] 35 | val BrandDataSource: DataSource[Any, GetBrand] = 36 | DataSource.fromFunctionBatchedZIO("BrandDataSource")( 37 | requests => dbService.getBrands(requests.map(_.id).toList).map(Chunk.fromIterable) 38 | ) 39 | def getBrand(id: BrandId): MyQuery[Brand] = ZQuery.fromRequest(GetBrand(id))(BrandDataSource) 40 | 41 | def getOrders(count: Int): MyQuery[List[OrderView]] = 42 | ZQuery 43 | .fromZIO(dbService.getLastOrders(count)) 44 | .map(_.map(order => OrderView(order.id, getCustomer(order.customerId), getProducts(order.products)))) 45 | 46 | def getProducts(products: List[(ProductId, Int)]): List[ProductOrderView] = 47 | products.map { 48 | case (productId, quantity) => 49 | ProductOrderView( 50 | productId, 51 | getProduct(productId).map(p => ProductDetailsView(p.name, p.description, getBrand(p.brandId))), 52 | quantity 53 | ) 54 | } 55 | 56 | Query(args => getOrders(args.count)) 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/scala/client/bahn.graphql: -------------------------------------------------------------------------------- 1 | type BikeAttributes { 2 | licensePlate: String! 3 | } 4 | 5 | type CarAttributes { 6 | seats: Int! 7 | color: String! 8 | doors: Int! 9 | transmissionType: String! 10 | licensePlate: String 11 | fillLevel: Int 12 | fuel: String 13 | } 14 | 15 | type CarEquipment { 16 | cdPlayer: Boolean 17 | airConditioning: Boolean 18 | navigationSystem: Boolean 19 | roofRailing: Boolean 20 | particulateFilter: Boolean 21 | audioInline: Boolean 22 | tyreType: String 23 | bluetoothHandsFreeCalling: Boolean 24 | cruiseControl: Boolean 25 | passengerAirbagTurnOff: Boolean 26 | isofixSeatFittings: Boolean 27 | } 28 | 29 | type Facility { 30 | description: String 31 | type: FacilityType! 32 | state: FacilityState! 33 | equipmentNumber: Int 34 | location: Location 35 | } 36 | 37 | enum FacilityState { 38 | ACTIVE 39 | INACTIVE 40 | UNKNOWN 41 | } 42 | 43 | enum FacilityType { 44 | ESCALATOR 45 | ELEVATOR 46 | } 47 | 48 | type FlinksterBike { 49 | id: String! 50 | url: String! 51 | name: String! 52 | description: String! 53 | location: Location! 54 | priceOptions: [PriceOption]! 55 | attributes: BikeAttributes! 56 | address: MailingAddress! 57 | rentalModel: String! 58 | type: String! 59 | providerRentalObjectId: Int! 60 | parkingArea: FlinksterParkingArea! 61 | bookingUrl: String! 62 | } 63 | 64 | type FlinksterCar { 65 | id: String! 66 | name: String! 67 | description: String! 68 | attributes: CarAttributes! 69 | location: Location! 70 | priceOptions: [PriceOption]! 71 | equipment: CarEquipment! 72 | rentalModel: String! 73 | parkingArea: FlinksterParkingArea! 74 | category: String! 75 | url: String! 76 | } 77 | 78 | type FlinksterParkingArea { 79 | id: String! 80 | url: String! 81 | name: String! 82 | address: MailingAddress! 83 | parkingDescription: String 84 | accessDescription: String 85 | locationDescription: String 86 | publicTransport: String 87 | provider: FlinksterProvider! 88 | type: String! 89 | position: Location! 90 | GeoJSON: GeoJSON 91 | } 92 | 93 | type FlinksterProvider { 94 | url: String! 95 | areaId: Int! 96 | networkIds: [Int!]! 97 | } 98 | 99 | type GeoFeature { 100 | type: String! 101 | properties: GeoProperties! 102 | geometry: GeoPolygon! 103 | } 104 | 105 | type GeoJSON { 106 | type: String! 107 | features: [GeoFeature!]! 108 | } 109 | 110 | type GeoPolygon { 111 | type: String! 112 | coordinates: [[[[Float]]]]! 113 | } 114 | 115 | type GeoProperties { 116 | name: String! 117 | } 118 | 119 | type Location { 120 | latitude: Float! 121 | longitude: Float! 122 | } 123 | 124 | type MailingAddress { 125 | city: String! 126 | zipcode: String! 127 | street: String! 128 | } 129 | 130 | type Nearby { 131 | stations(count: Int = 10, offset: Int = 0): [Station!]! 132 | parkingSpaces(count: Int = 10, offset: Int = 0): [ParkingSpace!]! 133 | travelCenters(count: Int = 10, offset: Int = 0): [TravelCenter!]! 134 | flinksterCars(count: Int = 10, offset: Int = 0): [FlinksterCar!]! 135 | bikes(count: Int = 10, offset: Int = 0): [FlinksterBike!]! 136 | } 137 | 138 | type Occupancy { 139 | validData: Boolean! 140 | timestamp: String! 141 | timeSegment: String! 142 | category: Int! 143 | text: String! 144 | } 145 | 146 | type OpeningTime { 147 | from: String! 148 | to: String! 149 | } 150 | 151 | type OpeningTimes { 152 | monday: OpeningTime 153 | tuesday: OpeningTime 154 | wednesday: OpeningTime 155 | thursday: OpeningTime 156 | friday: OpeningTime 157 | saturday: OpeningTime 158 | sunday: OpeningTime 159 | holiday: OpeningTime 160 | } 161 | 162 | type OperationLocation { 163 | id: String 164 | abbrev: String! 165 | name: String! 166 | shortName: String! 167 | type: String! 168 | status: String 169 | locationCode: String 170 | UIC: String! 171 | regionId: String 172 | validFrom: String! 173 | validTill: String 174 | timeTableRelevant: Boolean 175 | borderStation: Boolean 176 | } 177 | 178 | type ParkingPriceOption { 179 | id: Int! 180 | duration: String! 181 | price: Float 182 | } 183 | 184 | type ParkingSpace { 185 | type: String 186 | id: Int! 187 | name: String 188 | label: String 189 | spaceNumber: String 190 | responsibility: String 191 | source: String 192 | nameDisplay: String 193 | spaceType: String 194 | spaceTypeEn: String 195 | spaceTypeName: String 196 | location: Location 197 | url: String 198 | operator: String 199 | operatorUrl: String 200 | address: MailingAddress 201 | distance: String 202 | facilityType: String 203 | facilityTypeEn: String 204 | openingHours: String 205 | openingHoursEn: String 206 | numberParkingPlaces: String 207 | numberHandicapedPlaces: String 208 | isSpecialProductDb: Boolean! 209 | isOutOfService: Boolean! 210 | station: Station 211 | occupancy: Occupancy 212 | outOfServiceText: String 213 | outOfServiceTextEn: String 214 | reservation: String 215 | clearanceWidth: String 216 | clearanceHeight: String 217 | allowedPropulsions: String 218 | hasChargingStation: String 219 | tariffPrices: [ParkingPriceOption!]! 220 | outOfService: Boolean! 221 | isDiscountDbBahnCard: Boolean! 222 | isMonthVendingMachine: Boolean! 223 | isDiscountDbBahnComfort: Boolean! 224 | isDiscountDbParkAndRail: Boolean! 225 | isMonthParkAndRide: Boolean! 226 | isMonthSeason: Boolean! 227 | tariffDiscount: String 228 | tariffFreeParkingTime: String 229 | tariffDiscountEn: String 230 | tariffPaymentOptions: String 231 | tariffPaymentCustomerCards: String 232 | tariffFreeParkingTimeEn: String 233 | tariffPaymentOptionsEn: String 234 | slogan: String 235 | sloganEn: String 236 | } 237 | 238 | type Photographer { 239 | name: String! 240 | url: String! 241 | } 242 | 243 | type Picture { 244 | id: Int! 245 | url: String! 246 | license: String! 247 | photographer: Photographer! 248 | } 249 | 250 | type PriceOption { 251 | interval: Int 252 | type: String! 253 | grossamount: Float! 254 | currency: String! 255 | taxrate: Float! 256 | preferredprice: Boolean! 257 | } 258 | 259 | type Product { 260 | name: String 261 | class: Int 262 | productCode: Int 263 | productName: String 264 | } 265 | 266 | type Query { 267 | routing(from: Int!, to: Int!): [Route!]! 268 | stationWithEvaId(evaId: Int!): Station 269 | stationWithStationNumber(stationNumber: Int!): Station 270 | stationWithRill100(rill100: String!): Station 271 | search(searchTerm: String): Searchable! 272 | nearby(latitude: Float!, longitude: Float!, radius: Int = 10000): Nearby! 273 | parkingSpace(id: Int): ParkingSpace 274 | } 275 | 276 | type RegionalArea { 277 | number: Int! 278 | name: String! 279 | shortName: String! 280 | } 281 | 282 | type Route { 283 | parts: [RoutePart!]! 284 | from: Station 285 | to: Station 286 | } 287 | 288 | type RoutePart { 289 | """ 290 | Station where the part begins 291 | """ 292 | from: Station! 293 | to: Station! 294 | delay: Int 295 | product: Product 296 | direction: String! 297 | start: String! 298 | end: String! 299 | departingTrack: Track 300 | arrivingTrack: Track 301 | } 302 | 303 | type Searchable { 304 | stations: [Station!]! 305 | operationLocations: [OperationLocation!]! 306 | } 307 | 308 | type Station { 309 | primaryEvaId: Int 310 | stationNumber: Int 311 | primaryRil100: String 312 | name: String! 313 | location: Location 314 | category: Int! 315 | priceCategory: Int! 316 | hasParking: Boolean! 317 | hasBicycleParking: Boolean! 318 | hasLocalPublicTransport: Boolean! 319 | hasPublicFacilities: Boolean! 320 | hasLockerSystem: Boolean! 321 | hasTaxiRank: Boolean! 322 | hasTravelNecessities: Boolean! 323 | hasSteplessAccess: String! 324 | hasMobilityService: String! 325 | federalState: String! 326 | regionalArea: RegionalArea! 327 | facilities: [Facility!]! 328 | mailingAddress: MailingAddress! 329 | DBInformationOpeningTimes: OpeningTimes 330 | localServiceStaffAvailability: OpeningTimes 331 | aufgabentraeger: StationContact! 332 | timeTableOffice: StationContact 333 | szentrale: StationContact! 334 | stationManagement: StationContact! 335 | timetable: Timetable! 336 | parkingSpaces: [ParkingSpace!]! 337 | hasSteamPermission: Boolean! 338 | hasWiFi: Boolean! 339 | hasTravelCenter: Boolean! 340 | hasRailwayMission: Boolean! 341 | hasDBLounge: Boolean! 342 | hasLostAndFound: Boolean! 343 | hasCarRental: Boolean! 344 | tracks: [Track!]! 345 | picture: Picture 346 | } 347 | 348 | type StationContact { 349 | name: String! 350 | shortName: String 351 | email: String 352 | number: String 353 | phoneNumber: String 354 | } 355 | 356 | type Timetable { 357 | nextArrivals: [TrainInStation!]! 358 | nextDepatures: [TrainInStation!]! 359 | } 360 | 361 | type Track { 362 | platform: String! 363 | number: String! 364 | name: String! 365 | 366 | """ 367 | Length of the platform in cm 368 | """ 369 | length: Int 370 | 371 | """ 372 | Height of the platform in cm 373 | """ 374 | height: Int! 375 | } 376 | 377 | type TrainInStation { 378 | type: String! 379 | trainNumber: String! 380 | platform: String! 381 | time: String! 382 | stops: [String!]! 383 | } 384 | 385 | type TravelCenter { 386 | id: Int 387 | name: String 388 | address: MailingAddress 389 | type: String 390 | location: Location 391 | } 392 | -------------------------------------------------------------------------------- /src/main/scala/client/TrainClient.scala: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import caliban.client.CalibanClientError.DecodingError 4 | import caliban.client.FieldBuilder._ 5 | import caliban.client._ 6 | import caliban.client.__Value._ 7 | 8 | object TrainClient { 9 | 10 | sealed trait FacilityState extends scala.Product with scala.Serializable { def value: String } 11 | object FacilityState { 12 | case object ACTIVE extends FacilityState { val value: String = "ACTIVE" } 13 | case object INACTIVE extends FacilityState { val value: String = "INACTIVE" } 14 | case object UNKNOWN extends FacilityState { val value: String = "UNKNOWN" } 15 | 16 | implicit val decoder: ScalarDecoder[FacilityState] = { 17 | case __StringValue("ACTIVE") => Right(FacilityState.ACTIVE) 18 | case __StringValue("INACTIVE") => Right(FacilityState.INACTIVE) 19 | case __StringValue("UNKNOWN") => Right(FacilityState.UNKNOWN) 20 | case other => Left(DecodingError(s"Can't build FacilityState from input $other")) 21 | } 22 | implicit val encoder: ArgEncoder[FacilityState] = { 23 | case FacilityState.ACTIVE => __EnumValue("ACTIVE") 24 | case FacilityState.INACTIVE => __EnumValue("INACTIVE") 25 | case FacilityState.UNKNOWN => __EnumValue("UNKNOWN") 26 | } 27 | 28 | val values: Vector[FacilityState] = Vector(ACTIVE, INACTIVE, UNKNOWN) 29 | } 30 | 31 | sealed trait FacilityType extends scala.Product with scala.Serializable { def value: String } 32 | object FacilityType { 33 | case object ESCALATOR extends FacilityType { val value: String = "ESCALATOR" } 34 | case object ELEVATOR extends FacilityType { val value: String = "ELEVATOR" } 35 | 36 | implicit val decoder: ScalarDecoder[FacilityType] = { 37 | case __StringValue("ESCALATOR") => Right(FacilityType.ESCALATOR) 38 | case __StringValue("ELEVATOR") => Right(FacilityType.ELEVATOR) 39 | case other => Left(DecodingError(s"Can't build FacilityType from input $other")) 40 | } 41 | implicit val encoder: ArgEncoder[FacilityType] = { 42 | case FacilityType.ESCALATOR => __EnumValue("ESCALATOR") 43 | case FacilityType.ELEVATOR => __EnumValue("ELEVATOR") 44 | } 45 | 46 | val values: Vector[FacilityType] = Vector(ESCALATOR, ELEVATOR) 47 | } 48 | 49 | type BikeAttributes 50 | object BikeAttributes { 51 | def licensePlate: SelectionBuilder[BikeAttributes, String] = 52 | _root_.caliban.client.SelectionBuilder.Field("licensePlate", Scalar()) 53 | } 54 | 55 | type CarAttributes 56 | object CarAttributes { 57 | def seats: SelectionBuilder[CarAttributes, Int] = _root_.caliban.client.SelectionBuilder.Field("seats", Scalar()) 58 | def color: SelectionBuilder[CarAttributes, String] = _root_.caliban.client.SelectionBuilder.Field("color", Scalar()) 59 | def doors: SelectionBuilder[CarAttributes, Int] = _root_.caliban.client.SelectionBuilder.Field("doors", Scalar()) 60 | def transmissionType: SelectionBuilder[CarAttributes, String] = 61 | _root_.caliban.client.SelectionBuilder.Field("transmissionType", Scalar()) 62 | def licensePlate: SelectionBuilder[CarAttributes, Option[String]] = 63 | _root_.caliban.client.SelectionBuilder.Field("licensePlate", OptionOf(Scalar())) 64 | def fillLevel: SelectionBuilder[CarAttributes, Option[Int]] = 65 | _root_.caliban.client.SelectionBuilder.Field("fillLevel", OptionOf(Scalar())) 66 | def fuel: SelectionBuilder[CarAttributes, Option[String]] = 67 | _root_.caliban.client.SelectionBuilder.Field("fuel", OptionOf(Scalar())) 68 | } 69 | 70 | type CarEquipment 71 | object CarEquipment { 72 | def cdPlayer: SelectionBuilder[CarEquipment, Option[Boolean]] = 73 | _root_.caliban.client.SelectionBuilder.Field("cdPlayer", OptionOf(Scalar())) 74 | def airConditioning: SelectionBuilder[CarEquipment, Option[Boolean]] = 75 | _root_.caliban.client.SelectionBuilder.Field("airConditioning", OptionOf(Scalar())) 76 | def navigationSystem: SelectionBuilder[CarEquipment, Option[Boolean]] = 77 | _root_.caliban.client.SelectionBuilder.Field("navigationSystem", OptionOf(Scalar())) 78 | def roofRailing: SelectionBuilder[CarEquipment, Option[Boolean]] = 79 | _root_.caliban.client.SelectionBuilder.Field("roofRailing", OptionOf(Scalar())) 80 | def particulateFilter: SelectionBuilder[CarEquipment, Option[Boolean]] = 81 | _root_.caliban.client.SelectionBuilder.Field("particulateFilter", OptionOf(Scalar())) 82 | def audioInline: SelectionBuilder[CarEquipment, Option[Boolean]] = 83 | _root_.caliban.client.SelectionBuilder.Field("audioInline", OptionOf(Scalar())) 84 | def tyreType: SelectionBuilder[CarEquipment, Option[String]] = 85 | _root_.caliban.client.SelectionBuilder.Field("tyreType", OptionOf(Scalar())) 86 | def bluetoothHandsFreeCalling: SelectionBuilder[CarEquipment, Option[Boolean]] = 87 | _root_.caliban.client.SelectionBuilder.Field("bluetoothHandsFreeCalling", OptionOf(Scalar())) 88 | def cruiseControl: SelectionBuilder[CarEquipment, Option[Boolean]] = 89 | _root_.caliban.client.SelectionBuilder.Field("cruiseControl", OptionOf(Scalar())) 90 | def passengerAirbagTurnOff: SelectionBuilder[CarEquipment, Option[Boolean]] = 91 | _root_.caliban.client.SelectionBuilder.Field("passengerAirbagTurnOff", OptionOf(Scalar())) 92 | def isofixSeatFittings: SelectionBuilder[CarEquipment, Option[Boolean]] = 93 | _root_.caliban.client.SelectionBuilder.Field("isofixSeatFittings", OptionOf(Scalar())) 94 | } 95 | 96 | type Facility 97 | object Facility { 98 | def description: SelectionBuilder[Facility, Option[String]] = 99 | _root_.caliban.client.SelectionBuilder.Field("description", OptionOf(Scalar())) 100 | def `type`: SelectionBuilder[Facility, FacilityType] = 101 | _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 102 | def state: SelectionBuilder[Facility, FacilityState] = 103 | _root_.caliban.client.SelectionBuilder.Field("state", Scalar()) 104 | def equipmentNumber: SelectionBuilder[Facility, Option[Int]] = 105 | _root_.caliban.client.SelectionBuilder.Field("equipmentNumber", OptionOf(Scalar())) 106 | def location[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[Facility, Option[A]] = 107 | _root_.caliban.client.SelectionBuilder.Field("location", OptionOf(Obj(innerSelection))) 108 | } 109 | 110 | type FlinksterBike 111 | object FlinksterBike { 112 | def id: SelectionBuilder[FlinksterBike, String] = _root_.caliban.client.SelectionBuilder.Field("id", Scalar()) 113 | def url: SelectionBuilder[FlinksterBike, String] = _root_.caliban.client.SelectionBuilder.Field("url", Scalar()) 114 | def name: SelectionBuilder[FlinksterBike, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 115 | def description: SelectionBuilder[FlinksterBike, String] = 116 | _root_.caliban.client.SelectionBuilder.Field("description", Scalar()) 117 | def location[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[FlinksterBike, A] = 118 | _root_.caliban.client.SelectionBuilder.Field("location", Obj(innerSelection)) 119 | def priceOptions[A]( 120 | innerSelection: SelectionBuilder[PriceOption, A] 121 | ): SelectionBuilder[FlinksterBike, List[Option[A]]] = 122 | _root_.caliban.client.SelectionBuilder.Field("priceOptions", ListOf(OptionOf(Obj(innerSelection)))) 123 | def attributes[A](innerSelection: SelectionBuilder[BikeAttributes, A]): SelectionBuilder[FlinksterBike, A] = 124 | _root_.caliban.client.SelectionBuilder.Field("attributes", Obj(innerSelection)) 125 | def address[A](innerSelection: SelectionBuilder[MailingAddress, A]): SelectionBuilder[FlinksterBike, A] = 126 | _root_.caliban.client.SelectionBuilder.Field("address", Obj(innerSelection)) 127 | def rentalModel: SelectionBuilder[FlinksterBike, String] = 128 | _root_.caliban.client.SelectionBuilder.Field("rentalModel", Scalar()) 129 | def `type`: SelectionBuilder[FlinksterBike, String] = _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 130 | def providerRentalObjectId: SelectionBuilder[FlinksterBike, Int] = 131 | _root_.caliban.client.SelectionBuilder.Field("providerRentalObjectId", Scalar()) 132 | def parkingArea[A](innerSelection: SelectionBuilder[FlinksterParkingArea, A]): SelectionBuilder[FlinksterBike, A] = 133 | _root_.caliban.client.SelectionBuilder.Field("parkingArea", Obj(innerSelection)) 134 | def bookingUrl: SelectionBuilder[FlinksterBike, String] = 135 | _root_.caliban.client.SelectionBuilder.Field("bookingUrl", Scalar()) 136 | } 137 | 138 | type FlinksterCar 139 | object FlinksterCar { 140 | def id: SelectionBuilder[FlinksterCar, String] = _root_.caliban.client.SelectionBuilder.Field("id", Scalar()) 141 | def name: SelectionBuilder[FlinksterCar, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 142 | def description: SelectionBuilder[FlinksterCar, String] = 143 | _root_.caliban.client.SelectionBuilder.Field("description", Scalar()) 144 | def attributes[A](innerSelection: SelectionBuilder[CarAttributes, A]): SelectionBuilder[FlinksterCar, A] = 145 | _root_.caliban.client.SelectionBuilder.Field("attributes", Obj(innerSelection)) 146 | def location[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[FlinksterCar, A] = 147 | _root_.caliban.client.SelectionBuilder.Field("location", Obj(innerSelection)) 148 | def priceOptions[A]( 149 | innerSelection: SelectionBuilder[PriceOption, A] 150 | ): SelectionBuilder[FlinksterCar, List[Option[A]]] = 151 | _root_.caliban.client.SelectionBuilder.Field("priceOptions", ListOf(OptionOf(Obj(innerSelection)))) 152 | def equipment[A](innerSelection: SelectionBuilder[CarEquipment, A]): SelectionBuilder[FlinksterCar, A] = 153 | _root_.caliban.client.SelectionBuilder.Field("equipment", Obj(innerSelection)) 154 | def rentalModel: SelectionBuilder[FlinksterCar, String] = 155 | _root_.caliban.client.SelectionBuilder.Field("rentalModel", Scalar()) 156 | def parkingArea[A](innerSelection: SelectionBuilder[FlinksterParkingArea, A]): SelectionBuilder[FlinksterCar, A] = 157 | _root_.caliban.client.SelectionBuilder.Field("parkingArea", Obj(innerSelection)) 158 | def category: SelectionBuilder[FlinksterCar, String] = 159 | _root_.caliban.client.SelectionBuilder.Field("category", Scalar()) 160 | def url: SelectionBuilder[FlinksterCar, String] = _root_.caliban.client.SelectionBuilder.Field("url", Scalar()) 161 | } 162 | 163 | type FlinksterParkingArea 164 | object FlinksterParkingArea { 165 | def id: SelectionBuilder[FlinksterParkingArea, String] = 166 | _root_.caliban.client.SelectionBuilder.Field("id", Scalar()) 167 | def url: SelectionBuilder[FlinksterParkingArea, String] = 168 | _root_.caliban.client.SelectionBuilder.Field("url", Scalar()) 169 | def name: SelectionBuilder[FlinksterParkingArea, String] = 170 | _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 171 | def address[A](innerSelection: SelectionBuilder[MailingAddress, A]): SelectionBuilder[FlinksterParkingArea, A] = 172 | _root_.caliban.client.SelectionBuilder.Field("address", Obj(innerSelection)) 173 | def parkingDescription: SelectionBuilder[FlinksterParkingArea, Option[String]] = 174 | _root_.caliban.client.SelectionBuilder.Field("parkingDescription", OptionOf(Scalar())) 175 | def accessDescription: SelectionBuilder[FlinksterParkingArea, Option[String]] = 176 | _root_.caliban.client.SelectionBuilder.Field("accessDescription", OptionOf(Scalar())) 177 | def locationDescription: SelectionBuilder[FlinksterParkingArea, Option[String]] = 178 | _root_.caliban.client.SelectionBuilder.Field("locationDescription", OptionOf(Scalar())) 179 | def publicTransport: SelectionBuilder[FlinksterParkingArea, Option[String]] = 180 | _root_.caliban.client.SelectionBuilder.Field("publicTransport", OptionOf(Scalar())) 181 | def provider[A](innerSelection: SelectionBuilder[FlinksterProvider, A]): SelectionBuilder[FlinksterParkingArea, A] = 182 | _root_.caliban.client.SelectionBuilder.Field("provider", Obj(innerSelection)) 183 | def `type`: SelectionBuilder[FlinksterParkingArea, String] = 184 | _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 185 | def position[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[FlinksterParkingArea, A] = 186 | _root_.caliban.client.SelectionBuilder.Field("position", Obj(innerSelection)) 187 | def GeoJSON[A](innerSelection: SelectionBuilder[GeoJSON, A]): SelectionBuilder[FlinksterParkingArea, Option[A]] = 188 | _root_.caliban.client.SelectionBuilder.Field("GeoJSON", OptionOf(Obj(innerSelection))) 189 | } 190 | 191 | type FlinksterProvider 192 | object FlinksterProvider { 193 | def url: SelectionBuilder[FlinksterProvider, String] = _root_.caliban.client.SelectionBuilder.Field("url", Scalar()) 194 | def areaId: SelectionBuilder[FlinksterProvider, Int] = 195 | _root_.caliban.client.SelectionBuilder.Field("areaId", Scalar()) 196 | def networkIds: SelectionBuilder[FlinksterProvider, List[Int]] = 197 | _root_.caliban.client.SelectionBuilder.Field("networkIds", ListOf(Scalar())) 198 | } 199 | 200 | type GeoFeature 201 | object GeoFeature { 202 | def `type`: SelectionBuilder[GeoFeature, String] = _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 203 | def properties[A](innerSelection: SelectionBuilder[GeoProperties, A]): SelectionBuilder[GeoFeature, A] = 204 | _root_.caliban.client.SelectionBuilder.Field("properties", Obj(innerSelection)) 205 | def geometry[A](innerSelection: SelectionBuilder[GeoPolygon, A]): SelectionBuilder[GeoFeature, A] = 206 | _root_.caliban.client.SelectionBuilder.Field("geometry", Obj(innerSelection)) 207 | } 208 | 209 | type GeoJSON 210 | object GeoJSON { 211 | def `type`: SelectionBuilder[GeoJSON, String] = _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 212 | def features[A](innerSelection: SelectionBuilder[GeoFeature, A]): SelectionBuilder[GeoJSON, List[A]] = 213 | _root_.caliban.client.SelectionBuilder.Field("features", ListOf(Obj(innerSelection))) 214 | } 215 | 216 | type GeoPolygon 217 | object GeoPolygon { 218 | def `type`: SelectionBuilder[GeoPolygon, String] = _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 219 | def coordinates: SelectionBuilder[GeoPolygon, List[Option[List[Option[List[Option[List[Option[Double]]]]]]]]] = 220 | _root_.caliban.client.SelectionBuilder 221 | .Field("coordinates", ListOf(OptionOf(ListOf(OptionOf(ListOf(OptionOf(ListOf(OptionOf(Scalar()))))))))) 222 | } 223 | 224 | type GeoProperties 225 | object GeoProperties { 226 | def name: SelectionBuilder[GeoProperties, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 227 | } 228 | 229 | type Location 230 | object Location { 231 | def latitude: SelectionBuilder[Location, Double] = 232 | _root_.caliban.client.SelectionBuilder.Field("latitude", Scalar()) 233 | def longitude: SelectionBuilder[Location, Double] = 234 | _root_.caliban.client.SelectionBuilder.Field("longitude", Scalar()) 235 | } 236 | 237 | type MailingAddress 238 | object MailingAddress { 239 | def city: SelectionBuilder[MailingAddress, String] = _root_.caliban.client.SelectionBuilder.Field("city", Scalar()) 240 | def zipcode: SelectionBuilder[MailingAddress, String] = 241 | _root_.caliban.client.SelectionBuilder.Field("zipcode", Scalar()) 242 | def street: SelectionBuilder[MailingAddress, String] = 243 | _root_.caliban.client.SelectionBuilder.Field("street", Scalar()) 244 | } 245 | 246 | type Nearby 247 | object Nearby { 248 | def stations[A](count: Option[Int] = None, offset: Option[Int] = None)( 249 | innerSelection: SelectionBuilder[Station, A] 250 | )( 251 | implicit encoder0: ArgEncoder[Option[Int]], 252 | encoder1: ArgEncoder[Option[Int]] 253 | ): SelectionBuilder[Nearby, List[A]] = 254 | _root_.caliban.client.SelectionBuilder.Field( 255 | "stations", 256 | ListOf(Obj(innerSelection)), 257 | arguments = List(Argument("count", count, "Int")(encoder0), Argument("offset", offset, "Int")(encoder1)) 258 | ) 259 | def parkingSpaces[A](count: Option[Int] = None, offset: Option[Int] = None)( 260 | innerSelection: SelectionBuilder[ParkingSpace, A] 261 | )( 262 | implicit encoder0: ArgEncoder[Option[Int]], 263 | encoder1: ArgEncoder[Option[Int]] 264 | ): SelectionBuilder[Nearby, List[A]] = 265 | _root_.caliban.client.SelectionBuilder.Field( 266 | "parkingSpaces", 267 | ListOf(Obj(innerSelection)), 268 | arguments = List(Argument("count", count, "Int")(encoder0), Argument("offset", offset, "Int")(encoder1)) 269 | ) 270 | def travelCenters[A](count: Option[Int] = None, offset: Option[Int] = None)( 271 | innerSelection: SelectionBuilder[TravelCenter, A] 272 | )( 273 | implicit encoder0: ArgEncoder[Option[Int]], 274 | encoder1: ArgEncoder[Option[Int]] 275 | ): SelectionBuilder[Nearby, List[A]] = 276 | _root_.caliban.client.SelectionBuilder.Field( 277 | "travelCenters", 278 | ListOf(Obj(innerSelection)), 279 | arguments = List(Argument("count", count, "Int")(encoder0), Argument("offset", offset, "Int")(encoder1)) 280 | ) 281 | def flinksterCars[A](count: Option[Int] = None, offset: Option[Int] = None)( 282 | innerSelection: SelectionBuilder[FlinksterCar, A] 283 | )( 284 | implicit encoder0: ArgEncoder[Option[Int]], 285 | encoder1: ArgEncoder[Option[Int]] 286 | ): SelectionBuilder[Nearby, List[A]] = 287 | _root_.caliban.client.SelectionBuilder.Field( 288 | "flinksterCars", 289 | ListOf(Obj(innerSelection)), 290 | arguments = List(Argument("count", count, "Int")(encoder0), Argument("offset", offset, "Int")(encoder1)) 291 | ) 292 | def bikes[A](count: Option[Int] = None, offset: Option[Int] = None)( 293 | innerSelection: SelectionBuilder[FlinksterBike, A] 294 | )( 295 | implicit encoder0: ArgEncoder[Option[Int]], 296 | encoder1: ArgEncoder[Option[Int]] 297 | ): SelectionBuilder[Nearby, List[A]] = 298 | _root_.caliban.client.SelectionBuilder.Field( 299 | "bikes", 300 | ListOf(Obj(innerSelection)), 301 | arguments = List(Argument("count", count, "Int")(encoder0), Argument("offset", offset, "Int")(encoder1)) 302 | ) 303 | } 304 | 305 | type Occupancy 306 | object Occupancy { 307 | def validData: SelectionBuilder[Occupancy, Boolean] = 308 | _root_.caliban.client.SelectionBuilder.Field("validData", Scalar()) 309 | def timestamp: SelectionBuilder[Occupancy, String] = 310 | _root_.caliban.client.SelectionBuilder.Field("timestamp", Scalar()) 311 | def timeSegment: SelectionBuilder[Occupancy, String] = 312 | _root_.caliban.client.SelectionBuilder.Field("timeSegment", Scalar()) 313 | def category: SelectionBuilder[Occupancy, Int] = _root_.caliban.client.SelectionBuilder.Field("category", Scalar()) 314 | def text: SelectionBuilder[Occupancy, String] = _root_.caliban.client.SelectionBuilder.Field("text", Scalar()) 315 | } 316 | 317 | type OpeningTime 318 | object OpeningTime { 319 | def from: SelectionBuilder[OpeningTime, String] = _root_.caliban.client.SelectionBuilder.Field("from", Scalar()) 320 | def to: SelectionBuilder[OpeningTime, String] = _root_.caliban.client.SelectionBuilder.Field("to", Scalar()) 321 | } 322 | 323 | type OpeningTimes 324 | object OpeningTimes { 325 | def monday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 326 | _root_.caliban.client.SelectionBuilder.Field("monday", OptionOf(Obj(innerSelection))) 327 | def tuesday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 328 | _root_.caliban.client.SelectionBuilder.Field("tuesday", OptionOf(Obj(innerSelection))) 329 | def wednesday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 330 | _root_.caliban.client.SelectionBuilder.Field("wednesday", OptionOf(Obj(innerSelection))) 331 | def thursday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 332 | _root_.caliban.client.SelectionBuilder.Field("thursday", OptionOf(Obj(innerSelection))) 333 | def friday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 334 | _root_.caliban.client.SelectionBuilder.Field("friday", OptionOf(Obj(innerSelection))) 335 | def saturday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 336 | _root_.caliban.client.SelectionBuilder.Field("saturday", OptionOf(Obj(innerSelection))) 337 | def sunday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 338 | _root_.caliban.client.SelectionBuilder.Field("sunday", OptionOf(Obj(innerSelection))) 339 | def holiday[A](innerSelection: SelectionBuilder[OpeningTime, A]): SelectionBuilder[OpeningTimes, Option[A]] = 340 | _root_.caliban.client.SelectionBuilder.Field("holiday", OptionOf(Obj(innerSelection))) 341 | } 342 | 343 | type OperationLocation 344 | object OperationLocation { 345 | def id: SelectionBuilder[OperationLocation, Option[String]] = 346 | _root_.caliban.client.SelectionBuilder.Field("id", OptionOf(Scalar())) 347 | def abbrev: SelectionBuilder[OperationLocation, String] = 348 | _root_.caliban.client.SelectionBuilder.Field("abbrev", Scalar()) 349 | def name: SelectionBuilder[OperationLocation, String] = 350 | _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 351 | def shortName: SelectionBuilder[OperationLocation, String] = 352 | _root_.caliban.client.SelectionBuilder.Field("shortName", Scalar()) 353 | def `type`: SelectionBuilder[OperationLocation, String] = 354 | _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 355 | def status: SelectionBuilder[OperationLocation, Option[String]] = 356 | _root_.caliban.client.SelectionBuilder.Field("status", OptionOf(Scalar())) 357 | def locationCode: SelectionBuilder[OperationLocation, Option[String]] = 358 | _root_.caliban.client.SelectionBuilder.Field("locationCode", OptionOf(Scalar())) 359 | def UIC: SelectionBuilder[OperationLocation, String] = _root_.caliban.client.SelectionBuilder.Field("UIC", Scalar()) 360 | def regionId: SelectionBuilder[OperationLocation, Option[String]] = 361 | _root_.caliban.client.SelectionBuilder.Field("regionId", OptionOf(Scalar())) 362 | def validFrom: SelectionBuilder[OperationLocation, String] = 363 | _root_.caliban.client.SelectionBuilder.Field("validFrom", Scalar()) 364 | def validTill: SelectionBuilder[OperationLocation, Option[String]] = 365 | _root_.caliban.client.SelectionBuilder.Field("validTill", OptionOf(Scalar())) 366 | def timeTableRelevant: SelectionBuilder[OperationLocation, Option[Boolean]] = 367 | _root_.caliban.client.SelectionBuilder.Field("timeTableRelevant", OptionOf(Scalar())) 368 | def borderStation: SelectionBuilder[OperationLocation, Option[Boolean]] = 369 | _root_.caliban.client.SelectionBuilder.Field("borderStation", OptionOf(Scalar())) 370 | } 371 | 372 | type ParkingPriceOption 373 | object ParkingPriceOption { 374 | def id: SelectionBuilder[ParkingPriceOption, Int] = _root_.caliban.client.SelectionBuilder.Field("id", Scalar()) 375 | def duration: SelectionBuilder[ParkingPriceOption, String] = 376 | _root_.caliban.client.SelectionBuilder.Field("duration", Scalar()) 377 | def price: SelectionBuilder[ParkingPriceOption, Option[Double]] = 378 | _root_.caliban.client.SelectionBuilder.Field("price", OptionOf(Scalar())) 379 | } 380 | 381 | type ParkingSpace 382 | object ParkingSpace { 383 | def `type`: SelectionBuilder[ParkingSpace, Option[String]] = 384 | _root_.caliban.client.SelectionBuilder.Field("type", OptionOf(Scalar())) 385 | def id: SelectionBuilder[ParkingSpace, Int] = _root_.caliban.client.SelectionBuilder.Field("id", Scalar()) 386 | def name: SelectionBuilder[ParkingSpace, Option[String]] = 387 | _root_.caliban.client.SelectionBuilder.Field("name", OptionOf(Scalar())) 388 | def label: SelectionBuilder[ParkingSpace, Option[String]] = 389 | _root_.caliban.client.SelectionBuilder.Field("label", OptionOf(Scalar())) 390 | def spaceNumber: SelectionBuilder[ParkingSpace, Option[String]] = 391 | _root_.caliban.client.SelectionBuilder.Field("spaceNumber", OptionOf(Scalar())) 392 | def responsibility: SelectionBuilder[ParkingSpace, Option[String]] = 393 | _root_.caliban.client.SelectionBuilder.Field("responsibility", OptionOf(Scalar())) 394 | def source: SelectionBuilder[ParkingSpace, Option[String]] = 395 | _root_.caliban.client.SelectionBuilder.Field("source", OptionOf(Scalar())) 396 | def nameDisplay: SelectionBuilder[ParkingSpace, Option[String]] = 397 | _root_.caliban.client.SelectionBuilder.Field("nameDisplay", OptionOf(Scalar())) 398 | def spaceType: SelectionBuilder[ParkingSpace, Option[String]] = 399 | _root_.caliban.client.SelectionBuilder.Field("spaceType", OptionOf(Scalar())) 400 | def spaceTypeEn: SelectionBuilder[ParkingSpace, Option[String]] = 401 | _root_.caliban.client.SelectionBuilder.Field("spaceTypeEn", OptionOf(Scalar())) 402 | def spaceTypeName: SelectionBuilder[ParkingSpace, Option[String]] = 403 | _root_.caliban.client.SelectionBuilder.Field("spaceTypeName", OptionOf(Scalar())) 404 | def location[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[ParkingSpace, Option[A]] = 405 | _root_.caliban.client.SelectionBuilder.Field("location", OptionOf(Obj(innerSelection))) 406 | def url: SelectionBuilder[ParkingSpace, Option[String]] = 407 | _root_.caliban.client.SelectionBuilder.Field("url", OptionOf(Scalar())) 408 | def operator: SelectionBuilder[ParkingSpace, Option[String]] = 409 | _root_.caliban.client.SelectionBuilder.Field("operator", OptionOf(Scalar())) 410 | def operatorUrl: SelectionBuilder[ParkingSpace, Option[String]] = 411 | _root_.caliban.client.SelectionBuilder.Field("operatorUrl", OptionOf(Scalar())) 412 | def address[A](innerSelection: SelectionBuilder[MailingAddress, A]): SelectionBuilder[ParkingSpace, Option[A]] = 413 | _root_.caliban.client.SelectionBuilder.Field("address", OptionOf(Obj(innerSelection))) 414 | def distance: SelectionBuilder[ParkingSpace, Option[String]] = 415 | _root_.caliban.client.SelectionBuilder.Field("distance", OptionOf(Scalar())) 416 | def facilityType: SelectionBuilder[ParkingSpace, Option[String]] = 417 | _root_.caliban.client.SelectionBuilder.Field("facilityType", OptionOf(Scalar())) 418 | def facilityTypeEn: SelectionBuilder[ParkingSpace, Option[String]] = 419 | _root_.caliban.client.SelectionBuilder.Field("facilityTypeEn", OptionOf(Scalar())) 420 | def openingHours: SelectionBuilder[ParkingSpace, Option[String]] = 421 | _root_.caliban.client.SelectionBuilder.Field("openingHours", OptionOf(Scalar())) 422 | def openingHoursEn: SelectionBuilder[ParkingSpace, Option[String]] = 423 | _root_.caliban.client.SelectionBuilder.Field("openingHoursEn", OptionOf(Scalar())) 424 | def numberParkingPlaces: SelectionBuilder[ParkingSpace, Option[String]] = 425 | _root_.caliban.client.SelectionBuilder.Field("numberParkingPlaces", OptionOf(Scalar())) 426 | def numberHandicapedPlaces: SelectionBuilder[ParkingSpace, Option[String]] = 427 | _root_.caliban.client.SelectionBuilder.Field("numberHandicapedPlaces", OptionOf(Scalar())) 428 | def isSpecialProductDb: SelectionBuilder[ParkingSpace, Boolean] = 429 | _root_.caliban.client.SelectionBuilder.Field("isSpecialProductDb", Scalar()) 430 | def isOutOfService: SelectionBuilder[ParkingSpace, Boolean] = 431 | _root_.caliban.client.SelectionBuilder.Field("isOutOfService", Scalar()) 432 | def station[A](innerSelection: SelectionBuilder[Station, A]): SelectionBuilder[ParkingSpace, Option[A]] = 433 | _root_.caliban.client.SelectionBuilder.Field("station", OptionOf(Obj(innerSelection))) 434 | def occupancy[A](innerSelection: SelectionBuilder[Occupancy, A]): SelectionBuilder[ParkingSpace, Option[A]] = 435 | _root_.caliban.client.SelectionBuilder.Field("occupancy", OptionOf(Obj(innerSelection))) 436 | def outOfServiceText: SelectionBuilder[ParkingSpace, Option[String]] = 437 | _root_.caliban.client.SelectionBuilder.Field("outOfServiceText", OptionOf(Scalar())) 438 | def outOfServiceTextEn: SelectionBuilder[ParkingSpace, Option[String]] = 439 | _root_.caliban.client.SelectionBuilder.Field("outOfServiceTextEn", OptionOf(Scalar())) 440 | def reservation: SelectionBuilder[ParkingSpace, Option[String]] = 441 | _root_.caliban.client.SelectionBuilder.Field("reservation", OptionOf(Scalar())) 442 | def clearanceWidth: SelectionBuilder[ParkingSpace, Option[String]] = 443 | _root_.caliban.client.SelectionBuilder.Field("clearanceWidth", OptionOf(Scalar())) 444 | def clearanceHeight: SelectionBuilder[ParkingSpace, Option[String]] = 445 | _root_.caliban.client.SelectionBuilder.Field("clearanceHeight", OptionOf(Scalar())) 446 | def allowedPropulsions: SelectionBuilder[ParkingSpace, Option[String]] = 447 | _root_.caliban.client.SelectionBuilder.Field("allowedPropulsions", OptionOf(Scalar())) 448 | def hasChargingStation: SelectionBuilder[ParkingSpace, Option[String]] = 449 | _root_.caliban.client.SelectionBuilder.Field("hasChargingStation", OptionOf(Scalar())) 450 | def tariffPrices[A]( 451 | innerSelection: SelectionBuilder[ParkingPriceOption, A] 452 | ): SelectionBuilder[ParkingSpace, List[A]] = 453 | _root_.caliban.client.SelectionBuilder.Field("tariffPrices", ListOf(Obj(innerSelection))) 454 | def outOfService: SelectionBuilder[ParkingSpace, Boolean] = 455 | _root_.caliban.client.SelectionBuilder.Field("outOfService", Scalar()) 456 | def isDiscountDbBahnCard: SelectionBuilder[ParkingSpace, Boolean] = 457 | _root_.caliban.client.SelectionBuilder.Field("isDiscountDbBahnCard", Scalar()) 458 | def isMonthVendingMachine: SelectionBuilder[ParkingSpace, Boolean] = 459 | _root_.caliban.client.SelectionBuilder.Field("isMonthVendingMachine", Scalar()) 460 | def isDiscountDbBahnComfort: SelectionBuilder[ParkingSpace, Boolean] = 461 | _root_.caliban.client.SelectionBuilder.Field("isDiscountDbBahnComfort", Scalar()) 462 | def isDiscountDbParkAndRail: SelectionBuilder[ParkingSpace, Boolean] = 463 | _root_.caliban.client.SelectionBuilder.Field("isDiscountDbParkAndRail", Scalar()) 464 | def isMonthParkAndRide: SelectionBuilder[ParkingSpace, Boolean] = 465 | _root_.caliban.client.SelectionBuilder.Field("isMonthParkAndRide", Scalar()) 466 | def isMonthSeason: SelectionBuilder[ParkingSpace, Boolean] = 467 | _root_.caliban.client.SelectionBuilder.Field("isMonthSeason", Scalar()) 468 | def tariffDiscount: SelectionBuilder[ParkingSpace, Option[String]] = 469 | _root_.caliban.client.SelectionBuilder.Field("tariffDiscount", OptionOf(Scalar())) 470 | def tariffFreeParkingTime: SelectionBuilder[ParkingSpace, Option[String]] = 471 | _root_.caliban.client.SelectionBuilder.Field("tariffFreeParkingTime", OptionOf(Scalar())) 472 | def tariffDiscountEn: SelectionBuilder[ParkingSpace, Option[String]] = 473 | _root_.caliban.client.SelectionBuilder.Field("tariffDiscountEn", OptionOf(Scalar())) 474 | def tariffPaymentOptions: SelectionBuilder[ParkingSpace, Option[String]] = 475 | _root_.caliban.client.SelectionBuilder.Field("tariffPaymentOptions", OptionOf(Scalar())) 476 | def tariffPaymentCustomerCards: SelectionBuilder[ParkingSpace, Option[String]] = 477 | _root_.caliban.client.SelectionBuilder.Field("tariffPaymentCustomerCards", OptionOf(Scalar())) 478 | def tariffFreeParkingTimeEn: SelectionBuilder[ParkingSpace, Option[String]] = 479 | _root_.caliban.client.SelectionBuilder.Field("tariffFreeParkingTimeEn", OptionOf(Scalar())) 480 | def tariffPaymentOptionsEn: SelectionBuilder[ParkingSpace, Option[String]] = 481 | _root_.caliban.client.SelectionBuilder.Field("tariffPaymentOptionsEn", OptionOf(Scalar())) 482 | def slogan: SelectionBuilder[ParkingSpace, Option[String]] = 483 | _root_.caliban.client.SelectionBuilder.Field("slogan", OptionOf(Scalar())) 484 | def sloganEn: SelectionBuilder[ParkingSpace, Option[String]] = 485 | _root_.caliban.client.SelectionBuilder.Field("sloganEn", OptionOf(Scalar())) 486 | } 487 | 488 | type Photographer 489 | object Photographer { 490 | def name: SelectionBuilder[Photographer, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 491 | def url: SelectionBuilder[Photographer, String] = _root_.caliban.client.SelectionBuilder.Field("url", Scalar()) 492 | } 493 | 494 | type Picture 495 | object Picture { 496 | def id: SelectionBuilder[Picture, Int] = _root_.caliban.client.SelectionBuilder.Field("id", Scalar()) 497 | def url: SelectionBuilder[Picture, String] = _root_.caliban.client.SelectionBuilder.Field("url", Scalar()) 498 | def license: SelectionBuilder[Picture, String] = _root_.caliban.client.SelectionBuilder.Field("license", Scalar()) 499 | def photographer[A](innerSelection: SelectionBuilder[Photographer, A]): SelectionBuilder[Picture, A] = 500 | _root_.caliban.client.SelectionBuilder.Field("photographer", Obj(innerSelection)) 501 | } 502 | 503 | type PriceOption 504 | object PriceOption { 505 | def interval: SelectionBuilder[PriceOption, Option[Int]] = 506 | _root_.caliban.client.SelectionBuilder.Field("interval", OptionOf(Scalar())) 507 | def `type`: SelectionBuilder[PriceOption, String] = _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 508 | def grossamount: SelectionBuilder[PriceOption, Double] = 509 | _root_.caliban.client.SelectionBuilder.Field("grossamount", Scalar()) 510 | def currency: SelectionBuilder[PriceOption, String] = 511 | _root_.caliban.client.SelectionBuilder.Field("currency", Scalar()) 512 | def taxrate: SelectionBuilder[PriceOption, Double] = 513 | _root_.caliban.client.SelectionBuilder.Field("taxrate", Scalar()) 514 | def preferredprice: SelectionBuilder[PriceOption, Boolean] = 515 | _root_.caliban.client.SelectionBuilder.Field("preferredprice", Scalar()) 516 | } 517 | 518 | type Product 519 | object Product { 520 | def name: SelectionBuilder[Product, Option[String]] = 521 | _root_.caliban.client.SelectionBuilder.Field("name", OptionOf(Scalar())) 522 | def `class`: SelectionBuilder[Product, Option[Int]] = 523 | _root_.caliban.client.SelectionBuilder.Field("class", OptionOf(Scalar())) 524 | def productCode: SelectionBuilder[Product, Option[Int]] = 525 | _root_.caliban.client.SelectionBuilder.Field("productCode", OptionOf(Scalar())) 526 | def productName: SelectionBuilder[Product, Option[String]] = 527 | _root_.caliban.client.SelectionBuilder.Field("productName", OptionOf(Scalar())) 528 | } 529 | 530 | type RegionalArea 531 | object RegionalArea { 532 | def number: SelectionBuilder[RegionalArea, Int] = _root_.caliban.client.SelectionBuilder.Field("number", Scalar()) 533 | def name: SelectionBuilder[RegionalArea, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 534 | def shortName: SelectionBuilder[RegionalArea, String] = 535 | _root_.caliban.client.SelectionBuilder.Field("shortName", Scalar()) 536 | } 537 | 538 | type Route 539 | object Route { 540 | def parts[A](innerSelection: SelectionBuilder[RoutePart, A]): SelectionBuilder[Route, List[A]] = 541 | _root_.caliban.client.SelectionBuilder.Field("parts", ListOf(Obj(innerSelection))) 542 | def from[A](innerSelection: SelectionBuilder[Station, A]): SelectionBuilder[Route, Option[A]] = 543 | _root_.caliban.client.SelectionBuilder.Field("from", OptionOf(Obj(innerSelection))) 544 | def to[A](innerSelection: SelectionBuilder[Station, A]): SelectionBuilder[Route, Option[A]] = 545 | _root_.caliban.client.SelectionBuilder.Field("to", OptionOf(Obj(innerSelection))) 546 | } 547 | 548 | type RoutePart 549 | object RoutePart { 550 | 551 | /** 552 | * Station where the part begins 553 | */ 554 | def from[A](innerSelection: SelectionBuilder[Station, A]): SelectionBuilder[RoutePart, A] = 555 | _root_.caliban.client.SelectionBuilder.Field("from", Obj(innerSelection)) 556 | def to[A](innerSelection: SelectionBuilder[Station, A]): SelectionBuilder[RoutePart, A] = 557 | _root_.caliban.client.SelectionBuilder.Field("to", Obj(innerSelection)) 558 | def delay: SelectionBuilder[RoutePart, Option[Int]] = 559 | _root_.caliban.client.SelectionBuilder.Field("delay", OptionOf(Scalar())) 560 | def product[A](innerSelection: SelectionBuilder[Product, A]): SelectionBuilder[RoutePart, Option[A]] = 561 | _root_.caliban.client.SelectionBuilder.Field("product", OptionOf(Obj(innerSelection))) 562 | def direction: SelectionBuilder[RoutePart, String] = 563 | _root_.caliban.client.SelectionBuilder.Field("direction", Scalar()) 564 | def start: SelectionBuilder[RoutePart, String] = _root_.caliban.client.SelectionBuilder.Field("start", Scalar()) 565 | def end: SelectionBuilder[RoutePart, String] = _root_.caliban.client.SelectionBuilder.Field("end", Scalar()) 566 | def departingTrack[A](innerSelection: SelectionBuilder[Track, A]): SelectionBuilder[RoutePart, Option[A]] = 567 | _root_.caliban.client.SelectionBuilder.Field("departingTrack", OptionOf(Obj(innerSelection))) 568 | def arrivingTrack[A](innerSelection: SelectionBuilder[Track, A]): SelectionBuilder[RoutePart, Option[A]] = 569 | _root_.caliban.client.SelectionBuilder.Field("arrivingTrack", OptionOf(Obj(innerSelection))) 570 | } 571 | 572 | type Searchable 573 | object Searchable { 574 | def stations[A](innerSelection: SelectionBuilder[Station, A]): SelectionBuilder[Searchable, List[A]] = 575 | _root_.caliban.client.SelectionBuilder.Field("stations", ListOf(Obj(innerSelection))) 576 | def operationLocations[A]( 577 | innerSelection: SelectionBuilder[OperationLocation, A] 578 | ): SelectionBuilder[Searchable, List[A]] = 579 | _root_.caliban.client.SelectionBuilder.Field("operationLocations", ListOf(Obj(innerSelection))) 580 | } 581 | 582 | type Station 583 | object Station { 584 | def primaryEvaId: SelectionBuilder[Station, Option[Int]] = 585 | _root_.caliban.client.SelectionBuilder.Field("primaryEvaId", OptionOf(Scalar())) 586 | def stationNumber: SelectionBuilder[Station, Option[Int]] = 587 | _root_.caliban.client.SelectionBuilder.Field("stationNumber", OptionOf(Scalar())) 588 | def primaryRil100: SelectionBuilder[Station, Option[String]] = 589 | _root_.caliban.client.SelectionBuilder.Field("primaryRil100", OptionOf(Scalar())) 590 | def name: SelectionBuilder[Station, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 591 | def location[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[Station, Option[A]] = 592 | _root_.caliban.client.SelectionBuilder.Field("location", OptionOf(Obj(innerSelection))) 593 | def category: SelectionBuilder[Station, Int] = _root_.caliban.client.SelectionBuilder.Field("category", Scalar()) 594 | def priceCategory: SelectionBuilder[Station, Int] = 595 | _root_.caliban.client.SelectionBuilder.Field("priceCategory", Scalar()) 596 | def hasParking: SelectionBuilder[Station, Boolean] = 597 | _root_.caliban.client.SelectionBuilder.Field("hasParking", Scalar()) 598 | def hasBicycleParking: SelectionBuilder[Station, Boolean] = 599 | _root_.caliban.client.SelectionBuilder.Field("hasBicycleParking", Scalar()) 600 | def hasLocalPublicTransport: SelectionBuilder[Station, Boolean] = 601 | _root_.caliban.client.SelectionBuilder.Field("hasLocalPublicTransport", Scalar()) 602 | def hasPublicFacilities: SelectionBuilder[Station, Boolean] = 603 | _root_.caliban.client.SelectionBuilder.Field("hasPublicFacilities", Scalar()) 604 | def hasLockerSystem: SelectionBuilder[Station, Boolean] = 605 | _root_.caliban.client.SelectionBuilder.Field("hasLockerSystem", Scalar()) 606 | def hasTaxiRank: SelectionBuilder[Station, Boolean] = 607 | _root_.caliban.client.SelectionBuilder.Field("hasTaxiRank", Scalar()) 608 | def hasTravelNecessities: SelectionBuilder[Station, Boolean] = 609 | _root_.caliban.client.SelectionBuilder.Field("hasTravelNecessities", Scalar()) 610 | def hasSteplessAccess: SelectionBuilder[Station, String] = 611 | _root_.caliban.client.SelectionBuilder.Field("hasSteplessAccess", Scalar()) 612 | def hasMobilityService: SelectionBuilder[Station, String] = 613 | _root_.caliban.client.SelectionBuilder.Field("hasMobilityService", Scalar()) 614 | def federalState: SelectionBuilder[Station, String] = 615 | _root_.caliban.client.SelectionBuilder.Field("federalState", Scalar()) 616 | def regionalArea[A](innerSelection: SelectionBuilder[RegionalArea, A]): SelectionBuilder[Station, A] = 617 | _root_.caliban.client.SelectionBuilder.Field("regionalArea", Obj(innerSelection)) 618 | def facilities[A](innerSelection: SelectionBuilder[Facility, A]): SelectionBuilder[Station, List[A]] = 619 | _root_.caliban.client.SelectionBuilder.Field("facilities", ListOf(Obj(innerSelection))) 620 | def mailingAddress[A](innerSelection: SelectionBuilder[MailingAddress, A]): SelectionBuilder[Station, A] = 621 | _root_.caliban.client.SelectionBuilder.Field("mailingAddress", Obj(innerSelection)) 622 | def DBInformationOpeningTimes[A]( 623 | innerSelection: SelectionBuilder[OpeningTimes, A] 624 | ): SelectionBuilder[Station, Option[A]] = 625 | _root_.caliban.client.SelectionBuilder.Field("DBInformationOpeningTimes", OptionOf(Obj(innerSelection))) 626 | def localServiceStaffAvailability[A]( 627 | innerSelection: SelectionBuilder[OpeningTimes, A] 628 | ): SelectionBuilder[Station, Option[A]] = 629 | _root_.caliban.client.SelectionBuilder.Field("localServiceStaffAvailability", OptionOf(Obj(innerSelection))) 630 | def aufgabentraeger[A](innerSelection: SelectionBuilder[StationContact, A]): SelectionBuilder[Station, A] = 631 | _root_.caliban.client.SelectionBuilder.Field("aufgabentraeger", Obj(innerSelection)) 632 | def timeTableOffice[A](innerSelection: SelectionBuilder[StationContact, A]): SelectionBuilder[Station, Option[A]] = 633 | _root_.caliban.client.SelectionBuilder.Field("timeTableOffice", OptionOf(Obj(innerSelection))) 634 | def szentrale[A](innerSelection: SelectionBuilder[StationContact, A]): SelectionBuilder[Station, A] = 635 | _root_.caliban.client.SelectionBuilder.Field("szentrale", Obj(innerSelection)) 636 | def stationManagement[A](innerSelection: SelectionBuilder[StationContact, A]): SelectionBuilder[Station, A] = 637 | _root_.caliban.client.SelectionBuilder.Field("stationManagement", Obj(innerSelection)) 638 | def timetable[A](innerSelection: SelectionBuilder[Timetable, A]): SelectionBuilder[Station, A] = 639 | _root_.caliban.client.SelectionBuilder.Field("timetable", Obj(innerSelection)) 640 | def parkingSpaces[A](innerSelection: SelectionBuilder[ParkingSpace, A]): SelectionBuilder[Station, List[A]] = 641 | _root_.caliban.client.SelectionBuilder.Field("parkingSpaces", ListOf(Obj(innerSelection))) 642 | def hasSteamPermission: SelectionBuilder[Station, Boolean] = 643 | _root_.caliban.client.SelectionBuilder.Field("hasSteamPermission", Scalar()) 644 | def hasWiFi: SelectionBuilder[Station, Boolean] = _root_.caliban.client.SelectionBuilder.Field("hasWiFi", Scalar()) 645 | def hasTravelCenter: SelectionBuilder[Station, Boolean] = 646 | _root_.caliban.client.SelectionBuilder.Field("hasTravelCenter", Scalar()) 647 | def hasRailwayMission: SelectionBuilder[Station, Boolean] = 648 | _root_.caliban.client.SelectionBuilder.Field("hasRailwayMission", Scalar()) 649 | def hasDBLounge: SelectionBuilder[Station, Boolean] = 650 | _root_.caliban.client.SelectionBuilder.Field("hasDBLounge", Scalar()) 651 | def hasLostAndFound: SelectionBuilder[Station, Boolean] = 652 | _root_.caliban.client.SelectionBuilder.Field("hasLostAndFound", Scalar()) 653 | def hasCarRental: SelectionBuilder[Station, Boolean] = 654 | _root_.caliban.client.SelectionBuilder.Field("hasCarRental", Scalar()) 655 | def tracks[A](innerSelection: SelectionBuilder[Track, A]): SelectionBuilder[Station, List[A]] = 656 | _root_.caliban.client.SelectionBuilder.Field("tracks", ListOf(Obj(innerSelection))) 657 | def picture[A](innerSelection: SelectionBuilder[Picture, A]): SelectionBuilder[Station, Option[A]] = 658 | _root_.caliban.client.SelectionBuilder.Field("picture", OptionOf(Obj(innerSelection))) 659 | } 660 | 661 | type StationContact 662 | object StationContact { 663 | def name: SelectionBuilder[StationContact, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 664 | def shortName: SelectionBuilder[StationContact, Option[String]] = 665 | _root_.caliban.client.SelectionBuilder.Field("shortName", OptionOf(Scalar())) 666 | def email: SelectionBuilder[StationContact, Option[String]] = 667 | _root_.caliban.client.SelectionBuilder.Field("email", OptionOf(Scalar())) 668 | def number: SelectionBuilder[StationContact, Option[String]] = 669 | _root_.caliban.client.SelectionBuilder.Field("number", OptionOf(Scalar())) 670 | def phoneNumber: SelectionBuilder[StationContact, Option[String]] = 671 | _root_.caliban.client.SelectionBuilder.Field("phoneNumber", OptionOf(Scalar())) 672 | } 673 | 674 | type Timetable 675 | object Timetable { 676 | def nextArrivals[A](innerSelection: SelectionBuilder[TrainInStation, A]): SelectionBuilder[Timetable, List[A]] = 677 | _root_.caliban.client.SelectionBuilder.Field("nextArrivals", ListOf(Obj(innerSelection))) 678 | def nextDepatures[A](innerSelection: SelectionBuilder[TrainInStation, A]): SelectionBuilder[Timetable, List[A]] = 679 | _root_.caliban.client.SelectionBuilder.Field("nextDepatures", ListOf(Obj(innerSelection))) 680 | } 681 | 682 | type Track 683 | object Track { 684 | def platform: SelectionBuilder[Track, String] = _root_.caliban.client.SelectionBuilder.Field("platform", Scalar()) 685 | def number: SelectionBuilder[Track, String] = _root_.caliban.client.SelectionBuilder.Field("number", Scalar()) 686 | def name: SelectionBuilder[Track, String] = _root_.caliban.client.SelectionBuilder.Field("name", Scalar()) 687 | 688 | /** 689 | * Length of the platform in cm 690 | */ 691 | def length: SelectionBuilder[Track, Option[Int]] = 692 | _root_.caliban.client.SelectionBuilder.Field("length", OptionOf(Scalar())) 693 | 694 | /** 695 | * Height of the platform in cm 696 | */ 697 | def height: SelectionBuilder[Track, Int] = _root_.caliban.client.SelectionBuilder.Field("height", Scalar()) 698 | } 699 | 700 | type TrainInStation 701 | object TrainInStation { 702 | def `type`: SelectionBuilder[TrainInStation, String] = 703 | _root_.caliban.client.SelectionBuilder.Field("type", Scalar()) 704 | def trainNumber: SelectionBuilder[TrainInStation, String] = 705 | _root_.caliban.client.SelectionBuilder.Field("trainNumber", Scalar()) 706 | def platform: SelectionBuilder[TrainInStation, String] = 707 | _root_.caliban.client.SelectionBuilder.Field("platform", Scalar()) 708 | def time: SelectionBuilder[TrainInStation, String] = _root_.caliban.client.SelectionBuilder.Field("time", Scalar()) 709 | def stops: SelectionBuilder[TrainInStation, List[String]] = 710 | _root_.caliban.client.SelectionBuilder.Field("stops", ListOf(Scalar())) 711 | } 712 | 713 | type TravelCenter 714 | object TravelCenter { 715 | def id: SelectionBuilder[TravelCenter, Option[Int]] = 716 | _root_.caliban.client.SelectionBuilder.Field("id", OptionOf(Scalar())) 717 | def name: SelectionBuilder[TravelCenter, Option[String]] = 718 | _root_.caliban.client.SelectionBuilder.Field("name", OptionOf(Scalar())) 719 | def address[A](innerSelection: SelectionBuilder[MailingAddress, A]): SelectionBuilder[TravelCenter, Option[A]] = 720 | _root_.caliban.client.SelectionBuilder.Field("address", OptionOf(Obj(innerSelection))) 721 | def `type`: SelectionBuilder[TravelCenter, Option[String]] = 722 | _root_.caliban.client.SelectionBuilder.Field("type", OptionOf(Scalar())) 723 | def location[A](innerSelection: SelectionBuilder[Location, A]): SelectionBuilder[TravelCenter, Option[A]] = 724 | _root_.caliban.client.SelectionBuilder.Field("location", OptionOf(Obj(innerSelection))) 725 | } 726 | 727 | type Query = _root_.caliban.client.Operations.RootQuery 728 | object Query { 729 | def routing[A](from: Int, to: Int)(innerSelection: SelectionBuilder[Route, A])( 730 | implicit encoder0: ArgEncoder[Int], 731 | encoder1: ArgEncoder[Int] 732 | ): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, List[A]] = 733 | _root_.caliban.client.SelectionBuilder.Field( 734 | "routing", 735 | ListOf(Obj(innerSelection)), 736 | arguments = List(Argument("from", from, "Int!")(encoder0), Argument("to", to, "Int!")(encoder1)) 737 | ) 738 | def stationWithEvaId[A](evaId: Int)( 739 | innerSelection: SelectionBuilder[Station, A] 740 | )(implicit encoder0: ArgEncoder[Int]): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, Option[A]] = 741 | _root_.caliban.client.SelectionBuilder.Field( 742 | "stationWithEvaId", 743 | OptionOf(Obj(innerSelection)), 744 | arguments = List(Argument("evaId", evaId, "Int!")(encoder0)) 745 | ) 746 | def stationWithStationNumber[A](stationNumber: Int)( 747 | innerSelection: SelectionBuilder[Station, A] 748 | )(implicit encoder0: ArgEncoder[Int]): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, Option[A]] = 749 | _root_.caliban.client.SelectionBuilder.Field( 750 | "stationWithStationNumber", 751 | OptionOf(Obj(innerSelection)), 752 | arguments = List(Argument("stationNumber", stationNumber, "Int!")(encoder0)) 753 | ) 754 | def stationWithRill100[A](rill100: String)( 755 | innerSelection: SelectionBuilder[Station, A] 756 | )(implicit encoder0: ArgEncoder[String]): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, Option[A]] = 757 | _root_.caliban.client.SelectionBuilder.Field( 758 | "stationWithRill100", 759 | OptionOf(Obj(innerSelection)), 760 | arguments = List(Argument("rill100", rill100, "String!")(encoder0)) 761 | ) 762 | def search[A](searchTerm: Option[String] = None)( 763 | innerSelection: SelectionBuilder[Searchable, A] 764 | )(implicit encoder0: ArgEncoder[Option[String]]): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, A] = 765 | _root_.caliban.client.SelectionBuilder 766 | .Field("search", Obj(innerSelection), arguments = List(Argument("searchTerm", searchTerm, "String")(encoder0))) 767 | def nearby[A](latitude: Double, longitude: Double, radius: Option[Int] = None)( 768 | innerSelection: SelectionBuilder[Nearby, A] 769 | )( 770 | implicit encoder0: ArgEncoder[Double], 771 | encoder1: ArgEncoder[Double], 772 | encoder2: ArgEncoder[Option[Int]] 773 | ): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, A] = 774 | _root_.caliban.client.SelectionBuilder.Field( 775 | "nearby", 776 | Obj(innerSelection), 777 | arguments = List( 778 | Argument("latitude", latitude, "Float!")(encoder0), 779 | Argument("longitude", longitude, "Float!")(encoder1), 780 | Argument("radius", radius, "Int")(encoder2) 781 | ) 782 | ) 783 | def parkingSpace[A](id: Option[Int] = None)(innerSelection: SelectionBuilder[ParkingSpace, A])( 784 | implicit encoder0: ArgEncoder[Option[Int]] 785 | ): SelectionBuilder[_root_.caliban.client.Operations.RootQuery, Option[A]] = 786 | _root_.caliban.client.SelectionBuilder 787 | .Field("parkingSpace", OptionOf(Obj(innerSelection)), arguments = List(Argument("id", id, "Int")(encoder0))) 788 | } 789 | 790 | } 791 | --------------------------------------------------------------------------------