keiro-dsl-0.15.0.0: test/conformance-mapped-queue/Generated/MappedQueue/StructuralProjections.hs
{-# LANGUAGE TypeFamilies #-}
-- @generated by keiro-dsl 0.15.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 Generated.MappedQueue.Structural.Shape.JobPayload (JobPayloadShape(jobId, label))
import Conformance.MappedQueue.Bindings qualified as Bindings
import Conformance.MappedQueue.Domain (JobPayload)
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 = (bindingToShape Bindings.jobPayloadBinding owner).jobId
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 = (bindingToShape Bindings.jobPayloadBinding owner).label
jobPayloadLabelWitness :: FieldWitness JobPayloadLabelProjection
jobPayloadLabelWitness = fieldWitness @JobPayloadLabelProjection