keiro-dsl-0.17.0.0: test/conformance-mapped-queue/Generated/MappedQueue/StructuralProjections.hs
{-# LANGUAGE TypeFamilies #-}
-- @generated by keiro-dsl 0.17.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.
-- Nominal ID and enum leaves carry exact canonical-text domains.
-- Int, Natural, and UTCTime belong to Keiki's ordered subset.
module Generated.MappedQueue.StructuralProjections
( jobPayloadJobIdWitness
, jobPayloadJobIdGet
, jobPayloadLabelWitness
, jobPayloadLabelGet
) where
import Data.Text (Text)
import Keiro.Codec.Structural (bindingToShape)
import Keiki.Core (FieldProjection (..), FieldWitness, fieldWitness)
import Generated.MappedQueue.Structural.Shape.JobPayload (JobPayloadShape(jobId, label))
import Conformance.MappedQueue.Bindings qualified as Bindings
import Conformance.MappedQueue.Domain (JobPayload)
data JobPayloadJobIdProjection
jobPayloadJobIdGet :: JobPayload -> Text
jobPayloadJobIdGet owner = (bindingToShape Bindings.jobPayloadBinding owner).jobId
instance FieldProjection JobPayloadJobIdProjection where
type FieldName JobPayloadJobIdProjection = "/job_id"
type FieldOwner JobPayloadJobIdProjection = JobPayload
type FieldResult JobPayloadJobIdProjection = Text
fieldShapeId _ = "conformance.mapped-queue.JobPayload.v1"
projectFieldValue _ = jobPayloadJobIdGet
jobPayloadJobIdWitness :: FieldWitness JobPayloadJobIdProjection
jobPayloadJobIdWitness = fieldWitness @JobPayloadJobIdProjection
data JobPayloadLabelProjection
jobPayloadLabelGet :: JobPayload -> Text
jobPayloadLabelGet owner = (bindingToShape Bindings.jobPayloadBinding owner).label
instance FieldProjection JobPayloadLabelProjection where
type FieldName JobPayloadLabelProjection = "/label"
type FieldOwner JobPayloadLabelProjection = JobPayload
type FieldResult JobPayloadLabelProjection = Text
fieldShapeId _ = "conformance.mapped-queue.JobPayload.v1"
projectFieldValue _ = jobPayloadLabelGet
jobPayloadLabelWitness :: FieldWitness JobPayloadLabelProjection
jobPayloadLabelWitness = fieldWitness @JobPayloadLabelProjection