/** * Generated by API Builder - https://www.apibuilder.io * Service version: 1.0.0-dev * User agent: apibuilder app.apibuilder.io/helicalmoment/zola-takehome/1.0.0-dev/http4s_0_18 */ package org.helicalmoment.zola.takehome.v1.mock { class Client[F[_]: cats.Applicative] extends org.helicalmoment.zola.takehome.v1.interfaces.Client[F] { val baseUrl: org.http4s.Uri = org.http4s.Uri.unsafeFromString("http://mock.localhost") override def invoices: org.helicalmoment.zola.takehome.v1.Invoices[F] = new MockInvoices[F] } class MockInvoices[F[_]: cats.Applicative] extends org.helicalmoment.zola.takehome.v1.Invoices[F] { /** * Insert an invoice */ def put( invoice: org.helicalmoment.zola.takehome.v1.models.Invoice, requestHeaders: Seq[(String, String)] = Nil ): F[org.helicalmoment.zola.takehome.v1.models.Invoice] = cats.Applicative[F].pure { org.helicalmoment.zola.takehome.v1.mock.Factories.makeInvoice() } /** * Find an invoice by invoice_number or po_number. If neither is provided, returns * all invoices. * * @param invoiceNumber An invoice number to search for. * @param poNumber An purchase order number to search for. * @param limit How many records to return. Defaults to 50 if not provided or not in the range 0 * < limit <= 50. * @param offset Pagination offset; e.g., to retrieve the second page of invoices with a limit of * 50, set to 51. If not provided, defaults to 0. */ def get( invoiceNumber: _root_.scala.Option[String] = None, poNumber: _root_.scala.Option[String] = None, limit: _root_.scala.Option[Int] = None, offset: _root_.scala.Option[Int] = None, requestHeaders: Seq[(String, String)] = Nil ): F[Seq[org.helicalmoment.zola.takehome.v1.models.Invoice]] = cats.Applicative[F].pure { Nil } } object Factories { def randomString(length: Int = 24): String = { _root_.scala.util.Random.alphanumeric.take(length).mkString } def makeInvoice(): org.helicalmoment.zola.takehome.v1.models.Invoice = org.helicalmoment.zola.takehome.v1.models.Invoice( id = None, invoiceNumber = Factories.randomString(24), poNumber = Factories.randomString(24), dueDate = _root_.java.time.LocalDate.now, amountCents = 1L, createdAt = None ) } }