packages feed

keiro-dsl-0.12.0.0: test/conformance-mapped-queue/Generated/MappedQueue/StructuralProjections.hs

{-# LANGUAGE TypeFamilies #-}
-- @generated by keiro-dsl 0.12.0.0 (language keiro-dsl 5) from context mapped-queue mapped structural facade; do not edit.
-- Equality witnesses are emitted for Text, Int, Bool, Natural, and UTCTime.
-- Int, Natural, and UTCTime belong to Keiki's ordered subset.
module Generated.MappedQueue.StructuralProjections
  ( jobPayloadJobIdWitness
  , jobPayloadLabelWitness
  ) where

import Data.Text (Text)
import Keiro.Codec.Structural (bindingToShape)
import Keiki.Core (FieldProjection (..), FieldWitness, fieldWitness)
import Conformance.MappedQueue.Bindings qualified as Bindings
import Conformance.MappedQueue.Domain (JobPayload)
import Generated.MappedQueue.Structural.Shape.JobPayload qualified as ShapeJobPayload

data JobPayloadJobIdProjection

instance FieldProjection JobPayloadJobIdProjection where
  type FieldName JobPayloadJobIdProjection = "/job_id"
  type FieldOwner JobPayloadJobIdProjection = JobPayload
  type FieldResult JobPayloadJobIdProjection = Text
  fieldShapeId _ = "conformance.mapped-queue.JobPayload.v1"
  projectFieldValue _ owner = ShapeJobPayload.jobId (bindingToShape Bindings.jobPayloadBinding owner)

jobPayloadJobIdWitness :: FieldWitness JobPayloadJobIdProjection
jobPayloadJobIdWitness = fieldWitness @JobPayloadJobIdProjection

data JobPayloadLabelProjection

instance FieldProjection JobPayloadLabelProjection where
  type FieldName JobPayloadLabelProjection = "/label"
  type FieldOwner JobPayloadLabelProjection = JobPayload
  type FieldResult JobPayloadLabelProjection = Text
  fieldShapeId _ = "conformance.mapped-queue.JobPayload.v1"
  projectFieldValue _ owner = ShapeJobPayload.label (bindingToShape Bindings.jobPayloadBinding owner)

jobPayloadLabelWitness :: FieldWitness JobPayloadLabelProjection
jobPayloadLabelWitness = fieldWitness @JobPayloadLabelProjection