diff --git a/Justfile b/Justfile index a53734cee..bef0901dc 100644 --- a/Justfile +++ b/Justfile @@ -110,6 +110,8 @@ codegen-haskell: compile-proto-file --includeDir /usr/include --includeDir schemas/ --includeDir ${PROTOBUF_SRC} --proto ${pb} --out codegen/; \ done find codegen/Monocle -type f -name "*.hs" -exec sed -i {} -e '1i{-# LANGUAGE NoGeneralisedNewtypeDeriving #-}' \; + # Fix for: https://github.com/awakesecurity/proto3-suite/pull/262#issuecomment-2576179003 + find codegen/Monocle -type f -name "*.hs" -exec sed -i {} -e 's/HsProtobuf.String Hs.Text/(HsProtobuf.String Hs.Text)/' \; fourmolu -i codegen/Monocle # Generate javascript data type from protobuf diff --git a/codegen/Monocle/Protob/Auth.hs b/codegen/Monocle/Protob/Auth.hs index dcb3eba85..dd75368f0 100644 --- a/codegen/Monocle/Protob/Auth.hs +++ b/codegen/Monocle/Protob/Auth.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -45,540 +48,413 @@ import Proto3.Wire.Decode qualified as HsProtobuf ( import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs -newtype GetMagicJwtRequest = GetMagicJwtRequest - { getMagicJwtRequestToken :: - Hs.Text - } +newtype GetMagicJwtRequest = GetMagicJwtRequest {getMagicJwtRequestToken :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetMagicJwtRequest - -instance HsProtobuf.Named GetMagicJwtRequest where - nameOf _ = (Hs.fromString "GetMagicJwtRequest") - -instance HsProtobuf.HasDefault GetMagicJwtRequest - -instance HsProtobuf.Message GetMagicJwtRequest where - encodeMessage - _ - GetMagicJwtRequest - { getMagicJwtRequestToken = - getMagicJwtRequestToken - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getMagicJwtRequestToken) - ) - ) - ] - ) +instance (Hs.NFData GetMagicJwtRequest) +instance (HsProtobuf.Named GetMagicJwtRequest) where + nameOf _ = Hs.fromString "GetMagicJwtRequest" +instance (HsProtobuf.HasDefault GetMagicJwtRequest) +instance (HsProtobuf.Message GetMagicJwtRequest) where + encodeMessage _ GetMagicJwtRequest {getMagicJwtRequestToken} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getMagicJwtRequestToken + ) + ) decodeMessage _ = - (Hs.pure GetMagicJwtRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetMagicJwtRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "token") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "token") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetMagicJwtRequest where +instance (HsJSONPB.ToJSONPB GetMagicJwtRequest) where toJSONPB (GetMagicJwtRequest f1) = - ( HsJSONPB.object - [ "token" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["token" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (GetMagicJwtRequest f1) = - ( HsJSONPB.pairs - [ "token" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB GetMagicJwtRequest where + HsJSONPB.pairs + ["token" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB GetMagicJwtRequest) where parseJSONPB = - ( HsJSONPB.withObject - "GetMagicJwtRequest" - ( \obj -> - (Hs.pure GetMagicJwtRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "token") - ) - ) - ) - -instance HsJSONPB.ToJSON GetMagicJwtRequest where + HsJSONPB.withObject + "GetMagicJwtRequest" + ( \obj -> + Hs.pure GetMagicJwtRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "token") + ) + ) +instance (HsJSONPB.ToJSON GetMagicJwtRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetMagicJwtRequest where +instance (HsJSONPB.FromJSON GetMagicJwtRequest) where parseJSON = HsJSONPB.parseJSONPB - data GetMagicJwtError = GetMagicJwtErrorInvalidAdminToken | GetMagicJwtErrorMagicTokenDisabled | GetMagicJwtErrorMagicTokenCreateError deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named GetMagicJwtError where - nameOf _ = (Hs.fromString "GetMagicJwtError") - -instance HsProtobuf.HasDefault GetMagicJwtError - -instance Hs.Bounded GetMagicJwtError where +instance (HsProtobuf.Named GetMagicJwtError) where + nameOf _ = Hs.fromString "GetMagicJwtError" +instance (HsProtobuf.HasDefault GetMagicJwtError) +instance (Hs.Bounded GetMagicJwtError) where minBound = GetMagicJwtErrorInvalidAdminToken maxBound = GetMagicJwtErrorMagicTokenCreateError - -instance Hs.Ord GetMagicJwtError where +instance (Hs.Ord GetMagicJwtError) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum GetMagicJwtError where +instance (HsProtobuf.ProtoEnum GetMagicJwtError) where toProtoEnumMay 0 = Hs.Just GetMagicJwtErrorInvalidAdminToken toProtoEnumMay 1 = Hs.Just GetMagicJwtErrorMagicTokenDisabled toProtoEnumMay 2 = Hs.Just GetMagicJwtErrorMagicTokenCreateError toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (GetMagicJwtErrorInvalidAdminToken) = 0 - fromProtoEnum (GetMagicJwtErrorMagicTokenDisabled) = 1 - fromProtoEnum (GetMagicJwtErrorMagicTokenCreateError) = 2 - -instance HsJSONPB.ToJSONPB GetMagicJwtError where + fromProtoEnum GetMagicJwtErrorInvalidAdminToken = 0 + fromProtoEnum GetMagicJwtErrorMagicTokenDisabled = 1 + fromProtoEnum GetMagicJwtErrorMagicTokenCreateError = 2 +instance (HsJSONPB.ToJSONPB GetMagicJwtError) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB GetMagicJwtError where +instance (HsJSONPB.FromJSONPB GetMagicJwtError) where parseJSONPB (HsJSONPB.String "InvalidAdminToken") = Hs.pure GetMagicJwtErrorInvalidAdminToken parseJSONPB (HsJSONPB.String "MagicTokenDisabled") = Hs.pure GetMagicJwtErrorMagicTokenDisabled parseJSONPB (HsJSONPB.String "MagicTokenCreateError") = Hs.pure GetMagicJwtErrorMagicTokenCreateError - parseJSONPB v = (HsJSONPB.typeMismatch "GetMagicJwtError" v) - -instance HsJSONPB.ToJSON GetMagicJwtError where + parseJSONPB v = HsJSONPB.typeMismatch "GetMagicJwtError" v +instance (HsJSONPB.ToJSON GetMagicJwtError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetMagicJwtError where +instance (HsJSONPB.FromJSON GetMagicJwtError) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite GetMagicJwtError - -newtype GetMagicJwtResponse = GetMagicJwtResponse - { getMagicJwtResponseResult :: - Hs.Maybe GetMagicJwtResponseResult - } +instance (HsProtobuf.Finite GetMagicJwtError) +newtype GetMagicJwtResponse = GetMagicJwtResponse {getMagicJwtResponseResult :: (Hs.Maybe GetMagicJwtResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetMagicJwtResponse - -instance HsProtobuf.Named GetMagicJwtResponse where - nameOf _ = (Hs.fromString "GetMagicJwtResponse") - -instance HsProtobuf.HasDefault GetMagicJwtResponse - -instance HsProtobuf.Message GetMagicJwtResponse where - encodeMessage - _ - GetMagicJwtResponse - { getMagicJwtResponseResult = - getMagicJwtResponseResult - } = - ( Hs.mconcat - [ case getMagicJwtResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - GetMagicJwtResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) - ) - GetMagicJwtResponseResultJwt y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure GetMagicJwtResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. GetMagicJwtResponseResultError)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.Just Hs.. GetMagicJwtResponseResultJwt)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData GetMagicJwtResponse) +instance (HsProtobuf.Named GetMagicJwtResponse) where + nameOf _ = Hs.fromString "GetMagicJwtResponse" +instance (HsProtobuf.HasDefault GetMagicJwtResponse) +instance (HsProtobuf.Message GetMagicJwtResponse) where + encodeMessage _ GetMagicJwtResponse {getMagicJwtResponseResult} = + ( case getMagicJwtResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + GetMagicJwtResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + (HsProtobuf.ForceEmit y) + GetMagicJwtResponseResultJwt y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - ] + ) + decodeMessage _ = + Hs.pure GetMagicJwtResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. GetMagicJwtResponseResultError) + <*> HsProtobuf.decodeMessageField ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB GetMagicJwtResponse where - toJSONPB (GetMagicJwtResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (GetMagicJwtResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (GetMagicJwtResponseResultJwt f2) -> - ( HsJSONPB.pair - "jwt" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.Just Hs.. GetMagicJwtResponseResultJwt) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options ) ] - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB GetMagicJwtResponse) where + toJSONPB (GetMagicJwtResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (GetMagicJwtResponseResultError f1) -> + HsJSONPB.pair "error" f1 + Hs.Just (GetMagicJwtResponseResultJwt f2) -> + HsJSONPB.pair + "jwt" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] toEncodingPB (GetMagicJwtResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (GetMagicJwtResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (GetMagicJwtResponseResultJwt f2) -> - ( HsJSONPB.pair - "jwt" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options - ) - ] - ) - -instance HsJSONPB.FromJSONPB GetMagicJwtResponse where - parseJSONPB = - ( HsJSONPB.withObject - "GetMagicJwtResponse" - ( \obj -> - (Hs.pure GetMagicJwtResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. GetMagicJwtResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just - Hs.. GetMagicJwtResponseResultJwt - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "jwt") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (GetMagicJwtResponseResultError f1) -> + HsJSONPB.pair "error" f1 + Hs.Just (GetMagicJwtResponseResultJwt f2) -> + HsJSONPB.pair + "jwt" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON GetMagicJwtResponse where + ] +instance (HsJSONPB.FromJSONPB GetMagicJwtResponse) where + parseJSONPB = + HsJSONPB.withObject + "GetMagicJwtResponse" + ( \obj -> + Hs.pure GetMagicJwtResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. GetMagicJwtResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just + Hs.. GetMagicJwtResponseResultJwt + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "jwt" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON GetMagicJwtResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetMagicJwtResponse where +instance (HsJSONPB.FromJSON GetMagicJwtResponse) where parseJSON = HsJSONPB.parseJSONPB - data GetMagicJwtResponseResult - = GetMagicJwtResponseResultError - ( HsProtobuf.Enumerated - Monocle.Protob.Auth.GetMagicJwtError - ) + = GetMagicJwtResponseResultError (HsProtobuf.Enumerated Monocle.Protob.Auth.GetMagicJwtError) | GetMagicJwtResponseResultJwt Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetMagicJwtResponseResult - -instance HsProtobuf.Named GetMagicJwtResponseResult where - nameOf _ = (Hs.fromString "GetMagicJwtResponseResult") - +instance (Hs.NFData GetMagicJwtResponseResult) +instance (HsProtobuf.Named GetMagicJwtResponseResult) where + nameOf _ = Hs.fromString "GetMagicJwtResponseResult" newtype WhoAmiRequest = WhoAmiRequest {whoAmiRequestVoid :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData WhoAmiRequest - -instance HsProtobuf.Named WhoAmiRequest where - nameOf _ = (Hs.fromString "WhoAmiRequest") - -instance HsProtobuf.HasDefault WhoAmiRequest - -instance HsProtobuf.Message WhoAmiRequest where - encodeMessage - _ - WhoAmiRequest {whoAmiRequestVoid = whoAmiRequestVoid} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (whoAmiRequestVoid) - ) - ) - ] - ) +instance (Hs.NFData WhoAmiRequest) +instance (HsProtobuf.Named WhoAmiRequest) where + nameOf _ = Hs.fromString "WhoAmiRequest" +instance (HsProtobuf.HasDefault WhoAmiRequest) +instance (HsProtobuf.Message WhoAmiRequest) where + encodeMessage _ WhoAmiRequest {whoAmiRequestVoid} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + whoAmiRequestVoid + ) + ) decodeMessage _ = - (Hs.pure WhoAmiRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure WhoAmiRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "void") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") + [] + "" ] - -instance HsJSONPB.ToJSONPB WhoAmiRequest where +instance (HsJSONPB.ToJSONPB WhoAmiRequest) where toJSONPB (WhoAmiRequest f1) = - ( HsJSONPB.object - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (WhoAmiRequest f1) = - ( HsJSONPB.pairs - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB WhoAmiRequest where + HsJSONPB.pairs + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB WhoAmiRequest) where parseJSONPB = - ( HsJSONPB.withObject - "WhoAmiRequest" - ( \obj -> - (Hs.pure WhoAmiRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "void") - ) - ) - ) - -instance HsJSONPB.ToJSON WhoAmiRequest where + HsJSONPB.withObject + "WhoAmiRequest" + ( \obj -> + Hs.pure WhoAmiRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "void") + ) + ) +instance (HsJSONPB.ToJSON WhoAmiRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON WhoAmiRequest where +instance (HsJSONPB.FromJSON WhoAmiRequest) where parseJSON = HsJSONPB.parseJSONPB - -data WhoAmiError = WhoAmiErrorUnAuthorized +data WhoAmiError + = WhoAmiErrorUnAuthorized deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named WhoAmiError where - nameOf _ = (Hs.fromString "WhoAmiError") - -instance HsProtobuf.HasDefault WhoAmiError - -instance Hs.Bounded WhoAmiError where +instance (HsProtobuf.Named WhoAmiError) where + nameOf _ = Hs.fromString "WhoAmiError" +instance (HsProtobuf.HasDefault WhoAmiError) +instance (Hs.Bounded WhoAmiError) where minBound = WhoAmiErrorUnAuthorized maxBound = WhoAmiErrorUnAuthorized - -instance Hs.Ord WhoAmiError where +instance (Hs.Ord WhoAmiError) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum WhoAmiError where +instance (HsProtobuf.ProtoEnum WhoAmiError) where toProtoEnumMay 0 = Hs.Just WhoAmiErrorUnAuthorized toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (WhoAmiErrorUnAuthorized) = 0 - -instance HsJSONPB.ToJSONPB WhoAmiError where + fromProtoEnum WhoAmiErrorUnAuthorized = 0 +instance (HsJSONPB.ToJSONPB WhoAmiError) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB WhoAmiError where +instance (HsJSONPB.FromJSONPB WhoAmiError) where parseJSONPB (HsJSONPB.String "UnAuthorized") = Hs.pure WhoAmiErrorUnAuthorized - parseJSONPB v = (HsJSONPB.typeMismatch "WhoAmiError" v) - -instance HsJSONPB.ToJSON WhoAmiError where + parseJSONPB v = HsJSONPB.typeMismatch "WhoAmiError" v +instance (HsJSONPB.ToJSON WhoAmiError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON WhoAmiError where +instance (HsJSONPB.FromJSON WhoAmiError) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite WhoAmiError - -newtype WhoAmiResponse = WhoAmiResponse - { whoAmiResponseResult :: - Hs.Maybe WhoAmiResponseResult - } +instance (HsProtobuf.Finite WhoAmiError) +newtype WhoAmiResponse = WhoAmiResponse {whoAmiResponseResult :: (Hs.Maybe WhoAmiResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData WhoAmiResponse - -instance HsProtobuf.Named WhoAmiResponse where - nameOf _ = (Hs.fromString "WhoAmiResponse") - -instance HsProtobuf.HasDefault WhoAmiResponse - -instance HsProtobuf.Message WhoAmiResponse where - encodeMessage - _ - WhoAmiResponse {whoAmiResponseResult = whoAmiResponseResult} = - ( Hs.mconcat - [ case whoAmiResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - WhoAmiResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) - ) - WhoAmiResponseResultUid y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure WhoAmiResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. WhoAmiResponseResultError)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.Just Hs.. WhoAmiResponseResultUid)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData WhoAmiResponse) +instance (HsProtobuf.Named WhoAmiResponse) where + nameOf _ = Hs.fromString "WhoAmiResponse" +instance (HsProtobuf.HasDefault WhoAmiResponse) +instance (HsProtobuf.Message WhoAmiResponse) where + encodeMessage _ WhoAmiResponse {whoAmiResponseResult} = + ( case whoAmiResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + WhoAmiResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + (HsProtobuf.ForceEmit y) + WhoAmiResponseResultUid y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - ] + ) + decodeMessage _ = + Hs.pure WhoAmiResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. WhoAmiResponseResultError) + <*> HsProtobuf.decodeMessageField ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB WhoAmiResponse where - toJSONPB (WhoAmiResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (WhoAmiResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (WhoAmiResponseResultUid f2) -> - ( HsJSONPB.pair - "uid" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.Just Hs.. WhoAmiResponseResultUid) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options ) ] - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB WhoAmiResponse) where + toJSONPB (WhoAmiResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (WhoAmiResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Just (WhoAmiResponseResultUid f2) -> + HsJSONPB.pair + "uid" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] toEncodingPB (WhoAmiResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (WhoAmiResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (WhoAmiResponseResultUid f2) -> - ( HsJSONPB.pair - "uid" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options - ) - ] - ) - -instance HsJSONPB.FromJSONPB WhoAmiResponse where - parseJSONPB = - ( HsJSONPB.withObject - "WhoAmiResponse" - ( \obj -> - (Hs.pure WhoAmiResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. WhoAmiResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just - Hs.. WhoAmiResponseResultUid - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "uid") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (WhoAmiResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Just (WhoAmiResponseResultUid f2) -> + HsJSONPB.pair + "uid" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON WhoAmiResponse where + ] +instance (HsJSONPB.FromJSONPB WhoAmiResponse) where + parseJSONPB = + HsJSONPB.withObject + "WhoAmiResponse" + ( \obj -> + Hs.pure WhoAmiResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. WhoAmiResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just + Hs.. WhoAmiResponseResultUid + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "uid" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON WhoAmiResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON WhoAmiResponse where +instance (HsJSONPB.FromJSON WhoAmiResponse) where parseJSON = HsJSONPB.parseJSONPB - data WhoAmiResponseResult - = WhoAmiResponseResultError - ( HsProtobuf.Enumerated - Monocle.Protob.Auth.WhoAmiError - ) + = WhoAmiResponseResultError (HsProtobuf.Enumerated Monocle.Protob.Auth.WhoAmiError) | WhoAmiResponseResultUid Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData WhoAmiResponseResult - -instance HsProtobuf.Named WhoAmiResponseResult where - nameOf _ = (Hs.fromString "WhoAmiResponseResult") +instance (Hs.NFData WhoAmiResponseResult) +instance (HsProtobuf.Named WhoAmiResponseResult) where + nameOf _ = Hs.fromString "WhoAmiResponseResult" diff --git a/codegen/Monocle/Protob/Change.hs b/codegen/Monocle/Protob/Change.hs index c0329a595..308f5ef5a 100644 --- a/codegen/Monocle/Protob/Change.hs +++ b/codegen/Monocle/Protob/Change.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -49,649 +52,608 @@ import Prelude qualified as Hs data Ident = Ident { identUid :: Hs.Text , identMuid :: Hs.Text - , identGroups :: Hs.Vector Hs.Text + , identGroups :: (Hs.Vector Hs.Text) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Ident - -instance HsProtobuf.Named Ident where - nameOf _ = (Hs.fromString "Ident") - -instance HsProtobuf.HasDefault Ident - -instance HsProtobuf.Message Ident where - encodeMessage - _ - Ident - { identUid = identUid - , identMuid = identMuid - , identGroups = identGroups - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identUid)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identMuid)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (identGroups) - ) +instance (Hs.NFData Ident) +instance (HsProtobuf.Named Ident) where + nameOf _ = Hs.fromString "Ident" +instance (HsProtobuf.HasDefault Ident) +instance (HsProtobuf.Message Ident) where + encodeMessage _ Ident {identUid, identMuid, identGroups} = + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) identUid) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) identMuid) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) ) - ] + identGroups + ) ) decodeMessage _ = - (Hs.pure Ident) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Ident + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "uid") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "muid") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "groups") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "uid") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "muid") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "groups") + [] + "" ] - -instance HsJSONPB.ToJSONPB Ident where +instance (HsJSONPB.ToJSONPB Ident) where toJSONPB (Ident f1 f2 f3) = - ( HsJSONPB.object - [ "uid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "muid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "groups" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.object + [ "uid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "muid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "groups" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - ] - ) + f3 + ) + ] toEncodingPB (Ident f1 f2 f3) = - ( HsJSONPB.pairs - [ "uid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "muid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "groups" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.pairs + [ "uid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "muid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "groups" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - ] - ) - -instance HsJSONPB.FromJSONPB Ident where + f3 + ) + ] +instance (HsJSONPB.FromJSONPB Ident) where parseJSONPB = - ( HsJSONPB.withObject - "Ident" - ( \obj -> - (Hs.pure Ident) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "uid") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "muid") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Ident" + ( \obj -> + Hs.pure Ident + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "uid") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "muid") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "groups") ) - ) - ) - -instance HsJSONPB.ToJSON Ident where + (obj .: "groups") + ) + ) +instance (HsJSONPB.ToJSON Ident) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Ident where +instance (HsJSONPB.FromJSON Ident) where parseJSON = HsJSONPB.parseJSONPB - data ChangedFile = ChangedFile { changedFileAdditions :: Hs.Int32 , changedFileDeletions :: Hs.Int32 , changedFilePath :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangedFile - -instance HsProtobuf.Named ChangedFile where - nameOf _ = (Hs.fromString "ChangedFile") - -instance HsProtobuf.HasDefault ChangedFile - -instance HsProtobuf.Message ChangedFile where +instance (Hs.NFData ChangedFile) +instance (HsProtobuf.Named ChangedFile) where + nameOf _ = Hs.fromString "ChangedFile" +instance (HsProtobuf.HasDefault ChangedFile) +instance (HsProtobuf.Message ChangedFile) where encodeMessage _ ChangedFile - { changedFileAdditions = changedFileAdditions - , changedFileDeletions = changedFileDeletions - , changedFilePath = changedFilePath + { changedFileAdditions + , changedFileDeletions + , changedFilePath } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) changedFileAdditions ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) changedFileDeletions ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changedFilePath) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changedFilePath ) - ] - ) + ) decodeMessage _ = - (Hs.pure ChangedFile) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ChangedFile + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "additions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "deletions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "path") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "additions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "deletions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "path") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangedFile where +instance (HsJSONPB.ToJSONPB ChangedFile) where toJSONPB (ChangedFile f1 f2 f3) = - ( HsJSONPB.object - [ "additions" .= f1 - , "deletions" .= f2 - , "path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) + HsJSONPB.object + [ "additions" .= f1 + , "deletions" .= f2 + , "path" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] toEncodingPB (ChangedFile f1 f2 f3) = - ( HsJSONPB.pairs - [ "additions" .= f1 - , "deletions" .= f2 - , "path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) - -instance HsJSONPB.FromJSONPB ChangedFile where + HsJSONPB.pairs + [ "additions" .= f1 + , "deletions" .= f2 + , "path" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] +instance (HsJSONPB.FromJSONPB ChangedFile) where parseJSONPB = - ( HsJSONPB.withObject - "ChangedFile" - ( \obj -> - (Hs.pure ChangedFile) - <*> obj .: "additions" - <*> obj .: "deletions" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "path") - ) - ) - ) - -instance HsJSONPB.ToJSON ChangedFile where + HsJSONPB.withObject + "ChangedFile" + ( \obj -> + Hs.pure ChangedFile + <*> obj .: "additions" + <*> obj .: "deletions" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "path") + ) + ) +instance (HsJSONPB.ToJSON ChangedFile) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangedFile where +instance (HsJSONPB.FromJSON ChangedFile) where parseJSON = HsJSONPB.parseJSONPB - -newtype ChangedFilePath = ChangedFilePath - { changedFilePathPath :: - Hs.Text - } +newtype ChangedFilePath = ChangedFilePath {changedFilePathPath :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangedFilePath - -instance HsProtobuf.Named ChangedFilePath where - nameOf _ = (Hs.fromString "ChangedFilePath") - -instance HsProtobuf.HasDefault ChangedFilePath - -instance HsProtobuf.Message ChangedFilePath where - encodeMessage - _ - ChangedFilePath {changedFilePathPath = changedFilePathPath} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changedFilePathPath) - ) - ) - ] - ) +instance (Hs.NFData ChangedFilePath) +instance (HsProtobuf.Named ChangedFilePath) where + nameOf _ = Hs.fromString "ChangedFilePath" +instance (HsProtobuf.HasDefault ChangedFilePath) +instance (HsProtobuf.Message ChangedFilePath) where + encodeMessage _ ChangedFilePath {changedFilePathPath} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changedFilePathPath + ) + ) decodeMessage _ = - (Hs.pure ChangedFilePath) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ChangedFilePath + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "path") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "path") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangedFilePath where +instance (HsJSONPB.ToJSONPB ChangedFilePath) where toJSONPB (ChangedFilePath f1) = - ( HsJSONPB.object - [ "path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["path" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (ChangedFilePath f1) = - ( HsJSONPB.pairs - [ "path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB ChangedFilePath where + HsJSONPB.pairs + ["path" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB ChangedFilePath) where parseJSONPB = - ( HsJSONPB.withObject - "ChangedFilePath" - ( \obj -> - (Hs.pure ChangedFilePath) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "path") - ) - ) - ) - -instance HsJSONPB.ToJSON ChangedFilePath where + HsJSONPB.withObject + "ChangedFilePath" + ( \obj -> + Hs.pure ChangedFilePath + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "path") + ) + ) +instance (HsJSONPB.ToJSON ChangedFilePath) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangedFilePath where +instance (HsJSONPB.FromJSON ChangedFilePath) where parseJSON = HsJSONPB.parseJSONPB - data Commit = Commit { commitSha :: Hs.Text - , commitAuthor :: Hs.Maybe Monocle.Protob.Change.Ident - , commitCommitter :: Hs.Maybe Monocle.Protob.Change.Ident - , commitAuthoredAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , commitCommittedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp + , commitAuthor :: (Hs.Maybe Monocle.Protob.Change.Ident) + , commitCommitter :: (Hs.Maybe Monocle.Protob.Change.Ident) + , commitAuthoredAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , commitCommittedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) , commitAdditions :: Hs.Int32 , commitDeletions :: Hs.Int32 , commitTitle :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Commit - -instance HsProtobuf.Named Commit where - nameOf _ = (Hs.fromString "Commit") - -instance HsProtobuf.HasDefault Commit - -instance HsProtobuf.Message Commit where +instance (Hs.NFData Commit) +instance (HsProtobuf.Named Commit) where + nameOf _ = Hs.fromString "Commit" +instance (HsProtobuf.HasDefault Commit) +instance (HsProtobuf.Message Commit) where encodeMessage _ Commit - { commitSha = commitSha - , commitAuthor = commitAuthor - , commitCommitter = commitCommitter - , commitAuthoredAt = commitAuthoredAt - , commitCommittedAt = commitCommittedAt - , commitAdditions = commitAdditions - , commitDeletions = commitDeletions - , commitTitle = commitTitle + { commitSha + , commitAuthor + , commitCommitter + , commitAuthoredAt + , commitCommittedAt + , commitAdditions + , commitDeletions + , commitTitle } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (commitSha)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (commitAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (commitCommitter) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (commitAuthoredAt) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) commitSha) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + commitAuthor + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + commitCommitter + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + commitAuthoredAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + commitCommittedAt + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (commitCommittedAt) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + commitAdditions ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - commitAdditions - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) commitDeletions ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitTitle) - ) - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) commitTitle) + ) decodeMessage _ = - (Hs.pure Commit) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Commit + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 6) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 7) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 6) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 7) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 8) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "sha") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) - ) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) - ) - (HsProtobufAST.Single "committer") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "authored_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "committed_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "additions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "deletions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "title") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "sha") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "committer") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "authored_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "committed_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "additions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "deletions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") + [] + "" ] - -instance HsJSONPB.ToJSONPB Commit where +instance (HsJSONPB.ToJSONPB Commit) where toJSONPB (Commit f1 f2 f3 f4 f5 f6 f7 f8) = - ( HsJSONPB.object - [ "sha" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + HsJSONPB.object + [ "sha" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f2) ) - , "committer" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f2 + ) + , "committer" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f3) ) - , "authored_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f3 + ) + , "authored_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f4) ) - , "committed_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f4 + ) + , "committed_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f5) ) - , "additions" .= f6 - , "deletions" .= f7 - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - ] - ) + f5 + ) + , "additions" .= f6 + , "deletions" .= f7 + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + ] toEncodingPB (Commit f1 f2 f3 f4 f5 f6 f7 f8) = - ( HsJSONPB.pairs - [ "sha" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + HsJSONPB.pairs + [ "sha" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f2) ) - , "committer" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f2 + ) + , "committer" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f3) ) - , "authored_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f3 + ) + , "authored_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f4) ) - , "committed_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f4 + ) + , "committed_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f5) ) - , "additions" .= f6 - , "deletions" .= f7 - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - ] - ) - -instance HsJSONPB.FromJSONPB Commit where + f5 + ) + , "additions" .= f6 + , "deletions" .= f7 + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + ] +instance (HsJSONPB.FromJSONPB Commit) where parseJSONPB = - ( HsJSONPB.withObject - "Commit" - ( \obj -> - (Hs.pure Commit) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "sha") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Commit" + ( \obj -> + Hs.pure Commit + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "sha") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "author") ) - <*> ( HsProtobuf.coerceOver + (obj .: "author") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "committer") ) - <*> ( HsProtobuf.coerceOver + (obj .: "committer") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "authored_at") ) - <*> ( HsProtobuf.coerceOver + (obj .: "authored_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "committed_at") ) - <*> obj .: "additions" - <*> obj .: "deletions" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "title") - ) - ) - ) - -instance HsJSONPB.ToJSON Commit where + (obj .: "committed_at") + ) + <*> obj .: "additions" + <*> obj .: "deletions" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "title") + ) + ) +instance (HsJSONPB.ToJSON Commit) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Commit where +instance (HsJSONPB.FromJSON Commit) where parseJSON = HsJSONPB.parseJSONPB - data Change = Change { changeId :: Hs.Text , changeNumber :: Hs.Int32 @@ -703,725 +665,825 @@ data Change = Change , changeAdditions :: Hs.Int32 , changeDeletions :: Hs.Int32 , changeChangedFilesCount :: Hs.Int32 - , changeChangedFiles :: Hs.Vector Monocle.Protob.Change.ChangedFile - , changeCommits :: Hs.Vector Monocle.Protob.Change.Commit + , changeChangedFiles :: (Hs.Vector Monocle.Protob.Change.ChangedFile) + , changeCommits :: (Hs.Vector Monocle.Protob.Change.Commit) , changeRepositoryPrefix :: Hs.Text , changeRepositoryFullname :: Hs.Text , changeRepositoryShortname :: Hs.Text - , changeAuthor :: Hs.Maybe Monocle.Protob.Change.Ident - , changeOptionalMergedBy :: Hs.Maybe ChangeOptionalMergedBy + , changeAuthor :: (Hs.Maybe Monocle.Protob.Change.Ident) + , changeOptionalMergedBy :: (Hs.Maybe ChangeOptionalMergedBy) , changeBranch :: Hs.Text , changeTargetBranch :: Hs.Text - , changeCreatedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeOptionalMergedAt :: Hs.Maybe ChangeOptionalMergedAt - , changeUpdatedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeOptionalClosedAt :: Hs.Maybe ChangeOptionalClosedAt - , changeState :: - HsProtobuf.Enumerated Monocle.Protob.Change.Change_ChangeState - , changeOptionalDuration :: Hs.Maybe ChangeOptionalDuration + , changeCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeOptionalMergedAt :: (Hs.Maybe ChangeOptionalMergedAt) + , changeUpdatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeOptionalClosedAt :: (Hs.Maybe ChangeOptionalClosedAt) + , changeState :: (HsProtobuf.Enumerated Monocle.Protob.Change.Change_ChangeState) + , changeOptionalDuration :: (Hs.Maybe ChangeOptionalDuration) , changeMergeable :: Hs.Text - , changeLabels :: Hs.Vector Hs.Text - , changeAssignees :: Hs.Vector Monocle.Protob.Change.Ident - , changeApprovals :: Hs.Vector Hs.Text + , changeLabels :: (Hs.Vector Hs.Text) + , changeAssignees :: (Hs.Vector Monocle.Protob.Change.Ident) + , changeApprovals :: (Hs.Vector Hs.Text) , changeDraft :: Hs.Bool - , changeOptionalSelfMerged :: Hs.Maybe ChangeOptionalSelfMerged - , changeOptionalMergedCommitSha :: - Hs.Maybe ChangeOptionalMergedCommitSha + , changeOptionalSelfMerged :: (Hs.Maybe ChangeOptionalSelfMerged) + , changeOptionalMergedCommitSha :: (Hs.Maybe ChangeOptionalMergedCommitSha) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Change - -instance HsProtobuf.Named Change where - nameOf _ = (Hs.fromString "Change") - -instance HsProtobuf.HasDefault Change - -instance HsProtobuf.Message Change where +instance (Hs.NFData Change) +instance (HsProtobuf.Named Change) where + nameOf _ = Hs.fromString "Change" +instance (HsProtobuf.HasDefault Change) +instance (HsProtobuf.Message Change) where encodeMessage _ Change - { changeId = changeId - , changeNumber = changeNumber - , changeChangeId = changeChangeId - , changeTitle = changeTitle - , changeText = changeText - , changeUrl = changeUrl - , changeCommitCount = changeCommitCount - , changeAdditions = changeAdditions - , changeDeletions = changeDeletions - , changeChangedFilesCount = changeChangedFilesCount - , changeChangedFiles = changeChangedFiles - , changeCommits = changeCommits - , changeRepositoryPrefix = changeRepositoryPrefix - , changeRepositoryFullname = changeRepositoryFullname - , changeRepositoryShortname = changeRepositoryShortname - , changeAuthor = changeAuthor - , changeOptionalMergedBy = changeOptionalMergedBy - , changeBranch = changeBranch - , changeTargetBranch = changeTargetBranch - , changeCreatedAt = changeCreatedAt - , changeOptionalMergedAt = changeOptionalMergedAt - , changeUpdatedAt = changeUpdatedAt - , changeOptionalClosedAt = changeOptionalClosedAt - , changeState = changeState - , changeOptionalDuration = changeOptionalDuration - , changeMergeable = changeMergeable - , changeLabels = changeLabels - , changeAssignees = changeAssignees - , changeApprovals = changeApprovals - , changeDraft = changeDraft - , changeOptionalSelfMerged = changeOptionalSelfMerged - , changeOptionalMergedCommitSha = changeOptionalMergedCommitSha + { changeId + , changeNumber + , changeChangeId + , changeTitle + , changeText + , changeUrl + , changeCommitCount + , changeAdditions + , changeDeletions + , changeChangedFilesCount + , changeChangedFiles + , changeCommits + , changeRepositoryPrefix + , changeRepositoryFullname + , changeRepositoryShortname + , changeAuthor + , changeOptionalMergedBy + , changeBranch + , changeTargetBranch + , changeCreatedAt + , changeOptionalMergedAt + , changeUpdatedAt + , changeOptionalClosedAt + , changeState + , changeOptionalDuration + , changeMergeable + , changeLabels + , changeAssignees + , changeApprovals + , changeDraft + , changeOptionalSelfMerged + , changeOptionalMergedCommitSha } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeId)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - changeNumber - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeChangeId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeTitle)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeText)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeUrl)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - changeCommitCount - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - changeAdditions - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 9) - changeDeletions - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - changeChangedFilesCount - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFile) - @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) - (changeChangedFiles) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 12) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Commit) - @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) - (changeCommits) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 13) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeRepositoryPrefix) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 14) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeRepositoryFullname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 15) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeRepositoryShortname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 16) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (changeAuthor) - ) - ) - , case changeOptionalMergedBy of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeOptionalMergedByMergedBy y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 17) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (Hs.Just y) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 1 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeId + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 2 + ) + changeNumber + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 3 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeChangeId + ) + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 4 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeTitle + ) + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 5 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeText + ) + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 6 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeUrl + ) + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 7 + ) + changeCommitCount + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 8 + ) + changeAdditions + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 9 + ) + changeDeletions + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 10 + ) + changeChangedFilesCount + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 11 + ) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangedFile) + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) + ) + changeChangedFiles + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 12) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Commit) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) + ) + changeCommits + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 13) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeRepositoryPrefix + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 14) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeRepositoryFullname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 15) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeRepositoryShortname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 16) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + changeAuthor + ) + ) + ) + ( case changeOptionalMergedBy of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeOptionalMergedByMergedBy y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 17) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + (Hs.Just y) + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 18) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeBranch + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 19) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeTargetBranch + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 20) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeCreatedAt + ) + ) + ) + ( case changeOptionalMergedAt of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeOptionalMergedAtMergedAt y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 21) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + (Hs.Just y) + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 22) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeUpdatedAt + ) + ) + ) + ( case changeOptionalClosedAt of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeOptionalClosedAtClosedAt y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 23) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + (Hs.Just y) + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 24) + changeState + ) + ) + ( case changeOptionalDuration of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeOptionalDurationDuration y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 25) + (HsProtobuf.ForceEmit y) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 26) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeMergeable + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 27) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeLabels + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 18) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeBranch) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 19) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeTargetBranch) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 20) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeCreatedAt) - ) - ) - , case changeOptionalMergedAt of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeOptionalMergedAtMergedAt y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 21) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (Hs.Just y) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 28) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Ident) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) + ) + changeAssignees + ) ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 22) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeUpdatedAt) - ) - ) - , case changeOptionalClosedAt of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeOptionalClosedAtClosedAt y -> ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 23) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (Hs.Just y) + (HsProtobuf.FieldNumber 29) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeApprovals ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 24) - changeState - ) - , case changeOptionalDuration of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeOptionalDurationDuration y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 25) - (HsProtobuf.ForceEmit y) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 26) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeMergeable) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 27) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeLabels) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 28) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Ident) - @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) - (changeAssignees) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 29) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeApprovals) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 30) + changeDraft ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 30) - changeDraft - ) - , case changeOptionalSelfMerged of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeOptionalSelfMergedSelfMerged y -> - ( HsProtobuf.encodeMessageField + ( case changeOptionalSelfMerged of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeOptionalSelfMergedSelfMerged y -> + HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 31) (HsProtobuf.ForceEmit y) + ) + ) + ( case changeOptionalMergedCommitSha of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeOptionalMergedCommitShaMergedCommitSha y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 32) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , case changeOptionalMergedCommitSha of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeOptionalMergedCommitShaMergedCommitSha y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 32) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - ] - ) + ) decodeMessage _ = - (Hs.pure Change) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Change + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 7) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 8) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 9) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 10) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) - @(Hs.Vector Monocle.Protob.Change.ChangedFile) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 7) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 8) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 9) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 10) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) + @(Hs.Vector Monocle.Protob.Change.ChangedFile) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) - @(Hs.Vector Monocle.Protob.Change.Commit) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) + @(Hs.Vector Monocle.Protob.Change.Commit) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 12) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 13) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 14) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 15) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 16) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 17) - , (Hs.pure (Hs.fmap ChangeOptionalMergedByMergedBy)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 17) + , Hs.pure (Hs.fmap ChangeOptionalMergedByMergedBy) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ] + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 18) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 19) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 20) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 21) - , (Hs.pure (Hs.fmap ChangeOptionalMergedAtMergedAt)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 21) + , Hs.pure (Hs.fmap ChangeOptionalMergedAtMergedAt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ] + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 22) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 23) - , (Hs.pure (Hs.fmap ChangeOptionalClosedAtClosedAt)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (HsProtobuf.decodeMessageField) - ) - ) - ] - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 24) + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 23) + , Hs.pure (Hs.fmap ChangeOptionalClosedAtClosedAt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 25) - , (Hs.pure (Hs.Just Hs.. ChangeOptionalDurationDuration)) - <*> HsProtobuf.decodeMessageField - ) - ] + ] + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 24) + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 25) + , Hs.pure (Hs.Just Hs.. ChangeOptionalDurationDuration) + <*> HsProtobuf.decodeMessageField ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ] + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 26) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 27) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) - @(Hs.Vector Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) + @(Hs.Vector Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 28) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 29) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 30) - ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 31) - , (Hs.pure (Hs.Just Hs.. ChangeOptionalSelfMergedSelfMerged)) - <*> HsProtobuf.decodeMessageField - ) - ] - ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 32) - , ( Hs.pure - (Hs.Just Hs.. ChangeOptionalMergedCommitShaMergedCommitSha) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) - ) - ] - ) - dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "number") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "change_id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "title") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "text") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "commit_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "additions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 9) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "deletions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "changed_files_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "ChangedFile")) - ) - (HsProtobufAST.Single "changed_files") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 12) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Commit")) - ) - (HsProtobufAST.Single "commits") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 13) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_prefix") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 14) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_fullname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 15) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_shortname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 16) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) - ) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 18) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "branch") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 19) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "target_branch") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 20) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 30) + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 31) + , Hs.pure (Hs.Just Hs.. ChangeOptionalSelfMergedSelfMerged) + <*> HsProtobuf.decodeMessageField ) - (HsProtobufAST.Single "created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 22) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 32) + , Hs.pure (Hs.Just Hs.. ChangeOptionalMergedCommitShaMergedCommitSha) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - ) ) - (HsProtobufAST.Single "updated_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 24) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "ChangeState")) - ) - (HsProtobufAST.Single "state") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 26) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "mergeable") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 27) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "labels") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 28) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) - ) - (HsProtobufAST.Single "assignees") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 29) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "approvals") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 30) - (HsProtobufAST.Prim HsProtobufAST.Bool) - (HsProtobufAST.Single "draft") - [] - "" - ) + ] + dotProto _ = + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "text") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "commit_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "additions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 9) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "deletions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "changed_files_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ChangedFile")) + ) + (HsProtobufAST.Single "changed_files") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 12) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Commit")) + ) + (HsProtobufAST.Single "commits") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 13) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 14) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 15) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 16) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 18) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 19) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "target_branch") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 20) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 22) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "updated_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 24) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ChangeState")) + ) + (HsProtobufAST.Single "state") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 26) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "mergeable") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 27) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 28) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "assignees") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 29) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approvals") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 30) + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "draft") + [] + "" ] - -instance HsJSONPB.ToJSONPB Change where +instance (HsJSONPB.ToJSONPB Change) where toJSONPB ( Change f1 @@ -1457,168 +1519,199 @@ instance HsJSONPB.ToJSONPB Change where f31 f32 ) = - ( HsJSONPB.object - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "number" .= f2 - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "text" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "commit_count" .= f7 - , "additions" .= f8 - , "deletions" .= f9 - , "changed_files_count" .= f10 - , "changed_files" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFile) + HsJSONPB.object + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "number" .= f2 + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "text" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "commit_count" .= f7 + , "additions" .= f8 + , "deletions" .= f9 + , "changed_files_count" .= f10 + , "changed_files" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangedFile) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) - (f11) ) - , "commits" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Commit) + f11 + ) + , "commits" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Commit) @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) - (f12) ) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f13)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f14)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f12 + ) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f13) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f14) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f15) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f16) ) - , ( let encodeOptional_merged_by = - ( case f17 of - Hs.Just (ChangeOptionalMergedByMergedBy f17) -> - (HsJSONPB.pair "merged_by" f17) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_by" - .= (HsJSONPB.objectOrNull [encodeOptional_merged_by] options) - ) - options - else encodeOptional_merged_by options - ) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f18)) - , "target_branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f19)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f16 + ) + , ( let + encodeOptional_merged_by = + ( case f17 of + Hs.Just (ChangeOptionalMergedByMergedBy f17) -> + HsJSONPB.pair "merged_by" f17 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_by" + .= HsJSONPB.objectOrNull [encodeOptional_merged_by] options + ) + options + else encodeOptional_merged_by options + ) + ) + , "branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f18) + , "target_branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f19) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f20) ) - , ( let encodeOptional_merged_at = - ( case f21 of - Hs.Just (ChangeOptionalMergedAtMergedAt f21) -> - (HsJSONPB.pair "merged_at" f21) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_at" - .= (HsJSONPB.objectOrNull [encodeOptional_merged_at] options) - ) - options - else encodeOptional_merged_at options - ) - , "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f20 + ) + , ( let + encodeOptional_merged_at = + ( case f21 of + Hs.Just (ChangeOptionalMergedAtMergedAt f21) -> + HsJSONPB.pair "merged_at" f21 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_at" + .= HsJSONPB.objectOrNull [encodeOptional_merged_at] options + ) + options + else encodeOptional_merged_at options + ) + ) + , "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f22) ) - , ( let encodeOptional_closed_at = - ( case f23 of - Hs.Just (ChangeOptionalClosedAtClosedAt f23) -> - (HsJSONPB.pair "closed_at" f23) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_closed_at" - .= (HsJSONPB.objectOrNull [encodeOptional_closed_at] options) - ) - options - else encodeOptional_closed_at options - ) - , "state" .= f24 - , ( let encodeOptional_duration = - ( case f25 of - Hs.Just (ChangeOptionalDurationDuration f25) -> - (HsJSONPB.pair "duration" f25) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_duration" - .= (HsJSONPB.objectOrNull [encodeOptional_duration] options) - ) - options - else encodeOptional_duration options - ) - , "mergeable" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f26)) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f22 + ) + , ( let + encodeOptional_closed_at = + ( case f23 of + Hs.Just (ChangeOptionalClosedAtClosedAt f23) -> + HsJSONPB.pair "closed_at" f23 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_closed_at" + .= HsJSONPB.objectOrNull [encodeOptional_closed_at] options + ) + options + else encodeOptional_closed_at options + ) + ) + , "state" .= f24 + , ( let + encodeOptional_duration = + ( case f25 of + Hs.Just (ChangeOptionalDurationDuration f25) -> + HsJSONPB.pair "duration" f25 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_duration" + .= HsJSONPB.objectOrNull [encodeOptional_duration] options + ) + options + else encodeOptional_duration options + ) + ) + , "mergeable" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f26) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f27) ) - , "assignees" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Ident) + f27 + ) + , "assignees" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Ident) @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) - (f28) ) - , "approvals" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f28 + ) + , "approvals" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f29) ) - , "draft" .= f30 - , ( let encodeOptional_self_merged = - ( case f31 of - Hs.Just (ChangeOptionalSelfMergedSelfMerged f31) -> - (HsJSONPB.pair "self_merged" f31) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_self_merged" - .= (HsJSONPB.objectOrNull [encodeOptional_self_merged] options) - ) - options - else encodeOptional_self_merged options - ) - , ( let encodeOptional_merged_commit_sha = - ( case f32 of - Hs.Just (ChangeOptionalMergedCommitShaMergedCommitSha f32) -> - ( HsJSONPB.pair - "merged_commit_sha" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f32)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_commit_sha" - .= (HsJSONPB.objectOrNull [encodeOptional_merged_commit_sha] options) - ) - options - else encodeOptional_merged_commit_sha options - ) - ] - ) + f29 + ) + , "draft" .= f30 + , ( let + encodeOptional_self_merged = + ( case f31 of + Hs.Just (ChangeOptionalSelfMergedSelfMerged f31) -> + HsJSONPB.pair "self_merged" f31 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_self_merged" + .= HsJSONPB.objectOrNull [encodeOptional_self_merged] options + ) + options + else encodeOptional_self_merged options + ) + ) + , ( let + encodeOptional_merged_commit_sha = + ( case f32 of + Hs.Just (ChangeOptionalMergedCommitShaMergedCommitSha f32) -> + HsJSONPB.pair + "merged_commit_sha" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f32) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_commit_sha" + .= HsJSONPB.objectOrNull [encodeOptional_merged_commit_sha] options + ) + options + else encodeOptional_merged_commit_sha options + ) + ) + ] toEncodingPB ( Change f1 @@ -1654,733 +1747,677 @@ instance HsJSONPB.ToJSONPB Change where f31 f32 ) = - ( HsJSONPB.pairs - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "number" .= f2 - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "text" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "commit_count" .= f7 - , "additions" .= f8 - , "deletions" .= f9 - , "changed_files_count" .= f10 - , "changed_files" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFile) + HsJSONPB.pairs + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "number" .= f2 + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "text" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "commit_count" .= f7 + , "additions" .= f8 + , "deletions" .= f9 + , "changed_files_count" .= f10 + , "changed_files" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangedFile) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) - (f11) ) - , "commits" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Commit) + f11 + ) + , "commits" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Commit) @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) - (f12) ) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f13)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f14)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f12 + ) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f13) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f14) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f15) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f16) ) - , ( let encodeOptional_merged_by = - ( case f17 of - Hs.Just (ChangeOptionalMergedByMergedBy f17) -> - (HsJSONPB.pair "merged_by" f17) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_by" - .= (HsJSONPB.pairsOrNull [encodeOptional_merged_by] options) - ) - options - else encodeOptional_merged_by options - ) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f18)) - , "target_branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f19)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f16 + ) + , ( let + encodeOptional_merged_by = + ( case f17 of + Hs.Just (ChangeOptionalMergedByMergedBy f17) -> + HsJSONPB.pair "merged_by" f17 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_by" + .= HsJSONPB.pairsOrNull [encodeOptional_merged_by] options + ) + options + else encodeOptional_merged_by options + ) + ) + , "branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f18) + , "target_branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f19) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f20) ) - , ( let encodeOptional_merged_at = - ( case f21 of - Hs.Just (ChangeOptionalMergedAtMergedAt f21) -> - (HsJSONPB.pair "merged_at" f21) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_at" - .= (HsJSONPB.pairsOrNull [encodeOptional_merged_at] options) - ) - options - else encodeOptional_merged_at options - ) - , "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f20 + ) + , ( let + encodeOptional_merged_at = + ( case f21 of + Hs.Just (ChangeOptionalMergedAtMergedAt f21) -> + HsJSONPB.pair "merged_at" f21 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_at" + .= HsJSONPB.pairsOrNull [encodeOptional_merged_at] options + ) + options + else encodeOptional_merged_at options + ) + ) + , "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f22) ) - , ( let encodeOptional_closed_at = - ( case f23 of - Hs.Just (ChangeOptionalClosedAtClosedAt f23) -> - (HsJSONPB.pair "closed_at" f23) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_closed_at" - .= (HsJSONPB.pairsOrNull [encodeOptional_closed_at] options) - ) - options - else encodeOptional_closed_at options - ) - , "state" .= f24 - , ( let encodeOptional_duration = - ( case f25 of - Hs.Just (ChangeOptionalDurationDuration f25) -> - (HsJSONPB.pair "duration" f25) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_duration" - .= (HsJSONPB.pairsOrNull [encodeOptional_duration] options) - ) - options - else encodeOptional_duration options - ) - , "mergeable" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f26)) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f22 + ) + , ( let + encodeOptional_closed_at = + ( case f23 of + Hs.Just (ChangeOptionalClosedAtClosedAt f23) -> + HsJSONPB.pair "closed_at" f23 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_closed_at" + .= HsJSONPB.pairsOrNull [encodeOptional_closed_at] options + ) + options + else encodeOptional_closed_at options + ) + ) + , "state" .= f24 + , ( let + encodeOptional_duration = + ( case f25 of + Hs.Just (ChangeOptionalDurationDuration f25) -> + HsJSONPB.pair "duration" f25 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_duration" + .= HsJSONPB.pairsOrNull [encodeOptional_duration] options + ) + options + else encodeOptional_duration options + ) + ) + , "mergeable" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f26) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f27) ) - , "assignees" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Ident) + f27 + ) + , "assignees" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Ident) @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) - (f28) ) - , "approvals" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f28 + ) + , "approvals" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f29) ) - , "draft" .= f30 - , ( let encodeOptional_self_merged = - ( case f31 of - Hs.Just (ChangeOptionalSelfMergedSelfMerged f31) -> - (HsJSONPB.pair "self_merged" f31) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_self_merged" - .= (HsJSONPB.pairsOrNull [encodeOptional_self_merged] options) - ) - options - else encodeOptional_self_merged options - ) - , ( let encodeOptional_merged_commit_sha = - ( case f32 of - Hs.Just (ChangeOptionalMergedCommitShaMergedCommitSha f32) -> - ( HsJSONPB.pair - "merged_commit_sha" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f32)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_commit_sha" - .= (HsJSONPB.pairsOrNull [encodeOptional_merged_commit_sha] options) - ) - options - else encodeOptional_merged_commit_sha options - ) - ] - ) - -instance HsJSONPB.FromJSONPB Change where + f29 + ) + , "draft" .= f30 + , ( let + encodeOptional_self_merged = + ( case f31 of + Hs.Just (ChangeOptionalSelfMergedSelfMerged f31) -> + HsJSONPB.pair "self_merged" f31 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_self_merged" + .= HsJSONPB.pairsOrNull [encodeOptional_self_merged] options + ) + options + else encodeOptional_self_merged options + ) + ) + , ( let + encodeOptional_merged_commit_sha = + ( case f32 of + Hs.Just (ChangeOptionalMergedCommitShaMergedCommitSha f32) -> + HsJSONPB.pair + "merged_commit_sha" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f32) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_commit_sha" + .= HsJSONPB.pairsOrNull [encodeOptional_merged_commit_sha] options + ) + options + else encodeOptional_merged_commit_sha options + ) + ) + ] +instance (HsJSONPB.FromJSONPB Change) where parseJSONPB = - ( HsJSONPB.withObject - "Change" - ( \obj -> - (Hs.pure Change) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "id") - ) - <*> obj .: "number" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "change_id") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "title") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "text") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") - ) - <*> obj .: "commit_count" - <*> obj .: "additions" - <*> obj .: "deletions" - <*> obj .: "changed_files_count" - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Change" + ( \obj -> + Hs.pure Change + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "id") + ) + <*> obj .: "number" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "change_id") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "title") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "text") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> obj .: "commit_count" + <*> obj .: "additions" + <*> obj .: "deletions" + <*> obj .: "changed_files_count" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) @(Hs.Vector Monocle.Protob.Change.ChangedFile) - (obj .: "changed_files") ) - <*> ( HsProtobuf.coerceOver + (obj .: "changed_files") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) @(Hs.Vector Monocle.Protob.Change.Commit) - (obj .: "commits") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_prefix") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_fullname") ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_shortname") - ) - <*> ( HsProtobuf.coerceOver + (obj .: "commits") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_prefix") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_fullname") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_shortname") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "author") - ) - <*> ( let parseOptional_merged_by parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeOptionalMergedByMergedBy - <$> (HsJSONPB.parseField parseObj "merged_by") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_merged_by") - Hs.>>= (HsJSONPB.withObject "optional_merged_by" parseOptional_merged_by) - ) - <|> (parseOptional_merged_by obj) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "branch") ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "target_branch") - ) - <*> ( HsProtobuf.coerceOver + (obj .: "author") + ) + <*> ( let + parseOptional_merged_by parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeOptionalMergedByMergedBy + <$> HsJSONPB.parseField parseObj "merged_by" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_merged_by" + Hs.>>= HsJSONPB.withObject "optional_merged_by" parseOptional_merged_by + ) + <|> (parseOptional_merged_by obj) + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "branch") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "target_branch") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") - ) - <*> ( let parseOptional_merged_at parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeOptionalMergedAtMergedAt - <$> (HsJSONPB.parseField parseObj "merged_at") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_merged_at") - Hs.>>= (HsJSONPB.withObject "optional_merged_at" parseOptional_merged_at) - ) - <|> (parseOptional_merged_at obj) ) - <*> ( HsProtobuf.coerceOver + (obj .: "created_at") + ) + <*> ( let + parseOptional_merged_at parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeOptionalMergedAtMergedAt + <$> HsJSONPB.parseField parseObj "merged_at" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_merged_at" + Hs.>>= HsJSONPB.withObject "optional_merged_at" parseOptional_merged_at + ) + <|> (parseOptional_merged_at obj) + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "updated_at") - ) - <*> ( let parseOptional_closed_at parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeOptionalClosedAtClosedAt - <$> (HsJSONPB.parseField parseObj "closed_at") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_closed_at") - Hs.>>= (HsJSONPB.withObject "optional_closed_at" parseOptional_closed_at) - ) - <|> (parseOptional_closed_at obj) - ) - <*> obj .: "state" - <*> ( let parseOptional_duration parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeOptionalDurationDuration - <$> (HsJSONPB.parseField parseObj "duration") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_duration") - Hs.>>= (HsJSONPB.withObject "optional_duration" parseOptional_duration) - ) - <|> (parseOptional_duration obj) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "mergeable") ) - <*> ( HsProtobuf.coerceOver + (obj .: "updated_at") + ) + <*> ( let + parseOptional_closed_at parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeOptionalClosedAtClosedAt + <$> HsJSONPB.parseField parseObj "closed_at" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_closed_at" + Hs.>>= HsJSONPB.withObject "optional_closed_at" parseOptional_closed_at + ) + <|> (parseOptional_closed_at obj) + ) + <*> obj .: "state" + <*> ( let + parseOptional_duration parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeOptionalDurationDuration + <$> HsJSONPB.parseField parseObj "duration" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_duration" + Hs.>>= HsJSONPB.withObject "optional_duration" parseOptional_duration + ) + <|> (parseOptional_duration obj) + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "mergeable") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "labels") ) - <*> ( HsProtobuf.coerceOver + (obj .: "labels") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) @(Hs.Vector Monocle.Protob.Change.Ident) - (obj .: "assignees") ) - <*> ( HsProtobuf.coerceOver + (obj .: "assignees") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "approvals") ) - <*> obj .: "draft" - <*> ( let parseOptional_self_merged parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeOptionalSelfMergedSelfMerged - <$> (HsJSONPB.parseField parseObj "self_merged") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_self_merged") - Hs.>>= ( HsJSONPB.withObject - "optional_self_merged" - parseOptional_self_merged - ) - ) - <|> (parseOptional_self_merged obj) - ) - <*> ( let parseOptional_merged_commit_sha parseObj = - Hs.msum - [ Hs.Just - Hs.. ChangeOptionalMergedCommitShaMergedCommitSha - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "merged_commit_sha") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_merged_commit_sha") - Hs.>>= ( HsJSONPB.withObject - "optional_merged_commit_sha" - parseOptional_merged_commit_sha - ) - ) - <|> (parseOptional_merged_commit_sha obj) - ) - ) - ) - -instance HsJSONPB.ToJSON Change where + (obj .: "approvals") + ) + <*> obj .: "draft" + <*> ( let + parseOptional_self_merged parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeOptionalSelfMergedSelfMerged + <$> HsJSONPB.parseField parseObj "self_merged" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_self_merged" + Hs.>>= HsJSONPB.withObject + "optional_self_merged" + parseOptional_self_merged + ) + <|> (parseOptional_self_merged obj) + ) + <*> ( let + parseOptional_merged_commit_sha parseObj = + Hs.msum + [ Hs.Just + Hs.. ChangeOptionalMergedCommitShaMergedCommitSha + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "merged_commit_sha" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_merged_commit_sha" + Hs.>>= HsJSONPB.withObject + "optional_merged_commit_sha" + parseOptional_merged_commit_sha + ) + <|> (parseOptional_merged_commit_sha obj) + ) + ) +instance (HsJSONPB.ToJSON Change) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Change where +instance (HsJSONPB.FromJSON Change) where parseJSON = HsJSONPB.parseJSONPB - data Change_ChangeState = Change_ChangeStateOpen | Change_ChangeStateMerged | Change_ChangeStateClosed deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named Change_ChangeState where - nameOf _ = (Hs.fromString "Change_ChangeState") - -instance HsProtobuf.HasDefault Change_ChangeState - -instance Hs.Bounded Change_ChangeState where +instance (HsProtobuf.Named Change_ChangeState) where + nameOf _ = Hs.fromString "Change_ChangeState" +instance (HsProtobuf.HasDefault Change_ChangeState) +instance (Hs.Bounded Change_ChangeState) where minBound = Change_ChangeStateOpen maxBound = Change_ChangeStateClosed - -instance Hs.Ord Change_ChangeState where +instance (Hs.Ord Change_ChangeState) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum Change_ChangeState where +instance (HsProtobuf.ProtoEnum Change_ChangeState) where toProtoEnumMay 0 = Hs.Just Change_ChangeStateOpen toProtoEnumMay 1 = Hs.Just Change_ChangeStateMerged toProtoEnumMay 2 = Hs.Just Change_ChangeStateClosed toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (Change_ChangeStateOpen) = 0 - fromProtoEnum (Change_ChangeStateMerged) = 1 - fromProtoEnum (Change_ChangeStateClosed) = 2 - -instance HsJSONPB.ToJSONPB Change_ChangeState where + fromProtoEnum Change_ChangeStateOpen = 0 + fromProtoEnum Change_ChangeStateMerged = 1 + fromProtoEnum Change_ChangeStateClosed = 2 +instance (HsJSONPB.ToJSONPB Change_ChangeState) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB Change_ChangeState where +instance (HsJSONPB.FromJSONPB Change_ChangeState) where parseJSONPB (HsJSONPB.String "Open") = Hs.pure Change_ChangeStateOpen parseJSONPB (HsJSONPB.String "Merged") = Hs.pure Change_ChangeStateMerged parseJSONPB (HsJSONPB.String "Closed") = Hs.pure Change_ChangeStateClosed - parseJSONPB v = (HsJSONPB.typeMismatch "Change_ChangeState" v) - -instance HsJSONPB.ToJSON Change_ChangeState where + parseJSONPB v = HsJSONPB.typeMismatch "Change_ChangeState" v +instance (HsJSONPB.ToJSON Change_ChangeState) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Change_ChangeState where +instance (HsJSONPB.FromJSON Change_ChangeState) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite Change_ChangeState - -data ChangeOptionalMergedBy = ChangeOptionalMergedByMergedBy Monocle.Protob.Change.Ident +instance (HsProtobuf.Finite Change_ChangeState) +newtype ChangeOptionalMergedBy + = ChangeOptionalMergedByMergedBy Monocle.Protob.Change.Ident deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeOptionalMergedBy - -instance HsProtobuf.Named ChangeOptionalMergedBy where - nameOf _ = (Hs.fromString "ChangeOptionalMergedBy") - -data ChangeOptionalMergedAt = ChangeOptionalMergedAtMergedAt Google.Protobuf.Timestamp.Timestamp +instance (Hs.NFData ChangeOptionalMergedBy) +instance (HsProtobuf.Named ChangeOptionalMergedBy) where + nameOf _ = Hs.fromString "ChangeOptionalMergedBy" +newtype ChangeOptionalMergedAt + = ChangeOptionalMergedAtMergedAt Google.Protobuf.Timestamp.Timestamp deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeOptionalMergedAt - -instance HsProtobuf.Named ChangeOptionalMergedAt where - nameOf _ = (Hs.fromString "ChangeOptionalMergedAt") - -data ChangeOptionalClosedAt = ChangeOptionalClosedAtClosedAt Google.Protobuf.Timestamp.Timestamp +instance (Hs.NFData ChangeOptionalMergedAt) +instance (HsProtobuf.Named ChangeOptionalMergedAt) where + nameOf _ = Hs.fromString "ChangeOptionalMergedAt" +newtype ChangeOptionalClosedAt + = ChangeOptionalClosedAtClosedAt Google.Protobuf.Timestamp.Timestamp deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeOptionalClosedAt - -instance HsProtobuf.Named ChangeOptionalClosedAt where - nameOf _ = (Hs.fromString "ChangeOptionalClosedAt") - -data ChangeOptionalDuration = ChangeOptionalDurationDuration Hs.Int32 +instance (Hs.NFData ChangeOptionalClosedAt) +instance (HsProtobuf.Named ChangeOptionalClosedAt) where + nameOf _ = Hs.fromString "ChangeOptionalClosedAt" +newtype ChangeOptionalDuration + = ChangeOptionalDurationDuration Hs.Int32 deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeOptionalDuration - -instance HsProtobuf.Named ChangeOptionalDuration where - nameOf _ = (Hs.fromString "ChangeOptionalDuration") - -data ChangeOptionalSelfMerged = ChangeOptionalSelfMergedSelfMerged Hs.Bool +instance (Hs.NFData ChangeOptionalDuration) +instance (HsProtobuf.Named ChangeOptionalDuration) where + nameOf _ = Hs.fromString "ChangeOptionalDuration" +newtype ChangeOptionalSelfMerged + = ChangeOptionalSelfMergedSelfMerged Hs.Bool deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeOptionalSelfMerged - -instance HsProtobuf.Named ChangeOptionalSelfMerged where - nameOf _ = (Hs.fromString "ChangeOptionalSelfMerged") - -data ChangeOptionalMergedCommitSha = ChangeOptionalMergedCommitShaMergedCommitSha Hs.Text +instance (Hs.NFData ChangeOptionalSelfMerged) +instance (HsProtobuf.Named ChangeOptionalSelfMerged) where + nameOf _ = Hs.fromString "ChangeOptionalSelfMerged" +newtype ChangeOptionalMergedCommitSha + = ChangeOptionalMergedCommitShaMergedCommitSha Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeOptionalMergedCommitSha - -instance HsProtobuf.Named ChangeOptionalMergedCommitSha where - nameOf _ = (Hs.fromString "ChangeOptionalMergedCommitSha") - +instance (Hs.NFData ChangeOptionalMergedCommitSha) +instance (HsProtobuf.Named ChangeOptionalMergedCommitSha) where + nameOf _ = Hs.fromString "ChangeOptionalMergedCommitSha" data ChangeCreatedEvent = ChangeCreatedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeCreatedEvent - -instance HsProtobuf.Named ChangeCreatedEvent where - nameOf _ = (Hs.fromString "ChangeCreatedEvent") - -instance HsProtobuf.HasDefault ChangeCreatedEvent - -instance HsProtobuf.Message ChangeCreatedEvent where - encodeMessage _ ChangeCreatedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure ChangeCreatedEvent) +instance (Hs.NFData ChangeCreatedEvent) +instance (HsProtobuf.Named ChangeCreatedEvent) where + nameOf _ = Hs.fromString "ChangeCreatedEvent" +instance (HsProtobuf.HasDefault ChangeCreatedEvent) +instance (HsProtobuf.Message ChangeCreatedEvent) where + encodeMessage _ ChangeCreatedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure ChangeCreatedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB ChangeCreatedEvent where - toJSONPB (ChangeCreatedEvent) = (HsJSONPB.object []) - toEncodingPB (ChangeCreatedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB ChangeCreatedEvent where +instance (HsJSONPB.ToJSONPB ChangeCreatedEvent) where + toJSONPB ChangeCreatedEvent = HsJSONPB.object [] + toEncodingPB ChangeCreatedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB ChangeCreatedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeCreatedEvent" - (\obj -> (Hs.pure ChangeCreatedEvent)) - ) - -instance HsJSONPB.ToJSON ChangeCreatedEvent where + HsJSONPB.withObject + "ChangeCreatedEvent" + (\obj -> Hs.pure ChangeCreatedEvent) +instance (HsJSONPB.ToJSON ChangeCreatedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeCreatedEvent where +instance (HsJSONPB.FromJSON ChangeCreatedEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeCommentedEvent = ChangeCommentedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeCommentedEvent - -instance HsProtobuf.Named ChangeCommentedEvent where - nameOf _ = (Hs.fromString "ChangeCommentedEvent") - -instance HsProtobuf.HasDefault ChangeCommentedEvent - -instance HsProtobuf.Message ChangeCommentedEvent where - encodeMessage _ ChangeCommentedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure ChangeCommentedEvent) +instance (Hs.NFData ChangeCommentedEvent) +instance (HsProtobuf.Named ChangeCommentedEvent) where + nameOf _ = Hs.fromString "ChangeCommentedEvent" +instance (HsProtobuf.HasDefault ChangeCommentedEvent) +instance (HsProtobuf.Message ChangeCommentedEvent) where + encodeMessage _ ChangeCommentedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure ChangeCommentedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB ChangeCommentedEvent where - toJSONPB (ChangeCommentedEvent) = (HsJSONPB.object []) - toEncodingPB (ChangeCommentedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB ChangeCommentedEvent where +instance (HsJSONPB.ToJSONPB ChangeCommentedEvent) where + toJSONPB ChangeCommentedEvent = HsJSONPB.object [] + toEncodingPB ChangeCommentedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB ChangeCommentedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeCommentedEvent" - (\obj -> (Hs.pure ChangeCommentedEvent)) - ) - -instance HsJSONPB.ToJSON ChangeCommentedEvent where + HsJSONPB.withObject + "ChangeCommentedEvent" + (\obj -> Hs.pure ChangeCommentedEvent) +instance (HsJSONPB.ToJSON ChangeCommentedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeCommentedEvent where +instance (HsJSONPB.FromJSON ChangeCommentedEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeAbandonedEvent = ChangeAbandonedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeAbandonedEvent - -instance HsProtobuf.Named ChangeAbandonedEvent where - nameOf _ = (Hs.fromString "ChangeAbandonedEvent") - -instance HsProtobuf.HasDefault ChangeAbandonedEvent - -instance HsProtobuf.Message ChangeAbandonedEvent where - encodeMessage _ ChangeAbandonedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure ChangeAbandonedEvent) +instance (Hs.NFData ChangeAbandonedEvent) +instance (HsProtobuf.Named ChangeAbandonedEvent) where + nameOf _ = Hs.fromString "ChangeAbandonedEvent" +instance (HsProtobuf.HasDefault ChangeAbandonedEvent) +instance (HsProtobuf.Message ChangeAbandonedEvent) where + encodeMessage _ ChangeAbandonedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure ChangeAbandonedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB ChangeAbandonedEvent where - toJSONPB (ChangeAbandonedEvent) = (HsJSONPB.object []) - toEncodingPB (ChangeAbandonedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB ChangeAbandonedEvent where +instance (HsJSONPB.ToJSONPB ChangeAbandonedEvent) where + toJSONPB ChangeAbandonedEvent = HsJSONPB.object [] + toEncodingPB ChangeAbandonedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB ChangeAbandonedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeAbandonedEvent" - (\obj -> (Hs.pure ChangeAbandonedEvent)) - ) - -instance HsJSONPB.ToJSON ChangeAbandonedEvent where + HsJSONPB.withObject + "ChangeAbandonedEvent" + (\obj -> Hs.pure ChangeAbandonedEvent) +instance (HsJSONPB.ToJSON ChangeAbandonedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeAbandonedEvent where +instance (HsJSONPB.FromJSON ChangeAbandonedEvent) where parseJSON = HsJSONPB.parseJSONPB - -newtype ChangeReviewedEvent = ChangeReviewedEvent - { changeReviewedEventApprovals :: - Hs.Vector Hs.Text - } +newtype ChangeReviewedEvent = ChangeReviewedEvent {changeReviewedEventApprovals :: (Hs.Vector Hs.Text)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeReviewedEvent - -instance HsProtobuf.Named ChangeReviewedEvent where - nameOf _ = (Hs.fromString "ChangeReviewedEvent") - -instance HsProtobuf.HasDefault ChangeReviewedEvent - -instance HsProtobuf.Message ChangeReviewedEvent where - encodeMessage - _ - ChangeReviewedEvent - { changeReviewedEventApprovals = - changeReviewedEventApprovals - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeReviewedEventApprovals) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure ChangeReviewedEvent) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) +instance (Hs.NFData ChangeReviewedEvent) +instance (HsProtobuf.Named ChangeReviewedEvent) where + nameOf _ = Hs.fromString "ChangeReviewedEvent" +instance (HsProtobuf.HasDefault ChangeReviewedEvent) +instance (HsProtobuf.Message ChangeReviewedEvent) where + encodeMessage _ ChangeReviewedEvent {changeReviewedEventApprovals} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeReviewedEventApprovals + ) + ) + decodeMessage _ = + Hs.pure ChangeReviewedEvent + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "approvals") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approvals") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangeReviewedEvent where +instance (HsJSONPB.ToJSONPB ChangeReviewedEvent) where toJSONPB (ChangeReviewedEvent f1) = - ( HsJSONPB.object - [ "approvals" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.object + [ "approvals" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (ChangeReviewedEvent f1) = - ( HsJSONPB.pairs - [ "approvals" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.pairs + [ "approvals" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB ChangeReviewedEvent where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB ChangeReviewedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeReviewedEvent" - ( \obj -> - (Hs.pure ChangeReviewedEvent) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ChangeReviewedEvent" + ( \obj -> + Hs.pure ChangeReviewedEvent + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "approvals") ) - ) - ) - -instance HsJSONPB.ToJSON ChangeReviewedEvent where + (obj .: "approvals") + ) + ) +instance (HsJSONPB.ToJSON ChangeReviewedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeReviewedEvent where +instance (HsJSONPB.FromJSON ChangeReviewedEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeCommitForcePushedEvent = ChangeCommitForcePushedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeCommitForcePushedEvent - -instance HsProtobuf.Named ChangeCommitForcePushedEvent where - nameOf _ = (Hs.fromString "ChangeCommitForcePushedEvent") - -instance HsProtobuf.HasDefault ChangeCommitForcePushedEvent - -instance HsProtobuf.Message ChangeCommitForcePushedEvent where - encodeMessage _ ChangeCommitForcePushedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure ChangeCommitForcePushedEvent) +instance (Hs.NFData ChangeCommitForcePushedEvent) +instance (HsProtobuf.Named ChangeCommitForcePushedEvent) where + nameOf _ = Hs.fromString "ChangeCommitForcePushedEvent" +instance (HsProtobuf.HasDefault ChangeCommitForcePushedEvent) +instance (HsProtobuf.Message ChangeCommitForcePushedEvent) where + encodeMessage _ ChangeCommitForcePushedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure ChangeCommitForcePushedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB ChangeCommitForcePushedEvent where - toJSONPB (ChangeCommitForcePushedEvent) = (HsJSONPB.object []) - toEncodingPB (ChangeCommitForcePushedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB ChangeCommitForcePushedEvent where +instance (HsJSONPB.ToJSONPB ChangeCommitForcePushedEvent) where + toJSONPB ChangeCommitForcePushedEvent = HsJSONPB.object [] + toEncodingPB ChangeCommitForcePushedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB ChangeCommitForcePushedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeCommitForcePushedEvent" - (\obj -> (Hs.pure ChangeCommitForcePushedEvent)) - ) - -instance HsJSONPB.ToJSON ChangeCommitForcePushedEvent where + HsJSONPB.withObject + "ChangeCommitForcePushedEvent" + (\obj -> Hs.pure ChangeCommitForcePushedEvent) +instance (HsJSONPB.ToJSON ChangeCommitForcePushedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeCommitForcePushedEvent where +instance (HsJSONPB.FromJSON ChangeCommitForcePushedEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeCommitPushedEvent = ChangeCommitPushedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeCommitPushedEvent - -instance HsProtobuf.Named ChangeCommitPushedEvent where - nameOf _ = (Hs.fromString "ChangeCommitPushedEvent") - -instance HsProtobuf.HasDefault ChangeCommitPushedEvent - -instance HsProtobuf.Message ChangeCommitPushedEvent where - encodeMessage _ ChangeCommitPushedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure ChangeCommitPushedEvent) +instance (Hs.NFData ChangeCommitPushedEvent) +instance (HsProtobuf.Named ChangeCommitPushedEvent) where + nameOf _ = Hs.fromString "ChangeCommitPushedEvent" +instance (HsProtobuf.HasDefault ChangeCommitPushedEvent) +instance (HsProtobuf.Message ChangeCommitPushedEvent) where + encodeMessage _ ChangeCommitPushedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure ChangeCommitPushedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB ChangeCommitPushedEvent where - toJSONPB (ChangeCommitPushedEvent) = (HsJSONPB.object []) - toEncodingPB (ChangeCommitPushedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB ChangeCommitPushedEvent where +instance (HsJSONPB.ToJSONPB ChangeCommitPushedEvent) where + toJSONPB ChangeCommitPushedEvent = HsJSONPB.object [] + toEncodingPB ChangeCommitPushedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB ChangeCommitPushedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeCommitPushedEvent" - (\obj -> (Hs.pure ChangeCommitPushedEvent)) - ) - -instance HsJSONPB.ToJSON ChangeCommitPushedEvent where + HsJSONPB.withObject + "ChangeCommitPushedEvent" + (\obj -> Hs.pure ChangeCommitPushedEvent) +instance (HsJSONPB.ToJSON ChangeCommitPushedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeCommitPushedEvent where +instance (HsJSONPB.FromJSON ChangeCommitPushedEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeMergedEvent = ChangeMergedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeMergedEvent - -instance HsProtobuf.Named ChangeMergedEvent where - nameOf _ = (Hs.fromString "ChangeMergedEvent") - -instance HsProtobuf.HasDefault ChangeMergedEvent - -instance HsProtobuf.Message ChangeMergedEvent where - encodeMessage _ ChangeMergedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure ChangeMergedEvent) +instance (Hs.NFData ChangeMergedEvent) +instance (HsProtobuf.Named ChangeMergedEvent) where + nameOf _ = Hs.fromString "ChangeMergedEvent" +instance (HsProtobuf.HasDefault ChangeMergedEvent) +instance (HsProtobuf.Message ChangeMergedEvent) where + encodeMessage _ ChangeMergedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure ChangeMergedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB ChangeMergedEvent where - toJSONPB (ChangeMergedEvent) = (HsJSONPB.object []) - toEncodingPB (ChangeMergedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB ChangeMergedEvent where +instance (HsJSONPB.ToJSONPB ChangeMergedEvent) where + toJSONPB ChangeMergedEvent = HsJSONPB.object [] + toEncodingPB ChangeMergedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB ChangeMergedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeMergedEvent" - (\obj -> (Hs.pure ChangeMergedEvent)) - ) - -instance HsJSONPB.ToJSON ChangeMergedEvent where + HsJSONPB.withObject + "ChangeMergedEvent" + (\obj -> Hs.pure ChangeMergedEvent) +instance (HsJSONPB.ToJSON ChangeMergedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeMergedEvent where +instance (HsJSONPB.FromJSON ChangeMergedEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeEvent = ChangeEvent { changeEventId :: Hs.Text - , changeEventCreatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeEventAuthor :: Hs.Maybe Monocle.Protob.Change.Ident + , changeEventCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeEventAuthor :: (Hs.Maybe Monocle.Protob.Change.Ident) , changeEventRepositoryPrefix :: Hs.Text , changeEventRepositoryFullname :: Hs.Text , changeEventRepositoryShortname :: Hs.Text @@ -2389,568 +2426,605 @@ data ChangeEvent = ChangeEvent , changeEventNumber :: Hs.Int32 , changeEventChangeId :: Hs.Text , changeEventUrl :: Hs.Text - , changeEventOnAuthor :: Hs.Maybe Monocle.Protob.Change.Ident - , changeEventOnCreatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeEventChangedFiles :: - Hs.Vector Monocle.Protob.Change.ChangedFilePath - , changeEventType :: Hs.Maybe ChangeEventType - , changeEventLabels :: Hs.Vector Hs.Text - , changeEventOptionalDuration :: - Hs.Maybe ChangeEventOptionalDuration + , changeEventOnAuthor :: (Hs.Maybe Monocle.Protob.Change.Ident) + , changeEventOnCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeEventChangedFiles :: (Hs.Vector Monocle.Protob.Change.ChangedFilePath) + , changeEventType :: (Hs.Maybe ChangeEventType) + , changeEventLabels :: (Hs.Vector Hs.Text) + , changeEventOptionalDuration :: (Hs.Maybe ChangeEventOptionalDuration) , changeEventDraft :: Hs.Bool - , changeEventOptionalMergedCommitSha :: - Hs.Maybe ChangeEventOptionalMergedCommitSha + , changeEventOptionalMergedCommitSha :: (Hs.Maybe ChangeEventOptionalMergedCommitSha) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeEvent - -instance HsProtobuf.Named ChangeEvent where - nameOf _ = (Hs.fromString "ChangeEvent") - -instance HsProtobuf.HasDefault ChangeEvent - -instance HsProtobuf.Message ChangeEvent where +instance (Hs.NFData ChangeEvent) +instance (HsProtobuf.Named ChangeEvent) where + nameOf _ = Hs.fromString "ChangeEvent" +instance (HsProtobuf.HasDefault ChangeEvent) +instance (HsProtobuf.Message ChangeEvent) where encodeMessage _ ChangeEvent - { changeEventId = changeEventId - , changeEventCreatedAt = changeEventCreatedAt - , changeEventAuthor = changeEventAuthor - , changeEventRepositoryPrefix = changeEventRepositoryPrefix - , changeEventRepositoryFullname = changeEventRepositoryFullname - , changeEventRepositoryShortname = changeEventRepositoryShortname - , changeEventBranch = changeEventBranch - , changeEventTargetBranch = changeEventTargetBranch - , changeEventNumber = changeEventNumber - , changeEventChangeId = changeEventChangeId - , changeEventUrl = changeEventUrl - , changeEventOnAuthor = changeEventOnAuthor - , changeEventOnCreatedAt = changeEventOnCreatedAt - , changeEventChangedFiles = changeEventChangedFiles - , changeEventType = changeEventType - , changeEventLabels = changeEventLabels - , changeEventOptionalDuration = changeEventOptionalDuration - , changeEventDraft = changeEventDraft - , changeEventOptionalMergedCommitSha = - changeEventOptionalMergedCommitSha + { changeEventId + , changeEventCreatedAt + , changeEventAuthor + , changeEventRepositoryPrefix + , changeEventRepositoryFullname + , changeEventRepositoryShortname + , changeEventBranch + , changeEventTargetBranch + , changeEventNumber + , changeEventChangeId + , changeEventUrl + , changeEventOnAuthor + , changeEventOnCreatedAt + , changeEventChangedFiles + , changeEventType + , changeEventLabels + , changeEventOptionalDuration + , changeEventDraft + , changeEventOptionalMergedCommitSha } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeEventCreatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (changeEventAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventRepositoryPrefix) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventRepositoryFullname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventRepositoryShortname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventBranch) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventTargetBranch) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 9) - changeEventNumber - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventChangeId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventUrl) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 12) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (changeEventOnAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 13) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeEventOnCreatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 14) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) - @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) - (changeEventChangedFiles) - ) - ) - , case changeEventType of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeEventTypeChangeCreated y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 15) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.ChangeCreatedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCreatedEvent) - (Hs.Just y) - ) - ) - ChangeEventTypeChangeCommented y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 16) - ( Hs.coerce - @(Hs.Maybe Monocle.Protob.Change.ChangeCommentedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommentedEvent) - (Hs.Just y) - ) - ) - ChangeEventTypeChangeAbandoned y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 17) - ( Hs.coerce - @(Hs.Maybe Monocle.Protob.Change.ChangeAbandonedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeAbandonedEvent) - (Hs.Just y) - ) - ) - ChangeEventTypeChangeReviewed y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 18) - ( Hs.coerce - @(Hs.Maybe Monocle.Protob.Change.ChangeReviewedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeReviewedEvent) - (Hs.Just y) - ) - ) - ChangeEventTypeChangeCommitForcePushed y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 19) - ( Hs.coerce - @(Hs.Maybe Monocle.Protob.Change.ChangeCommitForcePushedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitForcePushedEvent) - (Hs.Just y) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeEventId + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeEventCreatedAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + changeEventAuthor + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeEventRepositoryPrefix + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeEventRepositoryFullname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventRepositoryShortname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventBranch + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventTargetBranch + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 9) + changeEventNumber + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventChangeId + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 11) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventUrl + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 12) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + changeEventOnAuthor + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 13) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeEventOnCreatedAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 14) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) + ) + changeEventChangedFiles + ) + ) ) - ) - ChangeEventTypeChangeCommitPushed y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 20) - ( Hs.coerce - @(Hs.Maybe Monocle.Protob.Change.ChangeCommitPushedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitPushedEvent) - (Hs.Just y) + ( case changeEventType of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeEventTypeChangeCreated y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 15) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeCreatedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCreatedEvent) + ) + (Hs.Just y) + ) + ChangeEventTypeChangeCommented y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 16) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeCommentedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommentedEvent) + ) + (Hs.Just y) + ) + ChangeEventTypeChangeAbandoned y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 17) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeAbandonedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeAbandonedEvent) + ) + (Hs.Just y) + ) + ChangeEventTypeChangeReviewed y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 18) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeReviewedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeReviewedEvent) + ) + (Hs.Just y) + ) + ChangeEventTypeChangeCommitForcePushed y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 19) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeCommitForcePushedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitForcePushedEvent) + ) + (Hs.Just y) + ) + ChangeEventTypeChangeCommitPushed y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 20) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeCommitPushedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitPushedEvent) + ) + (Hs.Just y) + ) + ChangeEventTypeChangeMerged y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 21) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.ChangeMergedEvent) + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeMergedEvent) + ) + (Hs.Just y) + ) ) ) - ChangeEventTypeChangeMerged y -> ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 21) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.ChangeMergedEvent) - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeMergedEvent) - (Hs.Just y) + (HsProtobuf.FieldNumber 22) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeEventLabels ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 22) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeEventLabels) + ) + ( case changeEventOptionalDuration of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeEventOptionalDurationDuration y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 23) + (HsProtobuf.ForceEmit y) ) ) - , case changeEventOptionalDuration of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeEventOptionalDurationDuration y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 23) - (HsProtobuf.ForceEmit y) - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 24) changeEventDraft ) - , case changeEventOptionalMergedCommitSha of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeEventOptionalMergedCommitShaMergedCommitSha y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 25) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) + ) + ( case changeEventOptionalMergedCommitSha of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeEventOptionalMergedCommitShaMergedCommitSha y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 25) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - ] - ) + ) decodeMessage _ = - (Hs.pure ChangeEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ChangeEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 8) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 9) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 9) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 12) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 13) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) - @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) + @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 14) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 15) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeCreated)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCreatedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeCreatedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 16) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeCommented)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommentedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeCommentedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 17) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeAbandoned)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeAbandonedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeAbandonedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 18) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeReviewed)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeReviewedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeReviewedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 19) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeCommitForcePushed)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitForcePushedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeCommitForcePushedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 20) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeCommitPushed)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitPushedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeCommitPushedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 21) - , (Hs.pure (Hs.fmap ChangeEventTypeChangeMerged)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.ChangeMergedEvent) - @(Hs.Maybe Monocle.Protob.Change.ChangeMergedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 15) + , Hs.pure (Hs.fmap ChangeEventTypeChangeCreated) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCreatedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCreatedEvent) + ) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) - ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 22) - ) + , + ( (HsProtobuf.FieldNumber 16) + , Hs.pure (Hs.fmap ChangeEventTypeChangeCommented) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommentedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCommentedEvent) + ) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 23) - , (Hs.pure (Hs.Just Hs.. ChangeEventOptionalDurationDuration)) - <*> HsProtobuf.decodeMessageField - ) - ] - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 24) - ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 25) - , ( Hs.pure - (Hs.Just Hs.. ChangeEventOptionalMergedCommitShaMergedCommitSha) + , + ( (HsProtobuf.FieldNumber 17) + , Hs.pure (Hs.fmap ChangeEventTypeChangeAbandoned) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeAbandonedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeAbandonedEvent) + ) + HsProtobuf.decodeMessageField ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) - ) - ] ) - dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + , + ( (HsProtobuf.FieldNumber 18) + , Hs.pure (Hs.fmap ChangeEventTypeChangeReviewed) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeReviewedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeReviewedEvent) + ) + HsProtobuf.decodeMessageField ) - ) ) - (HsProtobufAST.Single "created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + , + ( (HsProtobuf.FieldNumber 19) + , Hs.pure (Hs.fmap ChangeEventTypeChangeCommitForcePushed) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitForcePushedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCommitForcePushedEvent) + ) + HsProtobuf.decodeMessageField + ) ) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_prefix") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_fullname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_shortname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "branch") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "target_branch") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 9) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "number") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "change_id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 12) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) - ) - (HsProtobufAST.Single "on_author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 13) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + , + ( (HsProtobuf.FieldNumber 20) + , Hs.pure (Hs.fmap ChangeEventTypeChangeCommitPushed) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitPushedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCommitPushedEvent) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 21) + , Hs.pure (Hs.fmap ChangeEventTypeChangeMerged) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeMergedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeMergedEvent) + ) + HsProtobuf.decodeMessageField ) + ) + ] + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 22) ) ) - (HsProtobufAST.Single "on_created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 14) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "ChangedFilePath")) - ) - (HsProtobufAST.Single "changed_files") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 22) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "labels") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 24) - (HsProtobufAST.Prim HsProtobufAST.Bool) - (HsProtobufAST.Single "draft") - [] - "" - ) + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 23) + , Hs.pure (Hs.Just Hs.. ChangeEventOptionalDurationDuration) + <*> HsProtobuf.decodeMessageField + ) + ] + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 24) + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 25) + , Hs.pure + (Hs.Just Hs.. ChangeEventOptionalMergedCommitShaMergedCommitSha) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField + ) + ) + ] + dotProto _ = + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "target_branch") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 9) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 12) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "on_author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 13) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "on_created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 14) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ChangedFilePath")) + ) + (HsProtobufAST.Single "changed_files") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 22) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 24) + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "draft") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangeEvent where +instance (HsJSONPB.ToJSONPB ChangeEvent) where toJSONPB ( ChangeEvent f1 @@ -2973,111 +3047,129 @@ instance HsJSONPB.ToJSONPB ChangeEvent where f24 f25 ) = - ( HsJSONPB.object - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f2) ) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f2 + ) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f3) ) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - , "target_branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - , "number" .= f9 - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) - , "on_author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f3 + ) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "branch" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + , "target_branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + , "number" .= f9 + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f10) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f11) + , "on_author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f12) ) - , "on_created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f12 + ) + , "on_created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f13) ) - , "changed_files" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) + f13 + ) + , "changed_files" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) - (f14) ) - , ( let encodeType = - ( case f15_or_f16_or_f17_or_f18_or_f19_or_f20_or_f21 of - Hs.Just (ChangeEventTypeChangeCreated f15) -> - (HsJSONPB.pair "ChangeCreated" f15) - Hs.Just (ChangeEventTypeChangeCommented f16) -> - (HsJSONPB.pair "ChangeCommented" f16) - Hs.Just (ChangeEventTypeChangeAbandoned f17) -> - (HsJSONPB.pair "ChangeAbandoned" f17) - Hs.Just (ChangeEventTypeChangeReviewed f18) -> - (HsJSONPB.pair "ChangeReviewed" f18) - Hs.Just (ChangeEventTypeChangeCommitForcePushed f19) -> - (HsJSONPB.pair "ChangeCommitForcePushed" f19) - Hs.Just (ChangeEventTypeChangeCommitPushed f20) -> - (HsJSONPB.pair "ChangeCommitPushed" f20) - Hs.Just (ChangeEventTypeChangeMerged f21) -> - (HsJSONPB.pair "ChangeMerged" f21) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("type" .= (HsJSONPB.objectOrNull [encodeType] options)) options - else encodeType options - ) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f14 + ) + , ( let + encodeType = + ( case f15_or_f16_or_f17_or_f18_or_f19_or_f20_or_f21 of + Hs.Just (ChangeEventTypeChangeCreated f15) -> + HsJSONPB.pair "ChangeCreated" f15 + Hs.Just (ChangeEventTypeChangeCommented f16) -> + HsJSONPB.pair "ChangeCommented" f16 + Hs.Just (ChangeEventTypeChangeAbandoned f17) -> + HsJSONPB.pair "ChangeAbandoned" f17 + Hs.Just (ChangeEventTypeChangeReviewed f18) -> + HsJSONPB.pair "ChangeReviewed" f18 + Hs.Just (ChangeEventTypeChangeCommitForcePushed f19) -> + HsJSONPB.pair "ChangeCommitForcePushed" f19 + Hs.Just (ChangeEventTypeChangeCommitPushed f20) -> + HsJSONPB.pair "ChangeCommitPushed" f20 + Hs.Just (ChangeEventTypeChangeMerged f21) -> + HsJSONPB.pair "ChangeMerged" f21 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("type" .= HsJSONPB.objectOrNull [encodeType] options) options + else encodeType options + ) + ) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f22) ) - , ( let encodeOptional_duration = - ( case f23 of - Hs.Just (ChangeEventOptionalDurationDuration f23) -> - (HsJSONPB.pair "duration" f23) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_duration" - .= (HsJSONPB.objectOrNull [encodeOptional_duration] options) - ) - options - else encodeOptional_duration options - ) - , "draft" .= f24 - , ( let encodeOptional_merged_commit_sha = - ( case f25 of - Hs.Just (ChangeEventOptionalMergedCommitShaMergedCommitSha f25) -> - ( HsJSONPB.pair - "merged_commit_sha" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f25)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_commit_sha" - .= (HsJSONPB.objectOrNull [encodeOptional_merged_commit_sha] options) - ) - options - else encodeOptional_merged_commit_sha options - ) - ] - ) + f22 + ) + , ( let + encodeOptional_duration = + ( case f23 of + Hs.Just (ChangeEventOptionalDurationDuration f23) -> + HsJSONPB.pair "duration" f23 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_duration" + .= HsJSONPB.objectOrNull [encodeOptional_duration] options + ) + options + else encodeOptional_duration options + ) + ) + , "draft" .= f24 + , ( let + encodeOptional_merged_commit_sha = + ( case f25 of + Hs.Just (ChangeEventOptionalMergedCommitShaMergedCommitSha f25) -> + HsJSONPB.pair + "merged_commit_sha" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f25) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_commit_sha" + .= HsJSONPB.objectOrNull [encodeOptional_merged_commit_sha] options + ) + options + else encodeOptional_merged_commit_sha options + ) + ) + ] toEncodingPB ( ChangeEvent f1 @@ -3100,232 +3192,256 @@ instance HsJSONPB.ToJSONPB ChangeEvent where f24 f25 ) = - ( HsJSONPB.pairs - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.pairs + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f2) ) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f2 + ) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f3) ) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - , "target_branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - , "number" .= f9 - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) - , "on_author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f3 + ) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "branch" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + , "target_branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + , "number" .= f9 + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f10) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f11) + , "on_author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f12) ) - , "on_created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f12 + ) + , "on_created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f13) ) - , "changed_files" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) + f13 + ) + , "changed_files" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) - (f14) ) - , ( let encodeType = - ( case f15_or_f16_or_f17_or_f18_or_f19_or_f20_or_f21 of - Hs.Just (ChangeEventTypeChangeCreated f15) -> - (HsJSONPB.pair "ChangeCreated" f15) - Hs.Just (ChangeEventTypeChangeCommented f16) -> - (HsJSONPB.pair "ChangeCommented" f16) - Hs.Just (ChangeEventTypeChangeAbandoned f17) -> - (HsJSONPB.pair "ChangeAbandoned" f17) - Hs.Just (ChangeEventTypeChangeReviewed f18) -> - (HsJSONPB.pair "ChangeReviewed" f18) - Hs.Just (ChangeEventTypeChangeCommitForcePushed f19) -> - (HsJSONPB.pair "ChangeCommitForcePushed" f19) - Hs.Just (ChangeEventTypeChangeCommitPushed f20) -> - (HsJSONPB.pair "ChangeCommitPushed" f20) - Hs.Just (ChangeEventTypeChangeMerged f21) -> - (HsJSONPB.pair "ChangeMerged" f21) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("type" .= (HsJSONPB.pairsOrNull [encodeType] options)) options - else encodeType options - ) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f14 + ) + , ( let + encodeType = + ( case f15_or_f16_or_f17_or_f18_or_f19_or_f20_or_f21 of + Hs.Just (ChangeEventTypeChangeCreated f15) -> + HsJSONPB.pair "ChangeCreated" f15 + Hs.Just (ChangeEventTypeChangeCommented f16) -> + HsJSONPB.pair "ChangeCommented" f16 + Hs.Just (ChangeEventTypeChangeAbandoned f17) -> + HsJSONPB.pair "ChangeAbandoned" f17 + Hs.Just (ChangeEventTypeChangeReviewed f18) -> + HsJSONPB.pair "ChangeReviewed" f18 + Hs.Just (ChangeEventTypeChangeCommitForcePushed f19) -> + HsJSONPB.pair "ChangeCommitForcePushed" f19 + Hs.Just (ChangeEventTypeChangeCommitPushed f20) -> + HsJSONPB.pair "ChangeCommitPushed" f20 + Hs.Just (ChangeEventTypeChangeMerged f21) -> + HsJSONPB.pair "ChangeMerged" f21 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("type" .= HsJSONPB.pairsOrNull [encodeType] options) options + else encodeType options + ) + ) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f22) ) - , ( let encodeOptional_duration = - ( case f23 of - Hs.Just (ChangeEventOptionalDurationDuration f23) -> - (HsJSONPB.pair "duration" f23) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_duration" - .= (HsJSONPB.pairsOrNull [encodeOptional_duration] options) - ) - options - else encodeOptional_duration options - ) - , "draft" .= f24 - , ( let encodeOptional_merged_commit_sha = - ( case f25 of - Hs.Just (ChangeEventOptionalMergedCommitShaMergedCommitSha f25) -> - ( HsJSONPB.pair - "merged_commit_sha" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f25)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_merged_commit_sha" - .= (HsJSONPB.pairsOrNull [encodeOptional_merged_commit_sha] options) - ) - options - else encodeOptional_merged_commit_sha options - ) - ] - ) - -instance HsJSONPB.FromJSONPB ChangeEvent where + f22 + ) + , ( let + encodeOptional_duration = + ( case f23 of + Hs.Just (ChangeEventOptionalDurationDuration f23) -> + HsJSONPB.pair "duration" f23 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_duration" + .= HsJSONPB.pairsOrNull [encodeOptional_duration] options + ) + options + else encodeOptional_duration options + ) + ) + , "draft" .= f24 + , ( let + encodeOptional_merged_commit_sha = + ( case f25 of + Hs.Just (ChangeEventOptionalMergedCommitShaMergedCommitSha f25) -> + HsJSONPB.pair + "merged_commit_sha" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f25) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_merged_commit_sha" + .= HsJSONPB.pairsOrNull [encodeOptional_merged_commit_sha] options + ) + options + else encodeOptional_merged_commit_sha options + ) + ) + ] +instance (HsJSONPB.FromJSONPB ChangeEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeEvent" - ( \obj -> - (Hs.pure ChangeEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "id") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ChangeEvent" + ( \obj -> + Hs.pure ChangeEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "id") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") ) - <*> ( HsProtobuf.coerceOver + (obj .: "created_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "author") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_prefix") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_fullname") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_shortname") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "branch") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "target_branch") ) - <*> obj .: "number" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "change_id") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") - ) - <*> ( HsProtobuf.coerceOver + (obj .: "author") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_prefix") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_fullname") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_shortname") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "branch") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "target_branch") + ) + <*> obj .: "number" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "change_id") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "on_author") ) - <*> ( HsProtobuf.coerceOver + (obj .: "on_author") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "on_created_at") ) - <*> ( HsProtobuf.coerceOver + (obj .: "on_created_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) - (obj .: "changed_files") - ) - <*> ( let parseType parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeEventTypeChangeCreated - <$> (HsJSONPB.parseField parseObj "ChangeCreated") - , Hs.Just Hs.. ChangeEventTypeChangeCommented - <$> (HsJSONPB.parseField parseObj "ChangeCommented") - , Hs.Just Hs.. ChangeEventTypeChangeAbandoned - <$> (HsJSONPB.parseField parseObj "ChangeAbandoned") - , Hs.Just Hs.. ChangeEventTypeChangeReviewed - <$> (HsJSONPB.parseField parseObj "ChangeReviewed") - , Hs.Just Hs.. ChangeEventTypeChangeCommitForcePushed - <$> (HsJSONPB.parseField parseObj "ChangeCommitForcePushed") - , Hs.Just Hs.. ChangeEventTypeChangeCommitPushed - <$> (HsJSONPB.parseField parseObj "ChangeCommitPushed") - , Hs.Just Hs.. ChangeEventTypeChangeMerged - <$> (HsJSONPB.parseField parseObj "ChangeMerged") - , Hs.pure Hs.Nothing - ] - in ((obj .: "type") Hs.>>= (HsJSONPB.withObject "type" parseType)) - <|> (parseType obj) ) - <*> ( HsProtobuf.coerceOver + (obj .: "changed_files") + ) + <*> ( let + parseType parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeEventTypeChangeCreated + <$> HsJSONPB.parseField parseObj "ChangeCreated" + , Hs.Just Hs.. ChangeEventTypeChangeCommented + <$> HsJSONPB.parseField parseObj "ChangeCommented" + , Hs.Just Hs.. ChangeEventTypeChangeAbandoned + <$> HsJSONPB.parseField parseObj "ChangeAbandoned" + , Hs.Just Hs.. ChangeEventTypeChangeReviewed + <$> HsJSONPB.parseField parseObj "ChangeReviewed" + , Hs.Just Hs.. ChangeEventTypeChangeCommitForcePushed + <$> HsJSONPB.parseField parseObj "ChangeCommitForcePushed" + , Hs.Just Hs.. ChangeEventTypeChangeCommitPushed + <$> HsJSONPB.parseField parseObj "ChangeCommitPushed" + , Hs.Just Hs.. ChangeEventTypeChangeMerged + <$> HsJSONPB.parseField parseObj "ChangeMerged" + , Hs.pure Hs.Nothing + ] + in + (obj .: "type" Hs.>>= HsJSONPB.withObject "type" parseType) + <|> (parseType obj) + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "labels") - ) - <*> ( let parseOptional_duration parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeEventOptionalDurationDuration - <$> (HsJSONPB.parseField parseObj "duration") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_duration") - Hs.>>= (HsJSONPB.withObject "optional_duration" parseOptional_duration) - ) - <|> (parseOptional_duration obj) - ) - <*> obj .: "draft" - <*> ( let parseOptional_merged_commit_sha parseObj = - Hs.msum - [ Hs.Just - Hs.. ChangeEventOptionalMergedCommitShaMergedCommitSha - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "merged_commit_sha") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_merged_commit_sha") - Hs.>>= ( HsJSONPB.withObject - "optional_merged_commit_sha" - parseOptional_merged_commit_sha - ) - ) - <|> (parseOptional_merged_commit_sha obj) ) - ) - ) - -instance HsJSONPB.ToJSON ChangeEvent where + (obj .: "labels") + ) + <*> ( let + parseOptional_duration parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeEventOptionalDurationDuration + <$> HsJSONPB.parseField parseObj "duration" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_duration" + Hs.>>= HsJSONPB.withObject "optional_duration" parseOptional_duration + ) + <|> (parseOptional_duration obj) + ) + <*> obj .: "draft" + <*> ( let + parseOptional_merged_commit_sha parseObj = + Hs.msum + [ Hs.Just + Hs.. ChangeEventOptionalMergedCommitShaMergedCommitSha + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "merged_commit_sha" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_merged_commit_sha" + Hs.>>= HsJSONPB.withObject + "optional_merged_commit_sha" + parseOptional_merged_commit_sha + ) + <|> (parseOptional_merged_commit_sha obj) + ) + ) +instance (HsJSONPB.ToJSON ChangeEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeEvent where +instance (HsJSONPB.FromJSON ChangeEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeEventType = ChangeEventTypeChangeCreated Monocle.Protob.Change.ChangeCreatedEvent | ChangeEventTypeChangeCommented Monocle.Protob.Change.ChangeCommentedEvent @@ -3335,24 +3451,18 @@ data ChangeEventType | ChangeEventTypeChangeCommitPushed Monocle.Protob.Change.ChangeCommitPushedEvent | ChangeEventTypeChangeMerged Monocle.Protob.Change.ChangeMergedEvent deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeEventType - -instance HsProtobuf.Named ChangeEventType where - nameOf _ = (Hs.fromString "ChangeEventType") - -data ChangeEventOptionalDuration = ChangeEventOptionalDurationDuration Hs.Int32 +instance (Hs.NFData ChangeEventType) +instance (HsProtobuf.Named ChangeEventType) where + nameOf _ = Hs.fromString "ChangeEventType" +newtype ChangeEventOptionalDuration + = ChangeEventOptionalDurationDuration Hs.Int32 deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeEventOptionalDuration - -instance HsProtobuf.Named ChangeEventOptionalDuration where - nameOf _ = (Hs.fromString "ChangeEventOptionalDuration") - -data ChangeEventOptionalMergedCommitSha = ChangeEventOptionalMergedCommitShaMergedCommitSha Hs.Text +instance (Hs.NFData ChangeEventOptionalDuration) +instance (HsProtobuf.Named ChangeEventOptionalDuration) where + nameOf _ = Hs.fromString "ChangeEventOptionalDuration" +newtype ChangeEventOptionalMergedCommitSha + = ChangeEventOptionalMergedCommitShaMergedCommitSha Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeEventOptionalMergedCommitSha - -instance HsProtobuf.Named ChangeEventOptionalMergedCommitSha where - nameOf _ = (Hs.fromString "ChangeEventOptionalMergedCommitSha") +instance (Hs.NFData ChangeEventOptionalMergedCommitSha) +instance (HsProtobuf.Named ChangeEventOptionalMergedCommitSha) where + nameOf _ = Hs.fromString "ChangeEventOptionalMergedCommitSha" diff --git a/codegen/Monocle/Protob/Config.hs b/codegen/Monocle/Protob/Config.hs index 8d4437dbb..d504fa048 100644 --- a/codegen/Monocle/Protob/Config.hs +++ b/codegen/Monocle/Protob/Config.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -46,1661 +49,1355 @@ import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs data ProjectDefinition = ProjectDefinition - { projectDefinitionName :: - Hs.Text + { projectDefinitionName :: Hs.Text , projectDefinitionRepositoryRegex :: Hs.Text , projectDefinitionBranchRegex :: Hs.Text , projectDefinitionFileRegex :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ProjectDefinition - -instance HsProtobuf.Named ProjectDefinition where - nameOf _ = (Hs.fromString "ProjectDefinition") - -instance HsProtobuf.HasDefault ProjectDefinition - -instance HsProtobuf.Message ProjectDefinition where +instance (Hs.NFData ProjectDefinition) +instance (HsProtobuf.Named ProjectDefinition) where + nameOf _ = Hs.fromString "ProjectDefinition" +instance (HsProtobuf.HasDefault ProjectDefinition) +instance (HsProtobuf.Message ProjectDefinition) where encodeMessage _ ProjectDefinition - { projectDefinitionName = projectDefinitionName - , projectDefinitionRepositoryRegex = - projectDefinitionRepositoryRegex - , projectDefinitionBranchRegex = projectDefinitionBranchRegex - , projectDefinitionFileRegex = projectDefinitionFileRegex + { projectDefinitionName + , projectDefinitionRepositoryRegex + , projectDefinitionBranchRegex + , projectDefinitionFileRegex } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (projectDefinitionName) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + projectDefinitionName + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (projectDefinitionRepositoryRegex) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + projectDefinitionRepositoryRegex + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (projectDefinitionBranchRegex) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + projectDefinitionBranchRegex ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (projectDefinitionFileRegex) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + projectDefinitionFileRegex ) - ] - ) + ) decodeMessage _ = - (Hs.pure ProjectDefinition) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ProjectDefinition + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "name") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_regex") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "branch_regex") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "file_regex") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_regex") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch_regex") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "file_regex") + [] + "" ] - -instance HsJSONPB.ToJSONPB ProjectDefinition where +instance (HsJSONPB.ToJSONPB ProjectDefinition) where toJSONPB (ProjectDefinition f1 f2 f3 f4) = - ( HsJSONPB.object - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "repository_regex" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "branch_regex" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "file_regex" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - ] - ) + HsJSONPB.object + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "repository_regex" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "branch_regex" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "file_regex" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + ] toEncodingPB (ProjectDefinition f1 f2 f3 f4) = - ( HsJSONPB.pairs - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "repository_regex" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "branch_regex" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "file_regex" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - ] - ) - -instance HsJSONPB.FromJSONPB ProjectDefinition where + HsJSONPB.pairs + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "repository_regex" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "branch_regex" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "file_regex" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + ] +instance (HsJSONPB.FromJSONPB ProjectDefinition) where parseJSONPB = - ( HsJSONPB.withObject - "ProjectDefinition" - ( \obj -> - (Hs.pure ProjectDefinition) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "name") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_regex") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "branch_regex") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "file_regex") - ) - ) - ) - -instance HsJSONPB.ToJSON ProjectDefinition where + HsJSONPB.withObject + "ProjectDefinition" + ( \obj -> + Hs.pure ProjectDefinition + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "name") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_regex") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "branch_regex") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "file_regex") + ) + ) +instance (HsJSONPB.ToJSON ProjectDefinition) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ProjectDefinition where +instance (HsJSONPB.FromJSON ProjectDefinition) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetProjectsRequest = GetProjectsRequest - { getProjectsRequestIndex :: - Hs.Text - } +newtype GetProjectsRequest = GetProjectsRequest {getProjectsRequestIndex :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetProjectsRequest - -instance HsProtobuf.Named GetProjectsRequest where - nameOf _ = (Hs.fromString "GetProjectsRequest") - -instance HsProtobuf.HasDefault GetProjectsRequest - -instance HsProtobuf.Message GetProjectsRequest where - encodeMessage - _ - GetProjectsRequest - { getProjectsRequestIndex = - getProjectsRequestIndex - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getProjectsRequestIndex) - ) - ) - ] - ) +instance (Hs.NFData GetProjectsRequest) +instance (HsProtobuf.Named GetProjectsRequest) where + nameOf _ = Hs.fromString "GetProjectsRequest" +instance (HsProtobuf.HasDefault GetProjectsRequest) +instance (HsProtobuf.Message GetProjectsRequest) where + encodeMessage _ GetProjectsRequest {getProjectsRequestIndex} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getProjectsRequestIndex + ) + ) decodeMessage _ = - (Hs.pure GetProjectsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetProjectsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetProjectsRequest where +instance (HsJSONPB.ToJSONPB GetProjectsRequest) where toJSONPB (GetProjectsRequest f1) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (GetProjectsRequest f1) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB GetProjectsRequest where + HsJSONPB.pairs + ["index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB GetProjectsRequest) where parseJSONPB = - ( HsJSONPB.withObject - "GetProjectsRequest" - ( \obj -> - (Hs.pure GetProjectsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - ) - ) - -instance HsJSONPB.ToJSON GetProjectsRequest where + HsJSONPB.withObject + "GetProjectsRequest" + ( \obj -> + Hs.pure GetProjectsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + ) +instance (HsJSONPB.ToJSON GetProjectsRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetProjectsRequest where +instance (HsJSONPB.FromJSON GetProjectsRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetProjectsResponse = GetProjectsResponse - { getProjectsResponseProjects :: - Hs.Vector Monocle.Protob.Config.ProjectDefinition - } +newtype GetProjectsResponse = GetProjectsResponse {getProjectsResponseProjects :: (Hs.Vector Monocle.Protob.Config.ProjectDefinition)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetProjectsResponse - -instance HsProtobuf.Named GetProjectsResponse where - nameOf _ = (Hs.fromString "GetProjectsResponse") - -instance HsProtobuf.HasDefault GetProjectsResponse - -instance HsProtobuf.Message GetProjectsResponse where - encodeMessage - _ - GetProjectsResponse - { getProjectsResponseProjects = - getProjectsResponseProjects - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) - @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) - (getProjectsResponseProjects) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure GetProjectsResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) +instance (Hs.NFData GetProjectsResponse) +instance (HsProtobuf.Named GetProjectsResponse) where + nameOf _ = Hs.fromString "GetProjectsResponse" +instance (HsProtobuf.HasDefault GetProjectsResponse) +instance (HsProtobuf.Message GetProjectsResponse) where + encodeMessage _ GetProjectsResponse {getProjectsResponseProjects} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) + @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) + ) + getProjectsResponseProjects + ) + ) + decodeMessage _ = + Hs.pure GetProjectsResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) + @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "ProjectDefinition")) - ) - (HsProtobufAST.Single "projects") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ProjectDefinition")) + ) + (HsProtobufAST.Single "projects") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetProjectsResponse where +instance (HsJSONPB.ToJSONPB GetProjectsResponse) where toJSONPB (GetProjectsResponse f1) = - ( HsJSONPB.object - [ "projects" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) + HsJSONPB.object + [ "projects" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (GetProjectsResponse f1) = - ( HsJSONPB.pairs - [ "projects" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) + HsJSONPB.pairs + [ "projects" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB GetProjectsResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB GetProjectsResponse) where parseJSONPB = - ( HsJSONPB.withObject - "GetProjectsResponse" - ( \obj -> - (Hs.pure GetProjectsResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "GetProjectsResponse" + ( \obj -> + Hs.pure GetProjectsResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) - (obj .: "projects") ) - ) - ) - -instance HsJSONPB.ToJSON GetProjectsResponse where + (obj .: "projects") + ) + ) +instance (HsJSONPB.ToJSON GetProjectsResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetProjectsResponse where +instance (HsJSONPB.FromJSON GetProjectsResponse) where parseJSON = HsJSONPB.parseJSONPB - newtype Workspace = Workspace {workspaceName :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Workspace - -instance HsProtobuf.Named Workspace where - nameOf _ = (Hs.fromString "Workspace") - -instance HsProtobuf.HasDefault Workspace - -instance HsProtobuf.Message Workspace where - encodeMessage _ Workspace {workspaceName = workspaceName} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (workspaceName) - ) - ) - ] +instance (Hs.NFData Workspace) +instance (HsProtobuf.Named Workspace) where + nameOf _ = Hs.fromString "Workspace" +instance (HsProtobuf.HasDefault Workspace) +instance (HsProtobuf.Message Workspace) where + encodeMessage _ Workspace {workspaceName} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) workspaceName) ) decodeMessage _ = - (Hs.pure Workspace) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Workspace + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "name") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") + [] + "" ] - -instance HsJSONPB.ToJSONPB Workspace where +instance (HsJSONPB.ToJSONPB Workspace) where toJSONPB (Workspace f1) = - ( HsJSONPB.object - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (Workspace f1) = - ( HsJSONPB.pairs - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB Workspace where + HsJSONPB.pairs + ["name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB Workspace) where parseJSONPB = - ( HsJSONPB.withObject - "Workspace" - ( \obj -> - (Hs.pure Workspace) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "name") - ) - ) - ) - -instance HsJSONPB.ToJSON Workspace where + HsJSONPB.withObject + "Workspace" + ( \obj -> + Hs.pure Workspace + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "name") + ) + ) +instance (HsJSONPB.ToJSON Workspace) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Workspace where +instance (HsJSONPB.FromJSON Workspace) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetWorkspacesRequest = GetWorkspacesRequest - { getWorkspacesRequestVoid :: - Hs.Text - } +newtype GetWorkspacesRequest = GetWorkspacesRequest {getWorkspacesRequestVoid :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetWorkspacesRequest - -instance HsProtobuf.Named GetWorkspacesRequest where - nameOf _ = (Hs.fromString "GetWorkspacesRequest") - -instance HsProtobuf.HasDefault GetWorkspacesRequest - -instance HsProtobuf.Message GetWorkspacesRequest where - encodeMessage - _ - GetWorkspacesRequest - { getWorkspacesRequestVoid = - getWorkspacesRequestVoid - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getWorkspacesRequestVoid) - ) - ) - ] - ) +instance (Hs.NFData GetWorkspacesRequest) +instance (HsProtobuf.Named GetWorkspacesRequest) where + nameOf _ = Hs.fromString "GetWorkspacesRequest" +instance (HsProtobuf.HasDefault GetWorkspacesRequest) +instance (HsProtobuf.Message GetWorkspacesRequest) where + encodeMessage _ GetWorkspacesRequest {getWorkspacesRequestVoid} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getWorkspacesRequestVoid + ) + ) decodeMessage _ = - (Hs.pure GetWorkspacesRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetWorkspacesRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "void") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetWorkspacesRequest where +instance (HsJSONPB.ToJSONPB GetWorkspacesRequest) where toJSONPB (GetWorkspacesRequest f1) = - ( HsJSONPB.object - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (GetWorkspacesRequest f1) = - ( HsJSONPB.pairs - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB GetWorkspacesRequest where + HsJSONPB.pairs + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB GetWorkspacesRequest) where parseJSONPB = - ( HsJSONPB.withObject - "GetWorkspacesRequest" - ( \obj -> - (Hs.pure GetWorkspacesRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "void") - ) - ) - ) - -instance HsJSONPB.ToJSON GetWorkspacesRequest where + HsJSONPB.withObject + "GetWorkspacesRequest" + ( \obj -> + Hs.pure GetWorkspacesRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "void") + ) + ) +instance (HsJSONPB.ToJSON GetWorkspacesRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetWorkspacesRequest where +instance (HsJSONPB.FromJSON GetWorkspacesRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetWorkspacesResponse = GetWorkspacesResponse - { getWorkspacesResponseWorkspaces :: - Hs.Vector Monocle.Protob.Config.Workspace - } +newtype GetWorkspacesResponse = GetWorkspacesResponse {getWorkspacesResponseWorkspaces :: (Hs.Vector Monocle.Protob.Config.Workspace)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetWorkspacesResponse - -instance HsProtobuf.Named GetWorkspacesResponse where - nameOf _ = (Hs.fromString "GetWorkspacesResponse") - -instance HsProtobuf.HasDefault GetWorkspacesResponse - -instance HsProtobuf.Message GetWorkspacesResponse where +instance (Hs.NFData GetWorkspacesResponse) +instance (HsProtobuf.Named GetWorkspacesResponse) where + nameOf _ = Hs.fromString "GetWorkspacesResponse" +instance (HsProtobuf.HasDefault GetWorkspacesResponse) +instance (HsProtobuf.Message GetWorkspacesResponse) where encodeMessage _ - GetWorkspacesResponse - { getWorkspacesResponseWorkspaces = - getWorkspacesResponseWorkspaces - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.Workspace) - @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) - (getWorkspacesResponseWorkspaces) - ) + GetWorkspacesResponse {getWorkspacesResponseWorkspaces} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.Workspace) + @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) ) - ] + getWorkspacesResponseWorkspaces + ) ) decodeMessage _ = - (Hs.pure GetWorkspacesResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) - @(Hs.Vector Monocle.Protob.Config.Workspace) + Hs.pure GetWorkspacesResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) + @(Hs.Vector Monocle.Protob.Config.Workspace) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Workspace")) - ) - (HsProtobufAST.Single "workspaces") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Workspace")) + ) + (HsProtobufAST.Single "workspaces") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetWorkspacesResponse where +instance (HsJSONPB.ToJSONPB GetWorkspacesResponse) where toJSONPB (GetWorkspacesResponse f1) = - ( HsJSONPB.object - [ "workspaces" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.Workspace) + HsJSONPB.object + [ "workspaces" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.Workspace) @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (GetWorkspacesResponse f1) = - ( HsJSONPB.pairs - [ "workspaces" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.Workspace) + HsJSONPB.pairs + [ "workspaces" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.Workspace) @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB GetWorkspacesResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB GetWorkspacesResponse) where parseJSONPB = - ( HsJSONPB.withObject - "GetWorkspacesResponse" - ( \obj -> - (Hs.pure GetWorkspacesResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "GetWorkspacesResponse" + ( \obj -> + Hs.pure GetWorkspacesResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) @(Hs.Vector Monocle.Protob.Config.Workspace) - (obj .: "workspaces") ) - ) - ) - -instance HsJSONPB.ToJSON GetWorkspacesResponse where + (obj .: "workspaces") + ) + ) +instance (HsJSONPB.ToJSON GetWorkspacesResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetWorkspacesResponse where +instance (HsJSONPB.FromJSON GetWorkspacesResponse) where parseJSON = HsJSONPB.parseJSONPB - data About = About { aboutVersion :: Hs.Text - , aboutLinks :: Hs.Vector Monocle.Protob.Config.About_AboutLink - , aboutAuth :: Hs.Maybe AboutAuth + , aboutLinks :: (Hs.Vector Monocle.Protob.Config.About_AboutLink) + , aboutAuth :: (Hs.Maybe AboutAuth) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData About - -instance HsProtobuf.Named About where - nameOf _ = (Hs.fromString "About") - -instance HsProtobuf.HasDefault About - -instance HsProtobuf.Message About where - encodeMessage - _ - About - { aboutVersion = aboutVersion - , aboutLinks = aboutLinks - , aboutAuth = aboutAuth - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (aboutVersion) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.About_AboutLink) +instance (Hs.NFData About) +instance (HsProtobuf.Named About) where + nameOf _ = Hs.fromString "About" +instance (HsProtobuf.HasDefault About) +instance (HsProtobuf.Message About) where + encodeMessage _ About {aboutVersion, aboutLinks, aboutAuth} = + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) aboutVersion) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.About_AboutLink) @(HsProtobuf.NestedVec Monocle.Protob.Config.About_AboutLink) - (aboutLinks) ) - ) - , case aboutAuth of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - AboutAuthAuthConfig y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About_AuthConfig) - @(HsProtobuf.Nested Monocle.Protob.Config.About_AuthConfig) - (Hs.Just y) - ) + aboutLinks + ) + ) + ) + ( case aboutAuth of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + AboutAuthAuthConfig y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Config.About_AuthConfig) + @(HsProtobuf.Nested Monocle.Protob.Config.About_AuthConfig) ) - ] + (Hs.Just y) + ) ) decodeMessage _ = - (Hs.pure About) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure About + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Config.About_AboutLink) - @(Hs.Vector Monocle.Protob.Config.About_AboutLink) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.About_AboutLink) + @(Hs.Vector Monocle.Protob.Config.About_AboutLink) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 3) - , (Hs.pure (Hs.fmap AboutAuthAuthConfig)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Config.About_AuthConfig) - @(Hs.Maybe Monocle.Protob.Config.About_AuthConfig) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 3) + , Hs.pure (Hs.fmap AboutAuthAuthConfig) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Config.About_AuthConfig) + @(Hs.Maybe Monocle.Protob.Config.About_AuthConfig) + ) + HsProtobuf.decodeMessageField + ) ) + ] dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "version") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "AboutLink")) - ) - (HsProtobufAST.Single "links") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "version") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "AboutLink")) + ) + (HsProtobufAST.Single "links") + [] + "" ] - -instance HsJSONPB.ToJSONPB About where +instance (HsJSONPB.ToJSONPB About) where toJSONPB (About f1 f2 f3) = - ( HsJSONPB.object - [ "version" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "links" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.About_AboutLink) + HsJSONPB.object + [ "version" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "links" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.About_AboutLink) @(HsProtobuf.NestedVec Monocle.Protob.Config.About_AboutLink) - (f2) ) - , ( let encodeAuth = - ( case f3 of - Hs.Just (AboutAuthAuthConfig f3) -> - (HsJSONPB.pair "auth_config" f3) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("auth" .= (HsJSONPB.objectOrNull [encodeAuth] options)) options - else encodeAuth options - ) - ] - ) + f2 + ) + , ( let + encodeAuth = + ( case f3 of + Hs.Just (AboutAuthAuthConfig f3) -> HsJSONPB.pair "auth_config" f3 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("auth" .= HsJSONPB.objectOrNull [encodeAuth] options) options + else encodeAuth options + ) + ) + ] toEncodingPB (About f1 f2 f3) = - ( HsJSONPB.pairs - [ "version" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "links" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.About_AboutLink) + HsJSONPB.pairs + [ "version" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "links" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.About_AboutLink) @(HsProtobuf.NestedVec Monocle.Protob.Config.About_AboutLink) - (f2) ) - , ( let encodeAuth = - ( case f3 of - Hs.Just (AboutAuthAuthConfig f3) -> - (HsJSONPB.pair "auth_config" f3) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("auth" .= (HsJSONPB.pairsOrNull [encodeAuth] options)) options - else encodeAuth options - ) - ] - ) - -instance HsJSONPB.FromJSONPB About where + f2 + ) + , ( let + encodeAuth = + ( case f3 of + Hs.Just (AboutAuthAuthConfig f3) -> HsJSONPB.pair "auth_config" f3 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("auth" .= HsJSONPB.pairsOrNull [encodeAuth] options) options + else encodeAuth options + ) + ) + ] +instance (HsJSONPB.FromJSONPB About) where parseJSONPB = - ( HsJSONPB.withObject - "About" - ( \obj -> - (Hs.pure About) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "version") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "About" + ( \obj -> + Hs.pure About + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "version") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Config.About_AboutLink) @(Hs.Vector Monocle.Protob.Config.About_AboutLink) - (obj .: "links") - ) - <*> ( let parseAuth parseObj = - Hs.msum - [ Hs.Just Hs.. AboutAuthAuthConfig - <$> (HsJSONPB.parseField parseObj "auth_config") - , Hs.pure Hs.Nothing - ] - in ((obj .: "auth") Hs.>>= (HsJSONPB.withObject "auth" parseAuth)) - <|> (parseAuth obj) ) - ) - ) - -instance HsJSONPB.ToJSON About where + (obj .: "links") + ) + <*> ( let + parseAuth parseObj = + Hs.msum + [ Hs.Just Hs.. AboutAuthAuthConfig + <$> HsJSONPB.parseField parseObj "auth_config" + , Hs.pure Hs.Nothing + ] + in + (obj .: "auth" Hs.>>= HsJSONPB.withObject "auth" parseAuth) + <|> (parseAuth obj) + ) + ) +instance (HsJSONPB.ToJSON About) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON About where +instance (HsJSONPB.FromJSON About) where parseJSON = HsJSONPB.parseJSONPB - data About_AboutLink = About_AboutLink - { about_AboutLinkName :: - Hs.Text + { about_AboutLinkName :: Hs.Text , about_AboutLinkUrl :: Hs.Text , about_AboutLinkCategory :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData About_AboutLink - -instance HsProtobuf.Named About_AboutLink where - nameOf _ = (Hs.fromString "About_AboutLink") - -instance HsProtobuf.HasDefault About_AboutLink - -instance HsProtobuf.Message About_AboutLink where +instance (Hs.NFData About_AboutLink) +instance (HsProtobuf.Named About_AboutLink) where + nameOf _ = Hs.fromString "About_AboutLink" +instance (HsProtobuf.HasDefault About_AboutLink) +instance (HsProtobuf.Message About_AboutLink) where encodeMessage _ About_AboutLink - { about_AboutLinkName = about_AboutLinkName - , about_AboutLinkUrl = about_AboutLinkUrl - , about_AboutLinkCategory = about_AboutLinkCategory + { about_AboutLinkName + , about_AboutLinkUrl + , about_AboutLinkCategory } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (about_AboutLinkName) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + about_AboutLinkName ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (about_AboutLinkUrl) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + about_AboutLinkUrl ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (about_AboutLinkCategory) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + about_AboutLinkCategory ) - ] - ) + ) decodeMessage _ = - (Hs.pure About_AboutLink) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure About_AboutLink + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "name") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "category") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "category") + [] + "" ] - -instance HsJSONPB.ToJSONPB About_AboutLink where +instance (HsJSONPB.ToJSONPB About_AboutLink) where toJSONPB (About_AboutLink f1 f2 f3) = - ( HsJSONPB.object - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "category" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) + HsJSONPB.object + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "category" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] toEncodingPB (About_AboutLink f1 f2 f3) = - ( HsJSONPB.pairs - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "category" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) - -instance HsJSONPB.FromJSONPB About_AboutLink where + HsJSONPB.pairs + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "category" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] +instance (HsJSONPB.FromJSONPB About_AboutLink) where parseJSONPB = - ( HsJSONPB.withObject - "About_AboutLink" - ( \obj -> - (Hs.pure About_AboutLink) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "name") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "category") - ) - ) - ) - -instance HsJSONPB.ToJSON About_AboutLink where + HsJSONPB.withObject + "About_AboutLink" + ( \obj -> + Hs.pure About_AboutLink + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "name") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "category") + ) + ) +instance (HsJSONPB.ToJSON About_AboutLink) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON About_AboutLink where +instance (HsJSONPB.FromJSON About_AboutLink) where parseJSON = HsJSONPB.parseJSONPB - data About_AuthConfig = About_AuthConfig - { about_AuthConfigForceLogin :: - Hs.Bool + { about_AuthConfigForceLogin :: Hs.Bool , about_AuthConfigIssuer :: Hs.Text , about_AuthConfigProviderName :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData About_AuthConfig - -instance HsProtobuf.Named About_AuthConfig where - nameOf _ = (Hs.fromString "About_AuthConfig") - -instance HsProtobuf.HasDefault About_AuthConfig - -instance HsProtobuf.Message About_AuthConfig where +instance (Hs.NFData About_AuthConfig) +instance (HsProtobuf.Named About_AuthConfig) where + nameOf _ = Hs.fromString "About_AuthConfig" +instance (HsProtobuf.HasDefault About_AuthConfig) +instance (HsProtobuf.Message About_AuthConfig) where encodeMessage _ About_AuthConfig - { about_AuthConfigForceLogin = - about_AuthConfigForceLogin - , about_AuthConfigIssuer = about_AuthConfigIssuer - , about_AuthConfigProviderName = about_AuthConfigProviderName + { about_AuthConfigForceLogin + , about_AuthConfigIssuer + , about_AuthConfigProviderName } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) about_AuthConfigForceLogin ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (about_AuthConfigIssuer) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + about_AuthConfigIssuer ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (about_AuthConfigProviderName) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + about_AuthConfigProviderName ) - ] - ) + ) decodeMessage _ = - (Hs.pure About_AuthConfig) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure About_AuthConfig + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.Bool) - (HsProtobufAST.Single "force_login") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "issuer") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "provider_name") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "force_login") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "issuer") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "provider_name") + [] + "" ] - -instance HsJSONPB.ToJSONPB About_AuthConfig where +instance (HsJSONPB.ToJSONPB About_AuthConfig) where toJSONPB (About_AuthConfig f1 f2 f3) = - ( HsJSONPB.object - [ "force_login" .= f1 - , "issuer" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "provider_name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) + HsJSONPB.object + [ "force_login" .= f1 + , "issuer" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "provider_name" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] toEncodingPB (About_AuthConfig f1 f2 f3) = - ( HsJSONPB.pairs - [ "force_login" .= f1 - , "issuer" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "provider_name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) - -instance HsJSONPB.FromJSONPB About_AuthConfig where + HsJSONPB.pairs + [ "force_login" .= f1 + , "issuer" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "provider_name" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] +instance (HsJSONPB.FromJSONPB About_AuthConfig) where parseJSONPB = - ( HsJSONPB.withObject - "About_AuthConfig" - ( \obj -> - (Hs.pure About_AuthConfig) - <*> obj .: "force_login" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "issuer") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "provider_name") - ) - ) - ) - -instance HsJSONPB.ToJSON About_AuthConfig where + HsJSONPB.withObject + "About_AuthConfig" + ( \obj -> + Hs.pure About_AuthConfig + <*> obj .: "force_login" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "issuer") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "provider_name") + ) + ) +instance (HsJSONPB.ToJSON About_AuthConfig) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON About_AuthConfig where +instance (HsJSONPB.FromJSON About_AuthConfig) where parseJSON = HsJSONPB.parseJSONPB - -data AboutAuth = AboutAuthAuthConfig Monocle.Protob.Config.About_AuthConfig +newtype AboutAuth + = AboutAuthAuthConfig Monocle.Protob.Config.About_AuthConfig deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AboutAuth - -instance HsProtobuf.Named AboutAuth where - nameOf _ = (Hs.fromString "AboutAuth") - -newtype GetAboutRequest = GetAboutRequest - { getAboutRequestVoid :: - Hs.Text - } +instance (Hs.NFData AboutAuth) +instance (HsProtobuf.Named AboutAuth) where + nameOf _ = Hs.fromString "AboutAuth" +newtype GetAboutRequest = GetAboutRequest {getAboutRequestVoid :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetAboutRequest - -instance HsProtobuf.Named GetAboutRequest where - nameOf _ = (Hs.fromString "GetAboutRequest") - -instance HsProtobuf.HasDefault GetAboutRequest - -instance HsProtobuf.Message GetAboutRequest where - encodeMessage - _ - GetAboutRequest {getAboutRequestVoid = getAboutRequestVoid} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getAboutRequestVoid) - ) - ) - ] - ) +instance (Hs.NFData GetAboutRequest) +instance (HsProtobuf.Named GetAboutRequest) where + nameOf _ = Hs.fromString "GetAboutRequest" +instance (HsProtobuf.HasDefault GetAboutRequest) +instance (HsProtobuf.Message GetAboutRequest) where + encodeMessage _ GetAboutRequest {getAboutRequestVoid} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getAboutRequestVoid + ) + ) decodeMessage _ = - (Hs.pure GetAboutRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetAboutRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "void") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetAboutRequest where +instance (HsJSONPB.ToJSONPB GetAboutRequest) where toJSONPB (GetAboutRequest f1) = - ( HsJSONPB.object - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (GetAboutRequest f1) = - ( HsJSONPB.pairs - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB GetAboutRequest where + HsJSONPB.pairs + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB GetAboutRequest) where parseJSONPB = - ( HsJSONPB.withObject - "GetAboutRequest" - ( \obj -> - (Hs.pure GetAboutRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "void") - ) - ) - ) - -instance HsJSONPB.ToJSON GetAboutRequest where + HsJSONPB.withObject + "GetAboutRequest" + ( \obj -> + Hs.pure GetAboutRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "void") + ) + ) +instance (HsJSONPB.ToJSON GetAboutRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetAboutRequest where +instance (HsJSONPB.FromJSON GetAboutRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetAboutResponse = GetAboutResponse - { getAboutResponseAbout :: - Hs.Maybe Monocle.Protob.Config.About - } +newtype GetAboutResponse = GetAboutResponse {getAboutResponseAbout :: (Hs.Maybe Monocle.Protob.Config.About)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetAboutResponse - -instance HsProtobuf.Named GetAboutResponse where - nameOf _ = (Hs.fromString "GetAboutResponse") - -instance HsProtobuf.HasDefault GetAboutResponse - -instance HsProtobuf.Message GetAboutResponse where - encodeMessage - _ - GetAboutResponse {getAboutResponseAbout = getAboutResponseAbout} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) - @(HsProtobuf.Nested Monocle.Protob.Config.About) - (getAboutResponseAbout) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure GetAboutResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Config.About) +instance (Hs.NFData GetAboutResponse) +instance (HsProtobuf.Named GetAboutResponse) where + nameOf _ = Hs.fromString "GetAboutResponse" +instance (HsProtobuf.HasDefault GetAboutResponse) +instance (HsProtobuf.Message GetAboutResponse) where + encodeMessage _ GetAboutResponse {getAboutResponseAbout} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) + @(HsProtobuf.Nested Monocle.Protob.Config.About) + ) + getAboutResponseAbout + ) + ) + decodeMessage _ = + Hs.pure GetAboutResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Config.About) + @(Hs.Maybe Monocle.Protob.Config.About) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "About")) - ) - (HsProtobufAST.Single "about") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "About")) + ) + (HsProtobufAST.Single "about") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetAboutResponse where +instance (HsJSONPB.ToJSONPB GetAboutResponse) where toJSONPB (GetAboutResponse f1) = - ( HsJSONPB.object - [ "about" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) + HsJSONPB.object + [ "about" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Config.About) @(HsProtobuf.Nested Monocle.Protob.Config.About) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (GetAboutResponse f1) = - ( HsJSONPB.pairs - [ "about" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) + HsJSONPB.pairs + [ "about" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Config.About) @(HsProtobuf.Nested Monocle.Protob.Config.About) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB GetAboutResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB GetAboutResponse) where parseJSONPB = - ( HsJSONPB.withObject - "GetAboutResponse" - ( \obj -> - (Hs.pure GetAboutResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "GetAboutResponse" + ( \obj -> + Hs.pure GetAboutResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Config.About) @(Hs.Maybe Monocle.Protob.Config.About) - (obj .: "about") ) - ) - ) - -instance HsJSONPB.ToJSON GetAboutResponse where + (obj .: "about") + ) + ) +instance (HsJSONPB.ToJSON GetAboutResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetAboutResponse where +instance (HsJSONPB.FromJSON GetAboutResponse) where parseJSON = HsJSONPB.parseJSONPB - data GroupDefinition = GroupDefinition - { groupDefinitionName :: - Hs.Text + { groupDefinitionName :: Hs.Text , groupDefinitionMembers :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GroupDefinition - -instance HsProtobuf.Named GroupDefinition where - nameOf _ = (Hs.fromString "GroupDefinition") - -instance HsProtobuf.HasDefault GroupDefinition - -instance HsProtobuf.Message GroupDefinition where +instance (Hs.NFData GroupDefinition) +instance (HsProtobuf.Named GroupDefinition) where + nameOf _ = Hs.fromString "GroupDefinition" +instance (HsProtobuf.HasDefault GroupDefinition) +instance (HsProtobuf.Message GroupDefinition) where encodeMessage _ - GroupDefinition - { groupDefinitionName = groupDefinitionName - , groupDefinitionMembers = groupDefinitionMembers - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (groupDefinitionName) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - groupDefinitionMembers + GroupDefinition {groupDefinitionName, groupDefinitionMembers} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + groupDefinitionName ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + groupDefinitionMembers + ) decodeMessage _ = - (Hs.pure GroupDefinition) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GroupDefinition + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "name") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "members") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "members") + [] + "" ] - -instance HsJSONPB.ToJSONPB GroupDefinition where +instance (HsJSONPB.ToJSONPB GroupDefinition) where toJSONPB (GroupDefinition f1 f2) = - ( HsJSONPB.object - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "members" .= f2 - ] - ) + HsJSONPB.object + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "members" .= f2 + ] toEncodingPB (GroupDefinition f1 f2) = - ( HsJSONPB.pairs - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "members" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB GroupDefinition where + HsJSONPB.pairs + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "members" .= f2 + ] +instance (HsJSONPB.FromJSONPB GroupDefinition) where parseJSONPB = - ( HsJSONPB.withObject - "GroupDefinition" - ( \obj -> - (Hs.pure GroupDefinition) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "name") - ) - <*> obj .: "members" - ) - ) - -instance HsJSONPB.ToJSON GroupDefinition where + HsJSONPB.withObject + "GroupDefinition" + ( \obj -> + Hs.pure GroupDefinition + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "name") + ) + <*> obj .: "members" + ) +instance (HsJSONPB.ToJSON GroupDefinition) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GroupDefinition where +instance (HsJSONPB.FromJSON GroupDefinition) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetGroupsRequest = GetGroupsRequest - { getGroupsRequestIndex :: - Hs.Text - } +newtype GetGroupsRequest = GetGroupsRequest {getGroupsRequestIndex :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetGroupsRequest - -instance HsProtobuf.Named GetGroupsRequest where - nameOf _ = (Hs.fromString "GetGroupsRequest") - -instance HsProtobuf.HasDefault GetGroupsRequest - -instance HsProtobuf.Message GetGroupsRequest where - encodeMessage - _ - GetGroupsRequest {getGroupsRequestIndex = getGroupsRequestIndex} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getGroupsRequestIndex) - ) - ) - ] - ) +instance (Hs.NFData GetGroupsRequest) +instance (HsProtobuf.Named GetGroupsRequest) where + nameOf _ = Hs.fromString "GetGroupsRequest" +instance (HsProtobuf.HasDefault GetGroupsRequest) +instance (HsProtobuf.Message GetGroupsRequest) where + encodeMessage _ GetGroupsRequest {getGroupsRequestIndex} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getGroupsRequestIndex + ) + ) decodeMessage _ = - (Hs.pure GetGroupsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetGroupsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetGroupsRequest where +instance (HsJSONPB.ToJSONPB GetGroupsRequest) where toJSONPB (GetGroupsRequest f1) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (GetGroupsRequest f1) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB GetGroupsRequest where + HsJSONPB.pairs + ["index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB GetGroupsRequest) where parseJSONPB = - ( HsJSONPB.withObject - "GetGroupsRequest" - ( \obj -> - (Hs.pure GetGroupsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - ) - ) - -instance HsJSONPB.ToJSON GetGroupsRequest where + HsJSONPB.withObject + "GetGroupsRequest" + ( \obj -> + Hs.pure GetGroupsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + ) +instance (HsJSONPB.ToJSON GetGroupsRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetGroupsRequest where +instance (HsJSONPB.FromJSON GetGroupsRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetGroupsResponse = GetGroupsResponse - { getGroupsResponseItems :: - Hs.Vector Monocle.Protob.Config.GroupDefinition - } +newtype GetGroupsResponse = GetGroupsResponse {getGroupsResponseItems :: (Hs.Vector Monocle.Protob.Config.GroupDefinition)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetGroupsResponse - -instance HsProtobuf.Named GetGroupsResponse where - nameOf _ = (Hs.fromString "GetGroupsResponse") - -instance HsProtobuf.HasDefault GetGroupsResponse - -instance HsProtobuf.Message GetGroupsResponse where - encodeMessage - _ - GetGroupsResponse {getGroupsResponseItems = getGroupsResponseItems} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) - @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) - (getGroupsResponseItems) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure GetGroupsResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) +instance (Hs.NFData GetGroupsResponse) +instance (HsProtobuf.Named GetGroupsResponse) where + nameOf _ = Hs.fromString "GetGroupsResponse" +instance (HsProtobuf.HasDefault GetGroupsResponse) +instance (HsProtobuf.Message GetGroupsResponse) where + encodeMessage _ GetGroupsResponse {getGroupsResponseItems} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) + @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) + ) + getGroupsResponseItems + ) + ) + decodeMessage _ = + Hs.pure GetGroupsResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) + @(Hs.Vector Monocle.Protob.Config.GroupDefinition) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "GroupDefinition")) - ) - (HsProtobufAST.Single "items") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "GroupDefinition")) + ) + (HsProtobufAST.Single "items") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetGroupsResponse where +instance (HsJSONPB.ToJSONPB GetGroupsResponse) where toJSONPB (GetGroupsResponse f1) = - ( HsJSONPB.object - [ "items" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) + HsJSONPB.object + [ "items" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.GroupDefinition) @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (GetGroupsResponse f1) = - ( HsJSONPB.pairs - [ "items" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) + HsJSONPB.pairs + [ "items" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Config.GroupDefinition) @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB GetGroupsResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB GetGroupsResponse) where parseJSONPB = - ( HsJSONPB.withObject - "GetGroupsResponse" - ( \obj -> - (Hs.pure GetGroupsResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "GetGroupsResponse" + ( \obj -> + Hs.pure GetGroupsResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) @(Hs.Vector Monocle.Protob.Config.GroupDefinition) - (obj .: "items") ) - ) - ) - -instance HsJSONPB.ToJSON GetGroupsResponse where + (obj .: "items") + ) + ) +instance (HsJSONPB.ToJSON GetGroupsResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetGroupsResponse where +instance (HsJSONPB.FromJSON GetGroupsResponse) where parseJSON = HsJSONPB.parseJSONPB - data GetGroupMembersRequest = GetGroupMembersRequest - { getGroupMembersRequestIndex :: - Hs.Text + { getGroupMembersRequestIndex :: Hs.Text , getGroupMembersRequestGroup :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetGroupMembersRequest - -instance HsProtobuf.Named GetGroupMembersRequest where - nameOf _ = (Hs.fromString "GetGroupMembersRequest") - -instance HsProtobuf.HasDefault GetGroupMembersRequest - -instance HsProtobuf.Message GetGroupMembersRequest where +instance (Hs.NFData GetGroupMembersRequest) +instance (HsProtobuf.Named GetGroupMembersRequest) where + nameOf _ = Hs.fromString "GetGroupMembersRequest" +instance (HsProtobuf.HasDefault GetGroupMembersRequest) +instance (HsProtobuf.Message GetGroupMembersRequest) where encodeMessage _ GetGroupMembersRequest - { getGroupMembersRequestIndex = - getGroupMembersRequestIndex - , getGroupMembersRequestGroup = getGroupMembersRequestGroup + { getGroupMembersRequestIndex + , getGroupMembersRequestGroup } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getGroupMembersRequestIndex) - ) + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getGroupMembersRequestIndex ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getGroupMembersRequestGroup) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getGroupMembersRequestGroup ) - ] - ) + ) decodeMessage _ = - (Hs.pure GetGroupMembersRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetGroupMembersRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "group") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "group") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetGroupMembersRequest where +instance (HsJSONPB.ToJSONPB GetGroupMembersRequest) where toJSONPB (GetGroupMembersRequest f1 f2) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "group" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "group" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] toEncodingPB (GetGroupMembersRequest f1 f2) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "group" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) - -instance HsJSONPB.FromJSONPB GetGroupMembersRequest where + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "group" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] +instance (HsJSONPB.FromJSONPB GetGroupMembersRequest) where parseJSONPB = - ( HsJSONPB.withObject - "GetGroupMembersRequest" - ( \obj -> - (Hs.pure GetGroupMembersRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "group") - ) - ) - ) - -instance HsJSONPB.ToJSON GetGroupMembersRequest where + HsJSONPB.withObject + "GetGroupMembersRequest" + ( \obj -> + Hs.pure GetGroupMembersRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "group") + ) + ) +instance (HsJSONPB.ToJSON GetGroupMembersRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetGroupMembersRequest where +instance (HsJSONPB.FromJSON GetGroupMembersRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetGroupMembersResponse = GetGroupMembersResponse - { getGroupMembersResponseMembers :: - Hs.Vector Hs.Text - } +newtype GetGroupMembersResponse = GetGroupMembersResponse {getGroupMembersResponseMembers :: (Hs.Vector Hs.Text)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetGroupMembersResponse - -instance HsProtobuf.Named GetGroupMembersResponse where - nameOf _ = (Hs.fromString "GetGroupMembersResponse") - -instance HsProtobuf.HasDefault GetGroupMembersResponse - -instance HsProtobuf.Message GetGroupMembersResponse where +instance (Hs.NFData GetGroupMembersResponse) +instance (HsProtobuf.Named GetGroupMembersResponse) where + nameOf _ = Hs.fromString "GetGroupMembersResponse" +instance (HsProtobuf.HasDefault GetGroupMembersResponse) +instance (HsProtobuf.Message GetGroupMembersResponse) where encodeMessage _ - GetGroupMembersResponse - { getGroupMembersResponseMembers = - getGroupMembersResponseMembers - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (getGroupMembersResponseMembers) - ) + GetGroupMembersResponse {getGroupMembersResponseMembers} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) ) - ] + getGroupMembersResponseMembers + ) ) decodeMessage _ = - (Hs.pure GetGroupMembersResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + Hs.pure GetGroupMembersResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "members") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "members") + [] + "" ] - -instance HsJSONPB.ToJSONPB GetGroupMembersResponse where +instance (HsJSONPB.ToJSONPB GetGroupMembersResponse) where toJSONPB (GetGroupMembersResponse f1) = - ( HsJSONPB.object - [ "members" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.object + [ "members" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (GetGroupMembersResponse f1) = - ( HsJSONPB.pairs - [ "members" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.pairs + [ "members" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB GetGroupMembersResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB GetGroupMembersResponse) where parseJSONPB = - ( HsJSONPB.withObject - "GetGroupMembersResponse" - ( \obj -> - (Hs.pure GetGroupMembersResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "GetGroupMembersResponse" + ( \obj -> + Hs.pure GetGroupMembersResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "members") ) - ) - ) - -instance HsJSONPB.ToJSON GetGroupMembersResponse where + (obj .: "members") + ) + ) +instance (HsJSONPB.ToJSON GetGroupMembersResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetGroupMembersResponse where +instance (HsJSONPB.FromJSON GetGroupMembersResponse) where parseJSON = HsJSONPB.parseJSONPB diff --git a/codegen/Monocle/Protob/Crawler.hs b/codegen/Monocle/Protob/Crawler.hs index 9d8d15ac0..76d423247 100644 --- a/codegen/Monocle/Protob/Crawler.hs +++ b/codegen/Monocle/Protob/Crawler.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -49,228 +52,202 @@ import Proto3.Wire.Decode qualified as HsProtobuf ( import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs -newtype Entity = Entity {entityEntity :: Hs.Maybe EntityEntity} +newtype Entity = Entity {entityEntity :: (Hs.Maybe EntityEntity)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Entity - -instance HsProtobuf.Named Entity where - nameOf _ = (Hs.fromString "Entity") - -instance HsProtobuf.HasDefault Entity - -instance HsProtobuf.Message Entity where - encodeMessage _ Entity {entityEntity = entityEntity} = - ( Hs.mconcat - [ case entityEntity of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - EntityEntityOrganizationName y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - EntityEntityProjectName y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - EntityEntityProjectIssueName y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - EntityEntityTdName y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - EntityEntityUserName y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure Entity) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. EntityEntityOrganizationName)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData Entity) +instance (HsProtobuf.Named Entity) where + nameOf _ = Hs.fromString "Entity" +instance (HsProtobuf.HasDefault Entity) +instance (HsProtobuf.Message Entity) where + encodeMessage _ Entity {entityEntity} = + ( case entityEntity of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + EntityEntityOrganizationName y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.Just Hs.. EntityEntityProjectName)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) + EntityEntityProjectName y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , - ( (HsProtobuf.FieldNumber 4) - , (Hs.pure (Hs.Just Hs.. EntityEntityProjectIssueName)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) + EntityEntityProjectIssueName y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , - ( (HsProtobuf.FieldNumber 3) - , (Hs.pure (Hs.Just Hs.. EntityEntityTdName)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) + EntityEntityTdName y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , - ( (HsProtobuf.FieldNumber 5) - , (Hs.pure (Hs.Just Hs.. EntityEntityUserName)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) + EntityEntityUserName y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - ] + ) + decodeMessage _ = + Hs.pure Entity + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. EntityEntityOrganizationName) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField + ) ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB Entity where - toJSONPB (Entity f1_or_f2_or_f4_or_f3_or_f5) = - ( HsJSONPB.object - [ ( let encodeEntity = - ( case f1_or_f2_or_f4_or_f3_or_f5 of - Hs.Just (EntityEntityOrganizationName f1) -> - ( HsJSONPB.pair - "organization_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (EntityEntityProjectName f2) -> - ( HsJSONPB.pair - "project_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Just (EntityEntityProjectIssueName f4) -> - ( HsJSONPB.pair - "project_issue_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - ) - Hs.Just (EntityEntityTdName f3) -> - ( HsJSONPB.pair - "td_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ) - Hs.Just (EntityEntityUserName f5) -> - ( HsJSONPB.pair - "user_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - ) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.Just Hs.. EntityEntityProjectName) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("entity" .= (HsJSONPB.objectOrNull [encodeEntity] options)) - options - else encodeEntity options ) - ] - ) - toEncodingPB (Entity f1_or_f2_or_f4_or_f3_or_f5) = - ( HsJSONPB.pairs - [ ( let encodeEntity = - ( case f1_or_f2_or_f4_or_f3_or_f5 of - Hs.Just (EntityEntityOrganizationName f1) -> - ( HsJSONPB.pair - "organization_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (EntityEntityProjectName f2) -> - ( HsJSONPB.pair - "project_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Just (EntityEntityProjectIssueName f4) -> - ( HsJSONPB.pair - "project_issue_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - ) - Hs.Just (EntityEntityTdName f3) -> - ( HsJSONPB.pair - "td_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ) - Hs.Just (EntityEntityUserName f5) -> - ( HsJSONPB.pair - "user_name" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - ) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 4) + , Hs.pure (Hs.Just Hs.. EntityEntityProjectIssueName) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("entity" .= (HsJSONPB.pairsOrNull [encodeEntity] options)) options - else encodeEntity options ) - ] - ) - -instance HsJSONPB.FromJSONPB Entity where - parseJSONPB = - ( HsJSONPB.withObject - "Entity" - ( \obj -> - (Hs.pure Entity) - <*> ( let parseEntity parseObj = - Hs.msum - [ Hs.Just - Hs.. EntityEntityOrganizationName - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "organization_name") - , Hs.Just - Hs.. EntityEntityProjectName - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "project_name") - , Hs.Just - Hs.. EntityEntityProjectIssueName - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "project_issue_name") - , Hs.Just - Hs.. EntityEntityTdName - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "td_name") - , Hs.Just - Hs.. EntityEntityUserName - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "user_name") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "entity") - Hs.>>= (HsJSONPB.withObject "entity" parseEntity) - ) - <|> (parseEntity obj) + , + ( (HsProtobuf.FieldNumber 3) + , Hs.pure (Hs.Just Hs.. EntityEntityTdName) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 5) + , Hs.pure (Hs.Just Hs.. EntityEntityUserName) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) + ) + ] + dotProto _ = [] +instance (HsJSONPB.ToJSONPB Entity) where + toJSONPB (Entity f1_or_f2_or_f4_or_f3_or_f5) = + HsJSONPB.object + [ ( let + encodeEntity = + ( case f1_or_f2_or_f4_or_f3_or_f5 of + Hs.Just (EntityEntityOrganizationName f1) -> + HsJSONPB.pair + "organization_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (EntityEntityProjectName f2) -> + HsJSONPB.pair + "project_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Just (EntityEntityProjectIssueName f4) -> + HsJSONPB.pair + "project_issue_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + Hs.Just (EntityEntityTdName f3) -> + HsJSONPB.pair + "td_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + Hs.Just (EntityEntityUserName f5) -> + HsJSONPB.pair + "user_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("entity" .= HsJSONPB.objectOrNull [encodeEntity] options) options + else encodeEntity options + ) ) - ) - -instance HsJSONPB.ToJSON Entity where + ] + toEncodingPB (Entity f1_or_f2_or_f4_or_f3_or_f5) = + HsJSONPB.pairs + [ ( let + encodeEntity = + ( case f1_or_f2_or_f4_or_f3_or_f5 of + Hs.Just (EntityEntityOrganizationName f1) -> + HsJSONPB.pair + "organization_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (EntityEntityProjectName f2) -> + HsJSONPB.pair + "project_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Just (EntityEntityProjectIssueName f4) -> + HsJSONPB.pair + "project_issue_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + Hs.Just (EntityEntityTdName f3) -> + HsJSONPB.pair + "td_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + Hs.Just (EntityEntityUserName f5) -> + HsJSONPB.pair + "user_name" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("entity" .= HsJSONPB.pairsOrNull [encodeEntity] options) options + else encodeEntity options + ) + ) + ] +instance (HsJSONPB.FromJSONPB Entity) where + parseJSONPB = + HsJSONPB.withObject + "Entity" + ( \obj -> + Hs.pure Entity + <*> ( let + parseEntity parseObj = + Hs.msum + [ Hs.Just + Hs.. EntityEntityOrganizationName + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "organization_name" + , Hs.Just + Hs.. EntityEntityProjectName + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "project_name" + , Hs.Just + Hs.. EntityEntityProjectIssueName + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "project_issue_name" + , Hs.Just + Hs.. EntityEntityTdName + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "td_name" + , Hs.Just + Hs.. EntityEntityUserName + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "user_name" + , Hs.pure Hs.Nothing + ] + in + (obj .: "entity" Hs.>>= HsJSONPB.withObject "entity" parseEntity) + <|> (parseEntity obj) + ) + ) +instance (HsJSONPB.ToJSON Entity) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Entity where +instance (HsJSONPB.FromJSON Entity) where parseJSON = HsJSONPB.parseJSONPB - data EntityEntity = EntityEntityOrganizationName Hs.Text | EntityEntityProjectName Hs.Text @@ -278,50 +255,40 @@ data EntityEntity | EntityEntityTdName Hs.Text | EntityEntityUserName Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData EntityEntity - -instance HsProtobuf.Named EntityEntity where - nameOf _ = (Hs.fromString "EntityEntity") - +instance (Hs.NFData EntityEntity) +instance (HsProtobuf.Named EntityEntity) where + nameOf _ = Hs.fromString "EntityEntity" data EntityType = EntityTypeENTITY_TYPE_ORGANIZATION | EntityTypeENTITY_TYPE_PROJECT | EntityTypeENTITY_TYPE_TASK_DATA | EntityTypeENTITY_TYPE_USER deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named EntityType where - nameOf _ = (Hs.fromString "EntityType") - -instance HsProtobuf.HasDefault EntityType - -instance Hs.Bounded EntityType where +instance (HsProtobuf.Named EntityType) where + nameOf _ = Hs.fromString "EntityType" +instance (HsProtobuf.HasDefault EntityType) +instance (Hs.Bounded EntityType) where minBound = EntityTypeENTITY_TYPE_ORGANIZATION maxBound = EntityTypeENTITY_TYPE_USER - -instance Hs.Ord EntityType where +instance (Hs.Ord EntityType) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum EntityType where +instance (HsProtobuf.ProtoEnum EntityType) where toProtoEnumMay 0 = Hs.Just EntityTypeENTITY_TYPE_ORGANIZATION toProtoEnumMay 1 = Hs.Just EntityTypeENTITY_TYPE_PROJECT toProtoEnumMay 2 = Hs.Just EntityTypeENTITY_TYPE_TASK_DATA toProtoEnumMay 3 = Hs.Just EntityTypeENTITY_TYPE_USER toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (EntityTypeENTITY_TYPE_ORGANIZATION) = 0 - fromProtoEnum (EntityTypeENTITY_TYPE_PROJECT) = 1 - fromProtoEnum (EntityTypeENTITY_TYPE_TASK_DATA) = 2 - fromProtoEnum (EntityTypeENTITY_TYPE_USER) = 3 - -instance HsJSONPB.ToJSONPB EntityType where + fromProtoEnum EntityTypeENTITY_TYPE_ORGANIZATION = 0 + fromProtoEnum EntityTypeENTITY_TYPE_PROJECT = 1 + fromProtoEnum EntityTypeENTITY_TYPE_TASK_DATA = 2 + fromProtoEnum EntityTypeENTITY_TYPE_USER = 3 +instance (HsJSONPB.ToJSONPB EntityType) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB EntityType where +instance (HsJSONPB.FromJSONPB EntityType) where parseJSONPB (HsJSONPB.String "ENTITY_TYPE_ORGANIZATION") = Hs.pure EntityTypeENTITY_TYPE_ORGANIZATION parseJSONPB (HsJSONPB.String "ENTITY_TYPE_PROJECT") = @@ -330,1197 +297,1170 @@ instance HsJSONPB.FromJSONPB EntityType where Hs.pure EntityTypeENTITY_TYPE_TASK_DATA parseJSONPB (HsJSONPB.String "ENTITY_TYPE_USER") = Hs.pure EntityTypeENTITY_TYPE_USER - parseJSONPB v = (HsJSONPB.typeMismatch "EntityType" v) - -instance HsJSONPB.ToJSON EntityType where + parseJSONPB v = HsJSONPB.typeMismatch "EntityType" v +instance (HsJSONPB.ToJSON EntityType) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON EntityType where +instance (HsJSONPB.FromJSON EntityType) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite EntityType - +instance (HsProtobuf.Finite EntityType) data CrawlerError = CrawlerError { crawlerErrorMessage :: Hs.Text , crawlerErrorBody :: Hs.Text - , crawlerErrorCreatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp + , crawlerErrorCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CrawlerError - -instance HsProtobuf.Named CrawlerError where - nameOf _ = (Hs.fromString "CrawlerError") - -instance HsProtobuf.HasDefault CrawlerError - -instance HsProtobuf.Message CrawlerError where +instance (Hs.NFData CrawlerError) +instance (HsProtobuf.Named CrawlerError) where + nameOf _ = Hs.fromString "CrawlerError" +instance (HsProtobuf.HasDefault CrawlerError) +instance (HsProtobuf.Message CrawlerError) where encodeMessage _ CrawlerError - { crawlerErrorMessage = crawlerErrorMessage - , crawlerErrorBody = crawlerErrorBody - , crawlerErrorCreatedAt = crawlerErrorCreatedAt + { crawlerErrorMessage + , crawlerErrorBody + , crawlerErrorCreatedAt } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (crawlerErrorMessage) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + crawlerErrorMessage ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (crawlerErrorBody) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + crawlerErrorBody ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (crawlerErrorCreatedAt) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + crawlerErrorCreatedAt ) - ] - ) + ) decodeMessage _ = - (Hs.pure CrawlerError) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure CrawlerError + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "message") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "body") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "created_at") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "message") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "body") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" ] - -instance HsJSONPB.ToJSONPB CrawlerError where +instance (HsJSONPB.ToJSONPB CrawlerError) where toJSONPB (CrawlerError f2 f3 f4) = - ( HsJSONPB.object - [ "message" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "body" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "message" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "body" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f4) ) - ] - ) + f4 + ) + ] toEncodingPB (CrawlerError f2 f3 f4) = - ( HsJSONPB.pairs - [ "message" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "body" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.pairs + [ "message" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "body" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f4) ) - ] - ) - -instance HsJSONPB.FromJSONPB CrawlerError where + f4 + ) + ] +instance (HsJSONPB.FromJSONPB CrawlerError) where parseJSONPB = - ( HsJSONPB.withObject - "CrawlerError" - ( \obj -> - (Hs.pure CrawlerError) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "message") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "body") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "CrawlerError" + ( \obj -> + Hs.pure CrawlerError + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "message") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "body") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") ) - ) - ) - -instance HsJSONPB.ToJSON CrawlerError where + (obj .: "created_at") + ) + ) +instance (HsJSONPB.ToJSON CrawlerError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CrawlerError where +instance (HsJSONPB.FromJSON CrawlerError) where parseJSON = HsJSONPB.parseJSONPB - data CrawlerErrorList = CrawlerErrorList - { crawlerErrorListCrawler :: - Hs.Text - , crawlerErrorListEntity :: - Hs.Maybe Monocle.Protob.Crawler.Entity - , crawlerErrorListErrors :: - Hs.Vector Monocle.Protob.Crawler.CrawlerError + { crawlerErrorListCrawler :: Hs.Text + , crawlerErrorListEntity :: (Hs.Maybe Monocle.Protob.Crawler.Entity) + , crawlerErrorListErrors :: (Hs.Vector Monocle.Protob.Crawler.CrawlerError) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CrawlerErrorList - -instance HsProtobuf.Named CrawlerErrorList where - nameOf _ = (Hs.fromString "CrawlerErrorList") - -instance HsProtobuf.HasDefault CrawlerErrorList - -instance HsProtobuf.Message CrawlerErrorList where +instance (Hs.NFData CrawlerErrorList) +instance (HsProtobuf.Named CrawlerErrorList) where + nameOf _ = Hs.fromString "CrawlerErrorList" +instance (HsProtobuf.HasDefault CrawlerErrorList) +instance (HsProtobuf.Message CrawlerErrorList) where encodeMessage _ CrawlerErrorList - { crawlerErrorListCrawler = crawlerErrorListCrawler - , crawlerErrorListEntity = crawlerErrorListEntity - , crawlerErrorListErrors = crawlerErrorListErrors + { crawlerErrorListCrawler + , crawlerErrorListEntity + , crawlerErrorListErrors } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (crawlerErrorListCrawler) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + crawlerErrorListCrawler ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (crawlerErrorListEntity) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + ) + crawlerErrorListEntity ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - (crawlerErrorListErrors) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) + ) + crawlerErrorListErrors ) - ] - ) + ) decodeMessage _ = - (Hs.pure CrawlerErrorList) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure CrawlerErrorList + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - @(Hs.Maybe Monocle.Protob.Crawler.Entity) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "crawler") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) - ) - (HsProtobufAST.Single "entity") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "CrawlerError")) - ) - (HsProtobufAST.Single "errors") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "CrawlerError")) + ) + (HsProtobufAST.Single "errors") + [] + "" ] - -instance HsJSONPB.ToJSONPB CrawlerErrorList where +instance (HsJSONPB.ToJSONPB CrawlerErrorList) where toJSONPB (CrawlerErrorList f1 f2 f3) = - ( HsJSONPB.object - [ "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.object + [ "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f2) ) - , "errors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + f2 + ) + , "errors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - (f3) ) - ] - ) + f3 + ) + ] toEncodingPB (CrawlerErrorList f1 f2 f3) = - ( HsJSONPB.pairs - [ "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.pairs + [ "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f2) ) - , "errors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + f2 + ) + , "errors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - (f3) ) - ] - ) - -instance HsJSONPB.FromJSONPB CrawlerErrorList where + f3 + ) + ] +instance (HsJSONPB.FromJSONPB CrawlerErrorList) where parseJSONPB = - ( HsJSONPB.withObject - "CrawlerErrorList" - ( \obj -> - (Hs.pure CrawlerErrorList) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "crawler") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "CrawlerErrorList" + ( \obj -> + Hs.pure CrawlerErrorList + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "crawler") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) @(Hs.Maybe Monocle.Protob.Crawler.Entity) - (obj .: "entity") ) - <*> ( HsProtobuf.coerceOver + (obj .: "entity") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) - (obj .: "errors") ) - ) - ) - -instance HsJSONPB.ToJSON CrawlerErrorList where + (obj .: "errors") + ) + ) +instance (HsJSONPB.ToJSON CrawlerErrorList) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CrawlerErrorList where +instance (HsJSONPB.FromJSON CrawlerErrorList) where parseJSON = HsJSONPB.parseJSONPB - data ErrorsRequest = ErrorsRequest { errorsRequestIndex :: Hs.Text , errorsRequestQuery :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ErrorsRequest - -instance HsProtobuf.Named ErrorsRequest where - nameOf _ = (Hs.fromString "ErrorsRequest") - -instance HsProtobuf.HasDefault ErrorsRequest - -instance HsProtobuf.Message ErrorsRequest where +instance (Hs.NFData ErrorsRequest) +instance (HsProtobuf.Named ErrorsRequest) where + nameOf _ = Hs.fromString "ErrorsRequest" +instance (HsProtobuf.HasDefault ErrorsRequest) +instance (HsProtobuf.Message ErrorsRequest) where encodeMessage _ - ErrorsRequest - { errorsRequestIndex = errorsRequestIndex - , errorsRequestQuery = errorsRequestQuery - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (errorsRequestIndex) - ) + ErrorsRequest {errorsRequestIndex, errorsRequestQuery} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + errorsRequestIndex ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (errorsRequestQuery) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + errorsRequestQuery ) - ] - ) + ) decodeMessage _ = - (Hs.pure ErrorsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ErrorsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "query") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") + [] + "" ] - -instance HsJSONPB.ToJSONPB ErrorsRequest where +instance (HsJSONPB.ToJSONPB ErrorsRequest) where toJSONPB (ErrorsRequest f1 f2) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] toEncodingPB (ErrorsRequest f1 f2) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) - -instance HsJSONPB.FromJSONPB ErrorsRequest where + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] +instance (HsJSONPB.FromJSONPB ErrorsRequest) where parseJSONPB = - ( HsJSONPB.withObject - "ErrorsRequest" - ( \obj -> - (Hs.pure ErrorsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "query") - ) - ) - ) - -instance HsJSONPB.ToJSON ErrorsRequest where + HsJSONPB.withObject + "ErrorsRequest" + ( \obj -> + Hs.pure ErrorsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "query") + ) + ) +instance (HsJSONPB.ToJSON ErrorsRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ErrorsRequest where +instance (HsJSONPB.FromJSON ErrorsRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype ErrorsList = ErrorsList - { errorsListErrors :: - Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList - } +newtype ErrorsList = ErrorsList {errorsListErrors :: (Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ErrorsList - -instance HsProtobuf.Named ErrorsList where - nameOf _ = (Hs.fromString "ErrorsList") - -instance HsProtobuf.HasDefault ErrorsList - -instance HsProtobuf.Message ErrorsList where - encodeMessage _ ErrorsList {errorsListErrors = errorsListErrors} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) - (errorsListErrors) - ) +instance (Hs.NFData ErrorsList) +instance (HsProtobuf.Named ErrorsList) where + nameOf _ = Hs.fromString "ErrorsList" +instance (HsProtobuf.HasDefault ErrorsList) +instance (HsProtobuf.Message ErrorsList) where + encodeMessage _ ErrorsList {errorsListErrors} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) ) - ] + errorsListErrors + ) ) decodeMessage _ = - (Hs.pure ErrorsList) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) - @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) + Hs.pure ErrorsList + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) + @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "CrawlerErrorList")) - ) - (HsProtobufAST.Single "errors") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "CrawlerErrorList")) + ) + (HsProtobufAST.Single "errors") + [] + "" ] - -instance HsJSONPB.ToJSONPB ErrorsList where +instance (HsJSONPB.ToJSONPB ErrorsList) where toJSONPB (ErrorsList f1) = - ( HsJSONPB.object - [ "errors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) + HsJSONPB.object + [ "errors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (ErrorsList f1) = - ( HsJSONPB.pairs - [ "errors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) + HsJSONPB.pairs + [ "errors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB ErrorsList where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB ErrorsList) where parseJSONPB = - ( HsJSONPB.withObject - "ErrorsList" - ( \obj -> - (Hs.pure ErrorsList) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ErrorsList" + ( \obj -> + Hs.pure ErrorsList + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerErrorList) @(Hs.Vector Monocle.Protob.Crawler.CrawlerErrorList) - (obj .: "errors") ) - ) - ) - -instance HsJSONPB.ToJSON ErrorsList where + (obj .: "errors") + ) + ) +instance (HsJSONPB.ToJSON ErrorsList) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ErrorsList where +instance (HsJSONPB.FromJSON ErrorsList) where parseJSON = HsJSONPB.parseJSONPB - -newtype ErrorsResponse = ErrorsResponse - { errorsResponseResult :: - Hs.Maybe ErrorsResponseResult - } +newtype ErrorsResponse = ErrorsResponse {errorsResponseResult :: (Hs.Maybe ErrorsResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ErrorsResponse - -instance HsProtobuf.Named ErrorsResponse where - nameOf _ = (Hs.fromString "ErrorsResponse") - -instance HsProtobuf.HasDefault ErrorsResponse - -instance HsProtobuf.Message ErrorsResponse where - encodeMessage - _ - ErrorsResponse {errorsResponseResult = errorsResponseResult} = - ( Hs.mconcat - [ case errorsResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ErrorsResponseResultSuccess y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.ErrorsList) - @(HsProtobuf.Nested Monocle.Protob.Crawler.ErrorsList) - (Hs.Just y) - ) - ) - ErrorsResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure ErrorsResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.fmap ErrorsResponseResultSuccess)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Crawler.ErrorsList) - @(Hs.Maybe Monocle.Protob.Crawler.ErrorsList) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData ErrorsResponse) +instance (HsProtobuf.Named ErrorsResponse) where + nameOf _ = Hs.fromString "ErrorsResponse" +instance (HsProtobuf.HasDefault ErrorsResponse) +instance (HsProtobuf.Message ErrorsResponse) where + encodeMessage _ ErrorsResponse {errorsResponseResult} = + ( case errorsResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ErrorsResponseResultSuccess y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.ErrorsList) + @(HsProtobuf.Nested Monocle.Protob.Crawler.ErrorsList) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.Just Hs.. ErrorsResponseResultError)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) + ErrorsResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - ] - ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB ErrorsResponse where - toJSONPB (ErrorsResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (ErrorsResponseResultSuccess f1) -> - (HsJSONPB.pair "success" f1) - Hs.Just (ErrorsResponseResultError f2) -> - ( HsJSONPB.pair - "error" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Nothing -> Hs.mempty + ) + decodeMessage _ = + Hs.pure ErrorsResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.fmap ErrorsResponseResultSuccess) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.ErrorsList) + @(Hs.Maybe Monocle.Protob.Crawler.ErrorsList) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options ) - ] - ) - toEncodingPB (ErrorsResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (ErrorsResponseResultSuccess f1) -> - (HsJSONPB.pair "success" f1) - Hs.Just (ErrorsResponseResultError f2) -> - ( HsJSONPB.pair - "error" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.Just Hs.. ErrorsResponseResultError) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options ) ] - ) - -instance HsJSONPB.FromJSONPB ErrorsResponse where - parseJSONPB = - ( HsJSONPB.withObject - "ErrorsResponse" - ( \obj -> - (Hs.pure ErrorsResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. ErrorsResponseResultSuccess - <$> (HsJSONPB.parseField parseObj "success") - , Hs.Just - Hs.. ErrorsResponseResultError - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "error") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB ErrorsResponse) where + toJSONPB (ErrorsResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (ErrorsResponseResultSuccess f1) -> + HsJSONPB.pair "success" f1 + Hs.Just (ErrorsResponseResultError f2) -> + HsJSONPB.pair + "error" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON ErrorsResponse where + ] + toEncodingPB (ErrorsResponse f1_or_f2) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (ErrorsResponseResultSuccess f1) -> + HsJSONPB.pair "success" f1 + Hs.Just (ErrorsResponseResultError f2) -> + HsJSONPB.pair + "error" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB ErrorsResponse) where + parseJSONPB = + HsJSONPB.withObject + "ErrorsResponse" + ( \obj -> + Hs.pure ErrorsResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. ErrorsResponseResultSuccess + <$> HsJSONPB.parseField parseObj "success" + , Hs.Just + Hs.. ErrorsResponseResultError + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "error" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON ErrorsResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ErrorsResponse where +instance (HsJSONPB.FromJSON ErrorsResponse) where parseJSON = HsJSONPB.parseJSONPB - data ErrorsResponseResult = ErrorsResponseResultSuccess Monocle.Protob.Crawler.ErrorsList | ErrorsResponseResultError Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ErrorsResponseResult - -instance HsProtobuf.Named ErrorsResponseResult where - nameOf _ = (Hs.fromString "ErrorsResponseResult") - +instance (Hs.NFData ErrorsResponseResult) +instance (HsProtobuf.Named ErrorsResponseResult) where + nameOf _ = Hs.fromString "ErrorsResponseResult" data AddDocRequest = AddDocRequest { addDocRequestIndex :: Hs.Text , addDocRequestCrawler :: Hs.Text , addDocRequestApikey :: Hs.Text - , addDocRequestEntity :: Hs.Maybe Monocle.Protob.Crawler.Entity - , addDocRequestChanges :: Hs.Vector Monocle.Protob.Change.Change - , addDocRequestEvents :: - Hs.Vector Monocle.Protob.Change.ChangeEvent - , addDocRequestProjects :: - Hs.Vector Monocle.Protob.Crawler.Project - , addDocRequestTaskDatas :: - Hs.Vector Monocle.Protob.Search.TaskData - , addDocRequestIssues :: Hs.Vector Monocle.Protob.Issue.Issue - , addDocRequestIssueEvents :: - Hs.Vector Monocle.Protob.Issue.IssueEvent - , addDocRequestErrors :: - Hs.Vector Monocle.Protob.Crawler.CrawlerError + , addDocRequestEntity :: (Hs.Maybe Monocle.Protob.Crawler.Entity) + , addDocRequestChanges :: (Hs.Vector Monocle.Protob.Change.Change) + , addDocRequestEvents :: (Hs.Vector Monocle.Protob.Change.ChangeEvent) + , addDocRequestProjects :: (Hs.Vector Monocle.Protob.Crawler.Project) + , addDocRequestTaskDatas :: (Hs.Vector Monocle.Protob.Search.TaskData) + , addDocRequestIssues :: (Hs.Vector Monocle.Protob.Issue.Issue) + , addDocRequestIssueEvents :: (Hs.Vector Monocle.Protob.Issue.IssueEvent) + , addDocRequestErrors :: (Hs.Vector Monocle.Protob.Crawler.CrawlerError) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AddDocRequest - -instance HsProtobuf.Named AddDocRequest where - nameOf _ = (Hs.fromString "AddDocRequest") - -instance HsProtobuf.HasDefault AddDocRequest - -instance HsProtobuf.Message AddDocRequest where +instance (Hs.NFData AddDocRequest) +instance (HsProtobuf.Named AddDocRequest) where + nameOf _ = Hs.fromString "AddDocRequest" +instance (HsProtobuf.HasDefault AddDocRequest) +instance (HsProtobuf.Message AddDocRequest) where encodeMessage _ AddDocRequest - { addDocRequestIndex = addDocRequestIndex - , addDocRequestCrawler = addDocRequestCrawler - , addDocRequestApikey = addDocRequestApikey - , addDocRequestEntity = addDocRequestEntity - , addDocRequestChanges = addDocRequestChanges - , addDocRequestEvents = addDocRequestEvents - , addDocRequestProjects = addDocRequestProjects - , addDocRequestTaskDatas = addDocRequestTaskDatas - , addDocRequestIssues = addDocRequestIssues - , addDocRequestIssueEvents = addDocRequestIssueEvents - , addDocRequestErrors = addDocRequestErrors + { addDocRequestIndex + , addDocRequestCrawler + , addDocRequestApikey + , addDocRequestEntity + , addDocRequestChanges + , addDocRequestEvents + , addDocRequestProjects + , addDocRequestTaskDatas + , addDocRequestIssues + , addDocRequestIssueEvents + , addDocRequestErrors } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (addDocRequestIndex) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (addDocRequestCrawler) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (addDocRequestApikey) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (addDocRequestEntity) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Change) - @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) - (addDocRequestChanges) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangeEvent) - @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) - (addDocRequestEvents) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.Project) - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) - (addDocRequestProjects) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) - @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - (addDocRequestTaskDatas) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + addDocRequestIndex + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + addDocRequestCrawler + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + addDocRequestApikey + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + ) + addDocRequestEntity + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Change) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) + ) + addDocRequestChanges + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangeEvent) + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) + ) + addDocRequestEvents + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.Project) + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) + ) + addDocRequestProjects + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.TaskData) + @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) + ) + addDocRequestTaskDatas + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.Issue) - @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) - (addDocRequestIssues) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Issue.Issue) + @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) + ) + addDocRequestIssues + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.IssueEvent) - @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) - (addDocRequestIssueEvents) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) + ) + addDocRequestIssueEvents ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 12) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - (addDocRequestErrors) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 12) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) + ) + addDocRequestErrors ) - ] - ) + ) decodeMessage _ = - (Hs.pure AddDocRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure AddDocRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - @(Hs.Maybe Monocle.Protob.Crawler.Entity) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) - @(Hs.Vector Monocle.Protob.Change.Change) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) + @(Hs.Vector Monocle.Protob.Change.Change) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) - @(Hs.Vector Monocle.Protob.Change.ChangeEvent) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) + @(Hs.Vector Monocle.Protob.Change.ChangeEvent) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) - @(Hs.Vector Monocle.Protob.Crawler.Project) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) + @(Hs.Vector Monocle.Protob.Crawler.Project) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - @(Hs.Vector Monocle.Protob.Search.TaskData) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) + @(Hs.Vector Monocle.Protob.Search.TaskData) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 8) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) - @(Hs.Vector Monocle.Protob.Issue.Issue) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) + @(Hs.Vector Monocle.Protob.Issue.Issue) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) - @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) + @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 12) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "crawler") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "apikey") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) - ) - (HsProtobufAST.Single "entity") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_change" Hs.:| ["Change"])) - ) - ) - ) - (HsProtobufAST.Single "changes") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_change" Hs.:| ["ChangeEvent"])) - ) - ) - ) - (HsProtobufAST.Single "events") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Project")) - ) - (HsProtobufAST.Single "projects") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_search" Hs.:| ["TaskData"])) - ) - ) - ) - (HsProtobufAST.Single "task_datas") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_issue" Hs.:| ["Issue"])) - ) - ) - ) - (HsProtobufAST.Single "issues") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_issue" Hs.:| ["IssueEvent"])) - ) - ) - ) - (HsProtobufAST.Single "issue_events") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 12) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "CrawlerError")) - ) - (HsProtobufAST.Single "errors") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "apikey") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["Change"])) + ) + ) + ) + (HsProtobufAST.Single "changes") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["ChangeEvent"])) + ) + ) + ) + (HsProtobufAST.Single "events") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Project")) + ) + (HsProtobufAST.Single "projects") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_search" Hs.:| ["TaskData"])) + ) + ) + ) + (HsProtobufAST.Single "task_datas") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_issue" Hs.:| ["Issue"])) + ) + ) + ) + (HsProtobufAST.Single "issues") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_issue" Hs.:| ["IssueEvent"])) + ) + ) + ) + (HsProtobufAST.Single "issue_events") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 12) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "CrawlerError")) + ) + (HsProtobufAST.Single "errors") + [] + "" ] - -instance HsJSONPB.ToJSONPB AddDocRequest where +instance (HsJSONPB.ToJSONPB AddDocRequest) where toJSONPB (AddDocRequest f1 f2 f3 f4 f5 f6 f7 f8 f10 f11 f12) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "apikey" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "apikey" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f4) ) - , "changes" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Change) + f4 + ) + , "changes" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Change) @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) - (f5) ) - , "events" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangeEvent) + f5 + ) + , "events" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangeEvent) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) - (f6) ) - , "projects" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.Project) + f6 + ) + , "projects" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.Project) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) - (f7) ) - , "task_datas" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) + f7 + ) + , "task_datas" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.TaskData) @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - (f8) ) - , "issues" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.Issue) + f8 + ) + , "issues" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Issue.Issue) @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) - (f10) ) - , "issue_events" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + f10 + ) + , "issue_events" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Issue.IssueEvent) @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) - (f11) ) - , "errors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + f11 + ) + , "errors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - (f12) ) - ] - ) + f12 + ) + ] toEncodingPB (AddDocRequest f1 f2 f3 f4 f5 f6 f7 f8 f10 f11 f12) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "apikey" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "apikey" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f4) ) - , "changes" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Change) + f4 + ) + , "changes" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.Change) @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) - (f5) ) - , "events" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangeEvent) + f5 + ) + , "events" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Change.ChangeEvent) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) - (f6) ) - , "projects" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.Project) + f6 + ) + , "projects" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.Project) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) - (f7) ) - , "task_datas" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) + f7 + ) + , "task_datas" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.TaskData) @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - (f8) ) - , "issues" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.Issue) + f8 + ) + , "issues" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Issue.Issue) @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) - (f10) ) - , "issue_events" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + f10 + ) + , "issue_events" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Issue.IssueEvent) @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) - (f11) ) - , "errors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) + f11 + ) + , "errors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) - (f12) ) - ] - ) - -instance HsJSONPB.FromJSONPB AddDocRequest where + f12 + ) + ] +instance (HsJSONPB.FromJSONPB AddDocRequest) where parseJSONPB = - ( HsJSONPB.withObject - "AddDocRequest" - ( \obj -> - (Hs.pure AddDocRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "crawler") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "apikey") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "AddDocRequest" + ( \obj -> + Hs.pure AddDocRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "crawler") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "apikey") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) @(Hs.Maybe Monocle.Protob.Crawler.Entity) - (obj .: "entity") ) - <*> ( HsProtobuf.coerceOver + (obj .: "entity") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) @(Hs.Vector Monocle.Protob.Change.Change) - (obj .: "changes") ) - <*> ( HsProtobuf.coerceOver + (obj .: "changes") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) @(Hs.Vector Monocle.Protob.Change.ChangeEvent) - (obj .: "events") ) - <*> ( HsProtobuf.coerceOver + (obj .: "events") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) @(Hs.Vector Monocle.Protob.Crawler.Project) - (obj .: "projects") ) - <*> ( HsProtobuf.coerceOver + (obj .: "projects") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) @(Hs.Vector Monocle.Protob.Search.TaskData) - (obj .: "task_datas") ) - <*> ( HsProtobuf.coerceOver + (obj .: "task_datas") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) @(Hs.Vector Monocle.Protob.Issue.Issue) - (obj .: "issues") ) - <*> ( HsProtobuf.coerceOver + (obj .: "issues") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) @(Hs.Vector Monocle.Protob.Issue.IssueEvent) - (obj .: "issue_events") ) - <*> ( HsProtobuf.coerceOver + (obj .: "issue_events") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Crawler.CrawlerError) @(Hs.Vector Monocle.Protob.Crawler.CrawlerError) - (obj .: "errors") ) - ) - ) - -instance HsJSONPB.ToJSON AddDocRequest where + (obj .: "errors") + ) + ) +instance (HsJSONPB.ToJSON AddDocRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AddDocRequest where +instance (HsJSONPB.FromJSON AddDocRequest) where parseJSON = HsJSONPB.parseJSONPB - data AddDocError = AddDocErrorAddUnknownIndex | AddDocErrorAddUnknownCrawler | AddDocErrorAddUnknownApiKey | AddDocErrorAddFailed deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named AddDocError where - nameOf _ = (Hs.fromString "AddDocError") - -instance HsProtobuf.HasDefault AddDocError - -instance Hs.Bounded AddDocError where +instance (HsProtobuf.Named AddDocError) where + nameOf _ = Hs.fromString "AddDocError" +instance (HsProtobuf.HasDefault AddDocError) +instance (Hs.Bounded AddDocError) where minBound = AddDocErrorAddUnknownIndex maxBound = AddDocErrorAddFailed - -instance Hs.Ord AddDocError where +instance (Hs.Ord AddDocError) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum AddDocError where +instance (HsProtobuf.ProtoEnum AddDocError) where toProtoEnumMay 0 = Hs.Just AddDocErrorAddUnknownIndex toProtoEnumMay 1 = Hs.Just AddDocErrorAddUnknownCrawler toProtoEnumMay 2 = Hs.Just AddDocErrorAddUnknownApiKey toProtoEnumMay 3 = Hs.Just AddDocErrorAddFailed toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (AddDocErrorAddUnknownIndex) = 0 - fromProtoEnum (AddDocErrorAddUnknownCrawler) = 1 - fromProtoEnum (AddDocErrorAddUnknownApiKey) = 2 - fromProtoEnum (AddDocErrorAddFailed) = 3 - -instance HsJSONPB.ToJSONPB AddDocError where + fromProtoEnum AddDocErrorAddUnknownIndex = 0 + fromProtoEnum AddDocErrorAddUnknownCrawler = 1 + fromProtoEnum AddDocErrorAddUnknownApiKey = 2 + fromProtoEnum AddDocErrorAddFailed = 3 +instance (HsJSONPB.ToJSONPB AddDocError) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB AddDocError where +instance (HsJSONPB.FromJSONPB AddDocError) where parseJSONPB (HsJSONPB.String "AddUnknownIndex") = Hs.pure AddDocErrorAddUnknownIndex parseJSONPB (HsJSONPB.String "AddUnknownCrawler") = @@ -1529,353 +1469,322 @@ instance HsJSONPB.FromJSONPB AddDocError where Hs.pure AddDocErrorAddUnknownApiKey parseJSONPB (HsJSONPB.String "AddFailed") = Hs.pure AddDocErrorAddFailed - parseJSONPB v = (HsJSONPB.typeMismatch "AddDocError" v) - -instance HsJSONPB.ToJSON AddDocError where + parseJSONPB v = HsJSONPB.typeMismatch "AddDocError" v +instance (HsJSONPB.ToJSON AddDocError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AddDocError where +instance (HsJSONPB.FromJSON AddDocError) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite AddDocError - -newtype AddDocResponse = AddDocResponse - { addDocResponseResult :: - Hs.Maybe AddDocResponseResult - } +instance (HsProtobuf.Finite AddDocError) +newtype AddDocResponse = AddDocResponse {addDocResponseResult :: (Hs.Maybe AddDocResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AddDocResponse - -instance HsProtobuf.Named AddDocResponse where - nameOf _ = (Hs.fromString "AddDocResponse") - -instance HsProtobuf.HasDefault AddDocResponse - -instance HsProtobuf.Message AddDocResponse where - encodeMessage - _ - AddDocResponse {addDocResponseResult = addDocResponseResult} = - ( Hs.mconcat - [ case addDocResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - AddDocResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) - ) - ] - ) +instance (Hs.NFData AddDocResponse) +instance (HsProtobuf.Named AddDocResponse) where + nameOf _ = Hs.fromString "AddDocResponse" +instance (HsProtobuf.HasDefault AddDocResponse) +instance (HsProtobuf.Message AddDocResponse) where + encodeMessage _ AddDocResponse {addDocResponseResult} = + ( case addDocResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + AddDocResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + (HsProtobuf.ForceEmit y) + ) decodeMessage _ = - (Hs.pure AddDocResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. AddDocResponseResultError)) - <*> HsProtobuf.decodeMessageField - ) - ] + Hs.pure AddDocResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. AddDocResponseResultError) + <*> HsProtobuf.decodeMessageField ) + ] dotProto _ = [] - -instance HsJSONPB.ToJSONPB AddDocResponse where +instance (HsJSONPB.ToJSONPB AddDocResponse) where toJSONPB (AddDocResponse f1) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1 of - Hs.Just (AddDocResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options - ) - ] - ) + HsJSONPB.object + [ ( let + encodeResult = + ( case f1 of + Hs.Just (AddDocResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] toEncodingPB (AddDocResponse f1) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1 of - Hs.Just (AddDocResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options - ) - ] - ) - -instance HsJSONPB.FromJSONPB AddDocResponse where - parseJSONPB = - ( HsJSONPB.withObject - "AddDocResponse" - ( \obj -> - (Hs.pure AddDocResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. AddDocResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1 of + Hs.Just (AddDocResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON AddDocResponse where + ] +instance (HsJSONPB.FromJSONPB AddDocResponse) where + parseJSONPB = + HsJSONPB.withObject + "AddDocResponse" + ( \obj -> + Hs.pure AddDocResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. AddDocResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON AddDocResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AddDocResponse where +instance (HsJSONPB.FromJSON AddDocResponse) where parseJSON = HsJSONPB.parseJSONPB - -data AddDocResponseResult - = AddDocResponseResultError - ( HsProtobuf.Enumerated - Monocle.Protob.Crawler.AddDocError - ) +newtype AddDocResponseResult + = AddDocResponseResultError (HsProtobuf.Enumerated Monocle.Protob.Crawler.AddDocError) deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AddDocResponseResult - -instance HsProtobuf.Named AddDocResponseResult where - nameOf _ = (Hs.fromString "AddDocResponseResult") - +instance (Hs.NFData AddDocResponseResult) +instance (HsProtobuf.Named AddDocResponseResult) where + nameOf _ = Hs.fromString "AddDocResponseResult" data CommitRequest = CommitRequest { commitRequestIndex :: Hs.Text , commitRequestCrawler :: Hs.Text , commitRequestApikey :: Hs.Text - , commitRequestEntity :: Hs.Maybe Monocle.Protob.Crawler.Entity - , commitRequestTimestamp :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp + , commitRequestEntity :: (Hs.Maybe Monocle.Protob.Crawler.Entity) + , commitRequestTimestamp :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitRequest - -instance HsProtobuf.Named CommitRequest where - nameOf _ = (Hs.fromString "CommitRequest") - -instance HsProtobuf.HasDefault CommitRequest - -instance HsProtobuf.Message CommitRequest where +instance (Hs.NFData CommitRequest) +instance (HsProtobuf.Named CommitRequest) where + nameOf _ = Hs.fromString "CommitRequest" +instance (HsProtobuf.HasDefault CommitRequest) +instance (HsProtobuf.Message CommitRequest) where encodeMessage _ CommitRequest - { commitRequestIndex = commitRequestIndex - , commitRequestCrawler = commitRequestCrawler - , commitRequestApikey = commitRequestApikey - , commitRequestEntity = commitRequestEntity - , commitRequestTimestamp = commitRequestTimestamp + { commitRequestIndex + , commitRequestCrawler + , commitRequestApikey + , commitRequestEntity + , commitRequestTimestamp } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitRequestIndex) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitRequestCrawler) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + commitRequestIndex + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + commitRequestCrawler + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitRequestApikey) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + commitRequestApikey + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (commitRequestEntity) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + ) + commitRequestEntity ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (commitRequestTimestamp) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + commitRequestTimestamp ) - ] - ) + ) decodeMessage _ = - (Hs.pure CommitRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure CommitRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - @(Hs.Maybe Monocle.Protob.Crawler.Entity) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "crawler") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "apikey") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) - ) - (HsProtobufAST.Single "entity") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "timestamp") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "apikey") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "timestamp") + [] + "" ] - -instance HsJSONPB.ToJSONPB CommitRequest where +instance (HsJSONPB.ToJSONPB CommitRequest) where toJSONPB (CommitRequest f1 f2 f3 f4 f5) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "apikey" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "apikey" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f4) ) - , "timestamp" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f4 + ) + , "timestamp" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f5) ) - ] - ) + f5 + ) + ] toEncodingPB (CommitRequest f1 f2 f3 f4 f5) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "apikey" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "apikey" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f4) ) - , "timestamp" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f4 + ) + , "timestamp" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f5) ) - ] - ) - -instance HsJSONPB.FromJSONPB CommitRequest where + f5 + ) + ] +instance (HsJSONPB.FromJSONPB CommitRequest) where parseJSONPB = - ( HsJSONPB.withObject - "CommitRequest" - ( \obj -> - (Hs.pure CommitRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "crawler") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "apikey") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "CommitRequest" + ( \obj -> + Hs.pure CommitRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "crawler") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "apikey") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) @(Hs.Maybe Monocle.Protob.Crawler.Entity) - (obj .: "entity") ) - <*> ( HsProtobuf.coerceOver + (obj .: "entity") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "timestamp") ) - ) - ) - -instance HsJSONPB.ToJSON CommitRequest where + (obj .: "timestamp") + ) + ) +instance (HsJSONPB.ToJSON CommitRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitRequest where +instance (HsJSONPB.FromJSON CommitRequest) where parseJSON = HsJSONPB.parseJSONPB - data CommitError = CommitErrorCommitUnknownIndex | CommitErrorCommitUnknownCrawler @@ -1883,23 +1792,18 @@ data CommitError | CommitErrorCommitDateInferiorThanPrevious | CommitErrorCommitDateMissing deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named CommitError where - nameOf _ = (Hs.fromString "CommitError") - -instance HsProtobuf.HasDefault CommitError - -instance Hs.Bounded CommitError where +instance (HsProtobuf.Named CommitError) where + nameOf _ = Hs.fromString "CommitError" +instance (HsProtobuf.HasDefault CommitError) +instance (Hs.Bounded CommitError) where minBound = CommitErrorCommitUnknownIndex maxBound = CommitErrorCommitDateMissing - -instance Hs.Ord CommitError where +instance (Hs.Ord CommitError) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum CommitError where +instance (HsProtobuf.ProtoEnum CommitError) where toProtoEnumMay 0 = Hs.Just CommitErrorCommitUnknownIndex toProtoEnumMay 1 = Hs.Just CommitErrorCommitUnknownCrawler toProtoEnumMay 2 = Hs.Just CommitErrorCommitUnknownApiKey @@ -1907,17 +1811,15 @@ instance HsProtobuf.ProtoEnum CommitError where Hs.Just CommitErrorCommitDateInferiorThanPrevious toProtoEnumMay 4 = Hs.Just CommitErrorCommitDateMissing toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (CommitErrorCommitUnknownIndex) = 0 - fromProtoEnum (CommitErrorCommitUnknownCrawler) = 1 - fromProtoEnum (CommitErrorCommitUnknownApiKey) = 2 - fromProtoEnum (CommitErrorCommitDateInferiorThanPrevious) = 3 - fromProtoEnum (CommitErrorCommitDateMissing) = 4 - -instance HsJSONPB.ToJSONPB CommitError where + fromProtoEnum CommitErrorCommitUnknownIndex = 0 + fromProtoEnum CommitErrorCommitUnknownCrawler = 1 + fromProtoEnum CommitErrorCommitUnknownApiKey = 2 + fromProtoEnum CommitErrorCommitDateInferiorThanPrevious = 3 + fromProtoEnum CommitErrorCommitDateMissing = 4 +instance (HsJSONPB.ToJSONPB CommitError) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB CommitError where +instance (HsJSONPB.FromJSONPB CommitError) where parseJSONPB (HsJSONPB.String "CommitUnknownIndex") = Hs.pure CommitErrorCommitUnknownIndex parseJSONPB (HsJSONPB.String "CommitUnknownCrawler") = @@ -1928,711 +1830,607 @@ instance HsJSONPB.FromJSONPB CommitError where Hs.pure CommitErrorCommitDateInferiorThanPrevious parseJSONPB (HsJSONPB.String "CommitDateMissing") = Hs.pure CommitErrorCommitDateMissing - parseJSONPB v = (HsJSONPB.typeMismatch "CommitError" v) - -instance HsJSONPB.ToJSON CommitError where + parseJSONPB v = HsJSONPB.typeMismatch "CommitError" v +instance (HsJSONPB.ToJSON CommitError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitError where +instance (HsJSONPB.FromJSON CommitError) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite CommitError - -newtype CommitResponse = CommitResponse - { commitResponseResult :: - Hs.Maybe CommitResponseResult - } +instance (HsProtobuf.Finite CommitError) +newtype CommitResponse = CommitResponse {commitResponseResult :: (Hs.Maybe CommitResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitResponse - -instance HsProtobuf.Named CommitResponse where - nameOf _ = (Hs.fromString "CommitResponse") - -instance HsProtobuf.HasDefault CommitResponse - -instance HsProtobuf.Message CommitResponse where - encodeMessage - _ - CommitResponse {commitResponseResult = commitResponseResult} = - ( Hs.mconcat - [ case commitResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - CommitResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) - ) - CommitResponseResultTimestamp y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (Hs.Just y) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure CommitResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. CommitResponseResultError)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.fmap CommitResponseResultTimestamp)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (HsProtobuf.decodeMessageField) - ) - ) - ] - ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB CommitResponse where - toJSONPB (CommitResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (CommitResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (CommitResponseResultTimestamp f2) -> - (HsJSONPB.pair "timestamp" f2) - Hs.Nothing -> Hs.mempty +instance (Hs.NFData CommitResponse) +instance (HsProtobuf.Named CommitResponse) where + nameOf _ = Hs.fromString "CommitResponse" +instance (HsProtobuf.HasDefault CommitResponse) +instance (HsProtobuf.Message CommitResponse) where + encodeMessage _ CommitResponse {commitResponseResult} = + ( case commitResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + CommitResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + (HsProtobuf.ForceEmit y) + CommitResponseResultTimestamp y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options - ) - ] + (Hs.Just y) + ) ) - toEncodingPB (CommitResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (CommitResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (CommitResponseResultTimestamp f2) -> - (HsJSONPB.pair "timestamp" f2) - Hs.Nothing -> Hs.mempty + decodeMessage _ = + Hs.pure CommitResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. CommitResponseResultError) + <*> HsProtobuf.decodeMessageField + ) + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.fmap CommitResponseResultTimestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options ) ] - ) - -instance HsJSONPB.FromJSONPB CommitResponse where - parseJSONPB = - ( HsJSONPB.withObject - "CommitResponse" - ( \obj -> - (Hs.pure CommitResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. CommitResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. CommitResponseResultTimestamp - <$> (HsJSONPB.parseField parseObj "timestamp") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB CommitResponse) where + toJSONPB (CommitResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (CommitResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Just (CommitResponseResultTimestamp f2) -> + HsJSONPB.pair "timestamp" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON CommitResponse where + ] + toEncodingPB (CommitResponse f1_or_f2) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (CommitResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Just (CommitResponseResultTimestamp f2) -> + HsJSONPB.pair "timestamp" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB CommitResponse) where + parseJSONPB = + HsJSONPB.withObject + "CommitResponse" + ( \obj -> + Hs.pure CommitResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. CommitResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just Hs.. CommitResponseResultTimestamp + <$> HsJSONPB.parseField parseObj "timestamp" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON CommitResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitResponse where +instance (HsJSONPB.FromJSON CommitResponse) where parseJSON = HsJSONPB.parseJSONPB - data CommitResponseResult - = CommitResponseResultError - ( HsProtobuf.Enumerated - Monocle.Protob.Crawler.CommitError - ) + = CommitResponseResultError (HsProtobuf.Enumerated Monocle.Protob.Crawler.CommitError) | CommitResponseResultTimestamp Google.Protobuf.Timestamp.Timestamp deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitResponseResult - -instance HsProtobuf.Named CommitResponseResult where - nameOf _ = (Hs.fromString "CommitResponseResult") - +instance (Hs.NFData CommitResponseResult) +instance (HsProtobuf.Named CommitResponseResult) where + nameOf _ = Hs.fromString "CommitResponseResult" data CommitInfoRequest = CommitInfoRequest - { commitInfoRequestIndex :: - Hs.Text + { commitInfoRequestIndex :: Hs.Text , commitInfoRequestCrawler :: Hs.Text - , commitInfoRequestEntity :: - HsProtobuf.Enumerated Monocle.Protob.Crawler.EntityType + , commitInfoRequestEntity :: (HsProtobuf.Enumerated Monocle.Protob.Crawler.EntityType) , commitInfoRequestOffset :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitInfoRequest - -instance HsProtobuf.Named CommitInfoRequest where - nameOf _ = (Hs.fromString "CommitInfoRequest") - -instance HsProtobuf.HasDefault CommitInfoRequest - -instance HsProtobuf.Message CommitInfoRequest where +instance (Hs.NFData CommitInfoRequest) +instance (HsProtobuf.Named CommitInfoRequest) where + nameOf _ = Hs.fromString "CommitInfoRequest" +instance (HsProtobuf.HasDefault CommitInfoRequest) +instance (HsProtobuf.Message CommitInfoRequest) where encodeMessage _ CommitInfoRequest - { commitInfoRequestIndex = commitInfoRequestIndex - , commitInfoRequestCrawler = commitInfoRequestCrawler - , commitInfoRequestEntity = commitInfoRequestEntity - , commitInfoRequestOffset = commitInfoRequestOffset + { commitInfoRequestIndex + , commitInfoRequestCrawler + , commitInfoRequestEntity + , commitInfoRequestOffset } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitInfoRequestIndex) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + commitInfoRequestIndex + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitInfoRequestCrawler) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + commitInfoRequestCrawler + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) commitInfoRequestEntity ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - commitInfoRequestOffset - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + commitInfoRequestOffset + ) decodeMessage _ = - (Hs.pure CommitInfoRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure CommitInfoRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "crawler") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "EntityType")) - ) - (HsProtobufAST.Single "entity") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "offset") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "EntityType")) + ) + (HsProtobufAST.Single "entity") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "offset") + [] + "" ] - -instance HsJSONPB.ToJSONPB CommitInfoRequest where +instance (HsJSONPB.ToJSONPB CommitInfoRequest) where toJSONPB (CommitInfoRequest f1 f2 f3 f4) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "entity" .= f3 - , "offset" .= f4 - ] - ) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "entity" .= f3 + , "offset" .= f4 + ] toEncodingPB (CommitInfoRequest f1 f2 f3 f4) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "crawler" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "entity" .= f3 - , "offset" .= f4 - ] - ) - -instance HsJSONPB.FromJSONPB CommitInfoRequest where + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "crawler" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "entity" .= f3 + , "offset" .= f4 + ] +instance (HsJSONPB.FromJSONPB CommitInfoRequest) where parseJSONPB = - ( HsJSONPB.withObject - "CommitInfoRequest" - ( \obj -> - (Hs.pure CommitInfoRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "crawler") - ) - <*> obj .: "entity" - <*> obj .: "offset" - ) - ) - -instance HsJSONPB.ToJSON CommitInfoRequest where + HsJSONPB.withObject + "CommitInfoRequest" + ( \obj -> + Hs.pure CommitInfoRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "crawler") + ) + <*> obj .: "entity" + <*> obj .: "offset" + ) +instance (HsJSONPB.ToJSON CommitInfoRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitInfoRequest where +instance (HsJSONPB.FromJSON CommitInfoRequest) where parseJSON = HsJSONPB.parseJSONPB - data CommitInfoError = CommitInfoErrorCommitGetUnknownIndex | CommitInfoErrorCommitGetUnknownCrawler | CommitInfoErrorCommitGetNoEntity deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named CommitInfoError where - nameOf _ = (Hs.fromString "CommitInfoError") - -instance HsProtobuf.HasDefault CommitInfoError - -instance Hs.Bounded CommitInfoError where +instance (HsProtobuf.Named CommitInfoError) where + nameOf _ = Hs.fromString "CommitInfoError" +instance (HsProtobuf.HasDefault CommitInfoError) +instance (Hs.Bounded CommitInfoError) where minBound = CommitInfoErrorCommitGetUnknownIndex maxBound = CommitInfoErrorCommitGetNoEntity - -instance Hs.Ord CommitInfoError where +instance (Hs.Ord CommitInfoError) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum CommitInfoError where +instance (HsProtobuf.ProtoEnum CommitInfoError) where toProtoEnumMay 0 = Hs.Just CommitInfoErrorCommitGetUnknownIndex toProtoEnumMay 1 = Hs.Just CommitInfoErrorCommitGetUnknownCrawler toProtoEnumMay 2 = Hs.Just CommitInfoErrorCommitGetNoEntity toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (CommitInfoErrorCommitGetUnknownIndex) = 0 - fromProtoEnum (CommitInfoErrorCommitGetUnknownCrawler) = 1 - fromProtoEnum (CommitInfoErrorCommitGetNoEntity) = 2 - -instance HsJSONPB.ToJSONPB CommitInfoError where + fromProtoEnum CommitInfoErrorCommitGetUnknownIndex = 0 + fromProtoEnum CommitInfoErrorCommitGetUnknownCrawler = 1 + fromProtoEnum CommitInfoErrorCommitGetNoEntity = 2 +instance (HsJSONPB.ToJSONPB CommitInfoError) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB CommitInfoError where +instance (HsJSONPB.FromJSONPB CommitInfoError) where parseJSONPB (HsJSONPB.String "CommitGetUnknownIndex") = Hs.pure CommitInfoErrorCommitGetUnknownIndex parseJSONPB (HsJSONPB.String "CommitGetUnknownCrawler") = Hs.pure CommitInfoErrorCommitGetUnknownCrawler parseJSONPB (HsJSONPB.String "CommitGetNoEntity") = Hs.pure CommitInfoErrorCommitGetNoEntity - parseJSONPB v = (HsJSONPB.typeMismatch "CommitInfoError" v) - -instance HsJSONPB.ToJSON CommitInfoError where + parseJSONPB v = HsJSONPB.typeMismatch "CommitInfoError" v +instance (HsJSONPB.ToJSON CommitInfoError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitInfoError where +instance (HsJSONPB.FromJSON CommitInfoError) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite CommitInfoError - -newtype CommitInfoResponse = CommitInfoResponse - { commitInfoResponseResult :: - Hs.Maybe CommitInfoResponseResult - } +instance (HsProtobuf.Finite CommitInfoError) +newtype CommitInfoResponse = CommitInfoResponse {commitInfoResponseResult :: (Hs.Maybe CommitInfoResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitInfoResponse - -instance HsProtobuf.Named CommitInfoResponse where - nameOf _ = (Hs.fromString "CommitInfoResponse") - -instance HsProtobuf.HasDefault CommitInfoResponse - -instance HsProtobuf.Message CommitInfoResponse where - encodeMessage - _ - CommitInfoResponse - { commitInfoResponseResult = - commitInfoResponseResult - } = - ( Hs.mconcat - [ case commitInfoResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - CommitInfoResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) - ) - CommitInfoResponseResultEntity y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce - @(Hs.Maybe Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) - @(HsProtobuf.Nested Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) - (Hs.Just y) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure CommitInfoResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. CommitInfoResponseResultError)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.fmap CommitInfoResponseResultEntity)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) - @(Hs.Maybe Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) - (HsProtobuf.decodeMessageField) - ) - ) - ] - ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB CommitInfoResponse where - toJSONPB (CommitInfoResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (CommitInfoResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (CommitInfoResponseResultEntity f2) -> - (HsJSONPB.pair "entity" f2) - Hs.Nothing -> Hs.mempty +instance (Hs.NFData CommitInfoResponse) +instance (HsProtobuf.Named CommitInfoResponse) where + nameOf _ = Hs.fromString "CommitInfoResponse" +instance (HsProtobuf.HasDefault CommitInfoResponse) +instance (HsProtobuf.Message CommitInfoResponse) where + encodeMessage _ CommitInfoResponse {commitInfoResponseResult} = + ( case commitInfoResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + CommitInfoResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + (HsProtobuf.ForceEmit y) + CommitInfoResponseResultEntity y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) + @(HsProtobuf.Nested Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options - ) - ] + (Hs.Just y) + ) ) - toEncodingPB (CommitInfoResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (CommitInfoResponseResultError f1) -> - (HsJSONPB.pair "error" f1) - Hs.Just (CommitInfoResponseResultEntity f2) -> - (HsJSONPB.pair "entity" f2) - Hs.Nothing -> Hs.mempty + decodeMessage _ = + Hs.pure CommitInfoResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. CommitInfoResponseResultError) + <*> HsProtobuf.decodeMessageField + ) + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.fmap CommitInfoResponseResultEntity) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) + @(Hs.Maybe Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options ) ] - ) - -instance HsJSONPB.FromJSONPB CommitInfoResponse where - parseJSONPB = - ( HsJSONPB.withObject - "CommitInfoResponse" - ( \obj -> - (Hs.pure CommitInfoResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. CommitInfoResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. CommitInfoResponseResultEntity - <$> (HsJSONPB.parseField parseObj "entity") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB CommitInfoResponse) where + toJSONPB (CommitInfoResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (CommitInfoResponseResultError f1) -> + HsJSONPB.pair "error" f1 + Hs.Just (CommitInfoResponseResultEntity f2) -> + HsJSONPB.pair "entity" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON CommitInfoResponse where + ] + toEncodingPB (CommitInfoResponse f1_or_f2) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (CommitInfoResponseResultError f1) -> + HsJSONPB.pair "error" f1 + Hs.Just (CommitInfoResponseResultEntity f2) -> + HsJSONPB.pair "entity" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB CommitInfoResponse) where + parseJSONPB = + HsJSONPB.withObject + "CommitInfoResponse" + ( \obj -> + Hs.pure CommitInfoResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. CommitInfoResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just Hs.. CommitInfoResponseResultEntity + <$> HsJSONPB.parseField parseObj "entity" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON CommitInfoResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitInfoResponse where +instance (HsJSONPB.FromJSON CommitInfoResponse) where parseJSON = HsJSONPB.parseJSONPB - data CommitInfoResponse_OldestEntity = CommitInfoResponse_OldestEntity - { commitInfoResponse_OldestEntityEntity :: - Hs.Maybe - Monocle.Protob.Crawler.Entity - , commitInfoResponse_OldestEntityLastCommitAt :: - Hs.Maybe - Google.Protobuf.Timestamp.Timestamp + { commitInfoResponse_OldestEntityEntity :: (Hs.Maybe Monocle.Protob.Crawler.Entity) + , commitInfoResponse_OldestEntityLastCommitAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitInfoResponse_OldestEntity - -instance HsProtobuf.Named CommitInfoResponse_OldestEntity where - nameOf _ = (Hs.fromString "CommitInfoResponse_OldestEntity") - -instance HsProtobuf.HasDefault CommitInfoResponse_OldestEntity - -instance HsProtobuf.Message CommitInfoResponse_OldestEntity where +instance (Hs.NFData CommitInfoResponse_OldestEntity) +instance (HsProtobuf.Named CommitInfoResponse_OldestEntity) where + nameOf _ = Hs.fromString "CommitInfoResponse_OldestEntity" +instance (HsProtobuf.HasDefault CommitInfoResponse_OldestEntity) +instance (HsProtobuf.Message CommitInfoResponse_OldestEntity) where encodeMessage _ CommitInfoResponse_OldestEntity - { commitInfoResponse_OldestEntityEntity = - commitInfoResponse_OldestEntityEntity - , commitInfoResponse_OldestEntityLastCommitAt = - commitInfoResponse_OldestEntityLastCommitAt + { commitInfoResponse_OldestEntityEntity + , commitInfoResponse_OldestEntityLastCommitAt } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (commitInfoResponse_OldestEntityEntity) - ) + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + ) + commitInfoResponse_OldestEntityEntity ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (commitInfoResponse_OldestEntityLastCommitAt) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + commitInfoResponse_OldestEntityLastCommitAt ) - ] - ) + ) decodeMessage _ = - (Hs.pure CommitInfoResponse_OldestEntity) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - @(Hs.Maybe Monocle.Protob.Crawler.Entity) + Hs.pure CommitInfoResponse_OldestEntity + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) - ) - (HsProtobufAST.Single "entity") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "last_commit_at") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "last_commit_at") + [] + "" ] - -instance HsJSONPB.ToJSONPB CommitInfoResponse_OldestEntity where +instance (HsJSONPB.ToJSONPB CommitInfoResponse_OldestEntity) where toJSONPB (CommitInfoResponse_OldestEntity f1 f2) = - ( HsJSONPB.object - [ "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.object + [ "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f1) ) - , "last_commit_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f1 + ) + , "last_commit_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f2) ) - ] - ) + f2 + ) + ] toEncodingPB (CommitInfoResponse_OldestEntity f1 f2) = - ( HsJSONPB.pairs - [ "entity" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) + HsJSONPB.pairs + [ "entity" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - (f1) ) - , "last_commit_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f1 + ) + , "last_commit_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f2) ) - ] - ) - -instance HsJSONPB.FromJSONPB CommitInfoResponse_OldestEntity where + f2 + ) + ] +instance (HsJSONPB.FromJSONPB CommitInfoResponse_OldestEntity) where parseJSONPB = - ( HsJSONPB.withObject - "CommitInfoResponse_OldestEntity" - ( \obj -> - (Hs.pure CommitInfoResponse_OldestEntity) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "CommitInfoResponse_OldestEntity" + ( \obj -> + Hs.pure CommitInfoResponse_OldestEntity + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) @(Hs.Maybe Monocle.Protob.Crawler.Entity) - (obj .: "entity") ) - <*> ( HsProtobuf.coerceOver + (obj .: "entity") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "last_commit_at") ) - ) - ) - -instance HsJSONPB.ToJSON CommitInfoResponse_OldestEntity where + (obj .: "last_commit_at") + ) + ) +instance (HsJSONPB.ToJSON CommitInfoResponse_OldestEntity) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CommitInfoResponse_OldestEntity where +instance (HsJSONPB.FromJSON CommitInfoResponse_OldestEntity) where parseJSON = HsJSONPB.parseJSONPB - data CommitInfoResponseResult - = CommitInfoResponseResultError - ( HsProtobuf.Enumerated - Monocle.Protob.Crawler.CommitInfoError - ) + = CommitInfoResponseResultError (HsProtobuf.Enumerated Monocle.Protob.Crawler.CommitInfoError) | CommitInfoResponseResultEntity Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CommitInfoResponseResult - -instance HsProtobuf.Named CommitInfoResponseResult where - nameOf _ = (Hs.fromString "CommitInfoResponseResult") - +instance (Hs.NFData CommitInfoResponseResult) +instance (HsProtobuf.Named CommitInfoResponseResult) where + nameOf _ = Hs.fromString "CommitInfoResponseResult" newtype Project = Project {projectFullPath :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Project - -instance HsProtobuf.Named Project where - nameOf _ = (Hs.fromString "Project") - -instance HsProtobuf.HasDefault Project - -instance HsProtobuf.Message Project where - encodeMessage _ Project {projectFullPath = projectFullPath} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (projectFullPath) - ) - ) - ] +instance (Hs.NFData Project) +instance (HsProtobuf.Named Project) where + nameOf _ = Hs.fromString "Project" +instance (HsProtobuf.HasDefault Project) +instance (HsProtobuf.Message Project) where + encodeMessage _ Project {projectFullPath} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + projectFullPath + ) ) decodeMessage _ = - (Hs.pure Project) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Project + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "full_path") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "full_path") + [] + "" ] - -instance HsJSONPB.ToJSONPB Project where +instance (HsJSONPB.ToJSONPB Project) where toJSONPB (Project f1) = - ( HsJSONPB.object - [ "full_path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + [ "full_path" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] toEncodingPB (Project f1) = - ( HsJSONPB.pairs - [ "full_path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB Project where + HsJSONPB.pairs + [ "full_path" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] +instance (HsJSONPB.FromJSONPB Project) where parseJSONPB = - ( HsJSONPB.withObject - "Project" - ( \obj -> - (Hs.pure Project) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "full_path") - ) - ) - ) - -instance HsJSONPB.ToJSON Project where + HsJSONPB.withObject + "Project" + ( \obj -> + Hs.pure Project + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "full_path") + ) + ) +instance (HsJSONPB.ToJSON Project) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Project where +instance (HsJSONPB.FromJSON Project) where parseJSON = HsJSONPB.parseJSONPB diff --git a/codegen/Monocle/Protob/Issue.hs b/codegen/Monocle/Protob/Issue.hs index 9df736592..363867190 100644 --- a/codegen/Monocle/Protob/Issue.hs +++ b/codegen/Monocle/Protob/Issue.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -49,96 +52,78 @@ import Prelude qualified as Hs data Ident = Ident {identUid :: Hs.Text, identMuid :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Ident - -instance HsProtobuf.Named Ident where - nameOf _ = (Hs.fromString "Ident") - -instance HsProtobuf.HasDefault Ident - -instance HsProtobuf.Message Ident where - encodeMessage _ Ident {identUid = identUid, identMuid = identMuid} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identUid)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identMuid)) - ) - ] - ) +instance (Hs.NFData Ident) +instance (HsProtobuf.Named Ident) where + nameOf _ = Hs.fromString "Ident" +instance (HsProtobuf.HasDefault Ident) +instance (HsProtobuf.Message Ident) where + encodeMessage _ Ident {identUid, identMuid} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) identUid) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) identMuid) + ) decodeMessage _ = - (Hs.pure Ident) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Ident + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "uid") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "muid") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "uid") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "muid") + [] + "" ] - -instance HsJSONPB.ToJSONPB Ident where +instance (HsJSONPB.ToJSONPB Ident) where toJSONPB (Ident f1 f2) = - ( HsJSONPB.object - [ "uid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "muid" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) + HsJSONPB.object + [ "uid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "muid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] toEncodingPB (Ident f1 f2) = - ( HsJSONPB.pairs - [ "uid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "muid" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) - -instance HsJSONPB.FromJSONPB Ident where + HsJSONPB.pairs + [ "uid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "muid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] +instance (HsJSONPB.FromJSONPB Ident) where parseJSONPB = - ( HsJSONPB.withObject - "Ident" - ( \obj -> - (Hs.pure Ident) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "uid") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "muid") - ) - ) - ) - -instance HsJSONPB.ToJSON Ident where + HsJSONPB.withObject + "Ident" + ( \obj -> + Hs.pure Ident + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "uid") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "muid") + ) + ) +instance (HsJSONPB.ToJSON Ident) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Ident where +instance (HsJSONPB.FromJSON Ident) where parseJSON = HsJSONPB.parseJSONPB - data Issue = Issue { issueId :: Hs.Text , issueNumber :: Hs.Int32 @@ -148,1041 +133,1040 @@ data Issue = Issue , issueRepositoryPrefix :: Hs.Text , issueRepositoryFullname :: Hs.Text , issueRepositoryShortname :: Hs.Text - , issueAuthor :: Hs.Maybe Monocle.Protob.Change.Ident - , issueCreatedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , issueUpdatedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , issueOptionalClosedAt :: Hs.Maybe IssueOptionalClosedAt + , issueAuthor :: (Hs.Maybe Monocle.Protob.Change.Ident) + , issueCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , issueUpdatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , issueOptionalClosedAt :: (Hs.Maybe IssueOptionalClosedAt) , issueState :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Issue - -instance HsProtobuf.Named Issue where - nameOf _ = (Hs.fromString "Issue") - -instance HsProtobuf.HasDefault Issue - -instance HsProtobuf.Message Issue where +instance (Hs.NFData Issue) +instance (HsProtobuf.Named Issue) where + nameOf _ = Hs.fromString "Issue" +instance (HsProtobuf.HasDefault Issue) +instance (HsProtobuf.Message Issue) where encodeMessage _ Issue - { issueId = issueId - , issueNumber = issueNumber - , issueTitle = issueTitle - , issueText = issueText - , issueUrl = issueUrl - , issueRepositoryPrefix = issueRepositoryPrefix - , issueRepositoryFullname = issueRepositoryFullname - , issueRepositoryShortname = issueRepositoryShortname - , issueAuthor = issueAuthor - , issueCreatedAt = issueCreatedAt - , issueUpdatedAt = issueUpdatedAt - , issueOptionalClosedAt = issueOptionalClosedAt - , issueState = issueState + { issueId + , issueNumber + , issueTitle + , issueText + , issueUrl + , issueRepositoryPrefix + , issueRepositoryFullname + , issueRepositoryShortname + , issueAuthor + , issueCreatedAt + , issueUpdatedAt + , issueOptionalClosedAt + , issueState } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueId)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - issueNumber - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueTitle)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueText)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueUrl)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 13) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueRepositoryPrefix) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 14) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueRepositoryFullname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 15) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueRepositoryShortname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 16) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (issueAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 20) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (issueCreatedAt) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueId + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + issueNumber + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueTitle + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueText + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) issueUrl) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 13) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueRepositoryPrefix + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 14) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueRepositoryFullname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 15) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueRepositoryShortname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 16) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + issueAuthor + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 20) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + issueCreatedAt + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 22) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (issueUpdatedAt) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 22) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + issueUpdatedAt + ) ) ) - , case issueOptionalClosedAt of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - IssueOptionalClosedAtClosedAt y -> - ( HsProtobuf.encodeMessageField + ( case issueOptionalClosedAt of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + IssueOptionalClosedAtClosedAt y -> + HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 23) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) (Hs.Just y) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 24) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueState)) ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 24) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) issueState) + ) decodeMessage _ = - (Hs.pure Issue) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Issue + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 13) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 14) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 15) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 16) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 20) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 22) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 23) - , (Hs.pure (Hs.fmap IssueOptionalClosedAtClosedAt)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 23) + , Hs.pure (Hs.fmap IssueOptionalClosedAtClosedAt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ] + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 24) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "number") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "title") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "text") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 13) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_prefix") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 14) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_fullname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 15) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_shortname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 16) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_change" Hs.:| ["Ident"])) - ) - ) - ) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 20) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 22) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "updated_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 24) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "state") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "text") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 13) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 14) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 15) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 16) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["Ident"])) + ) + ) + ) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 20) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 22) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "updated_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 24) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "state") + [] + "" ] - -instance HsJSONPB.ToJSONPB Issue where +instance (HsJSONPB.ToJSONPB Issue) where toJSONPB (Issue f1 f2 f4 f5 f6 f13 f14 f15 f16 f20 f22 f23 f24) = - ( HsJSONPB.object - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "number" .= f2 - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "text" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f13)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f14)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + HsJSONPB.object + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "number" .= f2 + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "text" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f13) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f14) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f15) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f16) ) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f16 + ) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f20) ) - , "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f20 + ) + , "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f22) ) - , ( let encodeOptional_closed_at = - ( case f23 of - Hs.Just (IssueOptionalClosedAtClosedAt f23) -> - (HsJSONPB.pair "closed_at" f23) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_closed_at" - .= (HsJSONPB.objectOrNull [encodeOptional_closed_at] options) - ) - options - else encodeOptional_closed_at options - ) - , "state" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f24)) - ] - ) + f22 + ) + , ( let + encodeOptional_closed_at = + ( case f23 of + Hs.Just (IssueOptionalClosedAtClosedAt f23) -> + HsJSONPB.pair "closed_at" f23 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_closed_at" + .= HsJSONPB.objectOrNull [encodeOptional_closed_at] options + ) + options + else encodeOptional_closed_at options + ) + ) + , "state" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f24) + ] toEncodingPB (Issue f1 f2 f4 f5 f6 f13 f14 f15 f16 f20 f22 f23 f24) = - ( HsJSONPB.pairs - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "number" .= f2 - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "text" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f13)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f14)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + HsJSONPB.pairs + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "number" .= f2 + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "text" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f13) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f14) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f15) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f16) ) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f16 + ) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f20) ) - , "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f20 + ) + , "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f22) ) - , ( let encodeOptional_closed_at = - ( case f23 of - Hs.Just (IssueOptionalClosedAtClosedAt f23) -> - (HsJSONPB.pair "closed_at" f23) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "optional_closed_at" - .= (HsJSONPB.pairsOrNull [encodeOptional_closed_at] options) - ) - options - else encodeOptional_closed_at options - ) - , "state" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f24)) - ] - ) - -instance HsJSONPB.FromJSONPB Issue where + f22 + ) + , ( let + encodeOptional_closed_at = + ( case f23 of + Hs.Just (IssueOptionalClosedAtClosedAt f23) -> + HsJSONPB.pair "closed_at" f23 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ( "optional_closed_at" + .= HsJSONPB.pairsOrNull [encodeOptional_closed_at] options + ) + options + else encodeOptional_closed_at options + ) + ) + , "state" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f24) + ] +instance (HsJSONPB.FromJSONPB Issue) where parseJSONPB = - ( HsJSONPB.withObject - "Issue" - ( \obj -> - (Hs.pure Issue) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "id") - ) - <*> obj .: "number" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "title") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "text") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_prefix") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_fullname") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_shortname") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Issue" + ( \obj -> + Hs.pure Issue + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "id") + ) + <*> obj .: "number" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "title") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "text") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_prefix") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_fullname") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_shortname") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "author") ) - <*> ( HsProtobuf.coerceOver + (obj .: "author") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") ) - <*> ( HsProtobuf.coerceOver + (obj .: "created_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "updated_at") - ) - <*> ( let parseOptional_closed_at parseObj = - Hs.msum - [ Hs.Just Hs.. IssueOptionalClosedAtClosedAt - <$> (HsJSONPB.parseField parseObj "closed_at") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "optional_closed_at") - Hs.>>= (HsJSONPB.withObject "optional_closed_at" parseOptional_closed_at) - ) - <|> (parseOptional_closed_at obj) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "state") - ) - ) - ) - -instance HsJSONPB.ToJSON Issue where + (obj .: "updated_at") + ) + <*> ( let + parseOptional_closed_at parseObj = + Hs.msum + [ Hs.Just Hs.. IssueOptionalClosedAtClosedAt + <$> HsJSONPB.parseField parseObj "closed_at" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "optional_closed_at" + Hs.>>= HsJSONPB.withObject "optional_closed_at" parseOptional_closed_at + ) + <|> (parseOptional_closed_at obj) + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "state") + ) + ) +instance (HsJSONPB.ToJSON Issue) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Issue where +instance (HsJSONPB.FromJSON Issue) where parseJSON = HsJSONPB.parseJSONPB - -data IssueOptionalClosedAt = IssueOptionalClosedAtClosedAt Google.Protobuf.Timestamp.Timestamp +newtype IssueOptionalClosedAt + = IssueOptionalClosedAtClosedAt Google.Protobuf.Timestamp.Timestamp deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData IssueOptionalClosedAt - -instance HsProtobuf.Named IssueOptionalClosedAt where - nameOf _ = (Hs.fromString "IssueOptionalClosedAt") - +instance (Hs.NFData IssueOptionalClosedAt) +instance (HsProtobuf.Named IssueOptionalClosedAt) where + nameOf _ = Hs.fromString "IssueOptionalClosedAt" data IssueEvent = IssueEvent { issueEventId :: Hs.Text - , issueEventCreatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , issueEventAuthor :: Hs.Maybe Monocle.Protob.Change.Ident + , issueEventCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , issueEventAuthor :: (Hs.Maybe Monocle.Protob.Change.Ident) , issueEventRepositoryPrefix :: Hs.Text , issueEventRepositoryFullname :: Hs.Text , issueEventRepositoryShortname :: Hs.Text , issueEventNumber :: Hs.Int32 , issueEventUrl :: Hs.Text - , issueEventType :: Hs.Maybe IssueEventType + , issueEventType :: (Hs.Maybe IssueEventType) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData IssueEvent - -instance HsProtobuf.Named IssueEvent where - nameOf _ = (Hs.fromString "IssueEvent") - -instance HsProtobuf.HasDefault IssueEvent - -instance HsProtobuf.Message IssueEvent where +instance (Hs.NFData IssueEvent) +instance (HsProtobuf.Named IssueEvent) where + nameOf _ = Hs.fromString "IssueEvent" +instance (HsProtobuf.HasDefault IssueEvent) +instance (HsProtobuf.Message IssueEvent) where encodeMessage _ IssueEvent - { issueEventId = issueEventId - , issueEventCreatedAt = issueEventCreatedAt - , issueEventAuthor = issueEventAuthor - , issueEventRepositoryPrefix = issueEventRepositoryPrefix - , issueEventRepositoryFullname = issueEventRepositoryFullname - , issueEventRepositoryShortname = issueEventRepositoryShortname - , issueEventNumber = issueEventNumber - , issueEventUrl = issueEventUrl - , issueEventType = issueEventType + { issueEventId + , issueEventCreatedAt + , issueEventAuthor + , issueEventRepositoryPrefix + , issueEventRepositoryFullname + , issueEventRepositoryShortname + , issueEventNumber + , issueEventUrl + , issueEventType } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueEventId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (issueEventCreatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (issueEventAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueEventRepositoryPrefix) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueEventRepositoryFullname) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) issueEventId) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + issueEventCreatedAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + issueEventAuthor + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueEventRepositoryPrefix + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueEventRepositoryFullname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueEventRepositoryShortname + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueEventRepositoryShortname) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 9) + issueEventNumber ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 9) - issueEventNumber - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueEventUrl) - ) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) issueEventUrl) ) - , case issueEventType of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - IssueEventTypeIssueCreated y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 15) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Issue.IssueCreatedEvent) - @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCreatedEvent) - (Hs.Just y) - ) + ) + ( case issueEventType of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + IssueEventTypeIssueCreated y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 15) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Issue.IssueCreatedEvent) + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCreatedEvent) + ) + (Hs.Just y) ) - IssueEventTypeIssueCommented y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 16) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Issue.IssueCommentedEvent) - @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCommentedEvent) - (Hs.Just y) - ) + IssueEventTypeIssueCommented y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 16) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Issue.IssueCommentedEvent) + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCommentedEvent) + ) + (Hs.Just y) ) - IssueEventTypeIssueClosed y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 21) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Issue.IssueClosedEvent) - @(HsProtobuf.Nested Monocle.Protob.Issue.IssueClosedEvent) - (Hs.Just y) - ) + IssueEventTypeIssueClosed y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 21) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Issue.IssueClosedEvent) + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueClosedEvent) + ) + (Hs.Just y) ) - ] - ) + ) decodeMessage _ = - (Hs.pure IssueEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure IssueEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - @(Hs.Maybe Monocle.Protob.Change.Ident) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 9) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 9) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 15) - , (Hs.pure (Hs.fmap IssueEventTypeIssueCreated)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCreatedEvent) - @(Hs.Maybe Monocle.Protob.Issue.IssueCreatedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 16) - , (Hs.pure (Hs.fmap IssueEventTypeIssueCommented)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCommentedEvent) - @(Hs.Maybe Monocle.Protob.Issue.IssueCommentedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 21) - , (Hs.pure (Hs.fmap IssueEventTypeIssueClosed)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Issue.IssueClosedEvent) - @(Hs.Maybe Monocle.Protob.Issue.IssueClosedEvent) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 15) + , Hs.pure (Hs.fmap IssueEventTypeIssueCreated) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCreatedEvent) + @(Hs.Maybe Monocle.Protob.Issue.IssueCreatedEvent) + ) + HsProtobuf.decodeMessageField + ) ) - dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + , + ( (HsProtobuf.FieldNumber 16) + , Hs.pure (Hs.fmap IssueEventTypeIssueCommented) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCommentedEvent) + @(Hs.Maybe Monocle.Protob.Issue.IssueCommentedEvent) + ) + HsProtobuf.decodeMessageField ) - ) ) - (HsProtobufAST.Single "created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_change" Hs.:| ["Ident"])) + , + ( (HsProtobuf.FieldNumber 21) + , Hs.pure (Hs.fmap IssueEventTypeIssueClosed) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueClosedEvent) + @(Hs.Maybe Monocle.Protob.Issue.IssueClosedEvent) + ) + HsProtobuf.decodeMessageField ) - ) ) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_prefix") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_fullname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_shortname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 9) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "number") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) + ] + dotProto _ = + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["Ident"])) + ) + ) + ) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 9) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" ] - -instance HsJSONPB.ToJSONPB IssueEvent where +instance (HsJSONPB.ToJSONPB IssueEvent) where toJSONPB (IssueEvent f1 f2 f3 f4 f5 f6 f9 f11 f15_or_f16_or_f21) = - ( HsJSONPB.object - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f2) ) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) + f2 + ) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f3) + ) + f3 + ) + , "repository_prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "repository_shortname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "number" .= f9 + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f11) + , ( let + encodeType = + ( case f15_or_f16_or_f21 of + Hs.Just (IssueEventTypeIssueCreated f15) -> + HsJSONPB.pair "IssueCreated" f15 + Hs.Just (IssueEventTypeIssueCommented f16) -> + HsJSONPB.pair "IssueCommented" f16 + Hs.Just (IssueEventTypeIssueClosed f21) -> + HsJSONPB.pair "IssueClosed" f21 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("type" .= HsJSONPB.objectOrNull [encodeType] options) options + else encodeType options + ) + ) + ] + toEncodingPB + (IssueEvent f1 f2 f3 f4 f5 f6 f9 f11 f15_or_f16_or_f21) = + HsJSONPB.pairs + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + f2 + ) + , "author" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Change.Ident) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + ) + f3 ) , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) , "number" .= f9 - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) - , ( let encodeType = - ( case f15_or_f16_or_f21 of - Hs.Just (IssueEventTypeIssueCreated f15) -> - (HsJSONPB.pair "IssueCreated" f15) - Hs.Just (IssueEventTypeIssueCommented f16) -> - (HsJSONPB.pair "IssueCommented" f16) - Hs.Just (IssueEventTypeIssueClosed f21) -> - (HsJSONPB.pair "IssueClosed" f21) - Hs.Nothing -> Hs.mempty - ) - in \options -> + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f11) + , ( let + encodeType = + ( case f15_or_f16_or_f21 of + Hs.Just (IssueEventTypeIssueCreated f15) -> + HsJSONPB.pair "IssueCreated" f15 + Hs.Just (IssueEventTypeIssueCommented f16) -> + HsJSONPB.pair "IssueCommented" f16 + Hs.Just (IssueEventTypeIssueClosed f21) -> + HsJSONPB.pair "IssueClosed" f21 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> if HsJSONPB.optEmitNamedOneof options - then ("type" .= (HsJSONPB.objectOrNull [encodeType] options)) options + then ("type" .= HsJSONPB.pairsOrNull [encodeType] options) options else encodeType options + ) ) ] - ) - toEncodingPB - (IssueEvent f1 f2 f3 f4 f5 f6 f9 f11 f15_or_f16_or_f21) = - ( HsJSONPB.pairs - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f2) - ) - , "author" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) - @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - (f3) - ) - , "repository_prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "repository_shortname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "number" .= f9 - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) - , ( let encodeType = - ( case f15_or_f16_or_f21 of - Hs.Just (IssueEventTypeIssueCreated f15) -> - (HsJSONPB.pair "IssueCreated" f15) - Hs.Just (IssueEventTypeIssueCommented f16) -> - (HsJSONPB.pair "IssueCommented" f16) - Hs.Just (IssueEventTypeIssueClosed f21) -> - (HsJSONPB.pair "IssueClosed" f21) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("type" .= (HsJSONPB.pairsOrNull [encodeType] options)) options - else encodeType options - ) - ] - ) - -instance HsJSONPB.FromJSONPB IssueEvent where +instance (HsJSONPB.FromJSONPB IssueEvent) where parseJSONPB = - ( HsJSONPB.withObject - "IssueEvent" - ( \obj -> - (Hs.pure IssueEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "id") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "IssueEvent" + ( \obj -> + Hs.pure IssueEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "id") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") ) - <*> ( HsProtobuf.coerceOver + (obj .: "created_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Change.Ident) @(Hs.Maybe Monocle.Protob.Change.Ident) - (obj .: "author") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_prefix") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_fullname") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_shortname") - ) - <*> obj .: "number" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") ) - <*> ( let parseType parseObj = - Hs.msum - [ Hs.Just Hs.. IssueEventTypeIssueCreated - <$> (HsJSONPB.parseField parseObj "IssueCreated") - , Hs.Just Hs.. IssueEventTypeIssueCommented - <$> (HsJSONPB.parseField parseObj "IssueCommented") - , Hs.Just Hs.. IssueEventTypeIssueClosed - <$> (HsJSONPB.parseField parseObj "IssueClosed") - , Hs.pure Hs.Nothing - ] - in ((obj .: "type") Hs.>>= (HsJSONPB.withObject "type" parseType)) - <|> (parseType obj) - ) - ) - ) - -instance HsJSONPB.ToJSON IssueEvent where + (obj .: "author") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_prefix") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_fullname") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_shortname") + ) + <*> obj .: "number" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> ( let + parseType parseObj = + Hs.msum + [ Hs.Just Hs.. IssueEventTypeIssueCreated + <$> HsJSONPB.parseField parseObj "IssueCreated" + , Hs.Just Hs.. IssueEventTypeIssueCommented + <$> HsJSONPB.parseField parseObj "IssueCommented" + , Hs.Just Hs.. IssueEventTypeIssueClosed + <$> HsJSONPB.parseField parseObj "IssueClosed" + , Hs.pure Hs.Nothing + ] + in + (obj .: "type" Hs.>>= HsJSONPB.withObject "type" parseType) + <|> (parseType obj) + ) + ) +instance (HsJSONPB.ToJSON IssueEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON IssueEvent where +instance (HsJSONPB.FromJSON IssueEvent) where parseJSON = HsJSONPB.parseJSONPB - data IssueEventType = IssueEventTypeIssueCreated Monocle.Protob.Issue.IssueCreatedEvent | IssueEventTypeIssueCommented Monocle.Protob.Issue.IssueCommentedEvent | IssueEventTypeIssueClosed Monocle.Protob.Issue.IssueClosedEvent deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData IssueEventType - -instance HsProtobuf.Named IssueEventType where - nameOf _ = (Hs.fromString "IssueEventType") - +instance (Hs.NFData IssueEventType) +instance (HsProtobuf.Named IssueEventType) where + nameOf _ = Hs.fromString "IssueEventType" data IssueCreatedEvent = IssueCreatedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData IssueCreatedEvent - -instance HsProtobuf.Named IssueCreatedEvent where - nameOf _ = (Hs.fromString "IssueCreatedEvent") - -instance HsProtobuf.HasDefault IssueCreatedEvent - -instance HsProtobuf.Message IssueCreatedEvent where - encodeMessage _ IssueCreatedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure IssueCreatedEvent) +instance (Hs.NFData IssueCreatedEvent) +instance (HsProtobuf.Named IssueCreatedEvent) where + nameOf _ = Hs.fromString "IssueCreatedEvent" +instance (HsProtobuf.HasDefault IssueCreatedEvent) +instance (HsProtobuf.Message IssueCreatedEvent) where + encodeMessage _ IssueCreatedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure IssueCreatedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB IssueCreatedEvent where - toJSONPB (IssueCreatedEvent) = (HsJSONPB.object []) - toEncodingPB (IssueCreatedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB IssueCreatedEvent where +instance (HsJSONPB.ToJSONPB IssueCreatedEvent) where + toJSONPB IssueCreatedEvent = HsJSONPB.object [] + toEncodingPB IssueCreatedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB IssueCreatedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "IssueCreatedEvent" - (\obj -> (Hs.pure IssueCreatedEvent)) - ) - -instance HsJSONPB.ToJSON IssueCreatedEvent where + HsJSONPB.withObject + "IssueCreatedEvent" + (\obj -> Hs.pure IssueCreatedEvent) +instance (HsJSONPB.ToJSON IssueCreatedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON IssueCreatedEvent where +instance (HsJSONPB.FromJSON IssueCreatedEvent) where parseJSON = HsJSONPB.parseJSONPB - -newtype IssueCommentedEvent = IssueCommentedEvent - { issueCommentedEventComment :: - Hs.Text - } +newtype IssueCommentedEvent = IssueCommentedEvent {issueCommentedEventComment :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData IssueCommentedEvent - -instance HsProtobuf.Named IssueCommentedEvent where - nameOf _ = (Hs.fromString "IssueCommentedEvent") - -instance HsProtobuf.HasDefault IssueCommentedEvent - -instance HsProtobuf.Message IssueCommentedEvent where - encodeMessage - _ - IssueCommentedEvent - { issueCommentedEventComment = - issueCommentedEventComment - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (issueCommentedEventComment) - ) - ) - ] - ) +instance (Hs.NFData IssueCommentedEvent) +instance (HsProtobuf.Named IssueCommentedEvent) where + nameOf _ = Hs.fromString "IssueCommentedEvent" +instance (HsProtobuf.HasDefault IssueCommentedEvent) +instance (HsProtobuf.Message IssueCommentedEvent) where + encodeMessage _ IssueCommentedEvent {issueCommentedEventComment} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + issueCommentedEventComment + ) + ) decodeMessage _ = - (Hs.pure IssueCommentedEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure IssueCommentedEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "comment") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "comment") + [] + "" ] - -instance HsJSONPB.ToJSONPB IssueCommentedEvent where +instance (HsJSONPB.ToJSONPB IssueCommentedEvent) where toJSONPB (IssueCommentedEvent f1) = - ( HsJSONPB.object - [ "comment" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + [ "comment" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] toEncodingPB (IssueCommentedEvent f1) = - ( HsJSONPB.pairs - [ "comment" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB IssueCommentedEvent where + HsJSONPB.pairs + [ "comment" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] +instance (HsJSONPB.FromJSONPB IssueCommentedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "IssueCommentedEvent" - ( \obj -> - (Hs.pure IssueCommentedEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "comment") - ) - ) - ) - -instance HsJSONPB.ToJSON IssueCommentedEvent where + HsJSONPB.withObject + "IssueCommentedEvent" + ( \obj -> + Hs.pure IssueCommentedEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "comment") + ) + ) +instance (HsJSONPB.ToJSON IssueCommentedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON IssueCommentedEvent where +instance (HsJSONPB.FromJSON IssueCommentedEvent) where parseJSON = HsJSONPB.parseJSONPB - data IssueClosedEvent = IssueClosedEvent {} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData IssueClosedEvent - -instance HsProtobuf.Named IssueClosedEvent where - nameOf _ = (Hs.fromString "IssueClosedEvent") - -instance HsProtobuf.HasDefault IssueClosedEvent - -instance HsProtobuf.Message IssueClosedEvent where - encodeMessage _ IssueClosedEvent {} = (Hs.mconcat []) - decodeMessage _ = (Hs.pure IssueClosedEvent) +instance (Hs.NFData IssueClosedEvent) +instance (HsProtobuf.Named IssueClosedEvent) where + nameOf _ = Hs.fromString "IssueClosedEvent" +instance (HsProtobuf.HasDefault IssueClosedEvent) +instance (HsProtobuf.Message IssueClosedEvent) where + encodeMessage _ IssueClosedEvent {} = Hs.mempty + decodeMessage _ = Hs.pure IssueClosedEvent dotProto _ = [] - -instance HsJSONPB.ToJSONPB IssueClosedEvent where - toJSONPB (IssueClosedEvent) = (HsJSONPB.object []) - toEncodingPB (IssueClosedEvent) = (HsJSONPB.pairs []) - -instance HsJSONPB.FromJSONPB IssueClosedEvent where +instance (HsJSONPB.ToJSONPB IssueClosedEvent) where + toJSONPB IssueClosedEvent = HsJSONPB.object [] + toEncodingPB IssueClosedEvent = HsJSONPB.pairs [] +instance (HsJSONPB.FromJSONPB IssueClosedEvent) where parseJSONPB = - ( HsJSONPB.withObject - "IssueClosedEvent" - (\obj -> (Hs.pure IssueClosedEvent)) - ) - -instance HsJSONPB.ToJSON IssueClosedEvent where + HsJSONPB.withObject + "IssueClosedEvent" + (\obj -> Hs.pure IssueClosedEvent) +instance (HsJSONPB.ToJSON IssueClosedEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON IssueClosedEvent where +instance (HsJSONPB.FromJSON IssueClosedEvent) where parseJSON = HsJSONPB.parseJSONPB diff --git a/codegen/Monocle/Protob/Login.hs b/codegen/Monocle/Protob/Login.hs index 695ce7f0b..913584ab3 100644 --- a/codegen/Monocle/Protob/Login.hs +++ b/codegen/Monocle/Protob/Login.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -45,266 +48,199 @@ import Proto3.Wire.Decode qualified as HsProtobuf ( import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs -newtype LoginValidationRequest = LoginValidationRequest - { loginValidationRequestUsername :: - Hs.Text - } +newtype LoginValidationRequest = LoginValidationRequest {loginValidationRequestUsername :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData LoginValidationRequest - -instance HsProtobuf.Named LoginValidationRequest where - nameOf _ = (Hs.fromString "LoginValidationRequest") - -instance HsProtobuf.HasDefault LoginValidationRequest - -instance HsProtobuf.Message LoginValidationRequest where +instance (Hs.NFData LoginValidationRequest) +instance (HsProtobuf.Named LoginValidationRequest) where + nameOf _ = Hs.fromString "LoginValidationRequest" +instance (HsProtobuf.HasDefault LoginValidationRequest) +instance (HsProtobuf.Message LoginValidationRequest) where encodeMessage _ - LoginValidationRequest - { loginValidationRequestUsername = - loginValidationRequestUsername - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (loginValidationRequestUsername) - ) - ) - ] + LoginValidationRequest {loginValidationRequestUsername} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + loginValidationRequestUsername + ) ) decodeMessage _ = - (Hs.pure LoginValidationRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure LoginValidationRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "username") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") + [] + "" ] - -instance HsJSONPB.ToJSONPB LoginValidationRequest where +instance (HsJSONPB.ToJSONPB LoginValidationRequest) where toJSONPB (LoginValidationRequest f1) = - ( HsJSONPB.object - [ "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + [ "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] toEncodingPB (LoginValidationRequest f1) = - ( HsJSONPB.pairs - [ "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB LoginValidationRequest where + HsJSONPB.pairs + [ "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] +instance (HsJSONPB.FromJSONPB LoginValidationRequest) where parseJSONPB = - ( HsJSONPB.withObject - "LoginValidationRequest" - ( \obj -> - (Hs.pure LoginValidationRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "username") - ) - ) - ) - -instance HsJSONPB.ToJSON LoginValidationRequest where + HsJSONPB.withObject + "LoginValidationRequest" + ( \obj -> + Hs.pure LoginValidationRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "username") + ) + ) +instance (HsJSONPB.ToJSON LoginValidationRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON LoginValidationRequest where +instance (HsJSONPB.FromJSON LoginValidationRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype LoginValidationResponse = LoginValidationResponse - { loginValidationResponseResult :: - Hs.Maybe LoginValidationResponseResult - } +newtype LoginValidationResponse = LoginValidationResponse {loginValidationResponseResult :: (Hs.Maybe LoginValidationResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData LoginValidationResponse - -instance HsProtobuf.Named LoginValidationResponse where - nameOf _ = (Hs.fromString "LoginValidationResponse") - -instance HsProtobuf.HasDefault LoginValidationResponse - -instance HsProtobuf.Message LoginValidationResponse where +instance (Hs.NFData LoginValidationResponse) +instance (HsProtobuf.Named LoginValidationResponse) where + nameOf _ = Hs.fromString "LoginValidationResponse" +instance (HsProtobuf.HasDefault LoginValidationResponse) +instance (HsProtobuf.Message LoginValidationResponse) where encodeMessage _ - LoginValidationResponse - { loginValidationResponseResult = - loginValidationResponseResult - } = - ( Hs.mconcat - [ case loginValidationResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - LoginValidationResponseResultValidationResult y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) - ) - ] + LoginValidationResponse {loginValidationResponseResult} = + ( case loginValidationResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + LoginValidationResponseResultValidationResult y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + (HsProtobuf.ForceEmit y) ) decodeMessage _ = - (Hs.pure LoginValidationResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , ( Hs.pure - (Hs.Just Hs.. LoginValidationResponseResultValidationResult) - ) - <*> HsProtobuf.decodeMessageField - ) - ] + Hs.pure LoginValidationResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure + (Hs.Just Hs.. LoginValidationResponseResultValidationResult) + <*> HsProtobuf.decodeMessageField ) + ] dotProto _ = [] - -instance HsJSONPB.ToJSONPB LoginValidationResponse where +instance (HsJSONPB.ToJSONPB LoginValidationResponse) where toJSONPB (LoginValidationResponse f1) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1 of - Hs.Just (LoginValidationResponseResultValidationResult f1) -> - (HsJSONPB.pair "validation_result" f1) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options - ) - ] - ) + HsJSONPB.object + [ ( let + encodeResult = + ( case f1 of + Hs.Just (LoginValidationResponseResultValidationResult f1) -> + HsJSONPB.pair "validation_result" f1 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] toEncodingPB (LoginValidationResponse f1) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1 of - Hs.Just (LoginValidationResponseResultValidationResult f1) -> - (HsJSONPB.pair "validation_result" f1) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options - ) - ] - ) - -instance HsJSONPB.FromJSONPB LoginValidationResponse where - parseJSONPB = - ( HsJSONPB.withObject - "LoginValidationResponse" - ( \obj -> - (Hs.pure LoginValidationResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. LoginValidationResponseResultValidationResult - <$> (HsJSONPB.parseField parseObj "validation_result") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1 of + Hs.Just (LoginValidationResponseResultValidationResult f1) -> + HsJSONPB.pair "validation_result" f1 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON LoginValidationResponse where + ] +instance (HsJSONPB.FromJSONPB LoginValidationResponse) where + parseJSONPB = + HsJSONPB.withObject + "LoginValidationResponse" + ( \obj -> + Hs.pure LoginValidationResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. LoginValidationResponseResultValidationResult + <$> HsJSONPB.parseField parseObj "validation_result" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON LoginValidationResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON LoginValidationResponse where +instance (HsJSONPB.FromJSON LoginValidationResponse) where parseJSON = HsJSONPB.parseJSONPB - data LoginValidationResponse_ValidationResult = LoginValidationResponse_ValidationResultUnknownIdent | LoginValidationResponse_ValidationResultKnownIdent deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named LoginValidationResponse_ValidationResult where - nameOf _ = - (Hs.fromString "LoginValidationResponse_ValidationResult") - -instance - HsProtobuf.HasDefault - LoginValidationResponse_ValidationResult - -instance Hs.Bounded LoginValidationResponse_ValidationResult where +instance (HsProtobuf.Named LoginValidationResponse_ValidationResult) where + nameOf _ = Hs.fromString "LoginValidationResponse_ValidationResult" +instance (HsProtobuf.HasDefault LoginValidationResponse_ValidationResult) +instance (Hs.Bounded LoginValidationResponse_ValidationResult) where minBound = LoginValidationResponse_ValidationResultUnknownIdent maxBound = LoginValidationResponse_ValidationResultKnownIdent - -instance Hs.Ord LoginValidationResponse_ValidationResult where +instance (Hs.Ord LoginValidationResponse_ValidationResult) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance - HsProtobuf.ProtoEnum - LoginValidationResponse_ValidationResult - where +instance (HsProtobuf.ProtoEnum LoginValidationResponse_ValidationResult) where toProtoEnumMay 0 = Hs.Just LoginValidationResponse_ValidationResultUnknownIdent toProtoEnumMay 1 = Hs.Just LoginValidationResponse_ValidationResultKnownIdent toProtoEnumMay _ = Hs.Nothing - fromProtoEnum - (LoginValidationResponse_ValidationResultUnknownIdent) = 0 - fromProtoEnum (LoginValidationResponse_ValidationResultKnownIdent) = + fromProtoEnum LoginValidationResponse_ValidationResultUnknownIdent = + 0 + fromProtoEnum LoginValidationResponse_ValidationResultKnownIdent = 1 - -instance HsJSONPB.ToJSONPB LoginValidationResponse_ValidationResult where +instance (HsJSONPB.ToJSONPB LoginValidationResponse_ValidationResult) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance - HsJSONPB.FromJSONPB - LoginValidationResponse_ValidationResult - where +instance (HsJSONPB.FromJSONPB LoginValidationResponse_ValidationResult) where parseJSONPB (HsJSONPB.String "UnknownIdent") = Hs.pure LoginValidationResponse_ValidationResultUnknownIdent parseJSONPB (HsJSONPB.String "KnownIdent") = Hs.pure LoginValidationResponse_ValidationResultKnownIdent parseJSONPB v = - ( HsJSONPB.typeMismatch - "LoginValidationResponse_ValidationResult" - v - ) - -instance HsJSONPB.ToJSON LoginValidationResponse_ValidationResult where + HsJSONPB.typeMismatch + "LoginValidationResponse_ValidationResult" + v +instance (HsJSONPB.ToJSON LoginValidationResponse_ValidationResult) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON LoginValidationResponse_ValidationResult where +instance (HsJSONPB.FromJSON LoginValidationResponse_ValidationResult) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite LoginValidationResponse_ValidationResult - -data LoginValidationResponseResult - = LoginValidationResponseResultValidationResult - ( HsProtobuf.Enumerated - Monocle.Protob.Login.LoginValidationResponse_ValidationResult - ) +instance (HsProtobuf.Finite LoginValidationResponse_ValidationResult) +newtype LoginValidationResponseResult + = LoginValidationResponseResultValidationResult (HsProtobuf.Enumerated Monocle.Protob.Login.LoginValidationResponse_ValidationResult) deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData LoginValidationResponseResult - -instance HsProtobuf.Named LoginValidationResponseResult where - nameOf _ = (Hs.fromString "LoginValidationResponseResult") +instance (Hs.NFData LoginValidationResponseResult) +instance (HsProtobuf.Named LoginValidationResponseResult) where + nameOf _ = Hs.fromString "LoginValidationResponseResult" diff --git a/codegen/Monocle/Protob/Metric.hs b/codegen/Monocle/Protob/Metric.hs index 81ea5503f..6ef6bbada 100644 --- a/codegen/Monocle/Protob/Metric.hs +++ b/codegen/Monocle/Protob/Metric.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -52,2431 +55,2052 @@ data MetricInfo = MetricInfo , metricInfoMetric :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData MetricInfo - -instance HsProtobuf.Named MetricInfo where - nameOf _ = (Hs.fromString "MetricInfo") - -instance HsProtobuf.HasDefault MetricInfo - -instance HsProtobuf.Message MetricInfo where +instance (Hs.NFData MetricInfo) +instance (HsProtobuf.Named MetricInfo) where + nameOf _ = Hs.fromString "MetricInfo" +instance (HsProtobuf.HasDefault MetricInfo) +instance (HsProtobuf.Message MetricInfo) where encodeMessage _ MetricInfo - { metricInfoName = metricInfoName - , metricInfoDescription = metricInfoDescription - , metricInfoLongDescription = metricInfoLongDescription - , metricInfoMetric = metricInfoMetric + { metricInfoName + , metricInfoDescription + , metricInfoLongDescription + , metricInfoMetric } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (metricInfoName) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) metricInfoName) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (metricInfoDescription) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + metricInfoDescription + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (metricInfoLongDescription) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + metricInfoLongDescription ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (metricInfoMetric) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + metricInfoMetric ) - ] - ) + ) decodeMessage _ = - (Hs.pure MetricInfo) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure MetricInfo + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "name") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "description") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "long_description") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "metric") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "description") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "long_description") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "metric") + [] + "" ] - -instance HsJSONPB.ToJSONPB MetricInfo where +instance (HsJSONPB.ToJSONPB MetricInfo) where toJSONPB (MetricInfo f1 f2 f3 f4) = - ( HsJSONPB.object - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "description" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "long_description" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "metric" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - ] - ) + HsJSONPB.object + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "description" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "long_description" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "metric" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + ] toEncodingPB (MetricInfo f1 f2 f3 f4) = - ( HsJSONPB.pairs - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "description" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "long_description" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "metric" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - ] - ) - -instance HsJSONPB.FromJSONPB MetricInfo where + HsJSONPB.pairs + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "description" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "long_description" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "metric" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + ] +instance (HsJSONPB.FromJSONPB MetricInfo) where parseJSONPB = - ( HsJSONPB.withObject - "MetricInfo" - ( \obj -> - (Hs.pure MetricInfo) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "name") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "description") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "long_description") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "metric") - ) - ) - ) - -instance HsJSONPB.ToJSON MetricInfo where + HsJSONPB.withObject + "MetricInfo" + ( \obj -> + Hs.pure MetricInfo + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "name") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "description") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "long_description") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "metric") + ) + ) +instance (HsJSONPB.ToJSON MetricInfo) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON MetricInfo where +instance (HsJSONPB.FromJSON MetricInfo) where parseJSON = HsJSONPB.parseJSONPB - newtype ListRequest = ListRequest {listRequestVoid :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ListRequest - -instance HsProtobuf.Named ListRequest where - nameOf _ = (Hs.fromString "ListRequest") - -instance HsProtobuf.HasDefault ListRequest - -instance HsProtobuf.Message ListRequest where - encodeMessage _ ListRequest {listRequestVoid = listRequestVoid} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (listRequestVoid) - ) - ) - ] +instance (Hs.NFData ListRequest) +instance (HsProtobuf.Named ListRequest) where + nameOf _ = Hs.fromString "ListRequest" +instance (HsProtobuf.HasDefault ListRequest) +instance (HsProtobuf.Message ListRequest) where + encodeMessage _ ListRequest {listRequestVoid} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + listRequestVoid + ) ) decodeMessage _ = - (Hs.pure ListRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ListRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "void") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") + [] + "" ] - -instance HsJSONPB.ToJSONPB ListRequest where +instance (HsJSONPB.ToJSONPB ListRequest) where toJSONPB (ListRequest f1) = - ( HsJSONPB.object - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (ListRequest f1) = - ( HsJSONPB.pairs - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB ListRequest where + HsJSONPB.pairs + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB ListRequest) where parseJSONPB = - ( HsJSONPB.withObject - "ListRequest" - ( \obj -> - (Hs.pure ListRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "void") - ) - ) - ) - -instance HsJSONPB.ToJSON ListRequest where + HsJSONPB.withObject + "ListRequest" + ( \obj -> + Hs.pure ListRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "void") + ) + ) +instance (HsJSONPB.ToJSON ListRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ListRequest where +instance (HsJSONPB.FromJSON ListRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype ListResponse = ListResponse - { listResponseMetrics :: - Hs.Vector Monocle.Protob.Metric.MetricInfo - } +newtype ListResponse = ListResponse {listResponseMetrics :: (Hs.Vector Monocle.Protob.Metric.MetricInfo)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ListResponse - -instance HsProtobuf.Named ListResponse where - nameOf _ = (Hs.fromString "ListResponse") - -instance HsProtobuf.HasDefault ListResponse - -instance HsProtobuf.Message ListResponse where - encodeMessage - _ - ListResponse {listResponseMetrics = listResponseMetrics} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) - (listResponseMetrics) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure ListResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) +instance (Hs.NFData ListResponse) +instance (HsProtobuf.Named ListResponse) where + nameOf _ = Hs.fromString "ListResponse" +instance (HsProtobuf.HasDefault ListResponse) +instance (HsProtobuf.Message ListResponse) where + encodeMessage _ ListResponse {listResponseMetrics} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) + ) + listResponseMetrics + ) + ) + decodeMessage _ = + Hs.pure ListResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) + @(Hs.Vector Monocle.Protob.Metric.MetricInfo) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "MetricInfo")) - ) - (HsProtobufAST.Single "metrics") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "MetricInfo")) + ) + (HsProtobufAST.Single "metrics") + [] + "" ] - -instance HsJSONPB.ToJSONPB ListResponse where +instance (HsJSONPB.ToJSONPB ListResponse) where toJSONPB (ListResponse f1) = - ( HsJSONPB.object - [ "metrics" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) + HsJSONPB.object + [ "metrics" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.MetricInfo) @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (ListResponse f1) = - ( HsJSONPB.pairs - [ "metrics" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) + HsJSONPB.pairs + [ "metrics" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.MetricInfo) @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB ListResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB ListResponse) where parseJSONPB = - ( HsJSONPB.withObject - "ListResponse" - ( \obj -> - (Hs.pure ListResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ListResponse" + ( \obj -> + Hs.pure ListResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) @(Hs.Vector Monocle.Protob.Metric.MetricInfo) - (obj .: "metrics") ) - ) - ) - -instance HsJSONPB.ToJSON ListResponse where + (obj .: "metrics") + ) + ) +instance (HsJSONPB.ToJSON ListResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ListResponse where +instance (HsJSONPB.FromJSON ListResponse) where parseJSON = HsJSONPB.parseJSONPB - newtype Trend = Trend {trendInterval :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Trend - -instance HsProtobuf.Named Trend where - nameOf _ = (Hs.fromString "Trend") - -instance HsProtobuf.HasDefault Trend - -instance HsProtobuf.Message Trend where - encodeMessage _ Trend {trendInterval = trendInterval} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (trendInterval) - ) - ) - ] +instance (Hs.NFData Trend) +instance (HsProtobuf.Named Trend) where + nameOf _ = Hs.fromString "Trend" +instance (HsProtobuf.HasDefault Trend) +instance (HsProtobuf.Message Trend) where + encodeMessage _ Trend {trendInterval} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) trendInterval) ) decodeMessage _ = - (Hs.pure Trend) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Trend + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "interval") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "interval") + [] + "" ] - -instance HsJSONPB.ToJSONPB Trend where +instance (HsJSONPB.ToJSONPB Trend) where toJSONPB (Trend f1) = - ( HsJSONPB.object - [ "interval" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + [ "interval" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] toEncodingPB (Trend f1) = - ( HsJSONPB.pairs - [ "interval" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB Trend where + HsJSONPB.pairs + [ "interval" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] +instance (HsJSONPB.FromJSONPB Trend) where parseJSONPB = - ( HsJSONPB.withObject - "Trend" - ( \obj -> - (Hs.pure Trend) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "interval") - ) - ) - ) - -instance HsJSONPB.ToJSON Trend where + HsJSONPB.withObject + "Trend" + ( \obj -> + Hs.pure Trend + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "interval") + ) + ) +instance (HsJSONPB.ToJSON Trend) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Trend where +instance (HsJSONPB.FromJSON Trend) where parseJSON = HsJSONPB.parseJSONPB - newtype Top = Top {topLimit :: Hs.Word32} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Top - -instance HsProtobuf.Named Top where - nameOf _ = (Hs.fromString "Top") - -instance HsProtobuf.HasDefault Top - -instance HsProtobuf.Message Top where - encodeMessage _ Top {topLimit = topLimit} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - topLimit - ) - ] +instance (Hs.NFData Top) +instance (HsProtobuf.Named Top) where + nameOf _ = Hs.fromString "Top" +instance (HsProtobuf.HasDefault Top) +instance (HsProtobuf.Message Top) where + encodeMessage _ Top {topLimit} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + topLimit ) decodeMessage _ = - (Hs.pure Top) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) + Hs.pure Top + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "limit") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "limit") + [] + "" ] - -instance HsJSONPB.ToJSONPB Top where - toJSONPB (Top f1) = (HsJSONPB.object ["limit" .= f1]) - toEncodingPB (Top f1) = (HsJSONPB.pairs ["limit" .= f1]) - -instance HsJSONPB.FromJSONPB Top where +instance (HsJSONPB.ToJSONPB Top) where + toJSONPB (Top f1) = HsJSONPB.object ["limit" .= f1] + toEncodingPB (Top f1) = HsJSONPB.pairs ["limit" .= f1] +instance (HsJSONPB.FromJSONPB Top) where parseJSONPB = - ( HsJSONPB.withObject - "Top" - (\obj -> (Hs.pure Top) <*> obj .: "limit") - ) - -instance HsJSONPB.ToJSON Top where + HsJSONPB.withObject + "Top" + (\obj -> Hs.pure Top <*> obj .: "limit") +instance (HsJSONPB.ToJSON Top) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Top where +instance (HsJSONPB.FromJSON Top) where parseJSON = HsJSONPB.parseJSONPB - newtype Compute = Compute {computeVoid :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Compute - -instance HsProtobuf.Named Compute where - nameOf _ = (Hs.fromString "Compute") - -instance HsProtobuf.HasDefault Compute - -instance HsProtobuf.Message Compute where - encodeMessage _ Compute {computeVoid = computeVoid} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (computeVoid) - ) - ) - ] +instance (Hs.NFData Compute) +instance (HsProtobuf.Named Compute) where + nameOf _ = Hs.fromString "Compute" +instance (HsProtobuf.HasDefault Compute) +instance (HsProtobuf.Message Compute) where + encodeMessage _ Compute {computeVoid} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) computeVoid) ) decodeMessage _ = - (Hs.pure Compute) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Compute + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "void") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") + [] + "" ] - -instance HsJSONPB.ToJSONPB Compute where +instance (HsJSONPB.ToJSONPB Compute) where toJSONPB (Compute f1) = - ( HsJSONPB.object - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (Compute f1) = - ( HsJSONPB.pairs - [ "void" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB Compute where + HsJSONPB.pairs + ["void" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB Compute) where parseJSONPB = - ( HsJSONPB.withObject - "Compute" - ( \obj -> - (Hs.pure Compute) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "void") - ) - ) - ) - -instance HsJSONPB.ToJSON Compute where + HsJSONPB.withObject + "Compute" + ( \obj -> + Hs.pure Compute + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "void") + ) + ) +instance (HsJSONPB.ToJSON Compute) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Compute where +instance (HsJSONPB.FromJSON Compute) where parseJSON = HsJSONPB.parseJSONPB - data GetRequest = GetRequest { getRequestIndex :: Hs.Text , getRequestUsername :: Hs.Text , getRequestQuery :: Hs.Text , getRequestMetric :: Hs.Text - , getRequestOptions :: Hs.Maybe GetRequestOptions + , getRequestOptions :: (Hs.Maybe GetRequestOptions) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetRequest - -instance HsProtobuf.Named GetRequest where - nameOf _ = (Hs.fromString "GetRequest") - -instance HsProtobuf.HasDefault GetRequest - -instance HsProtobuf.Message GetRequest where +instance (Hs.NFData GetRequest) +instance (HsProtobuf.Named GetRequest) where + nameOf _ = Hs.fromString "GetRequest" +instance (HsProtobuf.HasDefault GetRequest) +instance (HsProtobuf.Message GetRequest) where encodeMessage _ GetRequest - { getRequestIndex = getRequestIndex - , getRequestUsername = getRequestUsername - , getRequestQuery = getRequestQuery - , getRequestMetric = getRequestMetric - , getRequestOptions = getRequestOptions + { getRequestIndex + , getRequestUsername + , getRequestQuery + , getRequestMetric + , getRequestOptions } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getRequestIndex) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getRequestUsername) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getRequestIndex + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getRequestUsername + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getRequestQuery) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getRequestQuery + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (getRequestMetric) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + getRequestMetric ) ) - , case getRequestOptions of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - GetRequestOptionsCompute y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.Compute) - @(HsProtobuf.Nested Monocle.Protob.Metric.Compute) - (Hs.Just y) - ) + ) + ( case getRequestOptions of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + GetRequestOptionsCompute y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.Compute) + @(HsProtobuf.Nested Monocle.Protob.Metric.Compute) + ) + (Hs.Just y) ) - GetRequestOptionsTrend y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.Trend) - @(HsProtobuf.Nested Monocle.Protob.Metric.Trend) - (Hs.Just y) - ) + GetRequestOptionsTrend y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.Trend) + @(HsProtobuf.Nested Monocle.Protob.Metric.Trend) + ) + (Hs.Just y) ) - GetRequestOptionsTop y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.Top) - @(HsProtobuf.Nested Monocle.Protob.Metric.Top) - (Hs.Just y) - ) + GetRequestOptionsTop y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.Top) + @(HsProtobuf.Nested Monocle.Protob.Metric.Top) + ) + (Hs.Just y) ) - ] - ) + ) decodeMessage _ = - (Hs.pure GetRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure GetRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 7) - , (Hs.pure (Hs.fmap GetRequestOptionsCompute)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.Compute) - @(Hs.Maybe Monocle.Protob.Metric.Compute) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 5) - , (Hs.pure (Hs.fmap GetRequestOptionsTrend)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.Trend) - @(Hs.Maybe Monocle.Protob.Metric.Trend) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 6) - , (Hs.pure (Hs.fmap GetRequestOptionsTop)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.Top) - @(Hs.Maybe Monocle.Protob.Metric.Top) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 7) + , Hs.pure (Hs.fmap GetRequestOptionsCompute) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Compute) + @(Hs.Maybe Monocle.Protob.Metric.Compute) + ) + HsProtobuf.decodeMessageField + ) ) - dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "username") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "query") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "metric") - [] - "" - ) - ] - -instance HsJSONPB.ToJSONPB GetRequest where - toJSONPB (GetRequest f1 f2 f3 f4 f7_or_f5_or_f6) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "metric" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , ( let encodeOptions = - ( case f7_or_f5_or_f6 of - Hs.Just (GetRequestOptionsCompute f7) -> - (HsJSONPB.pair "compute" f7) - Hs.Just (GetRequestOptionsTrend f5) -> (HsJSONPB.pair "trend" f5) - Hs.Just (GetRequestOptionsTop f6) -> (HsJSONPB.pair "top" f6) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 5) + , Hs.pure (Hs.fmap GetRequestOptionsTrend) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Trend) + @(Hs.Maybe Monocle.Protob.Metric.Trend) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("options" .= (HsJSONPB.objectOrNull [encodeOptions] options)) - options - else encodeOptions options ) - ] - ) - toEncodingPB (GetRequest f1 f2 f3 f4 f7_or_f5_or_f6) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "metric" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , ( let encodeOptions = - ( case f7_or_f5_or_f6 of - Hs.Just (GetRequestOptionsCompute f7) -> - (HsJSONPB.pair "compute" f7) - Hs.Just (GetRequestOptionsTrend f5) -> (HsJSONPB.pair "trend" f5) - Hs.Just (GetRequestOptionsTop f6) -> (HsJSONPB.pair "top" f6) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 6) + , Hs.pure (Hs.fmap GetRequestOptionsTop) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Top) + @(Hs.Maybe Monocle.Protob.Metric.Top) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("options" .= (HsJSONPB.pairsOrNull [encodeOptions] options)) - options - else encodeOptions options ) ] - ) - -instance HsJSONPB.FromJSONPB GetRequest where - parseJSONPB = - ( HsJSONPB.withObject - "GetRequest" - ( \obj -> - (Hs.pure GetRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "username") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "query") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "metric") - ) - <*> ( let parseOptions parseObj = - Hs.msum - [ Hs.Just Hs.. GetRequestOptionsCompute - <$> (HsJSONPB.parseField parseObj "compute") - , Hs.Just Hs.. GetRequestOptionsTrend - <$> (HsJSONPB.parseField parseObj "trend") - , Hs.Just Hs.. GetRequestOptionsTop - <$> (HsJSONPB.parseField parseObj "top") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "options") - Hs.>>= (HsJSONPB.withObject "options" parseOptions) - ) - <|> (parseOptions obj) - ) + dotProto _ = + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "metric") + [] + "" + ] +instance (HsJSONPB.ToJSONPB GetRequest) where + toJSONPB (GetRequest f1 f2 f3 f4 f7_or_f5_or_f6) = + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "metric" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , ( let + encodeOptions = + ( case f7_or_f5_or_f6 of + Hs.Just (GetRequestOptionsCompute f7) -> HsJSONPB.pair "compute" f7 + Hs.Just (GetRequestOptionsTrend f5) -> HsJSONPB.pair "trend" f5 + Hs.Just (GetRequestOptionsTop f6) -> HsJSONPB.pair "top" f6 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ("options" .= HsJSONPB.objectOrNull [encodeOptions] options) + options + else encodeOptions options + ) ) - ) - -instance HsJSONPB.ToJSON GetRequest where + ] + toEncodingPB (GetRequest f1 f2 f3 f4 f7_or_f5_or_f6) = + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "metric" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , ( let + encodeOptions = + ( case f7_or_f5_or_f6 of + Hs.Just (GetRequestOptionsCompute f7) -> HsJSONPB.pair "compute" f7 + Hs.Just (GetRequestOptionsTrend f5) -> HsJSONPB.pair "trend" f5 + Hs.Just (GetRequestOptionsTop f6) -> HsJSONPB.pair "top" f6 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("options" .= HsJSONPB.pairsOrNull [encodeOptions] options) options + else encodeOptions options + ) + ) + ] +instance (HsJSONPB.FromJSONPB GetRequest) where + parseJSONPB = + HsJSONPB.withObject + "GetRequest" + ( \obj -> + Hs.pure GetRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "username") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "query") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "metric") + ) + <*> ( let + parseOptions parseObj = + Hs.msum + [ Hs.Just Hs.. GetRequestOptionsCompute + <$> HsJSONPB.parseField parseObj "compute" + , Hs.Just Hs.. GetRequestOptionsTrend + <$> HsJSONPB.parseField parseObj "trend" + , Hs.Just Hs.. GetRequestOptionsTop + <$> HsJSONPB.parseField parseObj "top" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "options" + Hs.>>= HsJSONPB.withObject "options" parseOptions + ) + <|> (parseOptions obj) + ) + ) +instance (HsJSONPB.ToJSON GetRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetRequest where +instance (HsJSONPB.FromJSON GetRequest) where parseJSON = HsJSONPB.parseJSONPB - data GetRequestOptions = GetRequestOptionsCompute Monocle.Protob.Metric.Compute | GetRequestOptionsTrend Monocle.Protob.Metric.Trend | GetRequestOptionsTop Monocle.Protob.Metric.Top deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetRequestOptions - -instance HsProtobuf.Named GetRequestOptions where - nameOf _ = (Hs.fromString "GetRequestOptions") - +instance (Hs.NFData GetRequestOptions) +instance (HsProtobuf.Named GetRequestOptions) where + nameOf _ = Hs.fromString "GetRequestOptions" newtype InfoRequest = InfoRequest {infoRequestMetric :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData InfoRequest - -instance HsProtobuf.Named InfoRequest where - nameOf _ = (Hs.fromString "InfoRequest") - -instance HsProtobuf.HasDefault InfoRequest - -instance HsProtobuf.Message InfoRequest where - encodeMessage _ InfoRequest {infoRequestMetric = infoRequestMetric} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (infoRequestMetric) - ) - ) - ] +instance (Hs.NFData InfoRequest) +instance (HsProtobuf.Named InfoRequest) where + nameOf _ = Hs.fromString "InfoRequest" +instance (HsProtobuf.HasDefault InfoRequest) +instance (HsProtobuf.Message InfoRequest) where + encodeMessage _ InfoRequest {infoRequestMetric} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + infoRequestMetric + ) ) decodeMessage _ = - (Hs.pure InfoRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure InfoRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "metric") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "metric") + [] + "" ] - -instance HsJSONPB.ToJSONPB InfoRequest where +instance (HsJSONPB.ToJSONPB InfoRequest) where toJSONPB (InfoRequest f1) = - ( HsJSONPB.object - [ "metric" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + [ "metric" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] toEncodingPB (InfoRequest f1) = - ( HsJSONPB.pairs - [ "metric" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB InfoRequest where + HsJSONPB.pairs + [ "metric" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] +instance (HsJSONPB.FromJSONPB InfoRequest) where parseJSONPB = - ( HsJSONPB.withObject - "InfoRequest" - ( \obj -> - (Hs.pure InfoRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "metric") - ) - ) - ) - -instance HsJSONPB.ToJSON InfoRequest where + HsJSONPB.withObject + "InfoRequest" + ( \obj -> + Hs.pure InfoRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "metric") + ) + ) +instance (HsJSONPB.ToJSON InfoRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON InfoRequest where +instance (HsJSONPB.FromJSON InfoRequest) where parseJSON = HsJSONPB.parseJSONPB - -data HistoInt = HistoInt - { histoIntDate :: Hs.Text - , histoIntCount :: Hs.Word32 - } +data HistoInt = HistoInt {histoIntDate :: Hs.Text, histoIntCount :: Hs.Word32} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData HistoInt - -instance HsProtobuf.Named HistoInt where - nameOf _ = (Hs.fromString "HistoInt") - -instance HsProtobuf.HasDefault HistoInt - -instance HsProtobuf.Message HistoInt where - encodeMessage - _ - HistoInt - { histoIntDate = histoIntDate - , histoIntCount = histoIntCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (histoIntDate) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - histoIntCount - ) - ] +instance (Hs.NFData HistoInt) +instance (HsProtobuf.Named HistoInt) where + nameOf _ = Hs.fromString "HistoInt" +instance (HsProtobuf.HasDefault HistoInt) +instance (HsProtobuf.Message HistoInt) where + encodeMessage _ HistoInt {histoIntDate, histoIntCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) histoIntDate) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + histoIntCount ) decodeMessage _ = - (Hs.pure HistoInt) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure HistoInt + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "date") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "date") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") + [] + "" ] - -instance HsJSONPB.ToJSONPB HistoInt where +instance (HsJSONPB.ToJSONPB HistoInt) where toJSONPB (HistoInt f1 f2) = - ( HsJSONPB.object - [ "date" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) + HsJSONPB.object + [ "date" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] toEncodingPB (HistoInt f1 f2) = - ( HsJSONPB.pairs - [ "date" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB HistoInt where + HsJSONPB.pairs + [ "date" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] +instance (HsJSONPB.FromJSONPB HistoInt) where parseJSONPB = - ( HsJSONPB.withObject - "HistoInt" - ( \obj -> - (Hs.pure HistoInt) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "date") - ) - <*> obj .: "count" - ) - ) - -instance HsJSONPB.ToJSON HistoInt where + HsJSONPB.withObject + "HistoInt" + ( \obj -> + Hs.pure HistoInt + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "date") + ) + <*> obj .: "count" + ) +instance (HsJSONPB.ToJSON HistoInt) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON HistoInt where +instance (HsJSONPB.FromJSON HistoInt) where parseJSON = HsJSONPB.parseJSONPB - data HistoFloat = HistoFloat { histoFloatDate :: Hs.Text , histoFloatCount :: Hs.Float } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData HistoFloat - -instance HsProtobuf.Named HistoFloat where - nameOf _ = (Hs.fromString "HistoFloat") - -instance HsProtobuf.HasDefault HistoFloat - -instance HsProtobuf.Message HistoFloat where - encodeMessage - _ - HistoFloat - { histoFloatDate = histoFloatDate - , histoFloatCount = histoFloatCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (histoFloatDate) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - histoFloatCount - ) - ] +instance (Hs.NFData HistoFloat) +instance (HsProtobuf.Named HistoFloat) where + nameOf _ = Hs.fromString "HistoFloat" +instance (HsProtobuf.HasDefault HistoFloat) +instance (HsProtobuf.Message HistoFloat) where + encodeMessage _ HistoFloat {histoFloatDate, histoFloatCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) histoFloatDate) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + histoFloatCount ) decodeMessage _ = - (Hs.pure HistoFloat) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure HistoFloat + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "date") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "date") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "count") + [] + "" ] - -instance HsJSONPB.ToJSONPB HistoFloat where +instance (HsJSONPB.ToJSONPB HistoFloat) where toJSONPB (HistoFloat f1 f2) = - ( HsJSONPB.object - [ "date" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) + HsJSONPB.object + [ "date" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] toEncodingPB (HistoFloat f1 f2) = - ( HsJSONPB.pairs - [ "date" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB HistoFloat where + HsJSONPB.pairs + [ "date" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] +instance (HsJSONPB.FromJSONPB HistoFloat) where parseJSONPB = - ( HsJSONPB.withObject - "HistoFloat" - ( \obj -> - (Hs.pure HistoFloat) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "date") - ) - <*> obj .: "count" - ) - ) - -instance HsJSONPB.ToJSON HistoFloat where + HsJSONPB.withObject + "HistoFloat" + ( \obj -> + Hs.pure HistoFloat + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "date") + ) + <*> obj .: "count" + ) +instance (HsJSONPB.ToJSON HistoFloat) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON HistoFloat where +instance (HsJSONPB.FromJSON HistoFloat) where parseJSON = HsJSONPB.parseJSONPB - -newtype HistoIntStat = HistoIntStat - { histoIntStatHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - } +newtype HistoIntStat = HistoIntStat {histoIntStatHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData HistoIntStat - -instance HsProtobuf.Named HistoIntStat where - nameOf _ = (Hs.fromString "HistoIntStat") - -instance HsProtobuf.HasDefault HistoIntStat - -instance HsProtobuf.Message HistoIntStat where - encodeMessage _ HistoIntStat {histoIntStatHisto = histoIntStatHisto} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (histoIntStatHisto) - ) +instance (Hs.NFData HistoIntStat) +instance (HsProtobuf.Named HistoIntStat) where + nameOf _ = Hs.fromString "HistoIntStat" +instance (HsProtobuf.HasDefault HistoIntStat) +instance (HsProtobuf.Message HistoIntStat) where + encodeMessage _ HistoIntStat {histoIntStatHisto} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) ) - ] + histoIntStatHisto + ) ) decodeMessage _ = - (Hs.pure HistoIntStat) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + Hs.pure HistoIntStat + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "HistoInt")) - ) - (HsProtobufAST.Single "histo") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "HistoInt")) + ) + (HsProtobufAST.Single "histo") + [] + "" ] - -instance HsJSONPB.ToJSONPB HistoIntStat where +instance (HsJSONPB.ToJSONPB HistoIntStat) where toJSONPB (HistoIntStat f1) = - ( HsJSONPB.object - [ "histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + HsJSONPB.object + [ "histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (HistoIntStat f1) = - ( HsJSONPB.pairs - [ "histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + HsJSONPB.pairs + [ "histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB HistoIntStat where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB HistoIntStat) where parseJSONPB = - ( HsJSONPB.withObject - "HistoIntStat" - ( \obj -> - (Hs.pure HistoIntStat) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "HistoIntStat" + ( \obj -> + Hs.pure HistoIntStat + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "histo") ) - ) - ) - -instance HsJSONPB.ToJSON HistoIntStat where + (obj .: "histo") + ) + ) +instance (HsJSONPB.ToJSON HistoIntStat) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON HistoIntStat where +instance (HsJSONPB.FromJSON HistoIntStat) where parseJSON = HsJSONPB.parseJSONPB - -newtype HistoFloatStat = HistoFloatStat - { histoFloatStatHisto :: - Hs.Vector Monocle.Protob.Metric.HistoFloat - } +newtype HistoFloatStat = HistoFloatStat {histoFloatStatHisto :: (Hs.Vector Monocle.Protob.Metric.HistoFloat)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData HistoFloatStat - -instance HsProtobuf.Named HistoFloatStat where - nameOf _ = (Hs.fromString "HistoFloatStat") - -instance HsProtobuf.HasDefault HistoFloatStat - -instance HsProtobuf.Message HistoFloatStat where - encodeMessage - _ - HistoFloatStat {histoFloatStatHisto = histoFloatStatHisto} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) - (histoFloatStatHisto) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure HistoFloatStat) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) +instance (Hs.NFData HistoFloatStat) +instance (HsProtobuf.Named HistoFloatStat) where + nameOf _ = Hs.fromString "HistoFloatStat" +instance (HsProtobuf.HasDefault HistoFloatStat) +instance (HsProtobuf.Message HistoFloatStat) where + encodeMessage _ HistoFloatStat {histoFloatStatHisto} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) + ) + histoFloatStatHisto + ) + ) + decodeMessage _ = + Hs.pure HistoFloatStat + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) + @(Hs.Vector Monocle.Protob.Metric.HistoFloat) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "HistoFloat")) - ) - (HsProtobufAST.Single "histo") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "HistoFloat")) + ) + (HsProtobufAST.Single "histo") + [] + "" ] - -instance HsJSONPB.ToJSONPB HistoFloatStat where +instance (HsJSONPB.ToJSONPB HistoFloatStat) where toJSONPB (HistoFloatStat f1) = - ( HsJSONPB.object - [ "histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) + HsJSONPB.object + [ "histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoFloat) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (HistoFloatStat f1) = - ( HsJSONPB.pairs - [ "histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) + HsJSONPB.pairs + [ "histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoFloat) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB HistoFloatStat where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB HistoFloatStat) where parseJSONPB = - ( HsJSONPB.withObject - "HistoFloatStat" - ( \obj -> - (Hs.pure HistoFloatStat) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "HistoFloatStat" + ( \obj -> + Hs.pure HistoFloatStat + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) @(Hs.Vector Monocle.Protob.Metric.HistoFloat) - (obj .: "histo") ) - ) - ) - -instance HsJSONPB.ToJSON HistoFloatStat where + (obj .: "histo") + ) + ) +instance (HsJSONPB.ToJSON HistoFloatStat) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON HistoFloatStat where +instance (HsJSONPB.FromJSON HistoFloatStat) where parseJSON = HsJSONPB.parseJSONPB - data TermCountInt = TermCountInt { termCountIntTerm :: Hs.Text , termCountIntCount :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TermCountInt - -instance HsProtobuf.Named TermCountInt where - nameOf _ = (Hs.fromString "TermCountInt") - -instance HsProtobuf.HasDefault TermCountInt - -instance HsProtobuf.Message TermCountInt where - encodeMessage - _ - TermCountInt - { termCountIntTerm = termCountIntTerm - , termCountIntCount = termCountIntCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (termCountIntTerm) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - termCountIntCount - ) - ] +instance (Hs.NFData TermCountInt) +instance (HsProtobuf.Named TermCountInt) where + nameOf _ = Hs.fromString "TermCountInt" +instance (HsProtobuf.HasDefault TermCountInt) +instance (HsProtobuf.Message TermCountInt) where + encodeMessage _ TermCountInt {termCountIntTerm, termCountIntCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + termCountIntTerm + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + termCountIntCount ) decodeMessage _ = - (Hs.pure TermCountInt) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure TermCountInt + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "term") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "term") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") + [] + "" ] - -instance HsJSONPB.ToJSONPB TermCountInt where +instance (HsJSONPB.ToJSONPB TermCountInt) where toJSONPB (TermCountInt f1 f2) = - ( HsJSONPB.object - [ "term" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) + HsJSONPB.object + [ "term" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] toEncodingPB (TermCountInt f1 f2) = - ( HsJSONPB.pairs - [ "term" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB TermCountInt where + HsJSONPB.pairs + [ "term" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] +instance (HsJSONPB.FromJSONPB TermCountInt) where parseJSONPB = - ( HsJSONPB.withObject - "TermCountInt" - ( \obj -> - (Hs.pure TermCountInt) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "term") - ) - <*> obj .: "count" - ) - ) - -instance HsJSONPB.ToJSON TermCountInt where + HsJSONPB.withObject + "TermCountInt" + ( \obj -> + Hs.pure TermCountInt + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "term") + ) + <*> obj .: "count" + ) +instance (HsJSONPB.ToJSON TermCountInt) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TermCountInt where +instance (HsJSONPB.FromJSON TermCountInt) where parseJSON = HsJSONPB.parseJSONPB - data TermsCountInt = TermsCountInt - { termsCountIntTermcount :: - Hs.Vector Monocle.Protob.Metric.TermCountInt + { termsCountIntTermcount :: (Hs.Vector Monocle.Protob.Metric.TermCountInt) , termsCountIntTotalHits :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TermsCountInt - -instance HsProtobuf.Named TermsCountInt where - nameOf _ = (Hs.fromString "TermsCountInt") - -instance HsProtobuf.HasDefault TermsCountInt - -instance HsProtobuf.Message TermsCountInt where +instance (Hs.NFData TermsCountInt) +instance (HsProtobuf.Named TermsCountInt) where + nameOf _ = Hs.fromString "TermsCountInt" +instance (HsProtobuf.HasDefault TermsCountInt) +instance (HsProtobuf.Message TermsCountInt) where encodeMessage _ - TermsCountInt - { termsCountIntTermcount = termsCountIntTermcount - , termsCountIntTotalHits = termsCountIntTotalHits - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) - (termsCountIntTermcount) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - termsCountIntTotalHits + TermsCountInt {termsCountIntTermcount, termsCountIntTotalHits} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) + ) + termsCountIntTermcount ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + termsCountIntTotalHits + ) decodeMessage _ = - (Hs.pure TermsCountInt) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) - @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + Hs.pure TermsCountInt + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) + @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "TermCountInt")) - ) - (HsProtobufAST.Single "termcount") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "total_hits") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TermCountInt")) + ) + (HsProtobufAST.Single "termcount") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "total_hits") + [] + "" ] - -instance HsJSONPB.ToJSONPB TermsCountInt where +instance (HsJSONPB.ToJSONPB TermsCountInt) where toJSONPB (TermsCountInt f1 f2) = - ( HsJSONPB.object - [ "termcount" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + HsJSONPB.object + [ "termcount" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) - (f1) ) - , "total_hits" .= f2 - ] - ) + f1 + ) + , "total_hits" .= f2 + ] toEncodingPB (TermsCountInt f1 f2) = - ( HsJSONPB.pairs - [ "termcount" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + HsJSONPB.pairs + [ "termcount" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) - (f1) ) - , "total_hits" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB TermsCountInt where + f1 + ) + , "total_hits" .= f2 + ] +instance (HsJSONPB.FromJSONPB TermsCountInt) where parseJSONPB = - ( HsJSONPB.withObject - "TermsCountInt" - ( \obj -> - (Hs.pure TermsCountInt) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "TermsCountInt" + ( \obj -> + Hs.pure TermsCountInt + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) @(Hs.Vector Monocle.Protob.Metric.TermCountInt) - (obj .: "termcount") ) - <*> obj .: "total_hits" - ) - ) - -instance HsJSONPB.ToJSON TermsCountInt where + (obj .: "termcount") + ) + <*> obj .: "total_hits" + ) +instance (HsJSONPB.ToJSON TermsCountInt) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TermsCountInt where +instance (HsJSONPB.FromJSON TermsCountInt) where parseJSON = HsJSONPB.parseJSONPB - data TermCountFloat = TermCountFloat { termCountFloatTerm :: Hs.Text , termCountFloatCount :: Hs.Float } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TermCountFloat - -instance HsProtobuf.Named TermCountFloat where - nameOf _ = (Hs.fromString "TermCountFloat") - -instance HsProtobuf.HasDefault TermCountFloat - -instance HsProtobuf.Message TermCountFloat where +instance (Hs.NFData TermCountFloat) +instance (HsProtobuf.Named TermCountFloat) where + nameOf _ = Hs.fromString "TermCountFloat" +instance (HsProtobuf.HasDefault TermCountFloat) +instance (HsProtobuf.Message TermCountFloat) where encodeMessage _ - TermCountFloat - { termCountFloatTerm = termCountFloatTerm - , termCountFloatCount = termCountFloatCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (termCountFloatTerm) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - termCountFloatCount + TermCountFloat {termCountFloatTerm, termCountFloatCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + termCountFloatTerm ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + termCountFloatCount + ) decodeMessage _ = - (Hs.pure TermCountFloat) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure TermCountFloat + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "term") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "term") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "count") + [] + "" ] - -instance HsJSONPB.ToJSONPB TermCountFloat where +instance (HsJSONPB.ToJSONPB TermCountFloat) where toJSONPB (TermCountFloat f1 f2) = - ( HsJSONPB.object - [ "term" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) + HsJSONPB.object + [ "term" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] toEncodingPB (TermCountFloat f1 f2) = - ( HsJSONPB.pairs - [ "term" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB TermCountFloat where + HsJSONPB.pairs + [ "term" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] +instance (HsJSONPB.FromJSONPB TermCountFloat) where parseJSONPB = - ( HsJSONPB.withObject - "TermCountFloat" - ( \obj -> - (Hs.pure TermCountFloat) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "term") - ) - <*> obj .: "count" - ) - ) - -instance HsJSONPB.ToJSON TermCountFloat where + HsJSONPB.withObject + "TermCountFloat" + ( \obj -> + Hs.pure TermCountFloat + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "term") + ) + <*> obj .: "count" + ) +instance (HsJSONPB.ToJSON TermCountFloat) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TermCountFloat where +instance (HsJSONPB.FromJSON TermCountFloat) where parseJSON = HsJSONPB.parseJSONPB - data TermsCountFloat = TermsCountFloat - { termsCountFloatTermcount :: - Hs.Vector Monocle.Protob.Metric.TermCountFloat + { termsCountFloatTermcount :: (Hs.Vector Monocle.Protob.Metric.TermCountFloat) , termsCountFloatTotalHits :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TermsCountFloat - -instance HsProtobuf.Named TermsCountFloat where - nameOf _ = (Hs.fromString "TermsCountFloat") - -instance HsProtobuf.HasDefault TermsCountFloat - -instance HsProtobuf.Message TermsCountFloat where +instance (Hs.NFData TermsCountFloat) +instance (HsProtobuf.Named TermsCountFloat) where + nameOf _ = Hs.fromString "TermsCountFloat" +instance (HsProtobuf.HasDefault TermsCountFloat) +instance (HsProtobuf.Message TermsCountFloat) where encodeMessage _ TermsCountFloat - { termsCountFloatTermcount = - termsCountFloatTermcount - , termsCountFloatTotalHits = termsCountFloatTotalHits + { termsCountFloatTermcount + , termsCountFloatTotalHits } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) - (termsCountFloatTermcount) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - termsCountFloatTotalHits + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) + ) + termsCountFloatTermcount ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + termsCountFloatTotalHits + ) decodeMessage _ = - (Hs.pure TermsCountFloat) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) - @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + Hs.pure TermsCountFloat + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) + @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "TermCountFloat")) - ) - (HsProtobufAST.Single "termcount") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "total_hits") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TermCountFloat")) + ) + (HsProtobufAST.Single "termcount") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "total_hits") + [] + "" ] - -instance HsJSONPB.ToJSONPB TermsCountFloat where +instance (HsJSONPB.ToJSONPB TermsCountFloat) where toJSONPB (TermsCountFloat f1 f2) = - ( HsJSONPB.object - [ "termcount" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + HsJSONPB.object + [ "termcount" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) - (f1) ) - , "total_hits" .= f2 - ] - ) + f1 + ) + , "total_hits" .= f2 + ] toEncodingPB (TermsCountFloat f1 f2) = - ( HsJSONPB.pairs - [ "termcount" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + HsJSONPB.pairs + [ "termcount" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) - (f1) ) - , "total_hits" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB TermsCountFloat where + f1 + ) + , "total_hits" .= f2 + ] +instance (HsJSONPB.FromJSONPB TermsCountFloat) where parseJSONPB = - ( HsJSONPB.withObject - "TermsCountFloat" - ( \obj -> - (Hs.pure TermsCountFloat) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "TermsCountFloat" + ( \obj -> + Hs.pure TermsCountFloat + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) - (obj .: "termcount") ) - <*> obj .: "total_hits" - ) - ) - -instance HsJSONPB.ToJSON TermsCountFloat where + (obj .: "termcount") + ) + <*> obj .: "total_hits" + ) +instance (HsJSONPB.ToJSON TermsCountFloat) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TermsCountFloat where +instance (HsJSONPB.FromJSON TermsCountFloat) where parseJSON = HsJSONPB.parseJSONPB - newtype Duration = Duration {durationValue :: Hs.Word32} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Duration - -instance HsProtobuf.Named Duration where - nameOf _ = (Hs.fromString "Duration") - -instance HsProtobuf.HasDefault Duration - -instance HsProtobuf.Message Duration where - encodeMessage _ Duration {durationValue = durationValue} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - durationValue - ) - ] +instance (Hs.NFData Duration) +instance (HsProtobuf.Named Duration) where + nameOf _ = Hs.fromString "Duration" +instance (HsProtobuf.HasDefault Duration) +instance (HsProtobuf.Message Duration) where + encodeMessage _ Duration {durationValue} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + durationValue ) decodeMessage _ = - (Hs.pure Duration) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) + Hs.pure Duration + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "value") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "value") + [] + "" ] - -instance HsJSONPB.ToJSONPB Duration where - toJSONPB (Duration f1) = (HsJSONPB.object ["value" .= f1]) - toEncodingPB (Duration f1) = (HsJSONPB.pairs ["value" .= f1]) - -instance HsJSONPB.FromJSONPB Duration where +instance (HsJSONPB.ToJSONPB Duration) where + toJSONPB (Duration f1) = HsJSONPB.object ["value" .= f1] + toEncodingPB (Duration f1) = HsJSONPB.pairs ["value" .= f1] +instance (HsJSONPB.FromJSONPB Duration) where parseJSONPB = - ( HsJSONPB.withObject - "Duration" - (\obj -> (Hs.pure Duration) <*> obj .: "value") - ) - -instance HsJSONPB.ToJSON Duration where + HsJSONPB.withObject + "Duration" + (\obj -> Hs.pure Duration <*> obj .: "value") +instance (HsJSONPB.ToJSON Duration) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Duration where +instance (HsJSONPB.FromJSON Duration) where parseJSON = HsJSONPB.parseJSONPB - data HistoDuration = HistoDuration { histoDurationDate :: Hs.Text , histoDurationCount :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData HistoDuration - -instance HsProtobuf.Named HistoDuration where - nameOf _ = (Hs.fromString "HistoDuration") - -instance HsProtobuf.HasDefault HistoDuration - -instance HsProtobuf.Message HistoDuration where +instance (Hs.NFData HistoDuration) +instance (HsProtobuf.Named HistoDuration) where + nameOf _ = Hs.fromString "HistoDuration" +instance (HsProtobuf.HasDefault HistoDuration) +instance (HsProtobuf.Message HistoDuration) where encodeMessage _ - HistoDuration - { histoDurationDate = histoDurationDate - , histoDurationCount = histoDurationCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (histoDurationDate) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - histoDurationCount + HistoDuration {histoDurationDate, histoDurationCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + histoDurationDate ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + histoDurationCount + ) decodeMessage _ = - (Hs.pure HistoDuration) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure HistoDuration + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "date") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "date") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") + [] + "" ] - -instance HsJSONPB.ToJSONPB HistoDuration where +instance (HsJSONPB.ToJSONPB HistoDuration) where toJSONPB (HistoDuration f1 f2) = - ( HsJSONPB.object - [ "date" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) + HsJSONPB.object + [ "date" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] toEncodingPB (HistoDuration f1 f2) = - ( HsJSONPB.pairs - [ "date" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB HistoDuration where + HsJSONPB.pairs + [ "date" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] +instance (HsJSONPB.FromJSONPB HistoDuration) where parseJSONPB = - ( HsJSONPB.withObject - "HistoDuration" - ( \obj -> - (Hs.pure HistoDuration) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "date") - ) - <*> obj .: "count" - ) - ) - -instance HsJSONPB.ToJSON HistoDuration where + HsJSONPB.withObject + "HistoDuration" + ( \obj -> + Hs.pure HistoDuration + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "date") + ) + <*> obj .: "count" + ) +instance (HsJSONPB.ToJSON HistoDuration) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON HistoDuration where +instance (HsJSONPB.FromJSON HistoDuration) where parseJSON = HsJSONPB.parseJSONPB - -newtype HistoDurationStat = HistoDurationStat - { histoDurationStatHisto :: - Hs.Vector Monocle.Protob.Metric.HistoDuration - } +newtype HistoDurationStat = HistoDurationStat {histoDurationStatHisto :: (Hs.Vector Monocle.Protob.Metric.HistoDuration)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData HistoDurationStat - -instance HsProtobuf.Named HistoDurationStat where - nameOf _ = (Hs.fromString "HistoDurationStat") - -instance HsProtobuf.HasDefault HistoDurationStat - -instance HsProtobuf.Message HistoDurationStat where - encodeMessage - _ - HistoDurationStat {histoDurationStatHisto = histoDurationStatHisto} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) - (histoDurationStatHisto) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure HistoDurationStat) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) +instance (Hs.NFData HistoDurationStat) +instance (HsProtobuf.Named HistoDurationStat) where + nameOf _ = Hs.fromString "HistoDurationStat" +instance (HsProtobuf.HasDefault HistoDurationStat) +instance (HsProtobuf.Message HistoDurationStat) where + encodeMessage _ HistoDurationStat {histoDurationStatHisto} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) + ) + histoDurationStatHisto + ) + ) + decodeMessage _ = + Hs.pure HistoDurationStat + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) + @(Hs.Vector Monocle.Protob.Metric.HistoDuration) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "HistoDuration")) - ) - (HsProtobufAST.Single "histo") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "HistoDuration")) + ) + (HsProtobufAST.Single "histo") + [] + "" ] - -instance HsJSONPB.ToJSONPB HistoDurationStat where +instance (HsJSONPB.ToJSONPB HistoDurationStat) where toJSONPB (HistoDurationStat f1) = - ( HsJSONPB.object - [ "histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) + HsJSONPB.object + [ "histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoDuration) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (HistoDurationStat f1) = - ( HsJSONPB.pairs - [ "histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) + HsJSONPB.pairs + [ "histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoDuration) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB HistoDurationStat where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB HistoDurationStat) where parseJSONPB = - ( HsJSONPB.withObject - "HistoDurationStat" - ( \obj -> - (Hs.pure HistoDurationStat) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "HistoDurationStat" + ( \obj -> + Hs.pure HistoDurationStat + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) @(Hs.Vector Monocle.Protob.Metric.HistoDuration) - (obj .: "histo") ) - ) - ) - -instance HsJSONPB.ToJSON HistoDurationStat where + (obj .: "histo") + ) + ) +instance (HsJSONPB.ToJSON HistoDurationStat) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON HistoDurationStat where +instance (HsJSONPB.FromJSON HistoDurationStat) where parseJSON = HsJSONPB.parseJSONPB - data TermCountDuration = TermCountDuration - { termCountDurationTerm :: - Hs.Text + { termCountDurationTerm :: Hs.Text , termCountDurationCount :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TermCountDuration - -instance HsProtobuf.Named TermCountDuration where - nameOf _ = (Hs.fromString "TermCountDuration") - -instance HsProtobuf.HasDefault TermCountDuration - -instance HsProtobuf.Message TermCountDuration where +instance (Hs.NFData TermCountDuration) +instance (HsProtobuf.Named TermCountDuration) where + nameOf _ = Hs.fromString "TermCountDuration" +instance (HsProtobuf.HasDefault TermCountDuration) +instance (HsProtobuf.Message TermCountDuration) where encodeMessage _ - TermCountDuration - { termCountDurationTerm = termCountDurationTerm - , termCountDurationCount = termCountDurationCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (termCountDurationTerm) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - termCountDurationCount + TermCountDuration {termCountDurationTerm, termCountDurationCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + termCountDurationTerm ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + termCountDurationCount + ) decodeMessage _ = - (Hs.pure TermCountDuration) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure TermCountDuration + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "term") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "term") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") + [] + "" ] - -instance HsJSONPB.ToJSONPB TermCountDuration where +instance (HsJSONPB.ToJSONPB TermCountDuration) where toJSONPB (TermCountDuration f1 f2) = - ( HsJSONPB.object - [ "term" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) + HsJSONPB.object + [ "term" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] toEncodingPB (TermCountDuration f1 f2) = - ( HsJSONPB.pairs - [ "term" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "count" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB TermCountDuration where + HsJSONPB.pairs + [ "term" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "count" .= f2 + ] +instance (HsJSONPB.FromJSONPB TermCountDuration) where parseJSONPB = - ( HsJSONPB.withObject - "TermCountDuration" - ( \obj -> - (Hs.pure TermCountDuration) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "term") - ) - <*> obj .: "count" - ) - ) - -instance HsJSONPB.ToJSON TermCountDuration where + HsJSONPB.withObject + "TermCountDuration" + ( \obj -> + Hs.pure TermCountDuration + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "term") + ) + <*> obj .: "count" + ) +instance (HsJSONPB.ToJSON TermCountDuration) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TermCountDuration where +instance (HsJSONPB.FromJSON TermCountDuration) where parseJSON = HsJSONPB.parseJSONPB - data TermsCountDuration = TermsCountDuration - { termsCountDurationTermcount :: - Hs.Vector Monocle.Protob.Metric.TermCountDuration + { termsCountDurationTermcount :: (Hs.Vector Monocle.Protob.Metric.TermCountDuration) , termsCountDurationTotalHits :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TermsCountDuration - -instance HsProtobuf.Named TermsCountDuration where - nameOf _ = (Hs.fromString "TermsCountDuration") - -instance HsProtobuf.HasDefault TermsCountDuration - -instance HsProtobuf.Message TermsCountDuration where +instance (Hs.NFData TermsCountDuration) +instance (HsProtobuf.Named TermsCountDuration) where + nameOf _ = Hs.fromString "TermsCountDuration" +instance (HsProtobuf.HasDefault TermsCountDuration) +instance (HsProtobuf.Message TermsCountDuration) where encodeMessage _ TermsCountDuration - { termsCountDurationTermcount = - termsCountDurationTermcount - , termsCountDurationTotalHits = termsCountDurationTotalHits + { termsCountDurationTermcount + , termsCountDurationTotalHits } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) - (termsCountDurationTermcount) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - termsCountDurationTotalHits + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) + ) + termsCountDurationTermcount ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + termsCountDurationTotalHits + ) decodeMessage _ = - (Hs.pure TermsCountDuration) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) - @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + Hs.pure TermsCountDuration + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) + @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "TermCountDuration")) - ) - (HsProtobufAST.Single "termcount") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "total_hits") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TermCountDuration")) + ) + (HsProtobufAST.Single "termcount") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "total_hits") + [] + "" ] - -instance HsJSONPB.ToJSONPB TermsCountDuration where +instance (HsJSONPB.ToJSONPB TermsCountDuration) where toJSONPB (TermsCountDuration f1 f2) = - ( HsJSONPB.object - [ "termcount" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + HsJSONPB.object + [ "termcount" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) - (f1) ) - , "total_hits" .= f2 - ] - ) + f1 + ) + , "total_hits" .= f2 + ] toEncodingPB (TermsCountDuration f1 f2) = - ( HsJSONPB.pairs - [ "termcount" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + HsJSONPB.pairs + [ "termcount" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) - (f1) ) - , "total_hits" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB TermsCountDuration where + f1 + ) + , "total_hits" .= f2 + ] +instance (HsJSONPB.FromJSONPB TermsCountDuration) where parseJSONPB = - ( HsJSONPB.withObject - "TermsCountDuration" - ( \obj -> - (Hs.pure TermsCountDuration) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "TermsCountDuration" + ( \obj -> + Hs.pure TermsCountDuration + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) - (obj .: "termcount") ) - <*> obj .: "total_hits" - ) - ) - -instance HsJSONPB.ToJSON TermsCountDuration where + (obj .: "termcount") + ) + <*> obj .: "total_hits" + ) +instance (HsJSONPB.ToJSON TermsCountDuration) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TermsCountDuration where +instance (HsJSONPB.FromJSON TermsCountDuration) where parseJSON = HsJSONPB.parseJSONPB - -newtype GetResponse = GetResponse - { getResponseResult :: - Hs.Maybe GetResponseResult - } +newtype GetResponse = GetResponse {getResponseResult :: (Hs.Maybe GetResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetResponse - -instance HsProtobuf.Named GetResponse where - nameOf _ = (Hs.fromString "GetResponse") - -instance HsProtobuf.HasDefault GetResponse - -instance HsProtobuf.Message GetResponse where - encodeMessage _ GetResponse {getResponseResult = getResponseResult} = - ( Hs.mconcat - [ case getResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - GetResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) +instance (Hs.NFData GetResponse) +instance (HsProtobuf.Named GetResponse) where + nameOf _ = Hs.fromString "GetResponse" +instance (HsProtobuf.HasDefault GetResponse) +instance (HsProtobuf.Message GetResponse) where + encodeMessage _ GetResponse {getResponseResult} = + ( case getResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + GetResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) + ) + GetResponseResultFloatValue y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + (HsProtobuf.ForceEmit y) + GetResponseResultIntValue y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + (HsProtobuf.ForceEmit y) + GetResponseResultHistoInt y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) ) - GetResponseResultFloatValue y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - (HsProtobuf.ForceEmit y) + (Hs.Just y) + ) + GetResponseResultHistoFloat y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.HistoFloatStat) + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoFloatStat) ) - GetResponseResultIntValue y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - (HsProtobuf.ForceEmit y) + (Hs.Just y) + ) + GetResponseResultTopInt y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) ) - GetResponseResultHistoInt y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) - (Hs.Just y) - ) + (Hs.Just y) + ) + GetResponseResultTopFloat y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountFloat) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountFloat) ) - GetResponseResultHistoFloat y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.HistoFloatStat) - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoFloatStat) - (Hs.Just y) - ) + (Hs.Just y) + ) + GetResponseResultDurationValue y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.Duration) + @(HsProtobuf.Nested Monocle.Protob.Metric.Duration) ) - GetResponseResultTopInt y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (Hs.Just y) - ) + (Hs.Just y) + ) + GetResponseResultHistoDuration y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 9) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.HistoDurationStat) + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoDurationStat) ) - GetResponseResultTopFloat y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountFloat) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountFloat) - (Hs.Just y) - ) + (Hs.Just y) + ) + GetResponseResultTopDuration y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountDuration) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountDuration) ) - GetResponseResultDurationValue y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.Duration) - @(HsProtobuf.Nested Monocle.Protob.Metric.Duration) - (Hs.Just y) - ) + (Hs.Just y) + ) + ) + decodeMessage _ = + Hs.pure GetResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. GetResponseResultError) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - GetResponseResultHistoDuration y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 9) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.HistoDurationStat) - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoDurationStat) - (Hs.Just y) - ) + ) + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.Just Hs.. GetResponseResultFloatValue) + <*> HsProtobuf.decodeMessageField + ) + , + ( (HsProtobuf.FieldNumber 3) + , Hs.pure (Hs.Just Hs.. GetResponseResultIntValue) + <*> HsProtobuf.decodeMessageField + ) + , + ( (HsProtobuf.FieldNumber 4) + , Hs.pure (Hs.fmap GetResponseResultHistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) + ) + HsProtobuf.decodeMessageField ) - GetResponseResultTopDuration y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountDuration) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountDuration) - (Hs.Just y) - ) + ) + , + ( (HsProtobuf.FieldNumber 5) + , Hs.pure (Hs.fmap GetResponseResultHistoFloat) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoFloatStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoFloatStat) + ) + HsProtobuf.decodeMessageField ) - ] - ) - decodeMessage _ = - (Hs.pure GetResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. GetResponseResultError)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.Just Hs.. GetResponseResultFloatValue)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 3) - , (Hs.pure (Hs.Just Hs.. GetResponseResultIntValue)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 4) - , (Hs.pure (Hs.fmap GetResponseResultHistoInt)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) - @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 5) - , (Hs.pure (Hs.fmap GetResponseResultHistoFloat)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoFloatStat) - @(Hs.Maybe Monocle.Protob.Metric.HistoFloatStat) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 6) - , (Hs.pure (Hs.fmap GetResponseResultTopInt)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 7) - , (Hs.pure (Hs.fmap GetResponseResultTopFloat)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountFloat) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountFloat) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 8) - , (Hs.pure (Hs.fmap GetResponseResultDurationValue)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.Duration) - @(Hs.Maybe Monocle.Protob.Metric.Duration) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 9) - , (Hs.pure (Hs.fmap GetResponseResultHistoDuration)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoDurationStat) - @(Hs.Maybe Monocle.Protob.Metric.HistoDurationStat) - (HsProtobuf.decodeMessageField) - ) - ) - , - ( (HsProtobuf.FieldNumber 10) - , (Hs.pure (Hs.fmap GetResponseResultTopDuration)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountDuration) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountDuration) - (HsProtobuf.decodeMessageField) - ) - ) - ] ) + , + ( (HsProtobuf.FieldNumber 6) + , Hs.pure (Hs.fmap GetResponseResultTopInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 7) + , Hs.pure (Hs.fmap GetResponseResultTopFloat) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountFloat) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountFloat) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 8) + , Hs.pure (Hs.fmap GetResponseResultDurationValue) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Duration) + @(Hs.Maybe Monocle.Protob.Metric.Duration) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 9) + , Hs.pure (Hs.fmap GetResponseResultHistoDuration) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoDurationStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoDurationStat) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 10) + , Hs.pure (Hs.fmap GetResponseResultTopDuration) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountDuration) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountDuration) + ) + HsProtobuf.decodeMessageField + ) + ) + ] dotProto _ = [] - -instance HsJSONPB.ToJSONPB GetResponse where +instance (HsJSONPB.ToJSONPB GetResponse) where toJSONPB - ( GetResponse - f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10 - ) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10 of - Hs.Just (GetResponseResultError f1) -> - ( HsJSONPB.pair - "error" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (GetResponseResultFloatValue f2) -> - (HsJSONPB.pair "float_value" f2) - Hs.Just (GetResponseResultIntValue f3) -> - (HsJSONPB.pair "int_value" f3) - Hs.Just (GetResponseResultHistoInt f4) -> - (HsJSONPB.pair "histo_int" f4) - Hs.Just (GetResponseResultHistoFloat f5) -> - (HsJSONPB.pair "histo_float" f5) - Hs.Just (GetResponseResultTopInt f6) -> - (HsJSONPB.pair "top_int" f6) - Hs.Just (GetResponseResultTopFloat f7) -> - (HsJSONPB.pair "top_float" f7) - Hs.Just (GetResponseResultDurationValue f8) -> - (HsJSONPB.pair "duration_value" f8) - Hs.Just (GetResponseResultHistoDuration f9) -> - (HsJSONPB.pair "histo_duration" f9) - Hs.Just (GetResponseResultTopDuration f10) -> - (HsJSONPB.pair "top_duration" f10) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options - ) - ] - ) + (GetResponse f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10 of + Hs.Just (GetResponseResultError f1) -> + HsJSONPB.pair + "error" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (GetResponseResultFloatValue f2) -> + HsJSONPB.pair "float_value" f2 + Hs.Just (GetResponseResultIntValue f3) -> + HsJSONPB.pair "int_value" f3 + Hs.Just (GetResponseResultHistoInt f4) -> + HsJSONPB.pair "histo_int" f4 + Hs.Just (GetResponseResultHistoFloat f5) -> + HsJSONPB.pair "histo_float" f5 + Hs.Just (GetResponseResultTopInt f6) -> HsJSONPB.pair "top_int" f6 + Hs.Just (GetResponseResultTopFloat f7) -> + HsJSONPB.pair "top_float" f7 + Hs.Just (GetResponseResultDurationValue f8) -> + HsJSONPB.pair "duration_value" f8 + Hs.Just (GetResponseResultHistoDuration f9) -> + HsJSONPB.pair "histo_duration" f9 + Hs.Just (GetResponseResultTopDuration f10) -> + HsJSONPB.pair "top_duration" f10 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] toEncodingPB - ( GetResponse - f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10 - ) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10 of - Hs.Just (GetResponseResultError f1) -> - ( HsJSONPB.pair - "error" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (GetResponseResultFloatValue f2) -> - (HsJSONPB.pair "float_value" f2) - Hs.Just (GetResponseResultIntValue f3) -> - (HsJSONPB.pair "int_value" f3) - Hs.Just (GetResponseResultHistoInt f4) -> - (HsJSONPB.pair "histo_int" f4) - Hs.Just (GetResponseResultHistoFloat f5) -> - (HsJSONPB.pair "histo_float" f5) - Hs.Just (GetResponseResultTopInt f6) -> - (HsJSONPB.pair "top_int" f6) - Hs.Just (GetResponseResultTopFloat f7) -> - (HsJSONPB.pair "top_float" f7) - Hs.Just (GetResponseResultDurationValue f8) -> - (HsJSONPB.pair "duration_value" f8) - Hs.Just (GetResponseResultHistoDuration f9) -> - (HsJSONPB.pair "histo_duration" f9) - Hs.Just (GetResponseResultTopDuration f10) -> - (HsJSONPB.pair "top_duration" f10) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options - ) - ] - ) - -instance HsJSONPB.FromJSONPB GetResponse where + (GetResponse f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f7_or_f8_or_f9_or_f10 of + Hs.Just (GetResponseResultError f1) -> + HsJSONPB.pair + "error" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (GetResponseResultFloatValue f2) -> + HsJSONPB.pair "float_value" f2 + Hs.Just (GetResponseResultIntValue f3) -> + HsJSONPB.pair "int_value" f3 + Hs.Just (GetResponseResultHistoInt f4) -> + HsJSONPB.pair "histo_int" f4 + Hs.Just (GetResponseResultHistoFloat f5) -> + HsJSONPB.pair "histo_float" f5 + Hs.Just (GetResponseResultTopInt f6) -> HsJSONPB.pair "top_int" f6 + Hs.Just (GetResponseResultTopFloat f7) -> + HsJSONPB.pair "top_float" f7 + Hs.Just (GetResponseResultDurationValue f8) -> + HsJSONPB.pair "duration_value" f8 + Hs.Just (GetResponseResultHistoDuration f9) -> + HsJSONPB.pair "histo_duration" f9 + Hs.Just (GetResponseResultTopDuration f10) -> + HsJSONPB.pair "top_duration" f10 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB GetResponse) where parseJSONPB = - ( HsJSONPB.withObject - "GetResponse" - ( \obj -> - (Hs.pure GetResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just - Hs.. GetResponseResultError - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. GetResponseResultFloatValue - <$> (HsJSONPB.parseField parseObj "float_value") - , Hs.Just Hs.. GetResponseResultIntValue - <$> (HsJSONPB.parseField parseObj "int_value") - , Hs.Just Hs.. GetResponseResultHistoInt - <$> (HsJSONPB.parseField parseObj "histo_int") - , Hs.Just Hs.. GetResponseResultHistoFloat - <$> (HsJSONPB.parseField parseObj "histo_float") - , Hs.Just Hs.. GetResponseResultTopInt - <$> (HsJSONPB.parseField parseObj "top_int") - , Hs.Just Hs.. GetResponseResultTopFloat - <$> (HsJSONPB.parseField parseObj "top_float") - , Hs.Just Hs.. GetResponseResultDurationValue - <$> (HsJSONPB.parseField parseObj "duration_value") - , Hs.Just Hs.. GetResponseResultHistoDuration - <$> (HsJSONPB.parseField parseObj "histo_duration") - , Hs.Just Hs.. GetResponseResultTopDuration - <$> (HsJSONPB.parseField parseObj "top_duration") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) - ) - ) - -instance HsJSONPB.ToJSON GetResponse where + HsJSONPB.withObject + "GetResponse" + ( \obj -> + Hs.pure GetResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just + Hs.. GetResponseResultError + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just Hs.. GetResponseResultFloatValue + <$> HsJSONPB.parseField parseObj "float_value" + , Hs.Just Hs.. GetResponseResultIntValue + <$> HsJSONPB.parseField parseObj "int_value" + , Hs.Just Hs.. GetResponseResultHistoInt + <$> HsJSONPB.parseField parseObj "histo_int" + , Hs.Just Hs.. GetResponseResultHistoFloat + <$> HsJSONPB.parseField parseObj "histo_float" + , Hs.Just Hs.. GetResponseResultTopInt + <$> HsJSONPB.parseField parseObj "top_int" + , Hs.Just Hs.. GetResponseResultTopFloat + <$> HsJSONPB.parseField parseObj "top_float" + , Hs.Just Hs.. GetResponseResultDurationValue + <$> HsJSONPB.parseField parseObj "duration_value" + , Hs.Just Hs.. GetResponseResultHistoDuration + <$> HsJSONPB.parseField parseObj "histo_duration" + , Hs.Just Hs.. GetResponseResultTopDuration + <$> HsJSONPB.parseField parseObj "top_duration" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON GetResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON GetResponse where +instance (HsJSONPB.FromJSON GetResponse) where parseJSON = HsJSONPB.parseJSONPB - data GetResponseResult = GetResponseResultError Hs.Text | GetResponseResultFloatValue Hs.Float @@ -2489,154 +2113,132 @@ data GetResponseResult | GetResponseResultHistoDuration Monocle.Protob.Metric.HistoDurationStat | GetResponseResultTopDuration Monocle.Protob.Metric.TermsCountDuration deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData GetResponseResult - -instance HsProtobuf.Named GetResponseResult where - nameOf _ = (Hs.fromString "GetResponseResult") - -newtype InfoResponse = InfoResponse - { infoResponseResult :: - Hs.Maybe InfoResponseResult - } +instance (Hs.NFData GetResponseResult) +instance (HsProtobuf.Named GetResponseResult) where + nameOf _ = Hs.fromString "GetResponseResult" +newtype InfoResponse = InfoResponse {infoResponseResult :: (Hs.Maybe InfoResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData InfoResponse - -instance HsProtobuf.Named InfoResponse where - nameOf _ = (Hs.fromString "InfoResponse") - -instance HsProtobuf.HasDefault InfoResponse - -instance HsProtobuf.Message InfoResponse where - encodeMessage - _ - InfoResponse {infoResponseResult = infoResponseResult} = - ( Hs.mconcat - [ case infoResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - InfoResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - InfoResponseResultInfo y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.MetricInfo) - @(HsProtobuf.Nested Monocle.Protob.Metric.MetricInfo) - (Hs.Just y) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure InfoResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. InfoResponseResultError)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData InfoResponse) +instance (HsProtobuf.Named InfoResponse) where + nameOf _ = Hs.fromString "InfoResponse" +instance (HsProtobuf.HasDefault InfoResponse) +instance (HsProtobuf.Message InfoResponse) where + encodeMessage _ InfoResponse {infoResponseResult} = + ( case infoResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + InfoResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.fmap InfoResponseResultInfo)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.MetricInfo) - @(Hs.Maybe Monocle.Protob.Metric.MetricInfo) - (HsProtobuf.decodeMessageField) - ) + InfoResponseResultInfo y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.MetricInfo) + @(HsProtobuf.Nested Monocle.Protob.Metric.MetricInfo) + ) + (Hs.Just y) ) - ] - ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB InfoResponse where - toJSONPB (InfoResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (InfoResponseResultError f1) -> - ( HsJSONPB.pair - "error" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (InfoResponseResultInfo f2) -> (HsJSONPB.pair "info" f2) - Hs.Nothing -> Hs.mempty + ) + decodeMessage _ = + Hs.pure InfoResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. InfoResponseResultError) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options ) - ] - ) - toEncodingPB (InfoResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (InfoResponseResultError f1) -> - ( HsJSONPB.pair - "error" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (InfoResponseResultInfo f2) -> (HsJSONPB.pair "info" f2) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.fmap InfoResponseResultInfo) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.MetricInfo) + @(Hs.Maybe Monocle.Protob.Metric.MetricInfo) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options ) ] - ) - -instance HsJSONPB.FromJSONPB InfoResponse where - parseJSONPB = - ( HsJSONPB.withObject - "InfoResponse" - ( \obj -> - (Hs.pure InfoResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just - Hs.. InfoResponseResultError - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. InfoResponseResultInfo - <$> (HsJSONPB.parseField parseObj "info") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB InfoResponse) where + toJSONPB (InfoResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (InfoResponseResultError f1) -> + HsJSONPB.pair + "error" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (InfoResponseResultInfo f2) -> HsJSONPB.pair "info" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON InfoResponse where + ] + toEncodingPB (InfoResponse f1_or_f2) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (InfoResponseResultError f1) -> + HsJSONPB.pair + "error" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (InfoResponseResultInfo f2) -> HsJSONPB.pair "info" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB InfoResponse) where + parseJSONPB = + HsJSONPB.withObject + "InfoResponse" + ( \obj -> + Hs.pure InfoResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just + Hs.. InfoResponseResultError + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just Hs.. InfoResponseResultInfo + <$> HsJSONPB.parseField parseObj "info" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON InfoResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON InfoResponse where +instance (HsJSONPB.FromJSON InfoResponse) where parseJSON = HsJSONPB.parseJSONPB - data InfoResponseResult = InfoResponseResultError Hs.Text | InfoResponseResultInfo Monocle.Protob.Metric.MetricInfo deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData InfoResponseResult - -instance HsProtobuf.Named InfoResponseResult where - nameOf _ = (Hs.fromString "InfoResponseResult") +instance (Hs.NFData InfoResponseResult) +instance (HsProtobuf.Named InfoResponseResult) where + nameOf _ = Hs.fromString "InfoResponseResult" diff --git a/codegen/Monocle/Protob/Search.hs b/codegen/Monocle/Protob/Search.hs index 4ee0fd4f8..4aa31bf58 100644 --- a/codegen/Monocle/Protob/Search.hs +++ b/codegen/Monocle/Protob/Search.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoGeneralisedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-missing-export-lists #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -48,10 +51,9 @@ import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs data TaskData = TaskData - { taskDataUpdatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp + { taskDataUpdatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) , taskDataChangeUrl :: Hs.Text - , taskDataTtype :: Hs.Vector Hs.Text + , taskDataTtype :: (Hs.Vector Hs.Text) , taskDataTid :: Hs.Text , taskDataUrl :: Hs.Text , taskDataTitle :: Hs.Text @@ -61,983 +63,962 @@ data TaskData = TaskData , taskDataPrefix :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData TaskData - -instance HsProtobuf.Named TaskData where - nameOf _ = (Hs.fromString "TaskData") - -instance HsProtobuf.HasDefault TaskData - -instance HsProtobuf.Message TaskData where +instance (Hs.NFData TaskData) +instance (HsProtobuf.Named TaskData) where + nameOf _ = Hs.fromString "TaskData" +instance (HsProtobuf.HasDefault TaskData) +instance (HsProtobuf.Message TaskData) where encodeMessage _ TaskData - { taskDataUpdatedAt = taskDataUpdatedAt - , taskDataChangeUrl = taskDataChangeUrl - , taskDataTtype = taskDataTtype - , taskDataTid = taskDataTid - , taskDataUrl = taskDataUrl - , taskDataTitle = taskDataTitle - , taskDataSeverity = taskDataSeverity - , taskDataPriority = taskDataPriority - , taskDataScore = taskDataScore - , taskDataPrefix = taskDataPrefix + { taskDataUpdatedAt + , taskDataChangeUrl + , taskDataTtype + , taskDataTid + , taskDataUrl + , taskDataTitle + , taskDataSeverity + , taskDataPriority + , taskDataScore + , taskDataPrefix } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (taskDataUpdatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (taskDataChangeUrl) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (taskDataTtype) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (taskDataTid)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (taskDataUrl)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (taskDataTitle) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (taskDataSeverity) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + taskDataUpdatedAt + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + taskDataChangeUrl + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + taskDataTtype + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) taskDataTid) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) taskDataUrl) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) taskDataTitle) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + taskDataSeverity + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (taskDataPriority) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + taskDataPriority + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 9) taskDataScore ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (taskDataPrefix) - ) - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) taskDataPrefix) + ) decodeMessage _ = - (Hs.pure TaskData) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + Hs.pure TaskData + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 8) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 9) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 9) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "updated_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "change_url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "ttype") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "tid") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "title") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "severity") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "priority") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 9) - (HsProtobufAST.Prim HsProtobufAST.Int32) - (HsProtobufAST.Single "score") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "prefix") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "updated_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "ttype") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "tid") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "severity") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "priority") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 9) + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "score") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "prefix") + [] + "" ] - -instance HsJSONPB.ToJSONPB TaskData where +instance (HsJSONPB.ToJSONPB TaskData) where toJSONPB (TaskData f1 f2 f3 f4 f5 f6 f7 f8 f9 f10) = - ( HsJSONPB.object - [ "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f1) ) - , "change_url" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "ttype" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f1 + ) + , "change_url" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "ttype" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - , "tid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "severity" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - , "priority" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - , "score" .= f9 - , "prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) - ] - ) + f3 + ) + , "tid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "severity" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + , "priority" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + , "score" .= f9 + , "prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f10) + ] toEncodingPB (TaskData f1 f2 f3 f4 f5 f6 f7 f8 f9 f10) = - ( HsJSONPB.pairs - [ "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.pairs + [ "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f1) ) - , "change_url" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "ttype" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f1 + ) + , "change_url" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "ttype" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - , "tid" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "severity" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - , "priority" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - , "score" .= f9 - , "prefix" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) - ] - ) - -instance HsJSONPB.FromJSONPB TaskData where + f3 + ) + , "tid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "severity" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + , "priority" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + , "score" .= f9 + , "prefix" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f10) + ] +instance (HsJSONPB.FromJSONPB TaskData) where parseJSONPB = - ( HsJSONPB.withObject - "TaskData" - ( \obj -> - (Hs.pure TaskData) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "TaskData" + ( \obj -> + Hs.pure TaskData + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "updated_at") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "change_url") ) - <*> ( HsProtobuf.coerceOver + (obj .: "updated_at") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "change_url") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "ttype") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "tid") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "title") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "severity") ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "priority") - ) - <*> obj .: "score" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "prefix") - ) - ) - ) - -instance HsJSONPB.ToJSON TaskData where + (obj .: "ttype") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "tid") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "title") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "severity") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "priority") + ) + <*> obj .: "score" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "prefix") + ) + ) +instance (HsJSONPB.ToJSON TaskData) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON TaskData where +instance (HsJSONPB.FromJSON TaskData) where parseJSON = HsJSONPB.parseJSONPB - -newtype SuggestionsRequest = SuggestionsRequest - { suggestionsRequestIndex :: - Hs.Text - } +newtype SuggestionsRequest = SuggestionsRequest {suggestionsRequestIndex :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData SuggestionsRequest - -instance HsProtobuf.Named SuggestionsRequest where - nameOf _ = (Hs.fromString "SuggestionsRequest") - -instance HsProtobuf.HasDefault SuggestionsRequest - -instance HsProtobuf.Message SuggestionsRequest where - encodeMessage - _ - SuggestionsRequest - { suggestionsRequestIndex = - suggestionsRequestIndex - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (suggestionsRequestIndex) - ) - ) - ] - ) +instance (Hs.NFData SuggestionsRequest) +instance (HsProtobuf.Named SuggestionsRequest) where + nameOf _ = Hs.fromString "SuggestionsRequest" +instance (HsProtobuf.HasDefault SuggestionsRequest) +instance (HsProtobuf.Message SuggestionsRequest) where + encodeMessage _ SuggestionsRequest {suggestionsRequestIndex} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + suggestionsRequestIndex + ) + ) decodeMessage _ = - (Hs.pure SuggestionsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure SuggestionsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" ] - -instance HsJSONPB.ToJSONPB SuggestionsRequest where +instance (HsJSONPB.ToJSONPB SuggestionsRequest) where toJSONPB (SuggestionsRequest f1) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + ["index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] toEncodingPB (SuggestionsRequest f1) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB SuggestionsRequest where + HsJSONPB.pairs + ["index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1)] +instance (HsJSONPB.FromJSONPB SuggestionsRequest) where parseJSONPB = - ( HsJSONPB.withObject - "SuggestionsRequest" - ( \obj -> - (Hs.pure SuggestionsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - ) - ) - -instance HsJSONPB.ToJSON SuggestionsRequest where + HsJSONPB.withObject + "SuggestionsRequest" + ( \obj -> + Hs.pure SuggestionsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + ) +instance (HsJSONPB.ToJSON SuggestionsRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON SuggestionsRequest where +instance (HsJSONPB.FromJSON SuggestionsRequest) where parseJSON = HsJSONPB.parseJSONPB - data SuggestionsResponse = SuggestionsResponse - { suggestionsResponseTaskTypes :: - Hs.Vector Hs.Text - , suggestionsResponseAuthors :: Hs.Vector Hs.Text - , suggestionsResponseApprovals :: Hs.Vector Hs.Text - , suggestionsResponsePriorities :: Hs.Vector Hs.Text - , suggestionsResponseSeverities :: Hs.Vector Hs.Text - , suggestionsResponseProjects :: Hs.Vector Hs.Text - , suggestionsResponseGroups :: Hs.Vector Hs.Text - , suggestionsResponseLabels :: Hs.Vector Hs.Text + { suggestionsResponseTaskTypes :: (Hs.Vector Hs.Text) + , suggestionsResponseAuthors :: (Hs.Vector Hs.Text) + , suggestionsResponseApprovals :: (Hs.Vector Hs.Text) + , suggestionsResponsePriorities :: (Hs.Vector Hs.Text) + , suggestionsResponseSeverities :: (Hs.Vector Hs.Text) + , suggestionsResponseProjects :: (Hs.Vector Hs.Text) + , suggestionsResponseGroups :: (Hs.Vector Hs.Text) + , suggestionsResponseLabels :: (Hs.Vector Hs.Text) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData SuggestionsResponse - -instance HsProtobuf.Named SuggestionsResponse where - nameOf _ = (Hs.fromString "SuggestionsResponse") - -instance HsProtobuf.HasDefault SuggestionsResponse - -instance HsProtobuf.Message SuggestionsResponse where +instance (Hs.NFData SuggestionsResponse) +instance (HsProtobuf.Named SuggestionsResponse) where + nameOf _ = Hs.fromString "SuggestionsResponse" +instance (HsProtobuf.HasDefault SuggestionsResponse) +instance (HsProtobuf.Message SuggestionsResponse) where encodeMessage _ SuggestionsResponse - { suggestionsResponseTaskTypes = - suggestionsResponseTaskTypes - , suggestionsResponseAuthors = suggestionsResponseAuthors - , suggestionsResponseApprovals = suggestionsResponseApprovals - , suggestionsResponsePriorities = suggestionsResponsePriorities - , suggestionsResponseSeverities = suggestionsResponseSeverities - , suggestionsResponseProjects = suggestionsResponseProjects - , suggestionsResponseGroups = suggestionsResponseGroups - , suggestionsResponseLabels = suggestionsResponseLabels + { suggestionsResponseTaskTypes + , suggestionsResponseAuthors + , suggestionsResponseApprovals + , suggestionsResponsePriorities + , suggestionsResponseSeverities + , suggestionsResponseProjects + , suggestionsResponseGroups + , suggestionsResponseLabels } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseTaskTypes) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseAuthors) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseApprovals) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponsePriorities) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseSeverities) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseTaskTypes + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseAuthors + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseApprovals + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponsePriorities + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseSeverities + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseProjects) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseProjects + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseGroups) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseGroups ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (suggestionsResponseLabels) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + suggestionsResponseLabels ) - ] - ) + ) decodeMessage _ = - (Hs.pure SuggestionsResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + Hs.pure SuggestionsResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 8) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "task_types") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "authors") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "approvals") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "priorities") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "severities") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "projects") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "groups") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "labels") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "task_types") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "authors") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approvals") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "priorities") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "severities") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "projects") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "groups") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") + [] + "" ] - -instance HsJSONPB.ToJSONPB SuggestionsResponse where +instance (HsJSONPB.ToJSONPB SuggestionsResponse) where toJSONPB (SuggestionsResponse f1 f2 f3 f4 f5 f6 f7 f8) = - ( HsJSONPB.object - [ "task_types" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.object + [ "task_types" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f1) ) - , "authors" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f1 + ) + , "authors" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f2) ) - , "approvals" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f2 + ) + , "approvals" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - , "priorities" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f3 + ) + , "priorities" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f4) ) - , "severities" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f4 + ) + , "severities" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f5) ) - , "projects" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f5 + ) + , "projects" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f6) ) - , "groups" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f6 + ) + , "groups" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f7) ) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f7 + ) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f8) ) - ] - ) + f8 + ) + ] toEncodingPB (SuggestionsResponse f1 f2 f3 f4 f5 f6 f7 f8) = - ( HsJSONPB.pairs - [ "task_types" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.pairs + [ "task_types" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f1) ) - , "authors" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f1 + ) + , "authors" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f2) ) - , "approvals" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f2 + ) + , "approvals" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - , "priorities" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f3 + ) + , "priorities" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f4) ) - , "severities" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f4 + ) + , "severities" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f5) ) - , "projects" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f5 + ) + , "projects" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f6) ) - , "groups" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f6 + ) + , "groups" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f7) ) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f7 + ) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f8) ) - ] - ) - -instance HsJSONPB.FromJSONPB SuggestionsResponse where + f8 + ) + ] +instance (HsJSONPB.FromJSONPB SuggestionsResponse) where parseJSONPB = - ( HsJSONPB.withObject - "SuggestionsResponse" - ( \obj -> - (Hs.pure SuggestionsResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "SuggestionsResponse" + ( \obj -> + Hs.pure SuggestionsResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "task_types") ) - <*> ( HsProtobuf.coerceOver + (obj .: "task_types") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "authors") ) - <*> ( HsProtobuf.coerceOver + (obj .: "authors") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "approvals") ) - <*> ( HsProtobuf.coerceOver + (obj .: "approvals") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "priorities") ) - <*> ( HsProtobuf.coerceOver + (obj .: "priorities") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "severities") ) - <*> ( HsProtobuf.coerceOver + (obj .: "severities") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "projects") ) - <*> ( HsProtobuf.coerceOver + (obj .: "projects") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "groups") ) - <*> ( HsProtobuf.coerceOver + (obj .: "groups") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "labels") ) - ) - ) - -instance HsJSONPB.ToJSON SuggestionsResponse where + (obj .: "labels") + ) + ) +instance (HsJSONPB.ToJSON SuggestionsResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON SuggestionsResponse where +instance (HsJSONPB.FromJSON SuggestionsResponse) where parseJSON = HsJSONPB.parseJSONPB - -newtype FieldsRequest = FieldsRequest - { fieldsRequestVersion :: - Hs.Text - } +newtype FieldsRequest = FieldsRequest {fieldsRequestVersion :: Hs.Text} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData FieldsRequest - -instance HsProtobuf.Named FieldsRequest where - nameOf _ = (Hs.fromString "FieldsRequest") - -instance HsProtobuf.HasDefault FieldsRequest - -instance HsProtobuf.Message FieldsRequest where - encodeMessage - _ - FieldsRequest {fieldsRequestVersion = fieldsRequestVersion} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (fieldsRequestVersion) - ) - ) - ] - ) +instance (Hs.NFData FieldsRequest) +instance (HsProtobuf.Named FieldsRequest) where + nameOf _ = Hs.fromString "FieldsRequest" +instance (HsProtobuf.HasDefault FieldsRequest) +instance (HsProtobuf.Message FieldsRequest) where + encodeMessage _ FieldsRequest {fieldsRequestVersion} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + fieldsRequestVersion + ) + ) decodeMessage _ = - (Hs.pure FieldsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure FieldsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "version") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "version") + [] + "" ] - -instance HsJSONPB.ToJSONPB FieldsRequest where +instance (HsJSONPB.ToJSONPB FieldsRequest) where toJSONPB (FieldsRequest f1) = - ( HsJSONPB.object - [ "version" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) + HsJSONPB.object + [ "version" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] toEncodingPB (FieldsRequest f1) = - ( HsJSONPB.pairs - [ "version" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ] - ) - -instance HsJSONPB.FromJSONPB FieldsRequest where + HsJSONPB.pairs + [ "version" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + ] +instance (HsJSONPB.FromJSONPB FieldsRequest) where parseJSONPB = - ( HsJSONPB.withObject - "FieldsRequest" - ( \obj -> - (Hs.pure FieldsRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "version") - ) - ) - ) - -instance HsJSONPB.ToJSON FieldsRequest where + HsJSONPB.withObject + "FieldsRequest" + ( \obj -> + Hs.pure FieldsRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "version") + ) + ) +instance (HsJSONPB.ToJSON FieldsRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON FieldsRequest where +instance (HsJSONPB.FromJSON FieldsRequest) where parseJSON = HsJSONPB.parseJSONPB - data Field = Field { fieldName :: Hs.Text , fieldDescription :: Hs.Text - , fieldType :: - HsProtobuf.Enumerated Monocle.Protob.Search.Field_Type + , fieldType :: (HsProtobuf.Enumerated Monocle.Protob.Search.Field_Type) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Field - -instance HsProtobuf.Named Field where - nameOf _ = (Hs.fromString "Field") - -instance HsProtobuf.HasDefault Field - -instance HsProtobuf.Message Field where - encodeMessage - _ - Field - { fieldName = fieldName - , fieldDescription = fieldDescription - , fieldType = fieldType - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (fieldName)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (fieldDescription) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - fieldType - ) - ] +instance (Hs.NFData Field) +instance (HsProtobuf.Named Field) where + nameOf _ = Hs.fromString "Field" +instance (HsProtobuf.HasDefault Field) +instance (HsProtobuf.Message Field) where + encodeMessage _ Field {fieldName, fieldDescription, fieldType} = + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) fieldName) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + fieldDescription + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + fieldType ) decodeMessage _ = - (Hs.pure Field) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Field + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "name") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "description") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Type")) - ) - (HsProtobufAST.Single "type") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "description") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Type")) + ) + (HsProtobufAST.Single "type") + [] + "" ] - -instance HsJSONPB.ToJSONPB Field where +instance (HsJSONPB.ToJSONPB Field) where toJSONPB (Field f1 f2 f3) = - ( HsJSONPB.object - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "description" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "type" .= f3 - ] - ) + HsJSONPB.object + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "description" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "type" .= f3 + ] toEncodingPB (Field f1 f2 f3) = - ( HsJSONPB.pairs - [ "name" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "description" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "type" .= f3 - ] - ) - -instance HsJSONPB.FromJSONPB Field where + HsJSONPB.pairs + [ "name" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "description" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "type" .= f3 + ] +instance (HsJSONPB.FromJSONPB Field) where parseJSONPB = - ( HsJSONPB.withObject - "Field" - ( \obj -> - (Hs.pure Field) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "name") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "description") - ) - <*> obj .: "type" - ) - ) - -instance HsJSONPB.ToJSON Field where + HsJSONPB.withObject + "Field" + ( \obj -> + Hs.pure Field + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "name") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "description") + ) + <*> obj .: "type" + ) +instance (HsJSONPB.ToJSON Field) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Field where +instance (HsJSONPB.FromJSON Field) where parseJSON = HsJSONPB.parseJSONPB - data Field_Type = Field_TypeFIELD_DATE | Field_TypeFIELD_NUMBER @@ -1045,40 +1026,33 @@ data Field_Type | Field_TypeFIELD_BOOL | Field_TypeFIELD_REGEX deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named Field_Type where - nameOf _ = (Hs.fromString "Field_Type") - -instance HsProtobuf.HasDefault Field_Type - -instance Hs.Bounded Field_Type where +instance (HsProtobuf.Named Field_Type) where + nameOf _ = Hs.fromString "Field_Type" +instance (HsProtobuf.HasDefault Field_Type) +instance (Hs.Bounded Field_Type) where minBound = Field_TypeFIELD_DATE maxBound = Field_TypeFIELD_REGEX - -instance Hs.Ord Field_Type where +instance (Hs.Ord Field_Type) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum Field_Type where +instance (HsProtobuf.ProtoEnum Field_Type) where toProtoEnumMay 0 = Hs.Just Field_TypeFIELD_DATE toProtoEnumMay 1 = Hs.Just Field_TypeFIELD_NUMBER toProtoEnumMay 2 = Hs.Just Field_TypeFIELD_TEXT toProtoEnumMay 3 = Hs.Just Field_TypeFIELD_BOOL toProtoEnumMay 4 = Hs.Just Field_TypeFIELD_REGEX toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (Field_TypeFIELD_DATE) = 0 - fromProtoEnum (Field_TypeFIELD_NUMBER) = 1 - fromProtoEnum (Field_TypeFIELD_TEXT) = 2 - fromProtoEnum (Field_TypeFIELD_BOOL) = 3 - fromProtoEnum (Field_TypeFIELD_REGEX) = 4 - -instance HsJSONPB.ToJSONPB Field_Type where + fromProtoEnum Field_TypeFIELD_DATE = 0 + fromProtoEnum Field_TypeFIELD_NUMBER = 1 + fromProtoEnum Field_TypeFIELD_TEXT = 2 + fromProtoEnum Field_TypeFIELD_BOOL = 3 + fromProtoEnum Field_TypeFIELD_REGEX = 4 +instance (HsJSONPB.ToJSONPB Field_Type) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB Field_Type where +instance (HsJSONPB.FromJSONPB Field_Type) where parseJSONPB (HsJSONPB.String "FIELD_DATE") = Hs.pure Field_TypeFIELD_DATE parseJSONPB (HsJSONPB.String "FIELD_NUMBER") = @@ -1089,1222 +1063,1058 @@ instance HsJSONPB.FromJSONPB Field_Type where Hs.pure Field_TypeFIELD_BOOL parseJSONPB (HsJSONPB.String "FIELD_REGEX") = Hs.pure Field_TypeFIELD_REGEX - parseJSONPB v = (HsJSONPB.typeMismatch "Field_Type" v) - -instance HsJSONPB.ToJSON Field_Type where + parseJSONPB v = HsJSONPB.typeMismatch "Field_Type" v +instance (HsJSONPB.ToJSON Field_Type) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Field_Type where +instance (HsJSONPB.FromJSON Field_Type) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite Field_Type - -newtype FieldsResponse = FieldsResponse - { fieldsResponseFields :: - Hs.Vector Monocle.Protob.Search.Field - } +instance (HsProtobuf.Finite Field_Type) +newtype FieldsResponse = FieldsResponse {fieldsResponseFields :: (Hs.Vector Monocle.Protob.Search.Field)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData FieldsResponse - -instance HsProtobuf.Named FieldsResponse where - nameOf _ = (Hs.fromString "FieldsResponse") - -instance HsProtobuf.HasDefault FieldsResponse - -instance HsProtobuf.Message FieldsResponse where - encodeMessage - _ - FieldsResponse {fieldsResponseFields = fieldsResponseFields} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) - @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) - (fieldsResponseFields) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure FieldsResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) +instance (Hs.NFData FieldsResponse) +instance (HsProtobuf.Named FieldsResponse) where + nameOf _ = Hs.fromString "FieldsResponse" +instance (HsProtobuf.HasDefault FieldsResponse) +instance (HsProtobuf.Message FieldsResponse) where + encodeMessage _ FieldsResponse {fieldsResponseFields} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) + ) + fieldsResponseFields + ) + ) + decodeMessage _ = + Hs.pure FieldsResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) + @(Hs.Vector Monocle.Protob.Search.Field) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Field")) - ) - (HsProtobufAST.Single "fields") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Field")) + ) + (HsProtobufAST.Single "fields") + [] + "" ] - -instance HsJSONPB.ToJSONPB FieldsResponse where +instance (HsJSONPB.ToJSONPB FieldsResponse) where toJSONPB (FieldsResponse f1) = - ( HsJSONPB.object - [ "fields" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) + HsJSONPB.object + [ "fields" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Field) @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (FieldsResponse f1) = - ( HsJSONPB.pairs - [ "fields" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) + HsJSONPB.pairs + [ "fields" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Field) @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB FieldsResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB FieldsResponse) where parseJSONPB = - ( HsJSONPB.withObject - "FieldsResponse" - ( \obj -> - (Hs.pure FieldsResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "FieldsResponse" + ( \obj -> + Hs.pure FieldsResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) @(Hs.Vector Monocle.Protob.Search.Field) - (obj .: "fields") ) - ) - ) - -instance HsJSONPB.ToJSON FieldsResponse where + (obj .: "fields") + ) + ) +instance (HsJSONPB.ToJSON FieldsResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON FieldsResponse where +instance (HsJSONPB.FromJSON FieldsResponse) where parseJSON = HsJSONPB.parseJSONPB - data QueryError = QueryError { queryErrorMessage :: Hs.Text , queryErrorPosition :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData QueryError - -instance HsProtobuf.Named QueryError where - nameOf _ = (Hs.fromString "QueryError") - -instance HsProtobuf.HasDefault QueryError - -instance HsProtobuf.Message QueryError where - encodeMessage - _ - QueryError - { queryErrorMessage = queryErrorMessage - , queryErrorPosition = queryErrorPosition - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (queryErrorMessage) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - queryErrorPosition - ) - ] +instance (Hs.NFData QueryError) +instance (HsProtobuf.Named QueryError) where + nameOf _ = Hs.fromString "QueryError" +instance (HsProtobuf.HasDefault QueryError) +instance (HsProtobuf.Message QueryError) where + encodeMessage _ QueryError {queryErrorMessage, queryErrorPosition} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + queryErrorMessage + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + queryErrorPosition ) decodeMessage _ = - (Hs.pure QueryError) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure QueryError + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "message") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "position") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "message") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "position") + [] + "" ] - -instance HsJSONPB.ToJSONPB QueryError where +instance (HsJSONPB.ToJSONPB QueryError) where toJSONPB (QueryError f1 f2) = - ( HsJSONPB.object - [ "message" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "position" .= f2 - ] - ) + HsJSONPB.object + [ "message" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "position" .= f2 + ] toEncodingPB (QueryError f1 f2) = - ( HsJSONPB.pairs - [ "message" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "position" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB QueryError where + HsJSONPB.pairs + [ "message" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "position" .= f2 + ] +instance (HsJSONPB.FromJSONPB QueryError) where parseJSONPB = - ( HsJSONPB.withObject - "QueryError" - ( \obj -> - (Hs.pure QueryError) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "message") - ) - <*> obj .: "position" - ) - ) - -instance HsJSONPB.ToJSON QueryError where + HsJSONPB.withObject + "QueryError" + ( \obj -> + Hs.pure QueryError + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "message") + ) + <*> obj .: "position" + ) +instance (HsJSONPB.ToJSON QueryError) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON QueryError where +instance (HsJSONPB.FromJSON QueryError) where parseJSON = HsJSONPB.parseJSONPB - data CheckRequest = CheckRequest { checkRequestIndex :: Hs.Text , checkRequestUsername :: Hs.Text , checkRequestQuery :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CheckRequest - -instance HsProtobuf.Named CheckRequest where - nameOf _ = (Hs.fromString "CheckRequest") - -instance HsProtobuf.HasDefault CheckRequest - -instance HsProtobuf.Message CheckRequest where +instance (Hs.NFData CheckRequest) +instance (HsProtobuf.Named CheckRequest) where + nameOf _ = Hs.fromString "CheckRequest" +instance (HsProtobuf.HasDefault CheckRequest) +instance (HsProtobuf.Message CheckRequest) where encodeMessage _ CheckRequest - { checkRequestIndex = checkRequestIndex - , checkRequestUsername = checkRequestUsername - , checkRequestQuery = checkRequestQuery + { checkRequestIndex + , checkRequestUsername + , checkRequestQuery } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (checkRequestIndex) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + checkRequestIndex ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (checkRequestUsername) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + checkRequestUsername ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (checkRequestQuery) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + checkRequestQuery ) - ] - ) + ) decodeMessage _ = - (Hs.pure CheckRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure CheckRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "username") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "query") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") + [] + "" ] - -instance HsJSONPB.ToJSONPB CheckRequest where +instance (HsJSONPB.ToJSONPB CheckRequest) where toJSONPB (CheckRequest f1 f2 f3) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] toEncodingPB (CheckRequest f1 f2 f3) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) - -instance HsJSONPB.FromJSONPB CheckRequest where + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] +instance (HsJSONPB.FromJSONPB CheckRequest) where parseJSONPB = - ( HsJSONPB.withObject - "CheckRequest" - ( \obj -> - (Hs.pure CheckRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "username") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "query") - ) - ) - ) - -instance HsJSONPB.ToJSON CheckRequest where + HsJSONPB.withObject + "CheckRequest" + ( \obj -> + Hs.pure CheckRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "username") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "query") + ) + ) +instance (HsJSONPB.ToJSON CheckRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CheckRequest where +instance (HsJSONPB.FromJSON CheckRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype CheckResponse = CheckResponse - { checkResponseResult :: - Hs.Maybe CheckResponseResult - } +newtype CheckResponse = CheckResponse {checkResponseResult :: (Hs.Maybe CheckResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CheckResponse - -instance HsProtobuf.Named CheckResponse where - nameOf _ = (Hs.fromString "CheckResponse") - -instance HsProtobuf.HasDefault CheckResponse - -instance HsProtobuf.Message CheckResponse where - encodeMessage - _ - CheckResponse {checkResponseResult = checkResponseResult} = - ( Hs.mconcat - [ case checkResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - CheckResponseResultSuccess y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) - ) - ) - CheckResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.QueryError) - @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) - (Hs.Just y) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure CheckResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.Just Hs.. CheckResponseResultSuccess)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData CheckResponse) +instance (HsProtobuf.Named CheckResponse) where + nameOf _ = Hs.fromString "CheckResponse" +instance (HsProtobuf.HasDefault CheckResponse) +instance (HsProtobuf.Message CheckResponse) where + encodeMessage _ CheckResponse {checkResponseResult} = + ( case checkResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + CheckResponseResultSuccess y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( HsProtobuf.ForceEmit + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) y) ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.fmap CheckResponseResultError)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) - @(Hs.Maybe Monocle.Protob.Search.QueryError) - (HsProtobuf.decodeMessageField) - ) + CheckResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.QueryError) + @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) + ) + (Hs.Just y) ) - ] - ) - dotProto _ = [] - -instance HsJSONPB.ToJSONPB CheckResponse where - toJSONPB (CheckResponse f1_or_f2) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (CheckResponseResultSuccess f1) -> - ( HsJSONPB.pair - "success" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (CheckResponseResultError f2) -> (HsJSONPB.pair "error" f2) - Hs.Nothing -> Hs.mempty + ) + decodeMessage _ = + Hs.pure CheckResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.Just Hs.. CheckResponseResultSuccess) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options ) - ] - ) - toEncodingPB (CheckResponse f1_or_f2) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2 of - Hs.Just (CheckResponseResultSuccess f1) -> - ( HsJSONPB.pair - "success" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - ) - Hs.Just (CheckResponseResultError f2) -> (HsJSONPB.pair "error" f2) - Hs.Nothing -> Hs.mempty + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.fmap CheckResponseResultError) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) + @(Hs.Maybe Monocle.Protob.Search.QueryError) + ) + HsProtobuf.decodeMessageField ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options ) ] - ) - -instance HsJSONPB.FromJSONPB CheckResponse where - parseJSONPB = - ( HsJSONPB.withObject - "CheckResponse" - ( \obj -> - (Hs.pure CheckResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just - Hs.. CheckResponseResultSuccess - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "success") - , Hs.Just Hs.. CheckResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) + dotProto _ = [] +instance (HsJSONPB.ToJSONPB CheckResponse) where + toJSONPB (CheckResponse f1_or_f2) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (CheckResponseResultSuccess f1) -> + HsJSONPB.pair + "success" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (CheckResponseResultError f2) -> HsJSONPB.pair "error" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) ) - ) - -instance HsJSONPB.ToJSON CheckResponse where + ] + toEncodingPB (CheckResponse f1_or_f2) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2 of + Hs.Just (CheckResponseResultSuccess f1) -> + HsJSONPB.pair + "success" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + Hs.Just (CheckResponseResultError f2) -> HsJSONPB.pair "error" f2 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB CheckResponse) where + parseJSONPB = + HsJSONPB.withObject + "CheckResponse" + ( \obj -> + Hs.pure CheckResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just + Hs.. CheckResponseResultSuccess + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "success" + , Hs.Just Hs.. CheckResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON CheckResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON CheckResponse where +instance (HsJSONPB.FromJSON CheckResponse) where parseJSON = HsJSONPB.parseJSONPB - data CheckResponseResult = CheckResponseResultSuccess Hs.Text | CheckResponseResultError Monocle.Protob.Search.QueryError deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData CheckResponseResult - -instance HsProtobuf.Named CheckResponseResult where - nameOf _ = (Hs.fromString "CheckResponseResult") - +instance (Hs.NFData CheckResponseResult) +instance (HsProtobuf.Named CheckResponseResult) where + nameOf _ = Hs.fromString "CheckResponseResult" data Author = Author { authorMuid :: Hs.Text - , authorAliases :: Hs.Vector Hs.Text - , authorGroups :: Hs.Vector Hs.Text + , authorAliases :: (Hs.Vector Hs.Text) + , authorGroups :: (Hs.Vector Hs.Text) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Author - -instance HsProtobuf.Named Author where - nameOf _ = (Hs.fromString "Author") - -instance HsProtobuf.HasDefault Author - -instance HsProtobuf.Message Author where - encodeMessage - _ - Author - { authorMuid = authorMuid - , authorAliases = authorAliases - , authorGroups = authorGroups - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (authorMuid)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (authorAliases) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Hs.Text) +instance (Hs.NFData Author) +instance (HsProtobuf.Named Author) where + nameOf _ = Hs.fromString "Author" +instance (HsProtobuf.HasDefault Author) +instance (HsProtobuf.Message Author) where + encodeMessage _ Author {authorMuid, authorAliases, authorGroups} = + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) authorMuid) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (authorGroups) ) + authorAliases + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) ) - ] + authorGroups + ) ) decodeMessage _ = - (Hs.pure Author) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Author + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "muid") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "aliases") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "groups") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "muid") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "aliases") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "groups") + [] + "" ] - -instance HsJSONPB.ToJSONPB Author where +instance (HsJSONPB.ToJSONPB Author) where toJSONPB (Author f1 f2 f3) = - ( HsJSONPB.object - [ "muid" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "aliases" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.object + [ "muid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "aliases" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f2) ) - , "groups" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f2 + ) + , "groups" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - ] - ) + f3 + ) + ] toEncodingPB (Author f1 f2 f3) = - ( HsJSONPB.pairs - [ "muid" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "aliases" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + HsJSONPB.pairs + [ "muid" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "aliases" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f2) ) - , "groups" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f2 + ) + , "groups" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f3) ) - ] - ) - -instance HsJSONPB.FromJSONPB Author where + f3 + ) + ] +instance (HsJSONPB.FromJSONPB Author) where parseJSONPB = - ( HsJSONPB.withObject - "Author" - ( \obj -> - (Hs.pure Author) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "muid") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Author" + ( \obj -> + Hs.pure Author + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "muid") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "aliases") ) - <*> ( HsProtobuf.coerceOver + (obj .: "aliases") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "groups") ) - ) - ) - -instance HsJSONPB.ToJSON Author where + (obj .: "groups") + ) + ) +instance (HsJSONPB.ToJSON Author) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Author where +instance (HsJSONPB.FromJSON Author) where parseJSON = HsJSONPB.parseJSONPB - data AuthorRequest = AuthorRequest { authorRequestIndex :: Hs.Text , authorRequestQuery :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AuthorRequest - -instance HsProtobuf.Named AuthorRequest where - nameOf _ = (Hs.fromString "AuthorRequest") - -instance HsProtobuf.HasDefault AuthorRequest - -instance HsProtobuf.Message AuthorRequest where +instance (Hs.NFData AuthorRequest) +instance (HsProtobuf.Named AuthorRequest) where + nameOf _ = Hs.fromString "AuthorRequest" +instance (HsProtobuf.HasDefault AuthorRequest) +instance (HsProtobuf.Message AuthorRequest) where encodeMessage _ - AuthorRequest - { authorRequestIndex = authorRequestIndex - , authorRequestQuery = authorRequestQuery - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (authorRequestIndex) - ) + AuthorRequest {authorRequestIndex, authorRequestQuery} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + authorRequestIndex ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (authorRequestQuery) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + authorRequestQuery ) - ] - ) + ) decodeMessage _ = - (Hs.pure AuthorRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure AuthorRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "query") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") + [] + "" ] - -instance HsJSONPB.ToJSONPB AuthorRequest where +instance (HsJSONPB.ToJSONPB AuthorRequest) where toJSONPB (AuthorRequest f1 f2) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] toEncodingPB (AuthorRequest f1 f2) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - ] - ) - -instance HsJSONPB.FromJSONPB AuthorRequest where + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + ] +instance (HsJSONPB.FromJSONPB AuthorRequest) where parseJSONPB = - ( HsJSONPB.withObject - "AuthorRequest" - ( \obj -> - (Hs.pure AuthorRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "query") - ) - ) - ) - -instance HsJSONPB.ToJSON AuthorRequest where + HsJSONPB.withObject + "AuthorRequest" + ( \obj -> + Hs.pure AuthorRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "query") + ) + ) +instance (HsJSONPB.ToJSON AuthorRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AuthorRequest where +instance (HsJSONPB.FromJSON AuthorRequest) where parseJSON = HsJSONPB.parseJSONPB - -newtype AuthorResponse = AuthorResponse - { authorResponseAuthors :: - Hs.Vector Monocle.Protob.Search.Author - } +newtype AuthorResponse = AuthorResponse {authorResponseAuthors :: (Hs.Vector Monocle.Protob.Search.Author)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AuthorResponse - -instance HsProtobuf.Named AuthorResponse where - nameOf _ = (Hs.fromString "AuthorResponse") - -instance HsProtobuf.HasDefault AuthorResponse - -instance HsProtobuf.Message AuthorResponse where - encodeMessage - _ - AuthorResponse {authorResponseAuthors = authorResponseAuthors} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) - @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) - (authorResponseAuthors) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure AuthorResponse) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) +instance (Hs.NFData AuthorResponse) +instance (HsProtobuf.Named AuthorResponse) where + nameOf _ = Hs.fromString "AuthorResponse" +instance (HsProtobuf.HasDefault AuthorResponse) +instance (HsProtobuf.Message AuthorResponse) where + encodeMessage _ AuthorResponse {authorResponseAuthors} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) + ) + authorResponseAuthors + ) + ) + decodeMessage _ = + Hs.pure AuthorResponse + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) + @(Hs.Vector Monocle.Protob.Search.Author) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Author")) - ) - (HsProtobufAST.Single "authors") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Author")) + ) + (HsProtobufAST.Single "authors") + [] + "" ] - -instance HsJSONPB.ToJSONPB AuthorResponse where +instance (HsJSONPB.ToJSONPB AuthorResponse) where toJSONPB (AuthorResponse f1) = - ( HsJSONPB.object - [ "authors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) + HsJSONPB.object + [ "authors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Author) @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (AuthorResponse f1) = - ( HsJSONPB.pairs - [ "authors" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) + HsJSONPB.pairs + [ "authors" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Author) @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB AuthorResponse where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB AuthorResponse) where parseJSONPB = - ( HsJSONPB.withObject - "AuthorResponse" - ( \obj -> - (Hs.pure AuthorResponse) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "AuthorResponse" + ( \obj -> + Hs.pure AuthorResponse + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) @(Hs.Vector Monocle.Protob.Search.Author) - (obj .: "authors") ) - ) - ) - -instance HsJSONPB.ToJSON AuthorResponse where + (obj .: "authors") + ) + ) +instance (HsJSONPB.ToJSON AuthorResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AuthorResponse where +instance (HsJSONPB.FromJSON AuthorResponse) where parseJSON = HsJSONPB.parseJSONPB - data Order = Order { orderField :: Hs.Text - , orderDirection :: - HsProtobuf.Enumerated Monocle.Protob.Search.Order_Direction + , orderDirection :: (HsProtobuf.Enumerated Monocle.Protob.Search.Order_Direction) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Order - -instance HsProtobuf.Named Order where - nameOf _ = (Hs.fromString "Order") - -instance HsProtobuf.HasDefault Order - -instance HsProtobuf.Message Order where - encodeMessage - _ - Order {orderField = orderField, orderDirection = orderDirection} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (orderField)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - orderDirection - ) - ] +instance (Hs.NFData Order) +instance (HsProtobuf.Named Order) where + nameOf _ = Hs.fromString "Order" +instance (HsProtobuf.HasDefault Order) +instance (HsProtobuf.Message Order) where + encodeMessage _ Order {orderField, orderDirection} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) orderField) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + orderDirection ) decodeMessage _ = - (Hs.pure Order) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Order + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "field") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Direction")) - ) - (HsProtobufAST.Single "direction") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "field") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Direction")) + ) + (HsProtobufAST.Single "direction") + [] + "" ] - -instance HsJSONPB.ToJSONPB Order where +instance (HsJSONPB.ToJSONPB Order) where toJSONPB (Order f1 f2) = - ( HsJSONPB.object - [ "field" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "direction" .= f2 - ] - ) + HsJSONPB.object + [ "field" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "direction" .= f2 + ] toEncodingPB (Order f1 f2) = - ( HsJSONPB.pairs - [ "field" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "direction" .= f2 - ] - ) - -instance HsJSONPB.FromJSONPB Order where + HsJSONPB.pairs + [ "field" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "direction" .= f2 + ] +instance (HsJSONPB.FromJSONPB Order) where parseJSONPB = - ( HsJSONPB.withObject - "Order" - ( \obj -> - (Hs.pure Order) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "field") - ) - <*> obj .: "direction" - ) - ) - -instance HsJSONPB.ToJSON Order where + HsJSONPB.withObject + "Order" + ( \obj -> + Hs.pure Order + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "field") + ) + <*> obj .: "direction" + ) +instance (HsJSONPB.ToJSON Order) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Order where +instance (HsJSONPB.FromJSON Order) where parseJSON = HsJSONPB.parseJSONPB - data Order_Direction = Order_DirectionASC | Order_DirectionDESC deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named Order_Direction where - nameOf _ = (Hs.fromString "Order_Direction") - -instance HsProtobuf.HasDefault Order_Direction - -instance Hs.Bounded Order_Direction where +instance (HsProtobuf.Named Order_Direction) where + nameOf _ = Hs.fromString "Order_Direction" +instance (HsProtobuf.HasDefault Order_Direction) +instance (Hs.Bounded Order_Direction) where minBound = Order_DirectionASC maxBound = Order_DirectionDESC - -instance Hs.Ord Order_Direction where +instance (Hs.Ord Order_Direction) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum Order_Direction where +instance (HsProtobuf.ProtoEnum Order_Direction) where toProtoEnumMay 0 = Hs.Just Order_DirectionASC toProtoEnumMay 1 = Hs.Just Order_DirectionDESC toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (Order_DirectionASC) = 0 - fromProtoEnum (Order_DirectionDESC) = 1 - -instance HsJSONPB.ToJSONPB Order_Direction where + fromProtoEnum Order_DirectionASC = 0 + fromProtoEnum Order_DirectionDESC = 1 +instance (HsJSONPB.ToJSONPB Order_Direction) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB Order_Direction where +instance (HsJSONPB.FromJSONPB Order_Direction) where parseJSONPB (HsJSONPB.String "ASC") = Hs.pure Order_DirectionASC parseJSONPB (HsJSONPB.String "DESC") = Hs.pure Order_DirectionDESC - parseJSONPB v = (HsJSONPB.typeMismatch "Order_Direction" v) - -instance HsJSONPB.ToJSON Order_Direction where + parseJSONPB v = HsJSONPB.typeMismatch "Order_Direction" v +instance (HsJSONPB.ToJSON Order_Direction) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Order_Direction where +instance (HsJSONPB.FromJSON Order_Direction) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite Order_Direction - +instance (HsProtobuf.Finite Order_Direction) data QueryRequest = QueryRequest { queryRequestIndex :: Hs.Text , queryRequestUsername :: Hs.Text , queryRequestQuery :: Hs.Text - , queryRequestQueryType :: - HsProtobuf.Enumerated Monocle.Protob.Search.QueryRequest_QueryType - , queryRequestOrder :: Hs.Maybe Monocle.Protob.Search.Order + , queryRequestQueryType :: (HsProtobuf.Enumerated Monocle.Protob.Search.QueryRequest_QueryType) + , queryRequestOrder :: (Hs.Maybe Monocle.Protob.Search.Order) , queryRequestLimit :: Hs.Word32 , queryRequestChangeId :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData QueryRequest - -instance HsProtobuf.Named QueryRequest where - nameOf _ = (Hs.fromString "QueryRequest") - -instance HsProtobuf.HasDefault QueryRequest - -instance HsProtobuf.Message QueryRequest where +instance (Hs.NFData QueryRequest) +instance (HsProtobuf.Named QueryRequest) where + nameOf _ = Hs.fromString "QueryRequest" +instance (HsProtobuf.HasDefault QueryRequest) +instance (HsProtobuf.Message QueryRequest) where encodeMessage _ QueryRequest - { queryRequestIndex = queryRequestIndex - , queryRequestUsername = queryRequestUsername - , queryRequestQuery = queryRequestQuery - , queryRequestQueryType = queryRequestQueryType - , queryRequestOrder = queryRequestOrder - , queryRequestLimit = queryRequestLimit - , queryRequestChangeId = queryRequestChangeId + { queryRequestIndex + , queryRequestUsername + , queryRequestQuery + , queryRequestQueryType + , queryRequestOrder + , queryRequestLimit + , queryRequestChangeId } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (queryRequestIndex) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (queryRequestUsername) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (queryRequestQuery) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + queryRequestIndex + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + queryRequestUsername + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + queryRequestQuery + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + queryRequestQueryType + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - queryRequestQueryType - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Order) - @(HsProtobuf.Nested Monocle.Protob.Search.Order) - (queryRequestOrder) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Order) + @(HsProtobuf.Nested Monocle.Protob.Search.Order) + ) + queryRequestOrder + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) queryRequestLimit ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (queryRequestChangeId) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + queryRequestChangeId ) - ] - ) + ) decodeMessage _ = - (Hs.pure QueryRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure QueryRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.Order) - @(Hs.Maybe Monocle.Protob.Search.Order) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Order) + @(Hs.Maybe Monocle.Protob.Search.Order) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 6) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 6) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "index") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "username") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "query") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "QueryType")) - ) - (HsProtobufAST.Single "query_type") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Order")) - ) - (HsProtobufAST.Single "order") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "limit") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "change_id") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "QueryType")) + ) + (HsProtobufAST.Single "query_type") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Order")) + ) + (HsProtobufAST.Single "order") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "limit") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") + [] + "" ] - -instance HsJSONPB.ToJSONPB QueryRequest where +instance (HsJSONPB.ToJSONPB QueryRequest) where toJSONPB (QueryRequest f1 f2 f3 f4 f5 f6 f7) = - ( HsJSONPB.object - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "query_type" .= f4 - , "order" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Order) + HsJSONPB.object + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "query_type" .= f4 + , "order" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Order) @(HsProtobuf.Nested Monocle.Protob.Search.Order) - (f5) ) - , "limit" .= f6 - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - ] - ) + f5 + ) + , "limit" .= f6 + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + ] toEncodingPB (QueryRequest f1 f2 f3 f4 f5 f6 f7) = - ( HsJSONPB.pairs - [ "index" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "username" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "query" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "query_type" .= f4 - , "order" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Order) + HsJSONPB.pairs + [ "index" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "username" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "query" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "query_type" .= f4 + , "order" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Order) @(HsProtobuf.Nested Monocle.Protob.Search.Order) - (f5) ) - , "limit" .= f6 - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - ] - ) - -instance HsJSONPB.FromJSONPB QueryRequest where + f5 + ) + , "limit" .= f6 + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + ] +instance (HsJSONPB.FromJSONPB QueryRequest) where parseJSONPB = - ( HsJSONPB.withObject - "QueryRequest" - ( \obj -> - (Hs.pure QueryRequest) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "index") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "username") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "query") - ) - <*> obj .: "query_type" - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "QueryRequest" + ( \obj -> + Hs.pure QueryRequest + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "index") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "username") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "query") + ) + <*> obj .: "query_type" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Search.Order) @(Hs.Maybe Monocle.Protob.Search.Order) - (obj .: "order") - ) - <*> obj .: "limit" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "change_id") ) - ) - ) - -instance HsJSONPB.ToJSON QueryRequest where + (obj .: "order") + ) + <*> obj .: "limit" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "change_id") + ) + ) +instance (HsJSONPB.ToJSON QueryRequest) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON QueryRequest where +instance (HsJSONPB.FromJSON QueryRequest) where parseJSON = HsJSONPB.parseJSONPB - data QueryRequest_QueryType = QueryRequest_QueryTypeQUERY_CHANGE | QueryRequest_QueryTypeQUERY_REPOS_SUMMARY @@ -2325,23 +2135,18 @@ data QueryRequest_QueryType | QueryRequest_QueryTypeQUERY_HISTO_COMMITS | QueryRequest_QueryTypeQUERY_HISTO_REVIEWS_AND_COMMENTS deriving (Hs.Show, Hs.Eq, Hs.Generic, Hs.NFData) - -instance HsProtobuf.Named QueryRequest_QueryType where - nameOf _ = (Hs.fromString "QueryRequest_QueryType") - -instance HsProtobuf.HasDefault QueryRequest_QueryType - -instance Hs.Bounded QueryRequest_QueryType where +instance (HsProtobuf.Named QueryRequest_QueryType) where + nameOf _ = Hs.fromString "QueryRequest_QueryType" +instance (HsProtobuf.HasDefault QueryRequest_QueryType) +instance (Hs.Bounded QueryRequest_QueryType) where minBound = QueryRequest_QueryTypeQUERY_CHANGE maxBound = QueryRequest_QueryTypeQUERY_HISTO_REVIEWS_AND_COMMENTS - -instance Hs.Ord QueryRequest_QueryType where +instance (Hs.Ord QueryRequest_QueryType) where compare x y = Hs.compare (HsProtobuf.fromProtoEnum x) (HsProtobuf.fromProtoEnum y) - -instance HsProtobuf.ProtoEnum QueryRequest_QueryType where +instance (HsProtobuf.ProtoEnum QueryRequest_QueryType) where toProtoEnumMay 0 = Hs.Just QueryRequest_QueryTypeQUERY_CHANGE toProtoEnumMay 2 = Hs.Just QueryRequest_QueryTypeQUERY_REPOS_SUMMARY @@ -2378,42 +2183,40 @@ instance HsProtobuf.ProtoEnum QueryRequest_QueryType where toProtoEnumMay 51 = Hs.Just QueryRequest_QueryTypeQUERY_HISTO_REVIEWS_AND_COMMENTS toProtoEnumMay _ = Hs.Nothing - fromProtoEnum (QueryRequest_QueryTypeQUERY_CHANGE) = 0 - fromProtoEnum (QueryRequest_QueryTypeQUERY_REPOS_SUMMARY) = 2 + fromProtoEnum QueryRequest_QueryTypeQUERY_CHANGE = 0 + fromProtoEnum QueryRequest_QueryTypeQUERY_REPOS_SUMMARY = 2 fromProtoEnum - (QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_CREATED) = 3 + QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_CREATED = + 3 fromProtoEnum - (QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_MERGED) = 4 + QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_MERGED = + 4 fromProtoEnum - (QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_REVIEWED) = 5 + QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_REVIEWED = + 5 fromProtoEnum - (QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_COMMENTED) = 6 - fromProtoEnum (QueryRequest_QueryTypeQUERY_TOP_REVIEWED_AUTHORS) = - 7 - fromProtoEnum (QueryRequest_QueryTypeQUERY_TOP_COMMENTED_AUTHORS) = - 8 - fromProtoEnum (QueryRequest_QueryTypeQUERY_TOP_AUTHORS_PEERS) = 9 - fromProtoEnum (QueryRequest_QueryTypeQUERY_NEW_CHANGES_AUTHORS) = - 10 - fromProtoEnum (QueryRequest_QueryTypeQUERY_CHANGES_REVIEW_STATS) = - 20 - fromProtoEnum (QueryRequest_QueryTypeQUERY_CHANGES_LIFECYCLE_STATS) = + QueryRequest_QueryTypeQUERY_TOP_AUTHORS_CHANGES_COMMENTED = + 6 + fromProtoEnum QueryRequest_QueryTypeQUERY_TOP_REVIEWED_AUTHORS = 7 + fromProtoEnum QueryRequest_QueryTypeQUERY_TOP_COMMENTED_AUTHORS = 8 + fromProtoEnum QueryRequest_QueryTypeQUERY_TOP_AUTHORS_PEERS = 9 + fromProtoEnum QueryRequest_QueryTypeQUERY_NEW_CHANGES_AUTHORS = 10 + fromProtoEnum QueryRequest_QueryTypeQUERY_CHANGES_REVIEW_STATS = 20 + fromProtoEnum QueryRequest_QueryTypeQUERY_CHANGES_LIFECYCLE_STATS = 21 - fromProtoEnum (QueryRequest_QueryTypeQUERY_ACTIVE_AUTHORS_STATS) = - 22 - fromProtoEnum (QueryRequest_QueryTypeQUERY_CHANGE_AND_EVENTS) = 30 - fromProtoEnum (QueryRequest_QueryTypeQUERY_CHANGES_TOPS) = 31 - fromProtoEnum - (QueryRequest_QueryTypeQUERY_RATIO_COMMITS_VS_REVIEWS) = 40 - fromProtoEnum (QueryRequest_QueryTypeQUERY_HISTO_COMMITS) = 50 + fromProtoEnum QueryRequest_QueryTypeQUERY_ACTIVE_AUTHORS_STATS = 22 + fromProtoEnum QueryRequest_QueryTypeQUERY_CHANGE_AND_EVENTS = 30 + fromProtoEnum QueryRequest_QueryTypeQUERY_CHANGES_TOPS = 31 + fromProtoEnum QueryRequest_QueryTypeQUERY_RATIO_COMMITS_VS_REVIEWS = + 40 + fromProtoEnum QueryRequest_QueryTypeQUERY_HISTO_COMMITS = 50 fromProtoEnum - (QueryRequest_QueryTypeQUERY_HISTO_REVIEWS_AND_COMMENTS) = 51 - -instance HsJSONPB.ToJSONPB QueryRequest_QueryType where + QueryRequest_QueryTypeQUERY_HISTO_REVIEWS_AND_COMMENTS = + 51 +instance (HsJSONPB.ToJSONPB QueryRequest_QueryType) where toJSONPB x _ = HsJSONPB.enumFieldString x toEncodingPB x _ = HsJSONPB.enumFieldEncoding x - -instance HsJSONPB.FromJSONPB QueryRequest_QueryType where +instance (HsJSONPB.FromJSONPB QueryRequest_QueryType) where parseJSONPB (HsJSONPB.String "QUERY_CHANGE") = Hs.pure QueryRequest_QueryTypeQUERY_CHANGE parseJSONPB (HsJSONPB.String "QUERY_REPOS_SUMMARY") = @@ -2450,419 +2253,388 @@ instance HsJSONPB.FromJSONPB QueryRequest_QueryType where Hs.pure QueryRequest_QueryTypeQUERY_HISTO_COMMITS parseJSONPB (HsJSONPB.String "QUERY_HISTO_REVIEWS_AND_COMMENTS") = Hs.pure QueryRequest_QueryTypeQUERY_HISTO_REVIEWS_AND_COMMENTS - parseJSONPB v = (HsJSONPB.typeMismatch "QueryRequest_QueryType" v) - -instance HsJSONPB.ToJSON QueryRequest_QueryType where + parseJSONPB v = HsJSONPB.typeMismatch "QueryRequest_QueryType" v +instance (HsJSONPB.ToJSON QueryRequest_QueryType) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON QueryRequest_QueryType where +instance (HsJSONPB.FromJSON QueryRequest_QueryType) where parseJSON = HsJSONPB.parseJSONPB - -instance HsProtobuf.Finite QueryRequest_QueryType - +instance (HsProtobuf.Finite QueryRequest_QueryType) data File = File { fileAdditions :: Hs.Word32 , fileDeletions :: Hs.Word32 , filePath :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData File - -instance HsProtobuf.Named File where - nameOf _ = (Hs.fromString "File") - -instance HsProtobuf.HasDefault File - -instance HsProtobuf.Message File where - encodeMessage - _ - File - { fileAdditions = fileAdditions - , fileDeletions = fileDeletions - , filePath = filePath - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - fileAdditions - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - fileDeletions - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (filePath)) - ) - ] - ) - decodeMessage _ = - (Hs.pure File) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField +instance (Hs.NFData File) +instance (HsProtobuf.Named File) where + nameOf _ = Hs.fromString "File" +instance (HsProtobuf.HasDefault File) +instance (HsProtobuf.Message File) where + encodeMessage _ File {fileAdditions, fileDeletions, filePath} = + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) + fileAdditions ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) + fileDeletions ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) filePath) + ) + decodeMessage _ = + Hs.pure File + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "additions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "deletions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "path") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "additions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "deletions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "path") + [] + "" ] - -instance HsJSONPB.ToJSONPB File where +instance (HsJSONPB.ToJSONPB File) where toJSONPB (File f1 f2 f3) = - ( HsJSONPB.object - [ "additions" .= f1 - , "deletions" .= f2 - , "path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) + HsJSONPB.object + [ "additions" .= f1 + , "deletions" .= f2 + , "path" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] toEncodingPB (File f1 f2 f3) = - ( HsJSONPB.pairs - [ "additions" .= f1 - , "deletions" .= f2 - , "path" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - ] - ) - -instance HsJSONPB.FromJSONPB File where + HsJSONPB.pairs + [ "additions" .= f1 + , "deletions" .= f2 + , "path" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + ] +instance (HsJSONPB.FromJSONPB File) where parseJSONPB = - ( HsJSONPB.withObject - "File" - ( \obj -> - (Hs.pure File) - <*> obj .: "additions" - <*> obj .: "deletions" - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "path") - ) - ) - ) - -instance HsJSONPB.ToJSON File where + HsJSONPB.withObject + "File" + ( \obj -> + Hs.pure File + <*> obj .: "additions" + <*> obj .: "deletions" + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "path") + ) + ) +instance (HsJSONPB.ToJSON File) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON File where +instance (HsJSONPB.FromJSON File) where parseJSON = HsJSONPB.parseJSONPB - data Commit = Commit { commitSha :: Hs.Text , commitTitle :: Hs.Text , commitAuthor :: Hs.Text - , commitAuthoredAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp + , commitAuthoredAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) , commitCommitter :: Hs.Text - , commitCommittedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp + , commitCommittedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) , commitAdditions :: Hs.Word32 , commitDeletions :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Commit - -instance HsProtobuf.Named Commit where - nameOf _ = (Hs.fromString "Commit") - -instance HsProtobuf.HasDefault Commit - -instance HsProtobuf.Message Commit where +instance (Hs.NFData Commit) +instance (HsProtobuf.Named Commit) where + nameOf _ = Hs.fromString "Commit" +instance (HsProtobuf.HasDefault Commit) +instance (HsProtobuf.Message Commit) where encodeMessage _ Commit - { commitSha = commitSha - , commitTitle = commitTitle - , commitAuthor = commitAuthor - , commitAuthoredAt = commitAuthoredAt - , commitCommitter = commitCommitter - , commitCommittedAt = commitCommittedAt - , commitAdditions = commitAdditions - , commitDeletions = commitDeletions + { commitSha + , commitTitle + , commitAuthor + , commitAuthoredAt + , commitCommitter + , commitCommittedAt + , commitAdditions + , commitDeletions } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (commitSha)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (commitTitle)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (commitAuthoredAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (commitCommitter) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) commitSha) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) commitTitle) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) commitAuthor) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + commitAuthoredAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + commitCommitter + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (commitCommittedAt) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + commitCommittedAt + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) commitAdditions ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 11) - commitDeletions - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 11) + commitDeletions + ) decodeMessage _ = - (Hs.pure Commit) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Commit + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 10) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 11) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 10) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 11) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "sha") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "title") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "authored_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "committer") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "committed_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "additions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "deletions") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "sha") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "authored_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "committer") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "committed_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "additions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "deletions") + [] + "" ] - -instance HsJSONPB.ToJSONPB Commit where +instance (HsJSONPB.ToJSONPB Commit) where toJSONPB (Commit f1 f2 f3 f4 f5 f6 f10 f11) = - ( HsJSONPB.object - [ "sha" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "authored_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "sha" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "author" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "authored_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f4) ) - , "committer" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "committed_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f4 + ) + , "committer" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "committed_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f6) ) - , "additions" .= f10 - , "deletions" .= f11 - ] - ) + f6 + ) + , "additions" .= f10 + , "deletions" .= f11 + ] toEncodingPB (Commit f1 f2 f3 f4 f5 f6 f10 f11) = - ( HsJSONPB.pairs - [ "sha" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "authored_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.pairs + [ "sha" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "author" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "authored_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f4) ) - , "committer" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "committed_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f4 + ) + , "committer" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "committed_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f6) ) - , "additions" .= f10 - , "deletions" .= f11 - ] - ) - -instance HsJSONPB.FromJSONPB Commit where + f6 + ) + , "additions" .= f10 + , "deletions" .= f11 + ] +instance (HsJSONPB.FromJSONPB Commit) where parseJSONPB = - ( HsJSONPB.withObject - "Commit" - ( \obj -> - (Hs.pure Commit) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "sha") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "title") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "author") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Commit" + ( \obj -> + Hs.pure Commit + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "sha") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "title") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "author") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "authored_at") ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "committer") - ) - <*> ( HsProtobuf.coerceOver + (obj .: "authored_at") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "committer") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "committed_at") ) - <*> obj .: "additions" - <*> obj .: "deletions" - ) - ) - -instance HsJSONPB.ToJSON Commit where + (obj .: "committed_at") + ) + <*> obj .: "additions" + <*> obj .: "deletions" + ) +instance (HsJSONPB.ToJSON Commit) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Commit where +instance (HsJSONPB.FromJSON Commit) where parseJSON = HsJSONPB.parseJSONPB - data Change = Change { changeChangeId :: Hs.Text , changeAuthor :: Hs.Text @@ -2872,589 +2644,670 @@ data Change = Change , changeState :: Hs.Text , changeBranch :: Hs.Text , changeTargetBranch :: Hs.Text - , changeCreatedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeUpdatedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeMergedAt :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeMergedByM :: Hs.Maybe ChangeMergedByM + , changeCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeUpdatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeMergedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeMergedByM :: (Hs.Maybe ChangeMergedByM) , changeText :: Hs.Text , changeAdditions :: Hs.Word32 , changeDeletions :: Hs.Word32 - , changeApproval :: Hs.Vector Hs.Text - , changeAssignees :: Hs.Vector Hs.Text - , changeLabels :: Hs.Vector Hs.Text + , changeApproval :: (Hs.Vector Hs.Text) + , changeAssignees :: (Hs.Vector Hs.Text) + , changeLabels :: (Hs.Vector Hs.Text) , changeDraft :: Hs.Bool , changeMergeable :: Hs.Bool - , changeChangedFiles :: Hs.Vector Monocle.Protob.Search.File + , changeChangedFiles :: (Hs.Vector Monocle.Protob.Search.File) , changeChangedFilesCount :: Hs.Word32 - , changeCommits :: Hs.Vector Monocle.Protob.Search.Commit + , changeCommits :: (Hs.Vector Monocle.Protob.Search.Commit) , changeCommitsCount :: Hs.Word32 - , changeTaskData :: Hs.Vector Monocle.Protob.Search.TaskData - , changeTtm :: Hs.Maybe ChangeTtm + , changeTaskData :: (Hs.Vector Monocle.Protob.Search.TaskData) + , changeTtm :: (Hs.Maybe ChangeTtm) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Change - -instance HsProtobuf.Named Change where - nameOf _ = (Hs.fromString "Change") - -instance HsProtobuf.HasDefault Change - -instance HsProtobuf.Message Change where +instance (Hs.NFData Change) +instance (HsProtobuf.Named Change) where + nameOf _ = Hs.fromString "Change" +instance (HsProtobuf.HasDefault Change) +instance (HsProtobuf.Message Change) where encodeMessage _ Change - { changeChangeId = changeChangeId - , changeAuthor = changeAuthor - , changeTitle = changeTitle - , changeUrl = changeUrl - , changeRepositoryFullname = changeRepositoryFullname - , changeState = changeState - , changeBranch = changeBranch - , changeTargetBranch = changeTargetBranch - , changeCreatedAt = changeCreatedAt - , changeUpdatedAt = changeUpdatedAt - , changeMergedAt = changeMergedAt - , changeMergedByM = changeMergedByM - , changeText = changeText - , changeAdditions = changeAdditions - , changeDeletions = changeDeletions - , changeApproval = changeApproval - , changeAssignees = changeAssignees - , changeLabels = changeLabels - , changeDraft = changeDraft - , changeMergeable = changeMergeable - , changeChangedFiles = changeChangedFiles - , changeChangedFilesCount = changeChangedFilesCount - , changeCommits = changeCommits - , changeCommitsCount = changeCommitsCount - , changeTaskData = changeTaskData - , changeTtm = changeTtm + { changeChangeId + , changeAuthor + , changeTitle + , changeUrl + , changeRepositoryFullname + , changeState + , changeBranch + , changeTargetBranch + , changeCreatedAt + , changeUpdatedAt + , changeMergedAt + , changeMergedByM + , changeText + , changeAdditions + , changeDeletions + , changeApproval + , changeAssignees + , changeLabels + , changeDraft + , changeMergeable + , changeChangedFiles + , changeChangedFilesCount + , changeCommits + , changeCommitsCount + , changeTaskData + , changeTtm } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeChangeId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeAuthor) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeTitle)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeUrl)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeRepositoryFullname) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeState)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeBranch) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 8) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeTargetBranch) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 9) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeCreatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeUpdatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeMergedAt) - ) - ) - , case changeMergedByM of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeMergedByMMergedBy y -> + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 1 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeChangeId + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 2 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeAuthor + ) + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 3 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeTitle + ) + ) + ) + ( HsProtobuf.encodeMessageField + ( HsProtobuf.FieldNumber + 4 + ) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeUrl + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeRepositoryFullname + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeState + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 7) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeBranch + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 8) + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + changeTargetBranch + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 9) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeCreatedAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeUpdatedAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 11) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeMergedAt + ) + ) + ) + ( case changeMergedByM of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeMergedByMMergedBy y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 12) + ( HsProtobuf.ForceEmit + ( ( Hs.coerce + @Hs.Text + @((HsProtobuf.String Hs.Text)) + ) + y + ) + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 15) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeText + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 20) + changeAdditions + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 21) + changeDeletions + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 25) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeApproval + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 26) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeAssignees + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 27) + ( ( Hs.coerce + @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + ) + changeLabels + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 30) + changeDraft + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 32) + changeMergeable + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 50) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.File) + @(HsProtobuf.NestedVec Monocle.Protob.Search.File) + ) + changeChangedFiles + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 51) + changeChangedFilesCount + ) + ) ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 12) - ( HsProtobuf.ForceEmit - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + (HsProtobuf.FieldNumber 60) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Commit) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) + ) + changeCommits ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 15) - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeText)) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 20) - changeAdditions - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 21) - changeDeletions - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 25) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeApproval) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 26) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeAssignees) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 27) - ( Hs.coerce @(Hs.Vector Hs.Text) - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (changeLabels) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 30) - changeDraft - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 32) - changeMergeable - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 50) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.File) - @(HsProtobuf.NestedVec Monocle.Protob.Search.File) - (changeChangedFiles) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 51) - changeChangedFilesCount - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 60) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Commit) - @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) - (changeCommits) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 61) + changeCommitsCount ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 61) - changeCommitsCount - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 70) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) - @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - (changeTaskData) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.TaskData) + @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) + ) + changeTaskData ) ) - , case changeTtm of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - ChangeTtmDuration y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 80) - (HsProtobuf.ForceEmit y) - ) - ] - ) + ) + ( case changeTtm of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + ChangeTtmDuration y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 80) + (HsProtobuf.ForceEmit y) + ) decodeMessage _ = - (Hs.pure Change) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure Change + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 8) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 9) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 12) - , (Hs.pure (Hs.Just Hs.. ChangeMergedByMMergedBy)) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (HsProtobuf.decodeMessageField) - ) - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 12) + , Hs.pure (Hs.Just Hs.. ChangeMergedByMMergedBy) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + HsProtobuf.decodeMessageField + ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ] + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 15) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 20) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 21) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 20) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 21) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 25) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 26) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - @(Hs.Vector Hs.Text) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 27) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 30) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 32) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.File) - @(Hs.Vector Monocle.Protob.Search.File) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 30) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 32) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.File) + @(Hs.Vector Monocle.Protob.Search.File) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 50) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 51) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) - @(Hs.Vector Monocle.Protob.Search.Commit) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 51) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) + @(Hs.Vector Monocle.Protob.Search.Commit) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 60) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 61) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - @(Hs.Vector Monocle.Protob.Search.TaskData) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 61) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) + @(Hs.Vector Monocle.Protob.Search.TaskData) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 70) ) ) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 80) - , (Hs.pure (Hs.Just Hs.. ChangeTtmDuration)) - <*> HsProtobuf.decodeMessageField - ) - ] + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 80) + , Hs.pure (Hs.Just Hs.. ChangeTtmDuration) + <*> HsProtobuf.decodeMessageField ) + ] dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "change_id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "title") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "url") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "repository_fullname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "state") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 7) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "branch") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 8) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "target_branch") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 9) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "updated_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "merged_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 15) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "text") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 20) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "additions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 21) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "deletions") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 25) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "approval") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 26) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "assignees") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 27) - (HsProtobufAST.Repeated HsProtobufAST.String) - (HsProtobufAST.Single "labels") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 30) - (HsProtobufAST.Prim HsProtobufAST.Bool) - (HsProtobufAST.Single "draft") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 32) - (HsProtobufAST.Prim HsProtobufAST.Bool) - (HsProtobufAST.Single "mergeable") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 50) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "File")) - ) - (HsProtobufAST.Single "changed_files") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 51) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "changed_files_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 60) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Commit")) - ) - (HsProtobufAST.Single "commits") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 61) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "commits_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 70) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "TaskData")) - ) - (HsProtobufAST.Single "task_data") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "state") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 7) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 8) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "target_branch") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 9) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "updated_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "merged_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 15) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "text") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 20) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "additions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 21) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "deletions") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 25) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approval") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 26) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "assignees") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 27) + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 30) + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "draft") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 32) + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "mergeable") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 50) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "File")) + ) + (HsProtobufAST.Single "changed_files") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 51) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "changed_files_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 60) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Commit")) + ) + (HsProtobufAST.Single "commits") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 61) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "commits_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 70) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TaskData")) + ) + (HsProtobufAST.Single "task_data") + [] + "" ] - -instance HsJSONPB.ToJSONPB Change where +instance (HsJSONPB.ToJSONPB Change) where toJSONPB ( Change f1 @@ -3484,105 +3337,120 @@ instance HsJSONPB.ToJSONPB Change where f70 f80 ) = - ( HsJSONPB.object - [ "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "state" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - , "target_branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "author" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "state" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "branch" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + , "target_branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f9) ) - , "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f9 + ) + , "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f10) ) - , "merged_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f10 + ) + , "merged_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f11) ) - , ( let encodeMerged_byM = - ( case f12 of - Hs.Just (ChangeMergedByMMergedBy f12) -> - ( HsJSONPB.pair - "merged_by" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f12)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ( "merged_byM" - .= (HsJSONPB.objectOrNull [encodeMerged_byM] options) - ) - options - else encodeMerged_byM options - ) - , "text" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) - , "additions" .= f20 - , "deletions" .= f21 - , "approval" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f11 + ) + , ( let + encodeMerged_byM = + ( case f12 of + Hs.Just (ChangeMergedByMMergedBy f12) -> + HsJSONPB.pair + "merged_by" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f12) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ("merged_byM" .= HsJSONPB.objectOrNull [encodeMerged_byM] options) + options + else encodeMerged_byM options + ) + ) + , "text" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f15) + , "additions" .= f20 + , "deletions" .= f21 + , "approval" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f25) ) - , "assignees" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f25 + ) + , "assignees" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f26) ) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f26 + ) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f27) ) - , "draft" .= f30 - , "mergeable" .= f32 - , "changed_files" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.File) + f27 + ) + , "draft" .= f30 + , "mergeable" .= f32 + , "changed_files" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.File) @(HsProtobuf.NestedVec Monocle.Protob.Search.File) - (f50) ) - , "changed_files_count" .= f51 - , "commits" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Commit) + f50 + ) + , "changed_files_count" .= f51 + , "commits" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Commit) @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) - (f60) ) - , "commits_count" .= f61 - , "task_data" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) + f60 + ) + , "commits_count" .= f61 + , "task_data" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.TaskData) @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - (f70) ) - , ( let encodeTtm = - ( case f80 of - Hs.Just (ChangeTtmDuration f80) -> (HsJSONPB.pair "duration" f80) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("ttm" .= (HsJSONPB.objectOrNull [encodeTtm] options)) options - else encodeTtm options - ) - ] - ) + f70 + ) + , ( let + encodeTtm = + ( case f80 of + Hs.Just (ChangeTtmDuration f80) -> HsJSONPB.pair "duration" f80 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("ttm" .= HsJSONPB.objectOrNull [encodeTtm] options) options + else encodeTtm options + ) + ) + ] toEncodingPB ( Change f1 @@ -3612,1798 +3480,1788 @@ instance HsJSONPB.ToJSONPB Change where f70 f80 ) = - ( HsJSONPB.pairs - [ "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "title" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f4)) - , "repository_fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f5)) - , "state" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f6)) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) - , "target_branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.pairs + [ "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "author" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "title" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "url" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f4) + , "repository_fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f5) + , "state" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f6) + , "branch" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f7) + , "target_branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f8) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f9) ) - , "updated_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f9 + ) + , "updated_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f10) ) - , "merged_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f10 + ) + , "merged_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f11) ) - , ( let encodeMerged_byM = - ( case f12 of - Hs.Just (ChangeMergedByMMergedBy f12) -> - ( HsJSONPB.pair - "merged_by" - (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f12)) - ) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("merged_byM" .= (HsJSONPB.pairsOrNull [encodeMerged_byM] options)) - options - else encodeMerged_byM options - ) - , "text" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) - , "additions" .= f20 - , "deletions" .= f21 - , "approval" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f11 + ) + , ( let + encodeMerged_byM = + ( case f12 of + Hs.Just (ChangeMergedByMMergedBy f12) -> + HsJSONPB.pair + "merged_by" + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f12) + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then + ("merged_byM" .= HsJSONPB.pairsOrNull [encodeMerged_byM] options) + options + else encodeMerged_byM options + ) + ) + , "text" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f15) + , "additions" .= f20 + , "deletions" .= f21 + , "approval" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f25) ) - , "assignees" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f25 + ) + , "assignees" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f26) ) - , "labels" - .= ( Hs.coerce @(Hs.Vector Hs.Text) + f26 + ) + , "labels" + .= ( ( Hs.coerce + @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) - (f27) ) - , "draft" .= f30 - , "mergeable" .= f32 - , "changed_files" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.File) + f27 + ) + , "draft" .= f30 + , "mergeable" .= f32 + , "changed_files" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.File) @(HsProtobuf.NestedVec Monocle.Protob.Search.File) - (f50) ) - , "changed_files_count" .= f51 - , "commits" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Commit) + f50 + ) + , "changed_files_count" .= f51 + , "commits" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Commit) @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) - (f60) ) - , "commits_count" .= f61 - , "task_data" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) + f60 + ) + , "commits_count" .= f61 + , "task_data" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.TaskData) @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - (f70) ) - , ( let encodeTtm = - ( case f80 of - Hs.Just (ChangeTtmDuration f80) -> (HsJSONPB.pair "duration" f80) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("ttm" .= (HsJSONPB.pairsOrNull [encodeTtm] options)) options - else encodeTtm options - ) - ] - ) - -instance HsJSONPB.FromJSONPB Change where + f70 + ) + , ( let + encodeTtm = + ( case f80 of + Hs.Just (ChangeTtmDuration f80) -> HsJSONPB.pair "duration" f80 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("ttm" .= HsJSONPB.pairsOrNull [encodeTtm] options) options + else encodeTtm options + ) + ) + ] +instance (HsJSONPB.FromJSONPB Change) where parseJSONPB = - ( HsJSONPB.withObject - "Change" - ( \obj -> - (Hs.pure Change) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "change_id") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "author") + HsJSONPB.withObject + "Change" + ( \obj -> + Hs.pure Change + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "change_id") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "author") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "title") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "url") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "repository_fullname") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "state") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "branch") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "target_branch") + ) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "title") + (obj .: "created_at") + ) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "url") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "repository_fullname") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "state") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "branch") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "target_branch") - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "updated_at") - ) - <*> ( HsProtobuf.coerceOver + (obj .: "updated_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "merged_at") ) - <*> ( let parseMerged_byM parseObj = - Hs.msum - [ Hs.Just - Hs.. ChangeMergedByMMergedBy - Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) - <$> (HsJSONPB.parseField parseObj "merged_by") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "merged_byM") - Hs.>>= (HsJSONPB.withObject "merged_byM" parseMerged_byM) - ) - <|> (parseMerged_byM obj) - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "text") - ) - <*> obj .: "additions" - <*> obj .: "deletions" - <*> ( HsProtobuf.coerceOver + (obj .: "merged_at") + ) + <*> ( let + parseMerged_byM parseObj = + Hs.msum + [ Hs.Just + Hs.. ChangeMergedByMMergedBy + Hs.. (Hs.coerce @((HsProtobuf.String Hs.Text)) @Hs.Text) + <$> HsJSONPB.parseField parseObj "merged_by" + , Hs.pure Hs.Nothing + ] + in + ( obj .: "merged_byM" + Hs.>>= HsJSONPB.withObject "merged_byM" parseMerged_byM + ) + <|> (parseMerged_byM obj) + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "text") + ) + <*> obj .: "additions" + <*> obj .: "deletions" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "approval") ) - <*> ( HsProtobuf.coerceOver + (obj .: "approval") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "assignees") ) - <*> ( HsProtobuf.coerceOver + (obj .: "assignees") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) @(Hs.Vector Hs.Text) - (obj .: "labels") ) - <*> obj .: "draft" - <*> obj .: "mergeable" - <*> ( HsProtobuf.coerceOver + (obj .: "labels") + ) + <*> obj .: "draft" + <*> obj .: "mergeable" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.File) @(Hs.Vector Monocle.Protob.Search.File) - (obj .: "changed_files") ) - <*> obj .: "changed_files_count" - <*> ( HsProtobuf.coerceOver + (obj .: "changed_files") + ) + <*> obj .: "changed_files_count" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) @(Hs.Vector Monocle.Protob.Search.Commit) - (obj .: "commits") ) - <*> obj .: "commits_count" - <*> ( HsProtobuf.coerceOver + (obj .: "commits") + ) + <*> obj .: "commits_count" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) @(Hs.Vector Monocle.Protob.Search.TaskData) - (obj .: "task_data") ) - <*> ( let parseTtm parseObj = - Hs.msum - [ Hs.Just Hs.. ChangeTtmDuration - <$> (HsJSONPB.parseField parseObj "duration") - , Hs.pure Hs.Nothing - ] - in ((obj .: "ttm") Hs.>>= (HsJSONPB.withObject "ttm" parseTtm)) - <|> (parseTtm obj) - ) - ) - ) - -instance HsJSONPB.ToJSON Change where + (obj .: "task_data") + ) + <*> ( let + parseTtm parseObj = + Hs.msum + [ Hs.Just Hs.. ChangeTtmDuration + <$> HsJSONPB.parseField parseObj "duration" + , Hs.pure Hs.Nothing + ] + in + (obj .: "ttm" Hs.>>= HsJSONPB.withObject "ttm" parseTtm) + <|> (parseTtm obj) + ) + ) +instance (HsJSONPB.ToJSON Change) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Change where +instance (HsJSONPB.FromJSON Change) where parseJSON = HsJSONPB.parseJSONPB - -data ChangeMergedByM = ChangeMergedByMMergedBy Hs.Text +newtype ChangeMergedByM + = ChangeMergedByMMergedBy Hs.Text deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeMergedByM - -instance HsProtobuf.Named ChangeMergedByM where - nameOf _ = (Hs.fromString "ChangeMergedByM") - -data ChangeTtm = ChangeTtmDuration Hs.Word32 +instance (Hs.NFData ChangeMergedByM) +instance (HsProtobuf.Named ChangeMergedByM) where + nameOf _ = Hs.fromString "ChangeMergedByM" +newtype ChangeTtm + = ChangeTtmDuration Hs.Word32 deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeTtm - -instance HsProtobuf.Named ChangeTtm where - nameOf _ = (Hs.fromString "ChangeTtm") - -newtype Changes = Changes - { changesChanges :: - Hs.Vector Monocle.Protob.Search.Change - } +instance (Hs.NFData ChangeTtm) +instance (HsProtobuf.Named ChangeTtm) where + nameOf _ = Hs.fromString "ChangeTtm" +newtype Changes = Changes {changesChanges :: (Hs.Vector Monocle.Protob.Search.Change)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Changes - -instance HsProtobuf.Named Changes where - nameOf _ = (Hs.fromString "Changes") - -instance HsProtobuf.HasDefault Changes - -instance HsProtobuf.Message Changes where - encodeMessage _ Changes {changesChanges = changesChanges} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Change) - @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) - (changesChanges) - ) +instance (Hs.NFData Changes) +instance (HsProtobuf.Named Changes) where + nameOf _ = Hs.fromString "Changes" +instance (HsProtobuf.HasDefault Changes) +instance (HsProtobuf.Message Changes) where + encodeMessage _ Changes {changesChanges} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Change) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) ) - ] + changesChanges + ) ) decodeMessage _ = - (Hs.pure Changes) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) - @(Hs.Vector Monocle.Protob.Search.Change) + Hs.pure Changes + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) + @(Hs.Vector Monocle.Protob.Search.Change) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "Change")) - ) - (HsProtobufAST.Single "changes") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Change")) + ) + (HsProtobufAST.Single "changes") + [] + "" ] - -instance HsJSONPB.ToJSONPB Changes where +instance (HsJSONPB.ToJSONPB Changes) where toJSONPB (Changes f1) = - ( HsJSONPB.object - [ "changes" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Change) + HsJSONPB.object + [ "changes" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Change) @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (Changes f1) = - ( HsJSONPB.pairs - [ "changes" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Change) + HsJSONPB.pairs + [ "changes" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.Change) @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB Changes where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB Changes) where parseJSONPB = - ( HsJSONPB.withObject - "Changes" - ( \obj -> - (Hs.pure Changes) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "Changes" + ( \obj -> + Hs.pure Changes + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) @(Hs.Vector Monocle.Protob.Search.Change) - (obj .: "changes") ) - ) - ) - -instance HsJSONPB.ToJSON Changes where + (obj .: "changes") + ) + ) +instance (HsJSONPB.ToJSON Changes) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Changes where +instance (HsJSONPB.FromJSON Changes) where parseJSON = HsJSONPB.parseJSONPB - newtype Ratio = Ratio {ratioRatio :: Hs.Float} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData Ratio - -instance HsProtobuf.Named Ratio where - nameOf _ = (Hs.fromString "Ratio") - -instance HsProtobuf.HasDefault Ratio - -instance HsProtobuf.Message Ratio where - encodeMessage _ Ratio {ratioRatio = ratioRatio} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ratioRatio - ) - ] +instance (Hs.NFData Ratio) +instance (HsProtobuf.Named Ratio) where + nameOf _ = Hs.fromString "Ratio" +instance (HsProtobuf.HasDefault Ratio) +instance (HsProtobuf.Message Ratio) where + encodeMessage _ Ratio {ratioRatio} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ratioRatio ) decodeMessage _ = - (Hs.pure Ratio) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) + Hs.pure Ratio + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "ratio") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "ratio") + [] + "" ] - -instance HsJSONPB.ToJSONPB Ratio where - toJSONPB (Ratio f1) = (HsJSONPB.object ["ratio" .= f1]) - toEncodingPB (Ratio f1) = (HsJSONPB.pairs ["ratio" .= f1]) - -instance HsJSONPB.FromJSONPB Ratio where +instance (HsJSONPB.ToJSONPB Ratio) where + toJSONPB (Ratio f1) = HsJSONPB.object ["ratio" .= f1] + toEncodingPB (Ratio f1) = HsJSONPB.pairs ["ratio" .= f1] +instance (HsJSONPB.FromJSONPB Ratio) where parseJSONPB = - ( HsJSONPB.withObject - "Ratio" - (\obj -> (Hs.pure Ratio) <*> obj .: "ratio") - ) - -instance HsJSONPB.ToJSON Ratio where + HsJSONPB.withObject + "Ratio" + (\obj -> Hs.pure Ratio <*> obj .: "ratio") +instance (HsJSONPB.ToJSON Ratio) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON Ratio where +instance (HsJSONPB.FromJSON Ratio) where parseJSON = HsJSONPB.parseJSONPB - data ChangeEvent = ChangeEvent { changeEventId :: Hs.Text , changeEventType :: Hs.Text , changeEventChangeId :: Hs.Text - , changeEventCreatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp - , changeEventOnCreatedAt :: - Hs.Maybe Google.Protobuf.Timestamp.Timestamp + , changeEventCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + , changeEventOnCreatedAt :: (Hs.Maybe Google.Protobuf.Timestamp.Timestamp) , changeEventAuthor :: Hs.Text , changeEventOnAuthor :: Hs.Text , changeEventBranch :: Hs.Text } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeEvent - -instance HsProtobuf.Named ChangeEvent where - nameOf _ = (Hs.fromString "ChangeEvent") - -instance HsProtobuf.HasDefault ChangeEvent - -instance HsProtobuf.Message ChangeEvent where +instance (Hs.NFData ChangeEvent) +instance (HsProtobuf.Named ChangeEvent) where + nameOf _ = Hs.fromString "ChangeEvent" +instance (HsProtobuf.HasDefault ChangeEvent) +instance (HsProtobuf.Message ChangeEvent) where encodeMessage _ ChangeEvent - { changeEventId = changeEventId - , changeEventType = changeEventType - , changeEventChangeId = changeEventChangeId - , changeEventCreatedAt = changeEventCreatedAt - , changeEventOnCreatedAt = changeEventOnCreatedAt - , changeEventAuthor = changeEventAuthor - , changeEventOnAuthor = changeEventOnAuthor - , changeEventBranch = changeEventBranch + { changeEventId + , changeEventType + , changeEventChangeId + , changeEventCreatedAt + , changeEventOnCreatedAt + , changeEventAuthor + , changeEventOnAuthor + , changeEventBranch } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventType) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventChangeId) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeEventCreatedAt) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (changeEventOnCreatedAt) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) changeEventId) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventType + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventChangeId + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeEventCreatedAt + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + ) + changeEventOnCreatedAt + ) + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventAuthor) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventAuthor + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventOnAuthor) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventOnAuthor ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 20) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (changeEventBranch) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 20) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + changeEventBranch ) - ] - ) + ) decodeMessage _ = - (Hs.pure ChangeEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure ChangeEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 20) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "type") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "change_id") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) - ) - ) - ) - (HsProtobufAST.Single "on_created_at") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "on_author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 20) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "branch") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "type") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ) + ) + ) + (HsProtobufAST.Single "on_created_at") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "on_author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 20) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangeEvent where +instance (HsJSONPB.ToJSONPB ChangeEvent) where toJSONPB (ChangeEvent f1 f2 f3 f5 f6 f10 f11 f20) = - ( HsJSONPB.object - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "type" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.object + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "type" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f5) ) - , "on_created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f5 + ) + , "on_created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f6) ) - , "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) - , "on_author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f20)) - ] - ) + f6 + ) + , "author" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f10) + , "on_author" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f11) + , "branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f20) + ] toEncodingPB (ChangeEvent f1 f2 f3 f5 f6 f10 f11 f20) = - ( HsJSONPB.pairs - [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "type" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "change_id" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) - , "created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + HsJSONPB.pairs + [ "id" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "type" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "change_id" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f3) + , "created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f5) ) - , "on_created_at" - .= ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + f5 + ) + , "on_created_at" + .= ( ( Hs.coerce + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - (f6) ) - , "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) - , "on_author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) - , "branch" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f20)) - ] - ) - -instance HsJSONPB.FromJSONPB ChangeEvent where + f6 + ) + , "author" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f10) + , "on_author" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f11) + , "branch" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f20) + ] +instance (HsJSONPB.FromJSONPB ChangeEvent) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeEvent" - ( \obj -> - (Hs.pure ChangeEvent) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "id") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "type") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "change_id") - ) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ChangeEvent" + ( \obj -> + Hs.pure ChangeEvent + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "id") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "type") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "change_id") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "created_at") ) - <*> ( HsProtobuf.coerceOver + (obj .: "created_at") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) - (obj .: "on_created_at") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "author") ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "on_author") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "branch") - ) - ) - ) - -instance HsJSONPB.ToJSON ChangeEvent where + (obj .: "on_created_at") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "author") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "on_author") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "branch") + ) + ) +instance (HsJSONPB.ToJSON ChangeEvent) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeEvent where +instance (HsJSONPB.FromJSON ChangeEvent) where parseJSON = HsJSONPB.parseJSONPB - data ChangeAndEvents = ChangeAndEvents - { changeAndEventsChange :: - Hs.Maybe Monocle.Protob.Search.Change - , changeAndEventsEvents :: - Hs.Vector Monocle.Protob.Search.ChangeEvent + { changeAndEventsChange :: (Hs.Maybe Monocle.Protob.Search.Change) + , changeAndEventsEvents :: (Hs.Vector Monocle.Protob.Search.ChangeEvent) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangeAndEvents - -instance HsProtobuf.Named ChangeAndEvents where - nameOf _ = (Hs.fromString "ChangeAndEvents") - -instance HsProtobuf.HasDefault ChangeAndEvents - -instance HsProtobuf.Message ChangeAndEvents where +instance (Hs.NFData ChangeAndEvents) +instance (HsProtobuf.Named ChangeAndEvents) where + nameOf _ = Hs.fromString "ChangeAndEvents" +instance (HsProtobuf.HasDefault ChangeAndEvents) +instance (HsProtobuf.Message ChangeAndEvents) where encodeMessage _ - ChangeAndEvents - { changeAndEventsChange = changeAndEventsChange - , changeAndEventsEvents = changeAndEventsEvents - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Change) - @(HsProtobuf.Nested Monocle.Protob.Search.Change) - (changeAndEventsChange) - ) + ChangeAndEvents {changeAndEventsChange, changeAndEventsEvents} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Change) + @(HsProtobuf.Nested Monocle.Protob.Search.Change) + ) + changeAndEventsChange ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.ChangeEvent) - @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) - (changeAndEventsEvents) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.ChangeEvent) + @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) + ) + changeAndEventsEvents ) - ] - ) + ) decodeMessage _ = - (Hs.pure ChangeAndEvents) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.Change) - @(Hs.Maybe Monocle.Protob.Search.Change) + Hs.pure ChangeAndEvents + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Change) + @(Hs.Maybe Monocle.Protob.Search.Change) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) - @(Hs.Vector Monocle.Protob.Search.ChangeEvent) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) + @(Hs.Vector Monocle.Protob.Search.ChangeEvent) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "Change")) - ) - (HsProtobufAST.Single "change") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "ChangeEvent")) - ) - (HsProtobufAST.Single "events") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Change")) + ) + (HsProtobufAST.Single "change") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ChangeEvent")) + ) + (HsProtobufAST.Single "events") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangeAndEvents where +instance (HsJSONPB.ToJSONPB ChangeAndEvents) where toJSONPB (ChangeAndEvents f1 f2) = - ( HsJSONPB.object - [ "change" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Change) + HsJSONPB.object + [ "change" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Change) @(HsProtobuf.Nested Monocle.Protob.Search.Change) - (f1) ) - , "events" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.ChangeEvent) + f1 + ) + , "events" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.ChangeEvent) @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) - (f2) ) - ] - ) + f2 + ) + ] toEncodingPB (ChangeAndEvents f1 f2) = - ( HsJSONPB.pairs - [ "change" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Change) + HsJSONPB.pairs + [ "change" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Change) @(HsProtobuf.Nested Monocle.Protob.Search.Change) - (f1) ) - , "events" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.ChangeEvent) + f1 + ) + , "events" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.ChangeEvent) @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) - (f2) ) - ] - ) - -instance HsJSONPB.FromJSONPB ChangeAndEvents where + f2 + ) + ] +instance (HsJSONPB.FromJSONPB ChangeAndEvents) where parseJSONPB = - ( HsJSONPB.withObject - "ChangeAndEvents" - ( \obj -> - (Hs.pure ChangeAndEvents) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ChangeAndEvents" + ( \obj -> + Hs.pure ChangeAndEvents + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Search.Change) @(Hs.Maybe Monocle.Protob.Search.Change) - (obj .: "change") ) - <*> ( HsProtobuf.coerceOver + (obj .: "change") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) @(Hs.Vector Monocle.Protob.Search.ChangeEvent) - (obj .: "events") ) - ) - ) - -instance HsJSONPB.ToJSON ChangeAndEvents where + (obj .: "events") + ) + ) +instance (HsJSONPB.ToJSON ChangeAndEvents) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangeAndEvents where +instance (HsJSONPB.FromJSON ChangeAndEvents) where parseJSON = HsJSONPB.parseJSONPB - data ReviewCount = ReviewCount - { reviewCountAuthorsCount :: - Hs.Word32 + { reviewCountAuthorsCount :: Hs.Word32 , reviewCountEventsCount :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ReviewCount - -instance HsProtobuf.Named ReviewCount where - nameOf _ = (Hs.fromString "ReviewCount") - -instance HsProtobuf.HasDefault ReviewCount - -instance HsProtobuf.Message ReviewCount where +instance (Hs.NFData ReviewCount) +instance (HsProtobuf.Named ReviewCount) where + nameOf _ = Hs.fromString "ReviewCount" +instance (HsProtobuf.HasDefault ReviewCount) +instance (HsProtobuf.Message ReviewCount) where encodeMessage _ - ReviewCount - { reviewCountAuthorsCount = reviewCountAuthorsCount - , reviewCountEventsCount = reviewCountEventsCount - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - reviewCountAuthorsCount - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - reviewCountEventsCount - ) - ] - ) + ReviewCount {reviewCountAuthorsCount, reviewCountEventsCount} = + Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + reviewCountAuthorsCount + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + reviewCountEventsCount + ) decodeMessage _ = - (Hs.pure ReviewCount) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) + Hs.pure ReviewCount + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "authors_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "events_count") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "authors_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "events_count") + [] + "" ] - -instance HsJSONPB.ToJSONPB ReviewCount where +instance (HsJSONPB.ToJSONPB ReviewCount) where toJSONPB (ReviewCount f1 f2) = - (HsJSONPB.object ["authors_count" .= f1, "events_count" .= f2]) + HsJSONPB.object ["authors_count" .= f1, "events_count" .= f2] toEncodingPB (ReviewCount f1 f2) = - (HsJSONPB.pairs ["authors_count" .= f1, "events_count" .= f2]) - -instance HsJSONPB.FromJSONPB ReviewCount where + HsJSONPB.pairs ["authors_count" .= f1, "events_count" .= f2] +instance (HsJSONPB.FromJSONPB ReviewCount) where parseJSONPB = - ( HsJSONPB.withObject - "ReviewCount" - ( \obj -> - (Hs.pure ReviewCount) - <*> obj .: "authors_count" - <*> obj .: "events_count" - ) - ) - -instance HsJSONPB.ToJSON ReviewCount where + HsJSONPB.withObject + "ReviewCount" + ( \obj -> + Hs.pure ReviewCount + <*> obj .: "authors_count" + <*> obj .: "events_count" + ) +instance (HsJSONPB.ToJSON ReviewCount) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ReviewCount where +instance (HsJSONPB.FromJSON ReviewCount) where parseJSON = HsJSONPB.parseJSONPB - data ReviewStats = ReviewStats - { reviewStatsCommentCount :: - Hs.Maybe Monocle.Protob.Search.ReviewCount - , reviewStatsReviewCount :: - Hs.Maybe Monocle.Protob.Search.ReviewCount + { reviewStatsCommentCount :: (Hs.Maybe Monocle.Protob.Search.ReviewCount) + , reviewStatsReviewCount :: (Hs.Maybe Monocle.Protob.Search.ReviewCount) , reviewStatsCommentDelay :: Hs.Word32 , reviewStatsReviewDelay :: Hs.Word32 - , reviewStatsCommentHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , reviewStatsReviewHisto :: Hs.Vector Monocle.Protob.Metric.HistoInt + , reviewStatsCommentHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , reviewStatsReviewHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ReviewStats - -instance HsProtobuf.Named ReviewStats where - nameOf _ = (Hs.fromString "ReviewStats") - -instance HsProtobuf.HasDefault ReviewStats - -instance HsProtobuf.Message ReviewStats where +instance (Hs.NFData ReviewStats) +instance (HsProtobuf.Named ReviewStats) where + nameOf _ = Hs.fromString "ReviewStats" +instance (HsProtobuf.HasDefault ReviewStats) +instance (HsProtobuf.Message ReviewStats) where encodeMessage _ ReviewStats - { reviewStatsCommentCount = reviewStatsCommentCount - , reviewStatsReviewCount = reviewStatsReviewCount - , reviewStatsCommentDelay = reviewStatsCommentDelay - , reviewStatsReviewDelay = reviewStatsReviewDelay - , reviewStatsCommentHisto = reviewStatsCommentHisto - , reviewStatsReviewHisto = reviewStatsReviewHisto + { reviewStatsCommentCount + , reviewStatsReviewCount + , reviewStatsCommentDelay + , reviewStatsReviewDelay + , reviewStatsCommentHisto + , reviewStatsReviewHisto } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (reviewStatsCommentCount) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + ) + reviewStatsCommentCount + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + ) + reviewStatsReviewCount + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + reviewStatsCommentDelay + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + reviewStatsReviewDelay ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (reviewStatsReviewCount) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - reviewStatsCommentDelay - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - reviewStatsReviewDelay - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (reviewStatsCommentHisto) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + reviewStatsCommentHisto ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (reviewStatsReviewHisto) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 11) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + reviewStatsReviewHisto ) - ] - ) + ) decodeMessage _ = - (Hs.pure ReviewStats) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + Hs.pure ReviewStats + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 6) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 5) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 6) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) - ) - (HsProtobufAST.Single "comment_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) - ) - (HsProtobufAST.Single "review_count") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "comment_delay") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "review_delay") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "comment_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "review_histo") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) + ) + (HsProtobufAST.Single "comment_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) + ) + (HsProtobufAST.Single "review_count") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "comment_delay") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "review_delay") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "comment_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "review_histo") + [] + "" ] - -instance HsJSONPB.ToJSONPB ReviewStats where +instance (HsJSONPB.ToJSONPB ReviewStats) where toJSONPB (ReviewStats f1 f2 f5 f6 f10 f11) = - ( HsJSONPB.object - [ "comment_count" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + HsJSONPB.object + [ "comment_count" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (f1) ) - , "review_count" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + f1 + ) + , "review_count" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (f2) ) - , "comment_delay" .= f5 - , "review_delay" .= f6 - , "comment_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f2 + ) + , "comment_delay" .= f5 + , "review_delay" .= f6 + , "comment_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f10) ) - , "review_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f10 + ) + , "review_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f11) ) - ] - ) + f11 + ) + ] toEncodingPB (ReviewStats f1 f2 f5 f6 f10 f11) = - ( HsJSONPB.pairs - [ "comment_count" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + HsJSONPB.pairs + [ "comment_count" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (f1) ) - , "review_count" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + f1 + ) + , "review_count" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (f2) ) - , "comment_delay" .= f5 - , "review_delay" .= f6 - , "comment_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f2 + ) + , "comment_delay" .= f5 + , "review_delay" .= f6 + , "comment_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f10) ) - , "review_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f10 + ) + , "review_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f11) ) - ] - ) - -instance HsJSONPB.FromJSONPB ReviewStats where + f11 + ) + ] +instance (HsJSONPB.FromJSONPB ReviewStats) where parseJSONPB = - ( HsJSONPB.withObject - "ReviewStats" - ( \obj -> - (Hs.pure ReviewStats) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ReviewStats" + ( \obj -> + Hs.pure ReviewStats + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) @(Hs.Maybe Monocle.Protob.Search.ReviewCount) - (obj .: "comment_count") ) - <*> ( HsProtobuf.coerceOver + (obj .: "comment_count") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) @(Hs.Maybe Monocle.Protob.Search.ReviewCount) - (obj .: "review_count") ) - <*> obj .: "comment_delay" - <*> obj .: "review_delay" - <*> ( HsProtobuf.coerceOver + (obj .: "review_count") + ) + <*> obj .: "comment_delay" + <*> obj .: "review_delay" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "comment_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "comment_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "review_histo") ) - ) - ) - -instance HsJSONPB.ToJSON ReviewStats where + (obj .: "review_histo") + ) + ) +instance (HsJSONPB.ToJSON ReviewStats) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ReviewStats where +instance (HsJSONPB.FromJSON ReviewStats) where parseJSON = HsJSONPB.parseJSONPB - data ActivityStats = ActivityStats - { activityStatsChangeAuthors :: - Hs.Word32 + { activityStatsChangeAuthors :: Hs.Word32 , activityStatsCommentAuthors :: Hs.Word32 , activityStatsReviewAuthors :: Hs.Word32 - , activityStatsCommentsHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , activityStatsReviewsHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , activityStatsChangesHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt + , activityStatsCommentsHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , activityStatsReviewsHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , activityStatsChangesHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ActivityStats - -instance HsProtobuf.Named ActivityStats where - nameOf _ = (Hs.fromString "ActivityStats") - -instance HsProtobuf.HasDefault ActivityStats - -instance HsProtobuf.Message ActivityStats where +instance (Hs.NFData ActivityStats) +instance (HsProtobuf.Named ActivityStats) where + nameOf _ = Hs.fromString "ActivityStats" +instance (HsProtobuf.HasDefault ActivityStats) +instance (HsProtobuf.Message ActivityStats) where encodeMessage _ ActivityStats - { activityStatsChangeAuthors = - activityStatsChangeAuthors - , activityStatsCommentAuthors = activityStatsCommentAuthors - , activityStatsReviewAuthors = activityStatsReviewAuthors - , activityStatsCommentsHisto = activityStatsCommentsHisto - , activityStatsReviewsHisto = activityStatsReviewsHisto - , activityStatsChangesHisto = activityStatsChangesHisto + { activityStatsChangeAuthors + , activityStatsCommentAuthors + , activityStatsReviewAuthors + , activityStatsCommentsHisto + , activityStatsReviewsHisto + , activityStatsChangesHisto } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - activityStatsChangeAuthors - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - activityStatsCommentAuthors - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - activityStatsReviewAuthors - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 10) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (activityStatsCommentsHisto) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + activityStatsChangeAuthors + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + activityStatsCommentAuthors + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + activityStatsReviewAuthors + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 10) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + activityStatsCommentsHisto + ) ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (activityStatsReviewsHisto) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + activityStatsReviewsHisto ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 12) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (activityStatsChangesHisto) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 12) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + activityStatsChangesHisto ) - ] - ) + ) decodeMessage _ = - (Hs.pure ActivityStats) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) - ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + Hs.pure ActivityStats + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 12) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "change_authors") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "comment_authors") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "review_authors") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 10) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "comments_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "reviews_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 12) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "changes_histo") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "change_authors") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "comment_authors") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "review_authors") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 10) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "comments_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "reviews_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 12) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "changes_histo") + [] + "" ] - -instance HsJSONPB.ToJSONPB ActivityStats where +instance (HsJSONPB.ToJSONPB ActivityStats) where toJSONPB (ActivityStats f1 f2 f3 f10 f11 f12) = - ( HsJSONPB.object - [ "change_authors" .= f1 - , "comment_authors" .= f2 - , "review_authors" .= f3 - , "comments_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + HsJSONPB.object + [ "change_authors" .= f1 + , "comment_authors" .= f2 + , "review_authors" .= f3 + , "comments_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f10) ) - , "reviews_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f10 + ) + , "reviews_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f11) ) - , "changes_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f11 + ) + , "changes_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f12) ) - ] - ) + f12 + ) + ] toEncodingPB (ActivityStats f1 f2 f3 f10 f11 f12) = - ( HsJSONPB.pairs - [ "change_authors" .= f1 - , "comment_authors" .= f2 - , "review_authors" .= f3 - , "comments_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + HsJSONPB.pairs + [ "change_authors" .= f1 + , "comment_authors" .= f2 + , "review_authors" .= f3 + , "comments_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f10) ) - , "reviews_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f10 + ) + , "reviews_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f11) ) - , "changes_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f11 + ) + , "changes_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f12) ) - ] - ) - -instance HsJSONPB.FromJSONPB ActivityStats where + f12 + ) + ] +instance (HsJSONPB.FromJSONPB ActivityStats) where parseJSONPB = - ( HsJSONPB.withObject - "ActivityStats" - ( \obj -> - (Hs.pure ActivityStats) - <*> obj .: "change_authors" - <*> obj .: "comment_authors" - <*> obj .: "review_authors" - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ActivityStats" + ( \obj -> + Hs.pure ActivityStats + <*> obj .: "change_authors" + <*> obj .: "comment_authors" + <*> obj .: "review_authors" + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "comments_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "comments_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "reviews_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "reviews_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "changes_histo") ) - ) - ) - -instance HsJSONPB.ToJSON ActivityStats where + (obj .: "changes_histo") + ) + ) +instance (HsJSONPB.ToJSON ActivityStats) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ActivityStats where +instance (HsJSONPB.FromJSON ActivityStats) where parseJSON = HsJSONPB.parseJSONPB - -newtype QueryResponse = QueryResponse - { queryResponseResult :: - Hs.Maybe QueryResponseResult - } +newtype QueryResponse = QueryResponse {queryResponseResult :: (Hs.Maybe QueryResponseResult)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData QueryResponse - -instance HsProtobuf.Named QueryResponse where - nameOf _ = (Hs.fromString "QueryResponse") - -instance HsProtobuf.HasDefault QueryResponse - -instance HsProtobuf.Message QueryResponse where - encodeMessage - _ - QueryResponse {queryResponseResult = queryResponseResult} = - ( Hs.mconcat - [ case queryResponseResult of - Hs.Nothing -> Hs.mempty - Hs.Just x -> - case x of - QueryResponseResultError y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.QueryError) - @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) - (Hs.Just y) - ) - ) - QueryResponseResultChanges y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Changes) - @(HsProtobuf.Nested Monocle.Protob.Search.Changes) - (Hs.Just y) - ) - ) - QueryResponseResultReposSummary y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReposSummary) - @(HsProtobuf.Nested Monocle.Protob.Search.ReposSummary) - (Hs.Just y) - ) - ) - QueryResponseResultTopAuthors y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (Hs.Just y) - ) - ) - QueryResponseResultAuthorsPeers y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.AuthorsPeers) - @(HsProtobuf.Nested Monocle.Protob.Search.AuthorsPeers) - (Hs.Just y) - ) - ) - QueryResponseResultNewAuthors y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (Hs.Just y) - ) - ) - QueryResponseResultReviewStats y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 20) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewStats) - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewStats) - (Hs.Just y) - ) - ) - QueryResponseResultLifecycleStats y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 21) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.LifecycleStats) - @(HsProtobuf.Nested Monocle.Protob.Search.LifecycleStats) - (Hs.Just y) - ) - ) - QueryResponseResultActivityStats y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 22) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ActivityStats) - @(HsProtobuf.Nested Monocle.Protob.Search.ActivityStats) - (Hs.Just y) - ) - ) - QueryResponseResultChangeEvents y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 30) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ChangeAndEvents) - @(HsProtobuf.Nested Monocle.Protob.Search.ChangeAndEvents) - (Hs.Just y) - ) - ) - QueryResponseResultChangesTops y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 31) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ChangesTops) - @(HsProtobuf.Nested Monocle.Protob.Search.ChangesTops) - (Hs.Just y) - ) - ) - QueryResponseResultRatio y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 40) - (HsProtobuf.ForceEmit y) - ) - QueryResponseResultHisto y -> - ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 50) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) - (Hs.Just y) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure QueryResponse) - <*> ( HsProtobuf.oneof - Hs.Nothing - [ - ( (HsProtobuf.FieldNumber 1) - , (Hs.pure (Hs.fmap QueryResponseResultError)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) - @(Hs.Maybe Monocle.Protob.Search.QueryError) - (HsProtobuf.decodeMessageField) - ) +instance (Hs.NFData QueryResponse) +instance (HsProtobuf.Named QueryResponse) where + nameOf _ = Hs.fromString "QueryResponse" +instance (HsProtobuf.HasDefault QueryResponse) +instance (HsProtobuf.Message QueryResponse) where + encodeMessage _ QueryResponse {queryResponseResult} = + ( case queryResponseResult of + Hs.Nothing -> Hs.mempty + Hs.Just x -> + case x of + QueryResponseResultError y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.QueryError) + @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 2) - , (Hs.pure (Hs.fmap QueryResponseResultChanges)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.Changes) - @(Hs.Maybe Monocle.Protob.Search.Changes) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultChanges y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.Changes) + @(HsProtobuf.Nested Monocle.Protob.Search.Changes) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 3) - , (Hs.pure (Hs.fmap QueryResponseResultReposSummary)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ReposSummary) - @(Hs.Maybe Monocle.Protob.Search.ReposSummary) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultReposSummary y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReposSummary) + @(HsProtobuf.Nested Monocle.Protob.Search.ReposSummary) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 4) - , (Hs.pure (Hs.fmap QueryResponseResultTopAuthors)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultTopAuthors y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 5) - , (Hs.pure (Hs.fmap QueryResponseResultAuthorsPeers)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.AuthorsPeers) - @(Hs.Maybe Monocle.Protob.Search.AuthorsPeers) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultAuthorsPeers y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.AuthorsPeers) + @(HsProtobuf.Nested Monocle.Protob.Search.AuthorsPeers) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 6) - , (Hs.pure (Hs.fmap QueryResponseResultNewAuthors)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultNewAuthors y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 20) - , (Hs.pure (Hs.fmap QueryResponseResultReviewStats)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewStats) - @(Hs.Maybe Monocle.Protob.Search.ReviewStats) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultReviewStats y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 20) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewStats) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewStats) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 21) - , (Hs.pure (Hs.fmap QueryResponseResultLifecycleStats)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.LifecycleStats) - @(Hs.Maybe Monocle.Protob.Search.LifecycleStats) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultLifecycleStats y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 21) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.LifecycleStats) + @(HsProtobuf.Nested Monocle.Protob.Search.LifecycleStats) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 22) - , (Hs.pure (Hs.fmap QueryResponseResultActivityStats)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ActivityStats) - @(Hs.Maybe Monocle.Protob.Search.ActivityStats) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultActivityStats y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 22) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ActivityStats) + @(HsProtobuf.Nested Monocle.Protob.Search.ActivityStats) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 30) - , (Hs.pure (Hs.fmap QueryResponseResultChangeEvents)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ChangeAndEvents) - @(Hs.Maybe Monocle.Protob.Search.ChangeAndEvents) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultChangeEvents y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 30) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ChangeAndEvents) + @(HsProtobuf.Nested Monocle.Protob.Search.ChangeAndEvents) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 31) - , (Hs.pure (Hs.fmap QueryResponseResultChangesTops)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ChangesTops) - @(Hs.Maybe Monocle.Protob.Search.ChangesTops) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultChangesTops y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 31) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ChangesTops) + @(HsProtobuf.Nested Monocle.Protob.Search.ChangesTops) + ) + (Hs.Just y) ) - , - ( (HsProtobuf.FieldNumber 40) - , (Hs.pure (Hs.Just Hs.. QueryResponseResultRatio)) - <*> HsProtobuf.decodeMessageField - ) - , - ( (HsProtobuf.FieldNumber 50) - , (Hs.pure (Hs.fmap QueryResponseResultHisto)) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) - @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) - (HsProtobuf.decodeMessageField) - ) + QueryResponseResultRatio y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 40) + (HsProtobuf.ForceEmit y) + QueryResponseResultHisto y -> + HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 50) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) + ) + (Hs.Just y) ) - ] + ) + decodeMessage _ = + Hs.pure QueryResponse + <*> HsProtobuf.oneof + Hs.Nothing + [ + ( (HsProtobuf.FieldNumber 1) + , Hs.pure (Hs.fmap QueryResponseResultError) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) + @(Hs.Maybe Monocle.Protob.Search.QueryError) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 2) + , Hs.pure (Hs.fmap QueryResponseResultChanges) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Changes) + @(Hs.Maybe Monocle.Protob.Search.Changes) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 3) + , Hs.pure (Hs.fmap QueryResponseResultReposSummary) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReposSummary) + @(Hs.Maybe Monocle.Protob.Search.ReposSummary) + ) + HsProtobuf.decodeMessageField + ) ) + , + ( (HsProtobuf.FieldNumber 4) + , Hs.pure (Hs.fmap QueryResponseResultTopAuthors) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 5) + , Hs.pure (Hs.fmap QueryResponseResultAuthorsPeers) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.AuthorsPeers) + @(Hs.Maybe Monocle.Protob.Search.AuthorsPeers) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 6) + , Hs.pure (Hs.fmap QueryResponseResultNewAuthors) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 20) + , Hs.pure (Hs.fmap QueryResponseResultReviewStats) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewStats) + @(Hs.Maybe Monocle.Protob.Search.ReviewStats) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 21) + , Hs.pure (Hs.fmap QueryResponseResultLifecycleStats) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.LifecycleStats) + @(Hs.Maybe Monocle.Protob.Search.LifecycleStats) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 22) + , Hs.pure (Hs.fmap QueryResponseResultActivityStats) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ActivityStats) + @(Hs.Maybe Monocle.Protob.Search.ActivityStats) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 30) + , Hs.pure (Hs.fmap QueryResponseResultChangeEvents) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ChangeAndEvents) + @(Hs.Maybe Monocle.Protob.Search.ChangeAndEvents) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 31) + , Hs.pure (Hs.fmap QueryResponseResultChangesTops) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ChangesTops) + @(Hs.Maybe Monocle.Protob.Search.ChangesTops) + ) + HsProtobuf.decodeMessageField + ) + ) + , + ( (HsProtobuf.FieldNumber 40) + , Hs.pure (Hs.Just Hs.. QueryResponseResultRatio) + <*> HsProtobuf.decodeMessageField + ) + , + ( (HsProtobuf.FieldNumber 50) + , Hs.pure (Hs.fmap QueryResponseResultHisto) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) + ) + HsProtobuf.decodeMessageField + ) + ) + ] dotProto _ = [] - -instance HsJSONPB.ToJSONPB QueryResponse where +instance (HsJSONPB.ToJSONPB QueryResponse) where toJSONPB - ( QueryResponse - f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50 - ) = - ( HsJSONPB.object - [ ( let encodeResult = - ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50 of - Hs.Just (QueryResponseResultError f1) -> (HsJSONPB.pair "error" f1) - Hs.Just (QueryResponseResultChanges f2) -> - (HsJSONPB.pair "changes" f2) - Hs.Just (QueryResponseResultReposSummary f3) -> - (HsJSONPB.pair "repos_summary" f3) - Hs.Just (QueryResponseResultTopAuthors f4) -> - (HsJSONPB.pair "top_authors" f4) - Hs.Just (QueryResponseResultAuthorsPeers f5) -> - (HsJSONPB.pair "authors_peers" f5) - Hs.Just (QueryResponseResultNewAuthors f6) -> - (HsJSONPB.pair "new_authors" f6) - Hs.Just (QueryResponseResultReviewStats f20) -> - (HsJSONPB.pair "review_stats" f20) - Hs.Just (QueryResponseResultLifecycleStats f21) -> - (HsJSONPB.pair "lifecycle_stats" f21) - Hs.Just (QueryResponseResultActivityStats f22) -> - (HsJSONPB.pair "activity_stats" f22) - Hs.Just (QueryResponseResultChangeEvents f30) -> - (HsJSONPB.pair "change_events" f30) - Hs.Just (QueryResponseResultChangesTops f31) -> - (HsJSONPB.pair "changes_tops" f31) - Hs.Just (QueryResponseResultRatio f40) -> - (HsJSONPB.pair "ratio" f40) - Hs.Just (QueryResponseResultHisto f50) -> - (HsJSONPB.pair "histo" f50) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then - ("result" .= (HsJSONPB.objectOrNull [encodeResult] options)) - options - else encodeResult options - ) - ] - ) + (QueryResponse f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50) = + HsJSONPB.object + [ ( let + encodeResult = + ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50 of + Hs.Just (QueryResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Just (QueryResponseResultChanges f2) -> + HsJSONPB.pair "changes" f2 + Hs.Just (QueryResponseResultReposSummary f3) -> + HsJSONPB.pair "repos_summary" f3 + Hs.Just (QueryResponseResultTopAuthors f4) -> + HsJSONPB.pair "top_authors" f4 + Hs.Just (QueryResponseResultAuthorsPeers f5) -> + HsJSONPB.pair "authors_peers" f5 + Hs.Just (QueryResponseResultNewAuthors f6) -> + HsJSONPB.pair "new_authors" f6 + Hs.Just (QueryResponseResultReviewStats f20) -> + HsJSONPB.pair "review_stats" f20 + Hs.Just (QueryResponseResultLifecycleStats f21) -> + HsJSONPB.pair "lifecycle_stats" f21 + Hs.Just (QueryResponseResultActivityStats f22) -> + HsJSONPB.pair "activity_stats" f22 + Hs.Just (QueryResponseResultChangeEvents f30) -> + HsJSONPB.pair "change_events" f30 + Hs.Just (QueryResponseResultChangesTops f31) -> + HsJSONPB.pair "changes_tops" f31 + Hs.Just (QueryResponseResultRatio f40) -> HsJSONPB.pair "ratio" f40 + Hs.Just (QueryResponseResultHisto f50) -> HsJSONPB.pair "histo" f50 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.objectOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] toEncodingPB - ( QueryResponse - f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50 - ) = - ( HsJSONPB.pairs - [ ( let encodeResult = - ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50 of - Hs.Just (QueryResponseResultError f1) -> (HsJSONPB.pair "error" f1) - Hs.Just (QueryResponseResultChanges f2) -> - (HsJSONPB.pair "changes" f2) - Hs.Just (QueryResponseResultReposSummary f3) -> - (HsJSONPB.pair "repos_summary" f3) - Hs.Just (QueryResponseResultTopAuthors f4) -> - (HsJSONPB.pair "top_authors" f4) - Hs.Just (QueryResponseResultAuthorsPeers f5) -> - (HsJSONPB.pair "authors_peers" f5) - Hs.Just (QueryResponseResultNewAuthors f6) -> - (HsJSONPB.pair "new_authors" f6) - Hs.Just (QueryResponseResultReviewStats f20) -> - (HsJSONPB.pair "review_stats" f20) - Hs.Just (QueryResponseResultLifecycleStats f21) -> - (HsJSONPB.pair "lifecycle_stats" f21) - Hs.Just (QueryResponseResultActivityStats f22) -> - (HsJSONPB.pair "activity_stats" f22) - Hs.Just (QueryResponseResultChangeEvents f30) -> - (HsJSONPB.pair "change_events" f30) - Hs.Just (QueryResponseResultChangesTops f31) -> - (HsJSONPB.pair "changes_tops" f31) - Hs.Just (QueryResponseResultRatio f40) -> - (HsJSONPB.pair "ratio" f40) - Hs.Just (QueryResponseResultHisto f50) -> - (HsJSONPB.pair "histo" f50) - Hs.Nothing -> Hs.mempty - ) - in \options -> - if HsJSONPB.optEmitNamedOneof options - then ("result" .= (HsJSONPB.pairsOrNull [encodeResult] options)) options - else encodeResult options - ) - ] - ) - -instance HsJSONPB.FromJSONPB QueryResponse where + (QueryResponse f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50) = + HsJSONPB.pairs + [ ( let + encodeResult = + ( case f1_or_f2_or_f3_or_f4_or_f5_or_f6_or_f20_or_f21_or_f22_or_f30_or_f31_or_f40_or_f50 of + Hs.Just (QueryResponseResultError f1) -> HsJSONPB.pair "error" f1 + Hs.Just (QueryResponseResultChanges f2) -> + HsJSONPB.pair "changes" f2 + Hs.Just (QueryResponseResultReposSummary f3) -> + HsJSONPB.pair "repos_summary" f3 + Hs.Just (QueryResponseResultTopAuthors f4) -> + HsJSONPB.pair "top_authors" f4 + Hs.Just (QueryResponseResultAuthorsPeers f5) -> + HsJSONPB.pair "authors_peers" f5 + Hs.Just (QueryResponseResultNewAuthors f6) -> + HsJSONPB.pair "new_authors" f6 + Hs.Just (QueryResponseResultReviewStats f20) -> + HsJSONPB.pair "review_stats" f20 + Hs.Just (QueryResponseResultLifecycleStats f21) -> + HsJSONPB.pair "lifecycle_stats" f21 + Hs.Just (QueryResponseResultActivityStats f22) -> + HsJSONPB.pair "activity_stats" f22 + Hs.Just (QueryResponseResultChangeEvents f30) -> + HsJSONPB.pair "change_events" f30 + Hs.Just (QueryResponseResultChangesTops f31) -> + HsJSONPB.pair "changes_tops" f31 + Hs.Just (QueryResponseResultRatio f40) -> HsJSONPB.pair "ratio" f40 + Hs.Just (QueryResponseResultHisto f50) -> HsJSONPB.pair "histo" f50 + Hs.Nothing -> Hs.mempty + ) + in + ( \options -> + if HsJSONPB.optEmitNamedOneof options + then ("result" .= HsJSONPB.pairsOrNull [encodeResult] options) options + else encodeResult options + ) + ) + ] +instance (HsJSONPB.FromJSONPB QueryResponse) where parseJSONPB = - ( HsJSONPB.withObject - "QueryResponse" - ( \obj -> - (Hs.pure QueryResponse) - <*> ( let parseResult parseObj = - Hs.msum - [ Hs.Just Hs.. QueryResponseResultError - <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. QueryResponseResultChanges - <$> (HsJSONPB.parseField parseObj "changes") - , Hs.Just Hs.. QueryResponseResultReposSummary - <$> (HsJSONPB.parseField parseObj "repos_summary") - , Hs.Just Hs.. QueryResponseResultTopAuthors - <$> (HsJSONPB.parseField parseObj "top_authors") - , Hs.Just Hs.. QueryResponseResultAuthorsPeers - <$> (HsJSONPB.parseField parseObj "authors_peers") - , Hs.Just Hs.. QueryResponseResultNewAuthors - <$> (HsJSONPB.parseField parseObj "new_authors") - , Hs.Just Hs.. QueryResponseResultReviewStats - <$> (HsJSONPB.parseField parseObj "review_stats") - , Hs.Just Hs.. QueryResponseResultLifecycleStats - <$> (HsJSONPB.parseField parseObj "lifecycle_stats") - , Hs.Just Hs.. QueryResponseResultActivityStats - <$> (HsJSONPB.parseField parseObj "activity_stats") - , Hs.Just Hs.. QueryResponseResultChangeEvents - <$> (HsJSONPB.parseField parseObj "change_events") - , Hs.Just Hs.. QueryResponseResultChangesTops - <$> (HsJSONPB.parseField parseObj "changes_tops") - , Hs.Just Hs.. QueryResponseResultRatio - <$> (HsJSONPB.parseField parseObj "ratio") - , Hs.Just Hs.. QueryResponseResultHisto - <$> (HsJSONPB.parseField parseObj "histo") - , Hs.pure Hs.Nothing - ] - in ( (obj .: "result") - Hs.>>= (HsJSONPB.withObject "result" parseResult) - ) - <|> (parseResult obj) - ) - ) - ) - -instance HsJSONPB.ToJSON QueryResponse where + HsJSONPB.withObject + "QueryResponse" + ( \obj -> + Hs.pure QueryResponse + <*> ( let + parseResult parseObj = + Hs.msum + [ Hs.Just Hs.. QueryResponseResultError + <$> HsJSONPB.parseField parseObj "error" + , Hs.Just Hs.. QueryResponseResultChanges + <$> HsJSONPB.parseField parseObj "changes" + , Hs.Just Hs.. QueryResponseResultReposSummary + <$> HsJSONPB.parseField parseObj "repos_summary" + , Hs.Just Hs.. QueryResponseResultTopAuthors + <$> HsJSONPB.parseField parseObj "top_authors" + , Hs.Just Hs.. QueryResponseResultAuthorsPeers + <$> HsJSONPB.parseField parseObj "authors_peers" + , Hs.Just Hs.. QueryResponseResultNewAuthors + <$> HsJSONPB.parseField parseObj "new_authors" + , Hs.Just Hs.. QueryResponseResultReviewStats + <$> HsJSONPB.parseField parseObj "review_stats" + , Hs.Just Hs.. QueryResponseResultLifecycleStats + <$> HsJSONPB.parseField parseObj "lifecycle_stats" + , Hs.Just Hs.. QueryResponseResultActivityStats + <$> HsJSONPB.parseField parseObj "activity_stats" + , Hs.Just Hs.. QueryResponseResultChangeEvents + <$> HsJSONPB.parseField parseObj "change_events" + , Hs.Just Hs.. QueryResponseResultChangesTops + <$> HsJSONPB.parseField parseObj "changes_tops" + , Hs.Just Hs.. QueryResponseResultRatio + <$> HsJSONPB.parseField parseObj "ratio" + , Hs.Just Hs.. QueryResponseResultHisto + <$> HsJSONPB.parseField parseObj "histo" + , Hs.pure Hs.Nothing + ] + in + (obj .: "result" Hs.>>= HsJSONPB.withObject "result" parseResult) + <|> (parseResult obj) + ) + ) +instance (HsJSONPB.ToJSON QueryResponse) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON QueryResponse where +instance (HsJSONPB.FromJSON QueryResponse) where parseJSON = HsJSONPB.parseJSONPB - data QueryResponseResult = QueryResponseResultError Monocle.Protob.Search.QueryError | QueryResponseResultChanges Monocle.Protob.Search.Changes @@ -5419,23 +5277,15 @@ data QueryResponseResult | QueryResponseResultRatio Hs.Float | QueryResponseResultHisto Monocle.Protob.Metric.HistoIntStat deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData QueryResponseResult - -instance HsProtobuf.Named QueryResponseResult where - nameOf _ = (Hs.fromString "QueryResponseResult") - +instance (Hs.NFData QueryResponseResult) +instance (HsProtobuf.Named QueryResponseResult) where + nameOf _ = Hs.fromString "QueryResponseResult" data LifecycleStats = LifecycleStats - { lifecycleStatsCreatedHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , lifecycleStatsUpdatedHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , lifecycleStatsMergedHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , lifecycleStatsAbandonedHisto :: - Hs.Vector Monocle.Protob.Metric.HistoInt - , lifecycleStatsCreated :: - Hs.Maybe Monocle.Protob.Search.ReviewCount + { lifecycleStatsCreatedHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , lifecycleStatsUpdatedHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , lifecycleStatsMergedHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , lifecycleStatsAbandonedHisto :: (Hs.Vector Monocle.Protob.Metric.HistoInt) + , lifecycleStatsCreated :: (Hs.Maybe Monocle.Protob.Search.ReviewCount) , lifecycleStatsAbandoned :: Hs.Word32 , lifecycleStatsMerged :: Hs.Word32 , lifecycleStatsSelfMerged :: Hs.Word32 @@ -5448,331 +5298,338 @@ data LifecycleStats = LifecycleStats , lifecycleStatsCommitsPerChange :: Hs.Float } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData LifecycleStats - -instance HsProtobuf.Named LifecycleStats where - nameOf _ = (Hs.fromString "LifecycleStats") - -instance HsProtobuf.HasDefault LifecycleStats - -instance HsProtobuf.Message LifecycleStats where +instance (Hs.NFData LifecycleStats) +instance (HsProtobuf.Named LifecycleStats) where + nameOf _ = Hs.fromString "LifecycleStats" +instance (HsProtobuf.HasDefault LifecycleStats) +instance (HsProtobuf.Message LifecycleStats) where encodeMessage _ LifecycleStats - { lifecycleStatsCreatedHisto = - lifecycleStatsCreatedHisto - , lifecycleStatsUpdatedHisto = lifecycleStatsUpdatedHisto - , lifecycleStatsMergedHisto = lifecycleStatsMergedHisto - , lifecycleStatsAbandonedHisto = lifecycleStatsAbandonedHisto - , lifecycleStatsCreated = lifecycleStatsCreated - , lifecycleStatsAbandoned = lifecycleStatsAbandoned - , lifecycleStatsMerged = lifecycleStatsMerged - , lifecycleStatsSelfMerged = lifecycleStatsSelfMerged - , lifecycleStatsSelfMergedRatio = lifecycleStatsSelfMergedRatio - , lifecycleStatsTtmMean = lifecycleStatsTtmMean - , lifecycleStatsTtmVariability = lifecycleStatsTtmVariability - , lifecycleStatsUpdatesOfChanges = lifecycleStatsUpdatesOfChanges - , lifecycleStatsChangesWithTests = lifecycleStatsChangesWithTests - , lifecycleStatsIterationsPerChange = - lifecycleStatsIterationsPerChange - , lifecycleStatsCommitsPerChange = lifecycleStatsCommitsPerChange + { lifecycleStatsCreatedHisto + , lifecycleStatsUpdatedHisto + , lifecycleStatsMergedHisto + , lifecycleStatsAbandonedHisto + , lifecycleStatsCreated + , lifecycleStatsAbandoned + , lifecycleStatsMerged + , lifecycleStatsSelfMerged + , lifecycleStatsSelfMergedRatio + , lifecycleStatsTtmMean + , lifecycleStatsTtmVariability + , lifecycleStatsUpdatesOfChanges + , lifecycleStatsChangesWithTests + , lifecycleStatsIterationsPerChange + , lifecycleStatsCommitsPerChange } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (lifecycleStatsCreatedHisto) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (lifecycleStatsUpdatedHisto) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (lifecycleStatsMergedHisto) - ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (lifecycleStatsAbandonedHisto) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + lifecycleStatsCreatedHisto + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + lifecycleStatsUpdatedHisto + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + lifecycleStatsMergedHisto + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + ) + lifecycleStatsAbandonedHisto + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 5) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + ) + lifecycleStatsCreated + ) + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 11) + lifecycleStatsAbandoned + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 13) + lifecycleStatsMerged + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 15) + lifecycleStatsSelfMerged + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 16) + lifecycleStatsSelfMergedRatio + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 30) + lifecycleStatsTtmMean + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 31) + lifecycleStatsTtmVariability + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 32) + lifecycleStatsUpdatesOfChanges + ) ) - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 5) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (lifecycleStatsCreated) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 33) + lifecycleStatsChangesWithTests ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 11) - lifecycleStatsAbandoned - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 13) - lifecycleStatsMerged - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 15) - lifecycleStatsSelfMerged - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 16) - lifecycleStatsSelfMergedRatio - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 30) - lifecycleStatsTtmMean - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 31) - lifecycleStatsTtmVariability - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 32) - lifecycleStatsUpdatesOfChanges - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 33) - lifecycleStatsChangesWithTests - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 34) lifecycleStatsIterationsPerChange ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 35) - lifecycleStatsCommitsPerChange - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 35) + lifecycleStatsCommitsPerChange + ) decodeMessage _ = - (Hs.pure LifecycleStats) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + Hs.pure LifecycleStats + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - @(Hs.Vector Monocle.Protob.Metric.HistoInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) ) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 11) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 13) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 15) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 16) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 30) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 31) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 32) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 33) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 34) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 35) - ) - dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "created_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "updated_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "merged_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - ( HsProtobufAST.Repeated - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) - ) - ) - ) - (HsProtobufAST.Single "abandoned_histo") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - ( HsProtobufAST.Prim - (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) - ) - (HsProtobufAST.Single "created") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 11) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "abandoned") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 13) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "merged") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 15) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "self_merged") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 16) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "self_merged_ratio") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 30) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "ttm_mean") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 31) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "ttm_variability") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 32) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "updates_of_changes") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 33) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "changes_with_tests") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 34) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "iterations_per_change") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 35) - (HsProtobufAST.Prim HsProtobufAST.Float) - (HsProtobufAST.Single "commits_per_change") - [] - "" - ) + ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 11) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 13) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 15) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 16) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 30) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 31) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 32) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 33) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 34) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 35) + dotProto _ = + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "created_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "updated_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "merged_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ) + ) + ) + (HsProtobufAST.Single "abandoned_histo") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) + ) + (HsProtobufAST.Single "created") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 11) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "abandoned") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 13) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "merged") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 15) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "self_merged") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 16) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "self_merged_ratio") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 30) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "ttm_mean") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 31) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "ttm_variability") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 32) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "updates_of_changes") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 33) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "changes_with_tests") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 34) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "iterations_per_change") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 35) + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "commits_per_change") + [] + "" ] - -instance HsJSONPB.ToJSONPB LifecycleStats where +instance (HsJSONPB.ToJSONPB LifecycleStats) where toJSONPB ( LifecycleStats f1 @@ -5791,44 +5648,53 @@ instance HsJSONPB.ToJSONPB LifecycleStats where f34 f35 ) = - ( HsJSONPB.object - [ "created_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + HsJSONPB.object + [ "created_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f1) ) - , "updated_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f1 + ) + , "updated_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f2) ) - , "merged_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f2 + ) + , "merged_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f3) ) - , "abandoned_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f3 + ) + , "abandoned_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f4) ) - , "created" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + f4 + ) + , "created" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (f5) ) - , "abandoned" .= f11 - , "merged" .= f13 - , "self_merged" .= f15 - , "self_merged_ratio" .= f16 - , "ttm_mean" .= f30 - , "ttm_variability" .= f31 - , "updates_of_changes" .= f32 - , "changes_with_tests" .= f33 - , "iterations_per_change" .= f34 - , "commits_per_change" .= f35 - ] - ) + f5 + ) + , "abandoned" .= f11 + , "merged" .= f13 + , "self_merged" .= f15 + , "self_merged_ratio" .= f16 + , "ttm_mean" .= f30 + , "ttm_variability" .= f31 + , "updates_of_changes" .= f32 + , "changes_with_tests" .= f33 + , "iterations_per_change" .= f34 + , "commits_per_change" .= f35 + ] toEncodingPB ( LifecycleStats f1 @@ -5847,96 +5713,105 @@ instance HsJSONPB.ToJSONPB LifecycleStats where f34 f35 ) = - ( HsJSONPB.pairs - [ "created_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + HsJSONPB.pairs + [ "created_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f1) ) - , "updated_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f1 + ) + , "updated_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f2) ) - , "merged_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f2 + ) + , "merged_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f3) ) - , "abandoned_histo" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + f3 + ) + , "abandoned_histo" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - (f4) ) - , "created" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + f4 + ) + , "created" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - (f5) ) - , "abandoned" .= f11 - , "merged" .= f13 - , "self_merged" .= f15 - , "self_merged_ratio" .= f16 - , "ttm_mean" .= f30 - , "ttm_variability" .= f31 - , "updates_of_changes" .= f32 - , "changes_with_tests" .= f33 - , "iterations_per_change" .= f34 - , "commits_per_change" .= f35 - ] - ) - -instance HsJSONPB.FromJSONPB LifecycleStats where + f5 + ) + , "abandoned" .= f11 + , "merged" .= f13 + , "self_merged" .= f15 + , "self_merged_ratio" .= f16 + , "ttm_mean" .= f30 + , "ttm_variability" .= f31 + , "updates_of_changes" .= f32 + , "changes_with_tests" .= f33 + , "iterations_per_change" .= f34 + , "commits_per_change" .= f35 + ] +instance (HsJSONPB.FromJSONPB LifecycleStats) where parseJSONPB = - ( HsJSONPB.withObject - "LifecycleStats" - ( \obj -> - (Hs.pure LifecycleStats) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "LifecycleStats" + ( \obj -> + Hs.pure LifecycleStats + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "created_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "created_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "updated_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "updated_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "merged_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "merged_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) @(Hs.Vector Monocle.Protob.Metric.HistoInt) - (obj .: "abandoned_histo") ) - <*> ( HsProtobuf.coerceOver + (obj .: "abandoned_histo") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) @(Hs.Maybe Monocle.Protob.Search.ReviewCount) - (obj .: "created") ) - <*> obj .: "abandoned" - <*> obj .: "merged" - <*> obj .: "self_merged" - <*> obj .: "self_merged_ratio" - <*> obj .: "ttm_mean" - <*> obj .: "ttm_variability" - <*> obj .: "updates_of_changes" - <*> obj .: "changes_with_tests" - <*> obj .: "iterations_per_change" - <*> obj .: "commits_per_change" - ) - ) - -instance HsJSONPB.ToJSON LifecycleStats where + (obj .: "created") + ) + <*> obj .: "abandoned" + <*> obj .: "merged" + <*> obj .: "self_merged" + <*> obj .: "self_merged_ratio" + <*> obj .: "ttm_mean" + <*> obj .: "ttm_variability" + <*> obj .: "updates_of_changes" + <*> obj .: "changes_with_tests" + <*> obj .: "iterations_per_change" + <*> obj .: "commits_per_change" + ) +instance (HsJSONPB.ToJSON LifecycleStats) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON LifecycleStats where +instance (HsJSONPB.FromJSON LifecycleStats) where parseJSON = HsJSONPB.parseJSONPB - data RepoSummary = RepoSummary { repoSummaryFullname :: Hs.Text , repoSummaryCreatedChanges :: Hs.Word32 @@ -5946,662 +5821,607 @@ data RepoSummary = RepoSummary , repoSummaryOpenChanges :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData RepoSummary - -instance HsProtobuf.Named RepoSummary where - nameOf _ = (Hs.fromString "RepoSummary") - -instance HsProtobuf.HasDefault RepoSummary - -instance HsProtobuf.Message RepoSummary where +instance (Hs.NFData RepoSummary) +instance (HsProtobuf.Named RepoSummary) where + nameOf _ = Hs.fromString "RepoSummary" +instance (HsProtobuf.HasDefault RepoSummary) +instance (HsProtobuf.Message RepoSummary) where encodeMessage _ RepoSummary - { repoSummaryFullname = repoSummaryFullname - , repoSummaryCreatedChanges = repoSummaryCreatedChanges - , repoSummaryAbandonedChanges = repoSummaryAbandonedChanges - , repoSummaryMergedChanges = repoSummaryMergedChanges - , repoSummaryUpdatedChanges = repoSummaryUpdatedChanges - , repoSummaryOpenChanges = repoSummaryOpenChanges + { repoSummaryFullname + , repoSummaryCreatedChanges + , repoSummaryAbandonedChanges + , repoSummaryMergedChanges + , repoSummaryUpdatedChanges + , repoSummaryOpenChanges } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (repoSummaryFullname) + Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + repoSummaryFullname + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 2) + repoSummaryCreatedChanges + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + repoSummaryAbandonedChanges + ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 4) + repoSummaryMergedChanges ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 2) - repoSummaryCreatedChanges - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - repoSummaryAbandonedChanges - ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 4) - repoSummaryMergedChanges - ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) repoSummaryUpdatedChanges ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 6) - repoSummaryOpenChanges - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 6) + repoSummaryOpenChanges + ) decodeMessage _ = - (Hs.pure RepoSummary) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure RepoSummary + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) - ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 6) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 5) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 6) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "fullname") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "created_changes") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "abandoned_changes") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 4) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "merged_changes") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 5) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "updated_changes") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 6) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "open_changes") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "fullname") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "created_changes") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "abandoned_changes") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 4) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "merged_changes") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 5) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "updated_changes") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 6) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "open_changes") + [] + "" ] - -instance HsJSONPB.ToJSONPB RepoSummary where +instance (HsJSONPB.ToJSONPB RepoSummary) where toJSONPB (RepoSummary f1 f2 f3 f4 f5 f6) = - ( HsJSONPB.object - [ "fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "created_changes" .= f2 - , "abandoned_changes" .= f3 - , "merged_changes" .= f4 - , "updated_changes" .= f5 - , "open_changes" .= f6 - ] - ) + HsJSONPB.object + [ "fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "created_changes" .= f2 + , "abandoned_changes" .= f3 + , "merged_changes" .= f4 + , "updated_changes" .= f5 + , "open_changes" .= f6 + ] toEncodingPB (RepoSummary f1 f2 f3 f4 f5 f6) = - ( HsJSONPB.pairs - [ "fullname" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "created_changes" .= f2 - , "abandoned_changes" .= f3 - , "merged_changes" .= f4 - , "updated_changes" .= f5 - , "open_changes" .= f6 - ] - ) - -instance HsJSONPB.FromJSONPB RepoSummary where + HsJSONPB.pairs + [ "fullname" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "created_changes" .= f2 + , "abandoned_changes" .= f3 + , "merged_changes" .= f4 + , "updated_changes" .= f5 + , "open_changes" .= f6 + ] +instance (HsJSONPB.FromJSONPB RepoSummary) where parseJSONPB = - ( HsJSONPB.withObject - "RepoSummary" - ( \obj -> - (Hs.pure RepoSummary) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "fullname") - ) - <*> obj .: "created_changes" - <*> obj .: "abandoned_changes" - <*> obj .: "merged_changes" - <*> obj .: "updated_changes" - <*> obj .: "open_changes" - ) - ) - -instance HsJSONPB.ToJSON RepoSummary where + HsJSONPB.withObject + "RepoSummary" + ( \obj -> + Hs.pure RepoSummary + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "fullname") + ) + <*> obj .: "created_changes" + <*> obj .: "abandoned_changes" + <*> obj .: "merged_changes" + <*> obj .: "updated_changes" + <*> obj .: "open_changes" + ) +instance (HsJSONPB.ToJSON RepoSummary) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON RepoSummary where +instance (HsJSONPB.FromJSON RepoSummary) where parseJSON = HsJSONPB.parseJSONPB - -newtype ReposSummary = ReposSummary - { reposSummaryReposum :: - Hs.Vector Monocle.Protob.Search.RepoSummary - } +newtype ReposSummary = ReposSummary {reposSummaryReposum :: (Hs.Vector Monocle.Protob.Search.RepoSummary)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ReposSummary - -instance HsProtobuf.Named ReposSummary where - nameOf _ = (Hs.fromString "ReposSummary") - -instance HsProtobuf.HasDefault ReposSummary - -instance HsProtobuf.Message ReposSummary where - encodeMessage - _ - ReposSummary {reposSummaryReposum = reposSummaryReposum} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) - @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) - (reposSummaryReposum) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure ReposSummary) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) +instance (Hs.NFData ReposSummary) +instance (HsProtobuf.Named ReposSummary) where + nameOf _ = Hs.fromString "ReposSummary" +instance (HsProtobuf.HasDefault ReposSummary) +instance (HsProtobuf.Message ReposSummary) where + encodeMessage _ ReposSummary {reposSummaryReposum} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) + @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) + ) + reposSummaryReposum + ) + ) + decodeMessage _ = + Hs.pure ReposSummary + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) + @(Hs.Vector Monocle.Protob.Search.RepoSummary) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "RepoSummary")) - ) - (HsProtobufAST.Single "reposum") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "RepoSummary")) + ) + (HsProtobufAST.Single "reposum") + [] + "" ] - -instance HsJSONPB.ToJSONPB ReposSummary where +instance (HsJSONPB.ToJSONPB ReposSummary) where toJSONPB (ReposSummary f1) = - ( HsJSONPB.object - [ "reposum" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) + HsJSONPB.object + [ "reposum" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.RepoSummary) @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (ReposSummary f1) = - ( HsJSONPB.pairs - [ "reposum" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) + HsJSONPB.pairs + [ "reposum" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.RepoSummary) @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB ReposSummary where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB ReposSummary) where parseJSONPB = - ( HsJSONPB.withObject - "ReposSummary" - ( \obj -> - (Hs.pure ReposSummary) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ReposSummary" + ( \obj -> + Hs.pure ReposSummary + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) @(Hs.Vector Monocle.Protob.Search.RepoSummary) - (obj .: "reposum") ) - ) - ) - -instance HsJSONPB.ToJSON ReposSummary where + (obj .: "reposum") + ) + ) +instance (HsJSONPB.ToJSON ReposSummary) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ReposSummary where +instance (HsJSONPB.FromJSON ReposSummary) where parseJSON = HsJSONPB.parseJSONPB - data AuthorPeer = AuthorPeer { authorPeerAuthor :: Hs.Text , authorPeerPeer :: Hs.Text , authorPeerStrength :: Hs.Word32 } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AuthorPeer - -instance HsProtobuf.Named AuthorPeer where - nameOf _ = (Hs.fromString "AuthorPeer") - -instance HsProtobuf.HasDefault AuthorPeer - -instance HsProtobuf.Message AuthorPeer where +instance (Hs.NFData AuthorPeer) +instance (HsProtobuf.Named AuthorPeer) where + nameOf _ = Hs.fromString "AuthorPeer" +instance (HsProtobuf.HasDefault AuthorPeer) +instance (HsProtobuf.Message AuthorPeer) where encodeMessage _ - AuthorPeer - { authorPeerAuthor = authorPeerAuthor - , authorPeerPeer = authorPeerPeer - , authorPeerStrength = authorPeerStrength - } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + AuthorPeer {authorPeerAuthor, authorPeerPeer, authorPeerStrength} = + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (authorPeerAuthor) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + authorPeerAuthor ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) - (authorPeerPeer) + ( (Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) + authorPeerPeer ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - authorPeerStrength - ) - ] - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + authorPeerStrength + ) decodeMessage _ = - (Hs.pure AuthorPeer) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + Hs.pure AuthorPeer + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) - ) + <*> HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "author") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - (HsProtobufAST.Prim HsProtobufAST.String) - (HsProtobufAST.Single "peer") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - (HsProtobufAST.Prim HsProtobufAST.UInt32) - (HsProtobufAST.Single "strength") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "peer") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "strength") + [] + "" ] - -instance HsJSONPB.ToJSONPB AuthorPeer where +instance (HsJSONPB.ToJSONPB AuthorPeer) where toJSONPB (AuthorPeer f1 f2 f3) = - ( HsJSONPB.object - [ "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "peer" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "strength" .= f3 - ] - ) + HsJSONPB.object + [ "author" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "peer" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "strength" .= f3 + ] toEncodingPB (AuthorPeer f1 f2 f3) = - ( HsJSONPB.pairs - [ "author" - .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) - , "peer" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) - , "strength" .= f3 - ] - ) - -instance HsJSONPB.FromJSONPB AuthorPeer where + HsJSONPB.pairs + [ "author" + .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f1) + , "peer" .= ((Hs.coerce @Hs.Text @((HsProtobuf.String Hs.Text))) f2) + , "strength" .= f3 + ] +instance (HsJSONPB.FromJSONPB AuthorPeer) where parseJSONPB = - ( HsJSONPB.withObject - "AuthorPeer" - ( \obj -> - (Hs.pure AuthorPeer) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "author") - ) - <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) - (obj .: "peer") - ) - <*> obj .: "strength" - ) - ) - -instance HsJSONPB.ToJSON AuthorPeer where + HsJSONPB.withObject + "AuthorPeer" + ( \obj -> + Hs.pure AuthorPeer + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "author") + ) + <*> ( (HsProtobuf.coerceOver @((HsProtobuf.String Hs.Text)) @Hs.Text) + (obj .: "peer") + ) + <*> obj .: "strength" + ) +instance (HsJSONPB.ToJSON AuthorPeer) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AuthorPeer where +instance (HsJSONPB.FromJSON AuthorPeer) where parseJSON = HsJSONPB.parseJSONPB - -newtype AuthorsPeers = AuthorsPeers - { authorsPeersAuthorPeer :: - Hs.Vector Monocle.Protob.Search.AuthorPeer - } +newtype AuthorsPeers = AuthorsPeers {authorsPeersAuthorPeer :: (Hs.Vector Monocle.Protob.Search.AuthorPeer)} deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData AuthorsPeers - -instance HsProtobuf.Named AuthorsPeers where - nameOf _ = (Hs.fromString "AuthorsPeers") - -instance HsProtobuf.HasDefault AuthorsPeers - -instance HsProtobuf.Message AuthorsPeers where - encodeMessage - _ - AuthorsPeers {authorsPeersAuthorPeer = authorsPeersAuthorPeer} = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) - @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) - (authorsPeersAuthorPeer) - ) - ) - ] - ) - decodeMessage _ = - (Hs.pure AuthorsPeers) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) +instance (Hs.NFData AuthorsPeers) +instance (HsProtobuf.Named AuthorsPeers) where + nameOf _ = Hs.fromString "AuthorsPeers" +instance (HsProtobuf.HasDefault AuthorsPeers) +instance (HsProtobuf.Message AuthorsPeers) where + encodeMessage _ AuthorsPeers {authorsPeersAuthorPeer} = + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 1) + ( ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) + @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) + ) + authorsPeersAuthorPeer + ) + ) + decodeMessage _ = + Hs.pure AuthorsPeers + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) + @(Hs.Vector Monocle.Protob.Search.AuthorPeer) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Repeated - (HsProtobufAST.Named (HsProtobufAST.Single "AuthorPeer")) - ) - (HsProtobufAST.Single "author_peer") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "AuthorPeer")) + ) + (HsProtobufAST.Single "author_peer") + [] + "" ] - -instance HsJSONPB.ToJSONPB AuthorsPeers where +instance (HsJSONPB.ToJSONPB AuthorsPeers) where toJSONPB (AuthorsPeers f1) = - ( HsJSONPB.object - [ "author_peer" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) + HsJSONPB.object + [ "author_peer" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.AuthorPeer) @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) - (f1) ) - ] - ) + f1 + ) + ] toEncodingPB (AuthorsPeers f1) = - ( HsJSONPB.pairs - [ "author_peer" - .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) + HsJSONPB.pairs + [ "author_peer" + .= ( ( Hs.coerce + @(Hs.Vector Monocle.Protob.Search.AuthorPeer) @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) - (f1) ) - ] - ) - -instance HsJSONPB.FromJSONPB AuthorsPeers where + f1 + ) + ] +instance (HsJSONPB.FromJSONPB AuthorsPeers) where parseJSONPB = - ( HsJSONPB.withObject - "AuthorsPeers" - ( \obj -> - (Hs.pure AuthorsPeers) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "AuthorsPeers" + ( \obj -> + Hs.pure AuthorsPeers + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) @(Hs.Vector Monocle.Protob.Search.AuthorPeer) - (obj .: "author_peer") ) - ) - ) - -instance HsJSONPB.ToJSON AuthorsPeers where + (obj .: "author_peer") + ) + ) +instance (HsJSONPB.ToJSON AuthorsPeers) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON AuthorsPeers where +instance (HsJSONPB.FromJSON AuthorsPeers) where parseJSON = HsJSONPB.parseJSONPB - data ChangesTops = ChangesTops - { changesTopsAuthors :: - Hs.Maybe Monocle.Protob.Metric.TermsCountInt - , changesTopsRepos :: Hs.Maybe Monocle.Protob.Metric.TermsCountInt - , changesTopsApprovals :: - Hs.Maybe Monocle.Protob.Metric.TermsCountInt + { changesTopsAuthors :: (Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + , changesTopsRepos :: (Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + , changesTopsApprovals :: (Hs.Maybe Monocle.Protob.Metric.TermsCountInt) } deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) - -instance Hs.NFData ChangesTops - -instance HsProtobuf.Named ChangesTops where - nameOf _ = (Hs.fromString "ChangesTops") - -instance HsProtobuf.HasDefault ChangesTops - -instance HsProtobuf.Message ChangesTops where +instance (Hs.NFData ChangesTops) +instance (HsProtobuf.Named ChangesTops) where + nameOf _ = Hs.fromString "ChangesTops" +instance (HsProtobuf.HasDefault ChangesTops) +instance (HsProtobuf.Message ChangesTops) where encodeMessage _ ChangesTops - { changesTopsAuthors = changesTopsAuthors - , changesTopsRepos = changesTopsRepos - , changesTopsApprovals = changesTopsApprovals + { changesTopsAuthors + , changesTopsRepos + , changesTopsApprovals } = - ( Hs.mconcat - [ ( HsProtobuf.encodeMessageField + Hs.mappend + ( Hs.mappend + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (changesTopsAuthors) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + ) + changesTopsAuthors ) ) - , ( HsProtobuf.encodeMessageField + ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (changesTopsRepos) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + ) + changesTopsRepos ) ) - , ( HsProtobuf.encodeMessageField - (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (changesTopsApprovals) - ) + ) + ( HsProtobuf.encodeMessageField + (HsProtobuf.FieldNumber 3) + ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + ) + changesTopsApprovals ) - ] - ) + ) decodeMessage _ = - (Hs.pure ChangesTops) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + Hs.pure ChangesTops + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) ) - <*> ( HsProtobuf.coerceOver - @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + <*> ( ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + ) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) ) dotProto _ = - [ ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 1) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) - ) - ) - ) - (HsProtobufAST.Single "authors") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 2) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) - ) - ) - ) - (HsProtobufAST.Single "repos") - [] - "" - ) - , ( HsProtobufAST.DotProtoField - (HsProtobuf.FieldNumber 3) - ( HsProtobufAST.Prim - ( HsProtobufAST.Named - ( HsProtobufAST.Dots - (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) - ) - ) - ) - (HsProtobufAST.Single "approvals") - [] - "" - ) + [ HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 1) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) + ) + ) + ) + (HsProtobufAST.Single "authors") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 2) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) + ) + ) + ) + (HsProtobufAST.Single "repos") + [] + "" + , HsProtobufAST.DotProtoField + (HsProtobuf.FieldNumber 3) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) + ) + ) + ) + (HsProtobufAST.Single "approvals") + [] + "" ] - -instance HsJSONPB.ToJSONPB ChangesTops where +instance (HsJSONPB.ToJSONPB ChangesTops) where toJSONPB (ChangesTops f1 f2 f3) = - ( HsJSONPB.object - [ "authors" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + HsJSONPB.object + [ "authors" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (f1) ) - , "repos" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + f1 + ) + , "repos" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (f2) ) - , "approvals" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + f2 + ) + , "approvals" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (f3) ) - ] - ) + f3 + ) + ] toEncodingPB (ChangesTops f1 f2 f3) = - ( HsJSONPB.pairs - [ "authors" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + HsJSONPB.pairs + [ "authors" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (f1) ) - , "repos" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + f1 + ) + , "repos" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (f2) ) - , "approvals" - .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + f2 + ) + , "approvals" + .= ( ( Hs.coerce + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - (f3) ) - ] - ) - -instance HsJSONPB.FromJSONPB ChangesTops where + f3 + ) + ] +instance (HsJSONPB.FromJSONPB ChangesTops) where parseJSONPB = - ( HsJSONPB.withObject - "ChangesTops" - ( \obj -> - (Hs.pure ChangesTops) - <*> ( HsProtobuf.coerceOver + HsJSONPB.withObject + "ChangesTops" + ( \obj -> + Hs.pure ChangesTops + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - (obj .: "authors") ) - <*> ( HsProtobuf.coerceOver + (obj .: "authors") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - (obj .: "repos") ) - <*> ( HsProtobuf.coerceOver + (obj .: "repos") + ) + <*> ( ( HsProtobuf.coerceOver @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) - (obj .: "approvals") ) - ) - ) - -instance HsJSONPB.ToJSON ChangesTops where + (obj .: "approvals") + ) + ) +instance (HsJSONPB.ToJSON ChangesTops) where toJSON = HsJSONPB.toAesonValue toEncoding = HsJSONPB.toAesonEncoding - -instance HsJSONPB.FromJSON ChangesTops where +instance (HsJSONPB.FromJSON ChangesTops) where parseJSON = HsJSONPB.parseJSONPB