From e4fe1aa803f893571b18a1574b9fb54a68b029c6 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Sun, 6 Aug 2023 18:16:08 +0000 Subject: [PATCH] Update codegen with latest proto3-suite --- codegen/Monocle/Protob/Auth.hs | 155 +- codegen/Monocle/Protob/Change.hs | 1615 ++++++++----- codegen/Monocle/Protob/Config.hs | 917 +++++--- codegen/Monocle/Protob/Crawler.hs | 849 ++++--- codegen/Monocle/Protob/Issue.hs | 710 ++++-- codegen/Monocle/Protob/Login.hs | 58 +- codegen/Monocle/Protob/Metric.hs | 1226 +++++++--- codegen/Monocle/Protob/Search.hs | 3607 +++++++++++++++++++---------- 8 files changed, 6190 insertions(+), 2947 deletions(-) diff --git a/codegen/Monocle/Protob/Auth.hs b/codegen/Monocle/Protob/Auth.hs index a204a65ff..dcb3eba85 100644 --- a/codegen/Monocle/Protob/Auth.hs +++ b/codegen/Monocle/Protob/Auth.hs @@ -29,12 +29,19 @@ import Data.Vector qualified as Hs (Vector) import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs @@ -42,7 +49,9 @@ newtype GetMagicJwtRequest = GetMagicJwtRequest { getMagicJwtRequestToken :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetMagicJwtRequest instance HsProtobuf.Named GetMagicJwtRequest where nameOf _ = (Hs.fromString "GetMagicJwtRequest") @@ -59,21 +68,25 @@ instance HsProtobuf.Message GetMagicJwtRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getMagicJwtRequestToken + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getMagicJwtRequestToken) + ) ) ] ) decodeMessage _ = (Hs.pure GetMagicJwtRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "token") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "token") [] "" ) @@ -81,15 +94,28 @@ instance HsProtobuf.Message GetMagicJwtRequest where instance HsJSONPB.ToJSONPB GetMagicJwtRequest where toJSONPB (GetMagicJwtRequest f1) = - (HsJSONPB.object ["token" .= f1]) + ( HsJSONPB.object + [ "token" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (GetMagicJwtRequest f1) = - (HsJSONPB.pairs ["token" .= f1]) + ( 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) <*> obj .: "token") + ( \obj -> + (Hs.pure GetMagicJwtRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "token") + ) + ) ) instance HsJSONPB.ToJSON GetMagicJwtRequest where @@ -155,7 +181,9 @@ newtype GetMagicJwtResponse = GetMagicJwtResponse { getMagicJwtResponseResult :: Hs.Maybe GetMagicJwtResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetMagicJwtResponse instance HsProtobuf.Named GetMagicJwtResponse where nameOf _ = (Hs.fromString "GetMagicJwtResponse") @@ -182,7 +210,9 @@ instance HsProtobuf.Message GetMagicJwtResponse where GetMagicJwtResponseResultJwt y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) ] ) @@ -198,7 +228,9 @@ instance HsProtobuf.Message GetMagicJwtResponse where , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.Just Hs.. GetMagicJwtResponseResultJwt)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) ] ) @@ -212,7 +244,10 @@ instance HsJSONPB.ToJSONPB GetMagicJwtResponse where Hs.Just (GetMagicJwtResponseResultError f1) -> (HsJSONPB.pair "error" f1) Hs.Just (GetMagicJwtResponseResultJwt f2) -> - (HsJSONPB.pair "jwt" f2) + ( HsJSONPB.pair + "jwt" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) + ) Hs.Nothing -> Hs.mempty ) in \options -> @@ -231,7 +266,10 @@ instance HsJSONPB.ToJSONPB GetMagicJwtResponse where Hs.Just (GetMagicJwtResponseResultError f1) -> (HsJSONPB.pair "error" f1) Hs.Just (GetMagicJwtResponseResultJwt f2) -> - (HsJSONPB.pair "jwt" f2) + ( HsJSONPB.pair + "jwt" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) + ) Hs.Nothing -> Hs.mempty ) in \options -> @@ -252,7 +290,9 @@ instance HsJSONPB.FromJSONPB GetMagicJwtResponse where Hs.msum [ Hs.Just Hs.. GetMagicJwtResponseResultError <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. GetMagicJwtResponseResultJwt + , Hs.Just + Hs.. GetMagicJwtResponseResultJwt + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "jwt") , Hs.pure Hs.Nothing ] @@ -277,13 +317,17 @@ data GetMagicJwtResponseResult Monocle.Protob.Auth.GetMagicJwtError ) | GetMagicJwtResponseResultJwt Hs.Text - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData WhoAmiRequest instance HsProtobuf.Named WhoAmiRequest where nameOf _ = (Hs.fromString "WhoAmiRequest") @@ -297,35 +341,54 @@ instance HsProtobuf.Message WhoAmiRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - whoAmiRequestVoid + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (whoAmiRequestVoid) + ) ) ] ) decodeMessage _ = (Hs.pure WhoAmiRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "void") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") [] "" ) ] instance HsJSONPB.ToJSONPB WhoAmiRequest where - toJSONPB (WhoAmiRequest f1) = (HsJSONPB.object ["void" .= f1]) - toEncodingPB (WhoAmiRequest f1) = (HsJSONPB.pairs ["void" .= f1]) + toJSONPB (WhoAmiRequest 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 parseJSONPB = ( HsJSONPB.withObject "WhoAmiRequest" - (\obj -> (Hs.pure WhoAmiRequest) <*> obj .: "void") + ( \obj -> + (Hs.pure WhoAmiRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "void") + ) + ) ) instance HsJSONPB.ToJSON WhoAmiRequest where @@ -380,7 +443,9 @@ newtype WhoAmiResponse = WhoAmiResponse { whoAmiResponseResult :: Hs.Maybe WhoAmiResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData WhoAmiResponse instance HsProtobuf.Named WhoAmiResponse where nameOf _ = (Hs.fromString "WhoAmiResponse") @@ -404,7 +469,9 @@ instance HsProtobuf.Message WhoAmiResponse where WhoAmiResponseResultUid y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) ] ) @@ -420,7 +487,9 @@ instance HsProtobuf.Message WhoAmiResponse where , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.Just Hs.. WhoAmiResponseResultUid)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) ] ) @@ -433,7 +502,11 @@ instance HsJSONPB.ToJSONPB WhoAmiResponse where ( case f1_or_f2 of Hs.Just (WhoAmiResponseResultError f1) -> (HsJSONPB.pair "error" f1) - Hs.Just (WhoAmiResponseResultUid f2) -> (HsJSONPB.pair "uid" f2) + Hs.Just (WhoAmiResponseResultUid f2) -> + ( HsJSONPB.pair + "uid" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) + ) Hs.Nothing -> Hs.mempty ) in \options -> @@ -451,7 +524,11 @@ instance HsJSONPB.ToJSONPB WhoAmiResponse where ( case f1_or_f2 of Hs.Just (WhoAmiResponseResultError f1) -> (HsJSONPB.pair "error" f1) - Hs.Just (WhoAmiResponseResultUid f2) -> (HsJSONPB.pair "uid" f2) + Hs.Just (WhoAmiResponseResultUid f2) -> + ( HsJSONPB.pair + "uid" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) + ) Hs.Nothing -> Hs.mempty ) in \options -> @@ -472,7 +549,9 @@ instance HsJSONPB.FromJSONPB WhoAmiResponse where Hs.msum [ Hs.Just Hs.. WhoAmiResponseResultError <$> (HsJSONPB.parseField parseObj "error") - , Hs.Just Hs.. WhoAmiResponseResultUid + , Hs.Just + Hs.. WhoAmiResponseResultUid + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "uid") , Hs.pure Hs.Nothing ] @@ -497,7 +576,9 @@ data WhoAmiResponseResult Monocle.Protob.Auth.WhoAmiError ) | WhoAmiResponseResultUid Hs.Text - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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 c06275042..7c3aafbde 100644 --- a/codegen/Monocle/Protob/Change.hs +++ b/codegen/Monocle/Protob/Change.hs @@ -30,17 +30,26 @@ import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs import Google.Protobuf.Timestamp qualified +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs data Ident = Ident {identUid :: Hs.Text, identMuid :: Hs.Text} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Ident instance HsProtobuf.Named Ident where nameOf _ = (Hs.fromString "Ident") @@ -52,36 +61,40 @@ instance HsProtobuf.Message Ident where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - identUid + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identUid)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - identMuid + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identMuid)) ) ] ) decodeMessage _ = (Hs.pure Ident) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "uid") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "uid") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "muid") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "muid") [] "" ) @@ -89,15 +102,33 @@ instance HsProtobuf.Message Ident where instance HsJSONPB.ToJSONPB Ident where toJSONPB (Ident f1 f2) = - (HsJSONPB.object ["uid" .= f1, "muid" .= 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" .= f1, "muid" .= 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 parseJSONPB = ( HsJSONPB.withObject "Ident" - (\obj -> (Hs.pure Ident) <*> obj .: "uid" <*> obj .: "muid") + ( \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 @@ -112,7 +143,9 @@ data ChangedFile = ChangedFile , changedFileDeletions :: Hs.Int32 , changedFilePath :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangedFile instance HsProtobuf.Named ChangedFile where nameOf _ = (Hs.fromString "ChangedFile") @@ -138,7 +171,9 @@ instance HsProtobuf.Message ChangedFile where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - changedFilePath + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changedFilePath) + ) ) ] ) @@ -152,29 +187,31 @@ instance HsProtobuf.Message ChangedFile where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "additions") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "additions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "deletions") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "deletions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "path") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "path") [] "" ) @@ -183,11 +220,19 @@ instance HsProtobuf.Message ChangedFile where instance HsJSONPB.ToJSONPB ChangedFile where toJSONPB (ChangedFile f1 f2 f3) = ( HsJSONPB.object - ["additions" .= f1, "deletions" .= f2, "path" .= f3] + [ "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" .= f3] + [ "additions" .= f1 + , "deletions" .= f2 + , "path" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) + ] ) instance HsJSONPB.FromJSONPB ChangedFile where @@ -198,7 +243,9 @@ instance HsJSONPB.FromJSONPB ChangedFile where (Hs.pure ChangedFile) <*> obj .: "additions" <*> obj .: "deletions" - <*> obj .: "path" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "path") + ) ) ) @@ -213,7 +260,9 @@ newtype ChangedFilePath = ChangedFilePath { changedFilePathPath :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangedFilePath instance HsProtobuf.Named ChangedFilePath where nameOf _ = (Hs.fromString "ChangedFilePath") @@ -227,35 +276,54 @@ instance HsProtobuf.Message ChangedFilePath where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - changedFilePathPath + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changedFilePathPath) + ) ) ] ) decodeMessage _ = (Hs.pure ChangedFilePath) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "path") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "path") [] "" ) ] instance HsJSONPB.ToJSONPB ChangedFilePath where - toJSONPB (ChangedFilePath f1) = (HsJSONPB.object ["path" .= f1]) - toEncodingPB (ChangedFilePath f1) = (HsJSONPB.pairs ["path" .= f1]) + toJSONPB (ChangedFilePath 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 parseJSONPB = ( HsJSONPB.withObject "ChangedFilePath" - (\obj -> (Hs.pure ChangedFilePath) <*> obj .: "path") + ( \obj -> + (Hs.pure ChangedFilePath) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "path") + ) + ) ) instance HsJSONPB.ToJSON ChangedFilePath where @@ -275,7 +343,9 @@ data Commit = Commit , commitDeletions :: Hs.Int32 , commitTitle :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Commit instance HsProtobuf.Named Commit where nameOf _ = (Hs.fromString "Commit") @@ -298,34 +368,34 @@ instance HsProtobuf.Message Commit where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - commitSha + (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 + (commitAuthor) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - commitCommitter + (commitCommitter) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - commitAuthoredAt + (commitAuthoredAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - commitCommittedAt + (commitCommittedAt) ) ) , ( HsProtobuf.encodeMessageField @@ -338,41 +408,47 @@ instance HsProtobuf.Message Commit where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 8) - commitTitle + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (commitTitle) + ) ) ] ) decodeMessage _ = (Hs.pure Commit) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) @@ -386,76 +462,82 @@ instance HsProtobuf.Message Commit where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 7) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 8) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 8) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "sha") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "sha") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Ident"))) - (HsProtobuf.Single "author") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Ident"))) - (HsProtobuf.Single "committer") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "committer") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "authored_at") + (HsProtobufAST.Single "authored_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "committed_at") + (HsProtobufAST.Single "committed_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "additions") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "additions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "deletions") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "deletions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "title") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") [] "" ) @@ -464,26 +546,60 @@ instance HsProtobuf.Message Commit where instance HsJSONPB.ToJSONPB Commit where toJSONPB (Commit f1 f2 f3 f4 f5 f6 f7 f8) = ( HsJSONPB.object - [ "sha" .= f1 - , "author" .= f2 - , "committer" .= f3 - , "authored_at" .= f4 - , "committed_at" .= f5 + [ "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) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + (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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f5) + ) , "additions" .= f6 , "deletions" .= f7 - , "title" .= f8 + , "title" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) ] ) toEncodingPB (Commit f1 f2 f3 f4 f5 f6 f7 f8) = ( HsJSONPB.pairs - [ "sha" .= f1 - , "author" .= f2 - , "committer" .= f3 - , "authored_at" .= f4 - , "committed_at" .= f5 + [ "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) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + (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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f5) + ) , "additions" .= f6 , "deletions" .= f7 - , "title" .= f8 + , "title" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f8)) ] ) @@ -493,14 +609,34 @@ instance HsJSONPB.FromJSONPB Commit where "Commit" ( \obj -> (Hs.pure Commit) - <*> obj .: "sha" - <*> obj .: "author" - <*> obj .: "committer" - <*> obj .: "authored_at" - <*> obj .: "committed_at" + <*> ( 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 + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + (obj .: "committer") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (obj .: "authored_at") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (obj .: "committed_at") + ) <*> obj .: "additions" <*> obj .: "deletions" - <*> obj .: "title" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "title") + ) ) ) @@ -545,7 +681,9 @@ data Change = Change , changeDraft :: Hs.Bool , changeOptionalSelfMerged :: Hs.Maybe ChangeOptionalSelfMerged } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Change instance HsProtobuf.Named Change where nameOf _ = (Hs.fromString "Change") @@ -591,7 +729,7 @@ instance HsProtobuf.Message Change where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - changeId + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeId)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -599,19 +737,21 @@ instance HsProtobuf.Message Change where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - changeChangeId + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeChangeId) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - changeTitle + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeTitle)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - changeText + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeText)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) - changeUrl + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeUrl)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) @@ -633,33 +773,39 @@ instance HsProtobuf.Message Change where (HsProtobuf.FieldNumber 11) ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFile) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) - changeChangedFiles + (changeChangedFiles) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 12) ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Commit) @(HsProtobuf.NestedVec Monocle.Protob.Change.Commit) - changeCommits + (changeCommits) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 13) - changeRepositoryPrefix + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeRepositoryPrefix) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 14) - changeRepositoryFullname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeRepositoryFullname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 15) - changeRepositoryShortname + ( 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 + (changeAuthor) ) ) , case changeOptionalMergedBy of @@ -676,17 +822,21 @@ instance HsProtobuf.Message Change where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 18) - changeBranch + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeBranch) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 19) - changeTargetBranch + ( 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 + (changeCreatedAt) ) ) , case changeOptionalMergedAt of @@ -705,7 +855,7 @@ instance HsProtobuf.Message Change where (HsProtobuf.FieldNumber 22) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - changeUpdatedAt + (changeUpdatedAt) ) ) , case changeOptionalClosedAt of @@ -735,25 +885,29 @@ instance HsProtobuf.Message Change where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 26) - changeMergeable + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeMergeable) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 27) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - changeLabels + ( 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 + (changeAssignees) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 29) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - changeApprovals + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (changeApprovals) ) ) , ( HsProtobuf.encodeMessageField @@ -773,29 +927,39 @@ instance HsProtobuf.Message Change where ) decodeMessage _ = (Hs.pure Change) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( 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.at HsProtobuf.decodeMessageField @@ -813,35 +977,43 @@ instance HsProtobuf.Message Change where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 10) ) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile)) - @(_ (Hs.Vector Monocle.Protob.Change.ChangedFile)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) + @(Hs.Vector Monocle.Protob.Change.ChangedFile) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 11) ) ) - <*> ( Hs.coerce @(_ (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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 13) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 13) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 14) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 14) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 15) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 15) + ) ) - <*> ( Hs.coerce @(_ (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) @@ -852,24 +1024,29 @@ instance HsProtobuf.Message Change where [ ( (HsProtobuf.FieldNumber 17) , (Hs.pure (Hs.fmap ChangeOptionalMergedByMergedBy)) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Change.Ident)) - @(_ (Hs.Maybe Monocle.Protob.Change.Ident)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + @(Hs.Maybe Monocle.Protob.Change.Ident) + (HsProtobuf.decodeMessageField) ) ) ] ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 18) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 18) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 19) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 19) + ) ) - <*> ( Hs.coerce - @(_ (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) @@ -880,17 +1057,17 @@ instance HsProtobuf.Message Change where [ ( (HsProtobuf.FieldNumber 21) , (Hs.pure (Hs.fmap ChangeOptionalMergedAtMergedAt)) - <*> ( Hs.coerce - @(_ (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.decodeMessageField) ) ) ] ) - <*> ( Hs.coerce - @(_ (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) @@ -901,10 +1078,10 @@ instance HsProtobuf.Message Change where [ ( (HsProtobuf.FieldNumber 23) , (Hs.pure (Hs.fmap ChangeOptionalClosedAtClosedAt)) - <*> ( Hs.coerce - @(_ (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.decodeMessageField) ) ) ] @@ -922,26 +1099,31 @@ instance HsProtobuf.Message Change where ) ] ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 26) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 26) + ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) @@ -961,205 +1143,207 @@ instance HsProtobuf.Message Change where ] ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "number") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "change_id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "title") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "text") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "text") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "commit_count") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "commit_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "additions") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "additions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 9) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "deletions") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "deletions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "changed_files_count") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "changed_files_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "ChangedFile")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ChangedFile")) ) - (HsProtobuf.Single "changed_files") + (HsProtobufAST.Single "changed_files") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 12) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Commit")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Commit")) ) - (HsProtobuf.Single "commits") + (HsProtobufAST.Single "commits") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 13) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_prefix") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 14) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_fullname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 15) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_shortname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 16) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Ident"))) - (HsProtobuf.Single "author") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 18) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 19) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "target_branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "target_branch") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 20) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "created_at") + (HsProtobufAST.Single "created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 22) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "updated_at") + (HsProtobufAST.Single "updated_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 24) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "ChangeState")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ChangeState")) ) - (HsProtobuf.Single "state") + (HsProtobufAST.Single "state") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 26) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "mergeable") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "mergeable") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 27) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "labels") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 28) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Ident")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) ) - (HsProtobuf.Single "assignees") + (HsProtobufAST.Single "assignees") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 29) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "approvals") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approvals") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 30) - (HsProtobuf.Prim HsProtobuf.Bool) - (HsProtobuf.Single "draft") + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "draft") [] "" ) @@ -1201,22 +1385,39 @@ instance HsJSONPB.ToJSONPB Change where f31 ) = ( HsJSONPB.object - [ "id" .= f1 + [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) , "number" .= f2 - , "change_id" .= f3 - , "title" .= f4 - , "text" .= f5 - , "url" .= f6 + , "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" .= f11 - , "commits" .= f12 - , "repository_prefix" .= f13 - , "repository_fullname" .= f14 - , "repository_shortname" .= f15 - , "author" .= f16 + , "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) + @(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) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + (f16) + ) , ( let encodeOptional_merged_by = ( case f17 of Hs.Just (ChangeOptionalMergedByMergedBy f17) -> @@ -1232,9 +1433,15 @@ instance HsJSONPB.ToJSONPB Change where options else encodeOptional_merged_by options ) - , "branch" .= f18 - , "target_branch" .= f19 - , "created_at" .= f20 + , "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) -> @@ -1250,7 +1457,11 @@ instance HsJSONPB.ToJSONPB Change where options else encodeOptional_merged_at options ) - , "updated_at" .= f22 + , "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) -> @@ -1282,10 +1493,23 @@ instance HsJSONPB.ToJSONPB Change where options else encodeOptional_duration options ) - , "mergeable" .= f26 - , "labels" .= f27 - , "assignees" .= f28 - , "approvals" .= f29 + , "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) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) + (f28) + ) + , "approvals" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f29) + ) , "draft" .= f30 , ( let encodeOptional_self_merged = ( case f31 of @@ -1339,22 +1563,39 @@ instance HsJSONPB.ToJSONPB Change where f31 ) = ( HsJSONPB.pairs - [ "id" .= f1 + [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) , "number" .= f2 - , "change_id" .= f3 - , "title" .= f4 - , "text" .= f5 - , "url" .= f6 + , "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" .= f11 - , "commits" .= f12 - , "repository_prefix" .= f13 - , "repository_fullname" .= f14 - , "repository_shortname" .= f15 - , "author" .= f16 + , "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) + @(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) + @(HsProtobuf.Nested Monocle.Protob.Change.Ident) + (f16) + ) , ( let encodeOptional_merged_by = ( case f17 of Hs.Just (ChangeOptionalMergedByMergedBy f17) -> @@ -1370,9 +1611,15 @@ instance HsJSONPB.ToJSONPB Change where options else encodeOptional_merged_by options ) - , "branch" .= f18 - , "target_branch" .= f19 - , "created_at" .= f20 + , "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) -> @@ -1388,7 +1635,11 @@ instance HsJSONPB.ToJSONPB Change where options else encodeOptional_merged_at options ) - , "updated_at" .= f22 + , "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) -> @@ -1420,10 +1671,23 @@ instance HsJSONPB.ToJSONPB Change where options else encodeOptional_duration options ) - , "mergeable" .= f26 - , "labels" .= f27 - , "assignees" .= f28 - , "approvals" .= f29 + , "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) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) + (f28) + ) + , "approvals" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f29) + ) , "draft" .= f30 , ( let encodeOptional_self_merged = ( case f31 of @@ -1449,22 +1713,50 @@ instance HsJSONPB.FromJSONPB Change where "Change" ( \obj -> (Hs.pure Change) - <*> obj .: "id" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "id") + ) <*> obj .: "number" - <*> obj .: "change_id" - <*> obj .: "title" - <*> obj .: "text" - <*> obj .: "url" + <*> ( 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" - <*> obj .: "changed_files" - <*> obj .: "commits" - <*> obj .: "repository_prefix" - <*> obj .: "repository_fullname" - <*> obj .: "repository_shortname" - <*> obj .: "author" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFile) + @(Hs.Vector Monocle.Protob.Change.ChangedFile) + (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 + @(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 @@ -1476,9 +1768,17 @@ instance HsJSONPB.FromJSONPB Change where ) <|> (parseOptional_merged_by obj) ) - <*> obj .: "branch" - <*> obj .: "target_branch" - <*> obj .: "created_at" + <*> ( 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 @@ -1490,7 +1790,11 @@ instance HsJSONPB.FromJSONPB Change where ) <|> (parseOptional_merged_at obj) ) - <*> obj .: "updated_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.. ChangeOptionalClosedAtClosedAt @@ -1514,10 +1818,24 @@ instance HsJSONPB.FromJSONPB Change where ) <|> (parseOptional_duration obj) ) - <*> obj .: "mergeable" - <*> obj .: "labels" - <*> obj .: "assignees" - <*> obj .: "approvals" + <*> ( 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 + @(HsProtobuf.NestedVec Monocle.Protob.Change.Ident) + @(Hs.Vector Monocle.Protob.Change.Ident) + (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 @@ -1596,37 +1914,49 @@ instance HsJSONPB.FromJSON Change_ChangeState where instance HsProtobuf.Finite Change_ChangeState data ChangeOptionalMergedBy = ChangeOptionalMergedByMergedBy Monocle.Protob.Change.Ident - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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 - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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 - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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 - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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 - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeOptionalSelfMerged instance HsProtobuf.Named ChangeOptionalSelfMerged where nameOf _ = (Hs.fromString "ChangeOptionalSelfMerged") data ChangeCreatedEvent = ChangeCreatedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeCreatedEvent instance HsProtobuf.Named ChangeCreatedEvent where nameOf _ = (Hs.fromString "ChangeCreatedEvent") @@ -1657,7 +1987,9 @@ instance HsJSONPB.FromJSON ChangeCreatedEvent where parseJSON = HsJSONPB.parseJSONPB data ChangeCommentedEvent = ChangeCommentedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeCommentedEvent instance HsProtobuf.Named ChangeCommentedEvent where nameOf _ = (Hs.fromString "ChangeCommentedEvent") @@ -1688,7 +2020,9 @@ instance HsJSONPB.FromJSON ChangeCommentedEvent where parseJSON = HsJSONPB.parseJSONPB data ChangeAbandonedEvent = ChangeAbandonedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeAbandonedEvent instance HsProtobuf.Named ChangeAbandonedEvent where nameOf _ = (Hs.fromString "ChangeAbandonedEvent") @@ -1722,7 +2056,9 @@ newtype ChangeReviewedEvent = ChangeReviewedEvent { changeReviewedEventApprovals :: Hs.Vector Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeReviewedEvent instance HsProtobuf.Named ChangeReviewedEvent where nameOf _ = (Hs.fromString "ChangeReviewedEvent") @@ -1739,26 +2075,28 @@ instance HsProtobuf.Message ChangeReviewedEvent where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - changeReviewedEventApprovals + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (changeReviewedEventApprovals) ) ) ] ) decodeMessage _ = (Hs.pure ChangeReviewedEvent) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec Hs.Text)) - @(_ (Hs.Vector Hs.Text)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "approvals") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approvals") [] "" ) @@ -1766,15 +2104,36 @@ instance HsProtobuf.Message ChangeReviewedEvent where instance HsJSONPB.ToJSONPB ChangeReviewedEvent where toJSONPB (ChangeReviewedEvent f1) = - (HsJSONPB.object ["approvals" .= f1]) + ( HsJSONPB.object + [ "approvals" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f1) + ) + ] + ) toEncodingPB (ChangeReviewedEvent f1) = - (HsJSONPB.pairs ["approvals" .= f1]) + ( HsJSONPB.pairs + [ "approvals" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB ChangeReviewedEvent where parseJSONPB = ( HsJSONPB.withObject "ChangeReviewedEvent" - (\obj -> (Hs.pure ChangeReviewedEvent) <*> obj .: "approvals") + ( \obj -> + (Hs.pure ChangeReviewedEvent) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "approvals") + ) + ) ) instance HsJSONPB.ToJSON ChangeReviewedEvent where @@ -1785,7 +2144,9 @@ instance HsJSONPB.FromJSON ChangeReviewedEvent where parseJSON = HsJSONPB.parseJSONPB data ChangeCommitForcePushedEvent = ChangeCommitForcePushedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeCommitForcePushedEvent instance HsProtobuf.Named ChangeCommitForcePushedEvent where nameOf _ = (Hs.fromString "ChangeCommitForcePushedEvent") @@ -1816,7 +2177,9 @@ instance HsJSONPB.FromJSON ChangeCommitForcePushedEvent where parseJSON = HsJSONPB.parseJSONPB data ChangeCommitPushedEvent = ChangeCommitPushedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeCommitPushedEvent instance HsProtobuf.Named ChangeCommitPushedEvent where nameOf _ = (Hs.fromString "ChangeCommitPushedEvent") @@ -1847,7 +2210,9 @@ instance HsJSONPB.FromJSON ChangeCommitPushedEvent where parseJSON = HsJSONPB.parseJSONPB data ChangeMergedEvent = ChangeMergedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeMergedEvent instance HsProtobuf.Named ChangeMergedEvent where nameOf _ = (Hs.fromString "ChangeMergedEvent") @@ -1901,7 +2266,9 @@ data ChangeEvent = ChangeEvent Hs.Maybe ChangeEventOptionalDuration , changeEventDraft :: Hs.Bool } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeEvent instance HsProtobuf.Named ChangeEvent where nameOf _ = (Hs.fromString "ChangeEvent") @@ -1934,41 +2301,53 @@ instance HsProtobuf.Message ChangeEvent where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - changeEventId + ( 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 + (changeEventCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - changeEventAuthor + (changeEventAuthor) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - changeEventRepositoryPrefix + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventRepositoryPrefix) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - changeEventRepositoryFullname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventRepositoryFullname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) - changeEventRepositoryShortname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventRepositoryShortname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) - changeEventBranch + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventBranch) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 8) - changeEventTargetBranch + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventTargetBranch) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 9) @@ -1976,31 +2355,35 @@ instance HsProtobuf.Message ChangeEvent where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) - changeEventChangeId + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventChangeId) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - changeEventUrl + ( 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 + (changeEventOnAuthor) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 13) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - changeEventOnCreatedAt + (changeEventOnCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 14) ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangedFilePath) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangedFilePath) - changeEventChangedFiles + (changeEventChangedFiles) ) ) , case changeEventType of @@ -2070,8 +2453,9 @@ instance HsProtobuf.Message ChangeEvent where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 22) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - changeEventLabels + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (changeEventLabels) ) ) , case changeEventOptionalDuration of @@ -2091,75 +2475,93 @@ instance HsProtobuf.Message ChangeEvent where ) decodeMessage _ = (Hs.pure ChangeEvent) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce @(_ (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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 7) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 7) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 8) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 8) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 9) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 10) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 10) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 11) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 11) + ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) @@ -2170,70 +2572,71 @@ instance HsProtobuf.Message ChangeEvent where [ ( (HsProtobuf.FieldNumber 15) , (Hs.pure (Hs.fmap ChangeEventTypeChangeCreated)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeCreatedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeCreatedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCreatedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCreatedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 16) , (Hs.pure (Hs.fmap ChangeEventTypeChangeCommented)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeCommentedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeCommentedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommentedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCommentedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 17) , (Hs.pure (Hs.fmap ChangeEventTypeChangeAbandoned)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeAbandonedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeAbandonedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeAbandonedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeAbandonedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 18) , (Hs.pure (Hs.fmap ChangeEventTypeChangeReviewed)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeReviewedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeReviewedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeReviewedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeReviewedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 19) , (Hs.pure (Hs.fmap ChangeEventTypeChangeCommitForcePushed)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitForcePushedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeCommitForcePushedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitForcePushedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCommitForcePushedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 20) , (Hs.pure (Hs.fmap ChangeEventTypeChangeCommitPushed)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitPushedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeCommitPushedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeCommitPushedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeCommitPushedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 21) , (Hs.pure (Hs.fmap ChangeEventTypeChangeMerged)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Change.ChangeMergedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Change.ChangeMergedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Change.ChangeMergedEvent) + @(Hs.Maybe Monocle.Protob.Change.ChangeMergedEvent) + (HsProtobuf.decodeMessageField) ) ) ] ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec Hs.Text)) - @(_ (Hs.Vector Hs.Text)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 22) @@ -2253,129 +2656,133 @@ instance HsProtobuf.Message ChangeEvent where (HsProtobuf.FieldNumber 24) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "created_at") + (HsProtobufAST.Single "created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Ident"))) - (HsProtobuf.Single "author") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_prefix") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_fullname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_shortname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "target_branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "target_branch") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 9) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "number") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "change_id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 12) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Ident"))) - (HsProtobuf.Single "on_author") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Ident")) + ) + (HsProtobufAST.Single "on_author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 13) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "on_created_at") + (HsProtobufAST.Single "on_created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 14) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "ChangedFilePath")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ChangedFilePath")) ) - (HsProtobuf.Single "changed_files") + (HsProtobufAST.Single "changed_files") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 22) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "labels") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 24) - (HsProtobuf.Prim HsProtobuf.Bool) - (HsProtobuf.Single "draft") + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "draft") [] "" ) @@ -2404,20 +2811,46 @@ instance HsJSONPB.ToJSONPB ChangeEvent where f24 ) = ( HsJSONPB.object - [ "id" .= f1 - , "created_at" .= f2 - , "author" .= f3 - , "repository_prefix" .= f4 - , "repository_fullname" .= f5 - , "repository_shortname" .= f6 - , "branch" .= f7 - , "target_branch" .= f8 + [ "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)) + , "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" .= f10 - , "url" .= f11 - , "on_author" .= f12 - , "on_created_at" .= f13 - , "changed_files" .= f14 + , "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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (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) -> @@ -2441,7 +2874,11 @@ instance HsJSONPB.ToJSONPB ChangeEvent where then ("type" .= (HsJSONPB.objectOrNull [encodeType] options)) options else encodeType options ) - , "labels" .= f22 + , "labels" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f22) + ) , ( let encodeOptional_duration = ( case f23 of Hs.Just (ChangeEventOptionalDurationDuration f23) -> @@ -2482,20 +2919,46 @@ instance HsJSONPB.ToJSONPB ChangeEvent where f24 ) = ( HsJSONPB.pairs - [ "id" .= f1 - , "created_at" .= f2 - , "author" .= f3 - , "repository_prefix" .= f4 - , "repository_fullname" .= f5 - , "repository_shortname" .= f6 - , "branch" .= f7 - , "target_branch" .= f8 + [ "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)) + , "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" .= f10 - , "url" .= f11 - , "on_author" .= f12 - , "on_created_at" .= f13 - , "changed_files" .= f14 + , "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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (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) -> @@ -2519,7 +2982,11 @@ instance HsJSONPB.ToJSONPB ChangeEvent where then ("type" .= (HsJSONPB.pairsOrNull [encodeType] options)) options else encodeType options ) - , "labels" .= f22 + , "labels" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f22) + ) , ( let encodeOptional_duration = ( case f23 of Hs.Just (ChangeEventOptionalDurationDuration f23) -> @@ -2545,20 +3012,56 @@ instance HsJSONPB.FromJSONPB ChangeEvent where "ChangeEvent" ( \obj -> (Hs.pure ChangeEvent) - <*> obj .: "id" - <*> obj .: "created_at" - <*> obj .: "author" - <*> obj .: "repository_prefix" - <*> obj .: "repository_fullname" - <*> obj .: "repository_shortname" - <*> obj .: "branch" - <*> obj .: "target_branch" + <*> ( 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 + @(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" - <*> obj .: "change_id" - <*> obj .: "url" - <*> obj .: "on_author" - <*> obj .: "on_created_at" - <*> obj .: "changed_files" + <*> ( 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 + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (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 @@ -2580,7 +3083,11 @@ instance HsJSONPB.FromJSONPB ChangeEvent where in ((obj .: "type") Hs.>>= (HsJSONPB.withObject "type" parseType)) <|> (parseType obj) ) - <*> obj .: "labels" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "labels") + ) <*> ( let parseOptional_duration parseObj = Hs.msum [ Hs.Just Hs.. ChangeEventOptionalDurationDuration @@ -2611,13 +3118,17 @@ data ChangeEventType | ChangeEventTypeChangeCommitForcePushed Monocle.Protob.Change.ChangeCommitForcePushedEvent | ChangeEventTypeChangeCommitPushed Monocle.Protob.Change.ChangeCommitPushedEvent | ChangeEventTypeChangeMerged Monocle.Protob.Change.ChangeMergedEvent - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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 - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeEventOptionalDuration instance HsProtobuf.Named ChangeEventOptionalDuration where nameOf _ = (Hs.fromString "ChangeEventOptionalDuration") diff --git a/codegen/Monocle/Protob/Config.hs b/codegen/Monocle/Protob/Config.hs index 8641fedca..8d4437dbb 100644 --- a/codegen/Monocle/Protob/Config.hs +++ b/codegen/Monocle/Protob/Config.hs @@ -29,12 +29,19 @@ import Data.Vector qualified as Hs (Vector) import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs @@ -45,7 +52,9 @@ data ProjectDefinition = ProjectDefinition , projectDefinitionBranchRegex :: Hs.Text , projectDefinitionFileRegex :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ProjectDefinition instance HsProtobuf.Named ProjectDefinition where nameOf _ = (Hs.fromString "ProjectDefinition") @@ -65,66 +74,82 @@ instance HsProtobuf.Message ProjectDefinition where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - projectDefinitionName + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (projectDefinitionName) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - projectDefinitionRepositoryRegex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (projectDefinitionRepositoryRegex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - projectDefinitionBranchRegex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (projectDefinitionBranchRegex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - projectDefinitionFileRegex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (projectDefinitionFileRegex) + ) ) ] ) decodeMessage _ = (Hs.pure ProjectDefinition) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( 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.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_regex") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_regex") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "branch_regex") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch_regex") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "file_regex") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "file_regex") [] "" ) @@ -133,18 +158,26 @@ instance HsProtobuf.Message ProjectDefinition where instance HsJSONPB.ToJSONPB ProjectDefinition where toJSONPB (ProjectDefinition f1 f2 f3 f4) = ( HsJSONPB.object - [ "name" .= f1 - , "repository_regex" .= f2 - , "branch_regex" .= f3 - , "file_regex" .= f4 + [ "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" .= f1 - , "repository_regex" .= f2 - , "branch_regex" .= f3 - , "file_regex" .= f4 + [ "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)) ] ) @@ -154,10 +187,18 @@ instance HsJSONPB.FromJSONPB ProjectDefinition where "ProjectDefinition" ( \obj -> (Hs.pure ProjectDefinition) - <*> obj .: "name" - <*> obj .: "repository_regex" - <*> obj .: "branch_regex" - <*> obj .: "file_regex" + <*> ( 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") + ) ) ) @@ -172,7 +213,9 @@ newtype GetProjectsRequest = GetProjectsRequest { getProjectsRequestIndex :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetProjectsRequest instance HsProtobuf.Named GetProjectsRequest where nameOf _ = (Hs.fromString "GetProjectsRequest") @@ -189,21 +232,25 @@ instance HsProtobuf.Message GetProjectsRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getProjectsRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getProjectsRequestIndex) + ) ) ] ) decodeMessage _ = (Hs.pure GetProjectsRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) @@ -211,15 +258,28 @@ instance HsProtobuf.Message GetProjectsRequest where instance HsJSONPB.ToJSONPB GetProjectsRequest where toJSONPB (GetProjectsRequest f1) = - (HsJSONPB.object ["index" .= f1]) + ( HsJSONPB.object + [ "index" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (GetProjectsRequest f1) = - (HsJSONPB.pairs ["index" .= f1]) + ( 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) <*> obj .: "index") + ( \obj -> + (Hs.pure GetProjectsRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "index") + ) + ) ) instance HsJSONPB.ToJSON GetProjectsRequest where @@ -233,7 +293,9 @@ newtype GetProjectsResponse = GetProjectsResponse { getProjectsResponseProjects :: Hs.Vector Monocle.Protob.Config.ProjectDefinition } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetProjectsResponse instance HsProtobuf.Named GetProjectsResponse where nameOf _ = (Hs.fromString "GetProjectsResponse") @@ -252,28 +314,28 @@ instance HsProtobuf.Message GetProjectsResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) - getProjectsResponseProjects + (getProjectsResponseProjects) ) ) ] ) decodeMessage _ = (Hs.pure GetProjectsResponse) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition)) - @(_ (Hs.Vector Monocle.Protob.Config.ProjectDefinition)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) + @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "ProjectDefinition")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ProjectDefinition")) ) - (HsProtobuf.Single "projects") + (HsProtobufAST.Single "projects") [] "" ) @@ -281,15 +343,36 @@ instance HsProtobuf.Message GetProjectsResponse where instance HsJSONPB.ToJSONPB GetProjectsResponse where toJSONPB (GetProjectsResponse f1) = - (HsJSONPB.object ["projects" .= f1]) + ( HsJSONPB.object + [ "projects" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) + @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) + (f1) + ) + ] + ) toEncodingPB (GetProjectsResponse f1) = - (HsJSONPB.pairs ["projects" .= f1]) + ( HsJSONPB.pairs + [ "projects" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.ProjectDefinition) + @(HsProtobuf.NestedVec Monocle.Protob.Config.ProjectDefinition) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB GetProjectsResponse where parseJSONPB = ( HsJSONPB.withObject "GetProjectsResponse" - (\obj -> (Hs.pure GetProjectsResponse) <*> obj .: "projects") + ( \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 @@ -300,7 +383,9 @@ instance HsJSONPB.FromJSON GetProjectsResponse where parseJSON = HsJSONPB.parseJSONPB newtype Workspace = Workspace {workspaceName :: Hs.Text} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Workspace instance HsProtobuf.Named Workspace where nameOf _ = (Hs.fromString "Workspace") @@ -312,35 +397,54 @@ instance HsProtobuf.Message Workspace where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - workspaceName + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (workspaceName) + ) ) ] ) decodeMessage _ = (Hs.pure Workspace) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") [] "" ) ] instance HsJSONPB.ToJSONPB Workspace where - toJSONPB (Workspace f1) = (HsJSONPB.object ["name" .= f1]) - toEncodingPB (Workspace f1) = (HsJSONPB.pairs ["name" .= f1]) + toJSONPB (Workspace 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 parseJSONPB = ( HsJSONPB.withObject "Workspace" - (\obj -> (Hs.pure Workspace) <*> obj .: "name") + ( \obj -> + (Hs.pure Workspace) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "name") + ) + ) ) instance HsJSONPB.ToJSON Workspace where @@ -354,7 +458,9 @@ newtype GetWorkspacesRequest = GetWorkspacesRequest { getWorkspacesRequestVoid :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetWorkspacesRequest instance HsProtobuf.Named GetWorkspacesRequest where nameOf _ = (Hs.fromString "GetWorkspacesRequest") @@ -371,21 +477,25 @@ instance HsProtobuf.Message GetWorkspacesRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getWorkspacesRequestVoid + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getWorkspacesRequestVoid) + ) ) ] ) decodeMessage _ = (Hs.pure GetWorkspacesRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "void") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") [] "" ) @@ -393,15 +503,28 @@ instance HsProtobuf.Message GetWorkspacesRequest where instance HsJSONPB.ToJSONPB GetWorkspacesRequest where toJSONPB (GetWorkspacesRequest f1) = - (HsJSONPB.object ["void" .= f1]) + ( HsJSONPB.object + [ "void" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (GetWorkspacesRequest f1) = - (HsJSONPB.pairs ["void" .= f1]) + ( 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) <*> obj .: "void") + ( \obj -> + (Hs.pure GetWorkspacesRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "void") + ) + ) ) instance HsJSONPB.ToJSON GetWorkspacesRequest where @@ -415,7 +538,9 @@ newtype GetWorkspacesResponse = GetWorkspacesResponse { getWorkspacesResponseWorkspaces :: Hs.Vector Monocle.Protob.Config.Workspace } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetWorkspacesResponse instance HsProtobuf.Named GetWorkspacesResponse where nameOf _ = (Hs.fromString "GetWorkspacesResponse") @@ -434,28 +559,28 @@ instance HsProtobuf.Message GetWorkspacesResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.Workspace) @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) - getWorkspacesResponseWorkspaces + (getWorkspacesResponseWorkspaces) ) ) ] ) decodeMessage _ = (Hs.pure GetWorkspacesResponse) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Config.Workspace)) - @(_ (Hs.Vector Monocle.Protob.Config.Workspace)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) + @(Hs.Vector Monocle.Protob.Config.Workspace) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Workspace")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Workspace")) ) - (HsProtobuf.Single "workspaces") + (HsProtobufAST.Single "workspaces") [] "" ) @@ -463,15 +588,36 @@ instance HsProtobuf.Message GetWorkspacesResponse where instance HsJSONPB.ToJSONPB GetWorkspacesResponse where toJSONPB (GetWorkspacesResponse f1) = - (HsJSONPB.object ["workspaces" .= f1]) + ( HsJSONPB.object + [ "workspaces" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.Workspace) + @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) + (f1) + ) + ] + ) toEncodingPB (GetWorkspacesResponse f1) = - (HsJSONPB.pairs ["workspaces" .= f1]) + ( HsJSONPB.pairs + [ "workspaces" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.Workspace) + @(HsProtobuf.NestedVec Monocle.Protob.Config.Workspace) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB GetWorkspacesResponse where parseJSONPB = ( HsJSONPB.withObject "GetWorkspacesResponse" - (\obj -> (Hs.pure GetWorkspacesResponse) <*> obj .: "workspaces") + ( \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 @@ -486,7 +632,9 @@ data About = About , aboutLinks :: Hs.Vector Monocle.Protob.Config.About_AboutLink , aboutAuth :: Hs.Maybe AboutAuth } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData About instance HsProtobuf.Named About where nameOf _ = (Hs.fromString "About") @@ -504,13 +652,15 @@ instance HsProtobuf.Message About where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - aboutVersion + ( 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 + (aboutLinks) ) ) , case aboutAuth of @@ -529,13 +679,15 @@ instance HsProtobuf.Message About where ) decodeMessage _ = (Hs.pure About) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) - <*> ( Hs.coerce - @(_ (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) @@ -546,28 +698,28 @@ instance HsProtobuf.Message About where [ ( (HsProtobuf.FieldNumber 3) , (Hs.pure (Hs.fmap AboutAuthAuthConfig)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Config.About_AuthConfig)) - @(_ (Hs.Maybe Monocle.Protob.Config.About_AuthConfig)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Config.About_AuthConfig) + @(Hs.Maybe Monocle.Protob.Config.About_AuthConfig) + (HsProtobuf.decodeMessageField) ) ) ] ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "version") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "version") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "AboutLink")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "AboutLink")) ) - (HsProtobuf.Single "links") + (HsProtobufAST.Single "links") [] "" ) @@ -576,8 +728,13 @@ instance HsProtobuf.Message About where instance HsJSONPB.ToJSONPB About where toJSONPB (About f1 f2 f3) = ( HsJSONPB.object - [ "version" .= f1 - , "links" .= f2 + [ "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) -> @@ -593,8 +750,13 @@ instance HsJSONPB.ToJSONPB About where ) toEncodingPB (About f1 f2 f3) = ( HsJSONPB.pairs - [ "version" .= f1 - , "links" .= f2 + [ "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) -> @@ -615,8 +777,14 @@ instance HsJSONPB.FromJSONPB About where "About" ( \obj -> (Hs.pure About) - <*> obj .: "version" - <*> obj .: "links" + <*> ( 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 @@ -642,7 +810,9 @@ data About_AboutLink = About_AboutLink , about_AboutLinkUrl :: Hs.Text , about_AboutLinkCategory :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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") @@ -660,51 +830,63 @@ instance HsProtobuf.Message About_AboutLink where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - about_AboutLinkName + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (about_AboutLinkName) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - about_AboutLinkUrl + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (about_AboutLinkUrl) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - about_AboutLinkCategory + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (about_AboutLinkCategory) + ) ) ] ) decodeMessage _ = (Hs.pure About_AboutLink) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "category") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "category") [] "" ) @@ -712,9 +894,23 @@ instance HsProtobuf.Message About_AboutLink where instance HsJSONPB.ToJSONPB About_AboutLink where toJSONPB (About_AboutLink f1 f2 f3) = - (HsJSONPB.object ["name" .= f1, "url" .= f2, "category" .= 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" .= f1, "url" .= f2, "category" .= 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 parseJSONPB = @@ -722,9 +918,15 @@ instance HsJSONPB.FromJSONPB About_AboutLink where "About_AboutLink" ( \obj -> (Hs.pure About_AboutLink) - <*> obj .: "name" - <*> obj .: "url" - <*> obj .: "category" + <*> ( 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") + ) ) ) @@ -741,7 +943,9 @@ data About_AuthConfig = About_AuthConfig , about_AuthConfigIssuer :: Hs.Text , about_AuthConfigProviderName :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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") @@ -764,11 +968,15 @@ instance HsProtobuf.Message About_AuthConfig where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - about_AuthConfigIssuer + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (about_AuthConfigIssuer) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - about_AuthConfigProviderName + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (about_AuthConfigProviderName) + ) ) ] ) @@ -778,33 +986,37 @@ instance HsProtobuf.Message About_AuthConfig where 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.Bool) - (HsProtobuf.Single "force_login") + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "force_login") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "issuer") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "issuer") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "provider_name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "provider_name") [] "" ) @@ -813,11 +1025,21 @@ instance HsProtobuf.Message About_AuthConfig where instance HsJSONPB.ToJSONPB About_AuthConfig where toJSONPB (About_AuthConfig f1 f2 f3) = ( HsJSONPB.object - ["force_login" .= f1, "issuer" .= f2, "provider_name" .= f3] + [ "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" .= f2, "provider_name" .= f3] + [ "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 @@ -827,8 +1049,12 @@ instance HsJSONPB.FromJSONPB About_AuthConfig where ( \obj -> (Hs.pure About_AuthConfig) <*> obj .: "force_login" - <*> obj .: "issuer" - <*> obj .: "provider_name" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "issuer") + ) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "provider_name") + ) ) ) @@ -840,7 +1066,9 @@ instance HsJSONPB.FromJSON About_AuthConfig where parseJSON = HsJSONPB.parseJSONPB data AboutAuth = AboutAuthAuthConfig Monocle.Protob.Config.About_AuthConfig - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AboutAuth instance HsProtobuf.Named AboutAuth where nameOf _ = (Hs.fromString "AboutAuth") @@ -849,7 +1077,9 @@ newtype GetAboutRequest = GetAboutRequest { getAboutRequestVoid :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetAboutRequest instance HsProtobuf.Named GetAboutRequest where nameOf _ = (Hs.fromString "GetAboutRequest") @@ -863,35 +1093,54 @@ instance HsProtobuf.Message GetAboutRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getAboutRequestVoid + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getAboutRequestVoid) + ) ) ] ) decodeMessage _ = (Hs.pure GetAboutRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "void") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") [] "" ) ] instance HsJSONPB.ToJSONPB GetAboutRequest where - toJSONPB (GetAboutRequest f1) = (HsJSONPB.object ["void" .= f1]) - toEncodingPB (GetAboutRequest f1) = (HsJSONPB.pairs ["void" .= f1]) + toJSONPB (GetAboutRequest 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 parseJSONPB = ( HsJSONPB.withObject "GetAboutRequest" - (\obj -> (Hs.pure GetAboutRequest) <*> obj .: "void") + ( \obj -> + (Hs.pure GetAboutRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "void") + ) + ) ) instance HsJSONPB.ToJSON GetAboutRequest where @@ -905,7 +1154,9 @@ newtype GetAboutResponse = GetAboutResponse { getAboutResponseAbout :: Hs.Maybe Monocle.Protob.Config.About } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetAboutResponse instance HsProtobuf.Named GetAboutResponse where nameOf _ = (Hs.fromString "GetAboutResponse") @@ -921,40 +1172,65 @@ instance HsProtobuf.Message GetAboutResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) @(HsProtobuf.Nested Monocle.Protob.Config.About) - getAboutResponseAbout + (getAboutResponseAbout) ) ) ] ) decodeMessage _ = (Hs.pure GetAboutResponse) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Config.About)) - @(_ (Hs.Maybe Monocle.Protob.Config.About)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Config.About) + @(Hs.Maybe Monocle.Protob.Config.About) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "About"))) - (HsProtobuf.Single "about") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "About")) + ) + (HsProtobufAST.Single "about") [] "" ) ] instance HsJSONPB.ToJSONPB GetAboutResponse where - toJSONPB (GetAboutResponse f1) = (HsJSONPB.object ["about" .= f1]) + toJSONPB (GetAboutResponse f1) = + ( HsJSONPB.object + [ "about" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) + @(HsProtobuf.Nested Monocle.Protob.Config.About) + (f1) + ) + ] + ) toEncodingPB (GetAboutResponse f1) = - (HsJSONPB.pairs ["about" .= f1]) + ( HsJSONPB.pairs + [ "about" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Config.About) + @(HsProtobuf.Nested Monocle.Protob.Config.About) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB GetAboutResponse where parseJSONPB = ( HsJSONPB.withObject "GetAboutResponse" - (\obj -> (Hs.pure GetAboutResponse) <*> obj .: "about") + ( \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 @@ -969,7 +1245,9 @@ data GroupDefinition = GroupDefinition Hs.Text , groupDefinitionMembers :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GroupDefinition instance HsProtobuf.Named GroupDefinition where nameOf _ = (Hs.fromString "GroupDefinition") @@ -986,7 +1264,9 @@ instance HsProtobuf.Message GroupDefinition where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - groupDefinitionName + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (groupDefinitionName) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -996,26 +1276,28 @@ instance HsProtobuf.Message GroupDefinition where ) decodeMessage _ = (Hs.pure GroupDefinition) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "members") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "members") [] "" ) @@ -1023,16 +1305,30 @@ instance HsProtobuf.Message GroupDefinition where instance HsJSONPB.ToJSONPB GroupDefinition where toJSONPB (GroupDefinition f1 f2) = - (HsJSONPB.object ["name" .= f1, "members" .= f2]) + ( HsJSONPB.object + [ "name" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "members" .= f2 + ] + ) toEncodingPB (GroupDefinition f1 f2) = - (HsJSONPB.pairs ["name" .= f1, "members" .= f2]) + ( 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) <*> obj .: "name" <*> obj .: "members" + (Hs.pure GroupDefinition) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "name") + ) + <*> obj .: "members" ) ) @@ -1047,7 +1343,9 @@ newtype GetGroupsRequest = GetGroupsRequest { getGroupsRequestIndex :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetGroupsRequest instance HsProtobuf.Named GetGroupsRequest where nameOf _ = (Hs.fromString "GetGroupsRequest") @@ -1061,36 +1359,54 @@ instance HsProtobuf.Message GetGroupsRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getGroupsRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getGroupsRequestIndex) + ) ) ] ) decodeMessage _ = (Hs.pure GetGroupsRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) ] instance HsJSONPB.ToJSONPB GetGroupsRequest where - toJSONPB (GetGroupsRequest f1) = (HsJSONPB.object ["index" .= f1]) + toJSONPB (GetGroupsRequest f1) = + ( HsJSONPB.object + [ "index" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (GetGroupsRequest f1) = - (HsJSONPB.pairs ["index" .= f1]) + ( 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) <*> obj .: "index") + ( \obj -> + (Hs.pure GetGroupsRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "index") + ) + ) ) instance HsJSONPB.ToJSON GetGroupsRequest where @@ -1104,7 +1420,9 @@ newtype GetGroupsResponse = GetGroupsResponse { getGroupsResponseItems :: Hs.Vector Monocle.Protob.Config.GroupDefinition } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetGroupsResponse instance HsProtobuf.Named GetGroupsResponse where nameOf _ = (Hs.fromString "GetGroupsResponse") @@ -1120,43 +1438,65 @@ instance HsProtobuf.Message GetGroupsResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) - getGroupsResponseItems + (getGroupsResponseItems) ) ) ] ) decodeMessage _ = (Hs.pure GetGroupsResponse) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition)) - @(_ (Hs.Vector Monocle.Protob.Config.GroupDefinition)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) + @(Hs.Vector Monocle.Protob.Config.GroupDefinition) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "GroupDefinition")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "GroupDefinition")) ) - (HsProtobuf.Single "items") + (HsProtobufAST.Single "items") [] "" ) ] instance HsJSONPB.ToJSONPB GetGroupsResponse where - toJSONPB (GetGroupsResponse f1) = (HsJSONPB.object ["items" .= f1]) + toJSONPB (GetGroupsResponse f1) = + ( HsJSONPB.object + [ "items" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) + @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) + (f1) + ) + ] + ) toEncodingPB (GetGroupsResponse f1) = - (HsJSONPB.pairs ["items" .= f1]) + ( HsJSONPB.pairs + [ "items" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Config.GroupDefinition) + @(HsProtobuf.NestedVec Monocle.Protob.Config.GroupDefinition) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB GetGroupsResponse where parseJSONPB = ( HsJSONPB.withObject "GetGroupsResponse" - (\obj -> (Hs.pure GetGroupsResponse) <*> obj .: "items") + ( \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 @@ -1171,7 +1511,9 @@ data GetGroupMembersRequest = GetGroupMembersRequest Hs.Text , getGroupMembersRequestGroup :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetGroupMembersRequest instance HsProtobuf.Named GetGroupMembersRequest where nameOf _ = (Hs.fromString "GetGroupMembersRequest") @@ -1189,36 +1531,44 @@ instance HsProtobuf.Message GetGroupMembersRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getGroupMembersRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getGroupMembersRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - getGroupMembersRequestGroup + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getGroupMembersRequestGroup) + ) ) ] ) decodeMessage _ = (Hs.pure GetGroupMembersRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "group") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "group") [] "" ) @@ -1226,9 +1576,21 @@ instance HsProtobuf.Message GetGroupMembersRequest where instance HsJSONPB.ToJSONPB GetGroupMembersRequest where toJSONPB (GetGroupMembersRequest f1 f2) = - (HsJSONPB.object ["index" .= f1, "group" .= 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" .= f1, "group" .= 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 parseJSONPB = @@ -1236,8 +1598,12 @@ instance HsJSONPB.FromJSONPB GetGroupMembersRequest where "GetGroupMembersRequest" ( \obj -> (Hs.pure GetGroupMembersRequest) - <*> obj .: "index" - <*> obj .: "group" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "index") + ) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "group") + ) ) ) @@ -1252,7 +1618,9 @@ newtype GetGroupMembersResponse = GetGroupMembersResponse { getGroupMembersResponseMembers :: Hs.Vector Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetGroupMembersResponse instance HsProtobuf.Named GetGroupMembersResponse where nameOf _ = (Hs.fromString "GetGroupMembersResponse") @@ -1269,26 +1637,28 @@ instance HsProtobuf.Message GetGroupMembersResponse where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - getGroupMembersResponseMembers + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (getGroupMembersResponseMembers) ) ) ] ) decodeMessage _ = (Hs.pure GetGroupMembersResponse) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec Hs.Text)) - @(_ (Hs.Vector Hs.Text)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "members") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "members") [] "" ) @@ -1296,15 +1666,36 @@ instance HsProtobuf.Message GetGroupMembersResponse where instance HsJSONPB.ToJSONPB GetGroupMembersResponse where toJSONPB (GetGroupMembersResponse f1) = - (HsJSONPB.object ["members" .= f1]) + ( HsJSONPB.object + [ "members" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f1) + ) + ] + ) toEncodingPB (GetGroupMembersResponse f1) = - (HsJSONPB.pairs ["members" .= f1]) + ( HsJSONPB.pairs + [ "members" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB GetGroupMembersResponse where parseJSONPB = ( HsJSONPB.withObject "GetGroupMembersResponse" - (\obj -> (Hs.pure GetGroupMembersResponse) <*> obj .: "members") + ( \obj -> + (Hs.pure GetGroupMembersResponse) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "members") + ) + ) ) instance HsJSONPB.ToJSON GetGroupMembersResponse where diff --git a/codegen/Monocle/Protob/Crawler.hs b/codegen/Monocle/Protob/Crawler.hs index e21fd8a6e..ec956602a 100644 --- a/codegen/Monocle/Protob/Crawler.hs +++ b/codegen/Monocle/Protob/Crawler.hs @@ -30,20 +30,29 @@ import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs import Google.Protobuf.Timestamp qualified +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Monocle.Protob.Change qualified import Monocle.Protob.Issue qualified import Monocle.Protob.Search qualified import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs newtype Entity = Entity {entityEntity :: Hs.Maybe EntityEntity} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Entity instance HsProtobuf.Named Entity where nameOf _ = (Hs.fromString "Entity") @@ -60,22 +69,30 @@ instance HsProtobuf.Message Entity where EntityEntityOrganizationName y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) EntityEntityProjectName y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) EntityEntityProjectIssueName y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) EntityEntityTdName y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) ] ) @@ -86,22 +103,30 @@ instance HsProtobuf.Message Entity where [ ( (HsProtobuf.FieldNumber 1) , (Hs.pure (Hs.Just Hs.. EntityEntityOrganizationName)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.Just Hs.. EntityEntityProjectName)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) , ( (HsProtobuf.FieldNumber 4) , (Hs.pure (Hs.Just Hs.. EntityEntityProjectIssueName)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) , ( (HsProtobuf.FieldNumber 3) , (Hs.pure (Hs.Just Hs.. EntityEntityTdName)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) ] ) @@ -113,12 +138,25 @@ instance HsJSONPB.ToJSONPB Entity where [ ( let encodeEntity = ( case f1_or_f2_or_f4_or_f3 of Hs.Just (EntityEntityOrganizationName f1) -> - (HsJSONPB.pair "organization_name" f1) + ( HsJSONPB.pair + "organization_name" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ) Hs.Just (EntityEntityProjectName f2) -> - (HsJSONPB.pair "project_name" f2) + ( HsJSONPB.pair + "project_name" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) + ) Hs.Just (EntityEntityProjectIssueName f4) -> - (HsJSONPB.pair "project_issue_name" f4) - Hs.Just (EntityEntityTdName f3) -> (HsJSONPB.pair "td_name" f3) + ( 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.Nothing -> Hs.mempty ) in \options -> @@ -135,12 +173,25 @@ instance HsJSONPB.ToJSONPB Entity where [ ( let encodeEntity = ( case f1_or_f2_or_f4_or_f3 of Hs.Just (EntityEntityOrganizationName f1) -> - (HsJSONPB.pair "organization_name" f1) + ( HsJSONPB.pair + "organization_name" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ) Hs.Just (EntityEntityProjectName f2) -> - (HsJSONPB.pair "project_name" f2) + ( HsJSONPB.pair + "project_name" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f2)) + ) Hs.Just (EntityEntityProjectIssueName f4) -> - (HsJSONPB.pair "project_issue_name" f4) - Hs.Just (EntityEntityTdName f3) -> (HsJSONPB.pair "td_name" f3) + ( 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.Nothing -> Hs.mempty ) in \options -> @@ -159,13 +210,21 @@ instance HsJSONPB.FromJSONPB Entity where (Hs.pure Entity) <*> ( let parseEntity parseObj = Hs.msum - [ Hs.Just Hs.. EntityEntityOrganizationName + [ Hs.Just + Hs.. EntityEntityOrganizationName + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "organization_name") - , Hs.Just Hs.. EntityEntityProjectName + , Hs.Just + Hs.. EntityEntityProjectName + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "project_name") - , Hs.Just Hs.. EntityEntityProjectIssueName + , Hs.Just + Hs.. EntityEntityProjectIssueName + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "project_issue_name") - , Hs.Just Hs.. EntityEntityTdName + , Hs.Just + Hs.. EntityEntityTdName + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "td_name") , Hs.pure Hs.Nothing ] @@ -189,7 +248,9 @@ data EntityEntity | EntityEntityProjectName Hs.Text | EntityEntityProjectIssueName Hs.Text | EntityEntityTdName Hs.Text - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData EntityEntity instance HsProtobuf.Named EntityEntity where nameOf _ = (Hs.fromString "EntityEntity") @@ -262,7 +323,9 @@ data AddDocRequest = AddDocRequest , addDocRequestIssueEvents :: Hs.Vector Monocle.Protob.Issue.IssueEvent } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AddDocRequest instance HsProtobuf.Named AddDocRequest where nameOf _ = (Hs.fromString "AddDocRequest") @@ -287,234 +350,251 @@ instance HsProtobuf.Message AddDocRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - addDocRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (addDocRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - addDocRequestCrawler + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (addDocRequestCrawler) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - addDocRequestApikey + ( 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 + (addDocRequestEntity) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.Change) @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) - addDocRequestChanges + (addDocRequestChanges) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) ( Hs.coerce @(Hs.Vector Monocle.Protob.Change.ChangeEvent) @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) - addDocRequestEvents + (addDocRequestEvents) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) ( Hs.coerce @(Hs.Vector Monocle.Protob.Crawler.Project) @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) - addDocRequestProjects + (addDocRequestProjects) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 8) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - addDocRequestTaskDatas + (addDocRequestTaskDatas) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.Issue) @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) - addDocRequestIssues + (addDocRequestIssues) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.IssueEvent) @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) - addDocRequestIssueEvents + (addDocRequestIssueEvents) ) ) ] ) decodeMessage _ = (Hs.pure AddDocRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "crawler") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "apikey") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "apikey") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Entity"))) - (HsProtobuf.Single "entity") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_change" Hs.:| ["Change"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["Change"])) ) ) ) - (HsProtobuf.Single "changes") + (HsProtobufAST.Single "changes") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_change" Hs.:| ["ChangeEvent"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["ChangeEvent"])) ) ) ) - (HsProtobuf.Single "events") + (HsProtobufAST.Single "events") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Project")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Project")) ) - (HsProtobuf.Single "projects") + (HsProtobufAST.Single "projects") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_search" Hs.:| ["TaskData"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_search" Hs.:| ["TaskData"])) ) ) ) - (HsProtobuf.Single "task_datas") + (HsProtobufAST.Single "task_datas") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_issue" Hs.:| ["Issue"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_issue" Hs.:| ["Issue"])) ) ) ) - (HsProtobuf.Single "issues") + (HsProtobufAST.Single "issues") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_issue" Hs.:| ["IssueEvent"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_issue" Hs.:| ["IssueEvent"])) ) ) ) - (HsProtobuf.Single "issue_events") + (HsProtobufAST.Single "issue_events") [] "" ) @@ -523,30 +603,92 @@ instance HsProtobuf.Message AddDocRequest where instance HsJSONPB.ToJSONPB AddDocRequest where toJSONPB (AddDocRequest f1 f2 f3 f4 f5 f6 f7 f8 f10 f11) = ( HsJSONPB.object - [ "index" .= f1 - , "crawler" .= f2 - , "apikey" .= f3 - , "entity" .= f4 - , "changes" .= f5 - , "events" .= f6 - , "projects" .= f7 - , "task_datas" .= f8 - , "issues" .= f10 - , "issue_events" .= f11 + [ "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) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) + (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) + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) + (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) + @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) + (f10) + ) + , "issue_events" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) + (f11) + ) ] ) toEncodingPB (AddDocRequest f1 f2 f3 f4 f5 f6 f7 f8 f10 f11) = ( HsJSONPB.pairs - [ "index" .= f1 - , "crawler" .= f2 - , "apikey" .= f3 - , "entity" .= f4 - , "changes" .= f5 - , "events" .= f6 - , "projects" .= f7 - , "task_datas" .= f8 - , "issues" .= f10 - , "issue_events" .= f11 + [ "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) + @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) + (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) + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) + (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) + @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) + (f10) + ) + , "issue_events" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) + (f11) + ) ] ) @@ -556,16 +698,50 @@ instance HsJSONPB.FromJSONPB AddDocRequest where "AddDocRequest" ( \obj -> (Hs.pure AddDocRequest) - <*> obj .: "index" - <*> obj .: "crawler" - <*> obj .: "apikey" - <*> obj .: "entity" - <*> obj .: "changes" - <*> obj .: "events" - <*> obj .: "projects" - <*> obj .: "task_datas" - <*> obj .: "issues" - <*> obj .: "issue_events" + <*> ( 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 + @(HsProtobuf.NestedVec Monocle.Protob.Change.Change) + @(Hs.Vector Monocle.Protob.Change.Change) + (obj .: "changes") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Change.ChangeEvent) + @(Hs.Vector Monocle.Protob.Change.ChangeEvent) + (obj .: "events") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Crawler.Project) + @(Hs.Vector Monocle.Protob.Crawler.Project) + (obj .: "projects") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) + @(Hs.Vector Monocle.Protob.Search.TaskData) + (obj .: "task_datas") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Issue.Issue) + @(Hs.Vector Monocle.Protob.Issue.Issue) + (obj .: "issues") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Issue.IssueEvent) + @(Hs.Vector Monocle.Protob.Issue.IssueEvent) + (obj .: "issue_events") + ) ) ) @@ -637,7 +813,9 @@ newtype AddDocResponse = AddDocResponse { addDocResponseResult :: Hs.Maybe AddDocResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AddDocResponse instance HsProtobuf.Named AddDocResponse where nameOf _ = (Hs.fromString "AddDocResponse") @@ -739,7 +917,9 @@ data AddDocResponseResult ( HsProtobuf.Enumerated Monocle.Protob.Crawler.AddDocError ) - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AddDocResponseResult instance HsProtobuf.Named AddDocResponseResult where nameOf _ = (Hs.fromString "AddDocResponseResult") @@ -752,7 +932,9 @@ data CommitRequest = CommitRequest , commitRequestTimestamp :: Hs.Maybe Google.Protobuf.Timestamp.Timestamp } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CommitRequest instance HsProtobuf.Named CommitRequest where nameOf _ = (Hs.fromString "CommitRequest") @@ -772,100 +954,115 @@ instance HsProtobuf.Message CommitRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - commitRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (commitRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - commitRequestCrawler + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (commitRequestCrawler) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - commitRequestApikey + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (commitRequestApikey) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - commitRequestEntity + (commitRequestEntity) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - commitRequestTimestamp + (commitRequestTimestamp) ) ) ] ) decodeMessage _ = (Hs.pure CommitRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "crawler") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "apikey") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "apikey") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Entity"))) - (HsProtobuf.Single "entity") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "timestamp") + (HsProtobufAST.Single "timestamp") [] "" ) @@ -874,20 +1071,42 @@ instance HsProtobuf.Message CommitRequest where instance HsJSONPB.ToJSONPB CommitRequest where toJSONPB (CommitRequest f1 f2 f3 f4 f5) = ( HsJSONPB.object - [ "index" .= f1 - , "crawler" .= f2 - , "apikey" .= f3 - , "entity" .= f4 - , "timestamp" .= f5 + [ "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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f5) + ) ] ) toEncodingPB (CommitRequest f1 f2 f3 f4 f5) = ( HsJSONPB.pairs - [ "index" .= f1 - , "crawler" .= f2 - , "apikey" .= f3 - , "entity" .= f4 - , "timestamp" .= f5 + [ "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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f5) + ) ] ) @@ -897,11 +1116,25 @@ instance HsJSONPB.FromJSONPB CommitRequest where "CommitRequest" ( \obj -> (Hs.pure CommitRequest) - <*> obj .: "index" - <*> obj .: "crawler" - <*> obj .: "apikey" - <*> obj .: "entity" - <*> obj .: "timestamp" + <*> ( 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 + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (obj .: "timestamp") + ) ) ) @@ -979,7 +1212,9 @@ newtype CommitResponse = CommitResponse { commitResponseResult :: Hs.Maybe CommitResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CommitResponse instance HsProtobuf.Named CommitResponse where nameOf _ = (Hs.fromString "CommitResponse") @@ -1022,10 +1257,10 @@ instance HsProtobuf.Message CommitResponse where , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.fmap CommitResponseResultTimestamp)) - <*> ( Hs.coerce - @(_ (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.decodeMessageField) ) ) ] @@ -1105,7 +1340,9 @@ data CommitResponseResult Monocle.Protob.Crawler.CommitError ) | CommitResponseResultTimestamp Google.Protobuf.Timestamp.Timestamp - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CommitResponseResult instance HsProtobuf.Named CommitResponseResult where nameOf _ = (Hs.fromString "CommitResponseResult") @@ -1118,7 +1355,9 @@ data CommitInfoRequest = CommitInfoRequest HsProtobuf.Enumerated Monocle.Protob.Crawler.EntityType , commitInfoRequestOffset :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CommitInfoRequest instance HsProtobuf.Named CommitInfoRequest where nameOf _ = (Hs.fromString "CommitInfoRequest") @@ -1137,11 +1376,15 @@ instance HsProtobuf.Message CommitInfoRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - commitInfoRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (commitInfoRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - commitInfoRequestCrawler + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (commitInfoRequestCrawler) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) @@ -1155,13 +1398,17 @@ instance HsProtobuf.Message CommitInfoRequest where ) decodeMessage _ = (Hs.pure CommitInfoRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at HsProtobuf.decodeMessageField @@ -1172,33 +1419,33 @@ instance HsProtobuf.Message CommitInfoRequest where (HsProtobuf.FieldNumber 4) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "crawler") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "crawler") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "EntityType")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "EntityType")) ) - (HsProtobuf.Single "entity") + (HsProtobufAST.Single "entity") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "offset") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "offset") [] "" ) @@ -1207,11 +1454,23 @@ instance HsProtobuf.Message CommitInfoRequest where instance HsJSONPB.ToJSONPB CommitInfoRequest where toJSONPB (CommitInfoRequest f1 f2 f3 f4) = ( HsJSONPB.object - ["index" .= f1, "crawler" .= f2, "entity" .= f3, "offset" .= f4] + [ "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" .= f1, "crawler" .= f2, "entity" .= f3, "offset" .= f4] + [ "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 @@ -1220,8 +1479,12 @@ instance HsJSONPB.FromJSONPB CommitInfoRequest where "CommitInfoRequest" ( \obj -> (Hs.pure CommitInfoRequest) - <*> obj .: "index" - <*> obj .: "crawler" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "index") + ) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "crawler") + ) <*> obj .: "entity" <*> obj .: "offset" ) @@ -1290,7 +1553,9 @@ newtype CommitInfoResponse = CommitInfoResponse { commitInfoResponseResult :: Hs.Maybe CommitInfoResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CommitInfoResponse instance HsProtobuf.Named CommitInfoResponse where nameOf _ = (Hs.fromString "CommitInfoResponse") @@ -1337,10 +1602,10 @@ instance HsProtobuf.Message CommitInfoResponse where , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.fmap CommitInfoResponseResultEntity)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity)) - @(_ (Hs.Maybe Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) + @(Hs.Maybe Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity) + (HsProtobuf.decodeMessageField) ) ) ] @@ -1422,7 +1687,9 @@ data CommitInfoResponse_OldestEntity = CommitInfoResponse_OldestEntity Hs.Maybe Google.Protobuf.Timestamp.Timestamp } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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") @@ -1443,53 +1710,56 @@ instance HsProtobuf.Message CommitInfoResponse_OldestEntity where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Crawler.Entity) @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) - commitInfoResponse_OldestEntityEntity + (commitInfoResponse_OldestEntityEntity) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - commitInfoResponse_OldestEntityLastCommitAt + (commitInfoResponse_OldestEntityLastCommitAt) ) ) ] ) decodeMessage _ = (Hs.pure CommitInfoResponse_OldestEntity) - <*> ( Hs.coerce @(_ (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 1) ) ) - <*> ( Hs.coerce - @(_ (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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Entity"))) - (HsProtobuf.Single "entity") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Entity")) + ) + (HsProtobufAST.Single "entity") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "last_commit_at") + (HsProtobufAST.Single "last_commit_at") [] "" ) @@ -1497,9 +1767,33 @@ instance HsProtobuf.Message CommitInfoResponse_OldestEntity where instance HsJSONPB.ToJSONPB CommitInfoResponse_OldestEntity where toJSONPB (CommitInfoResponse_OldestEntity f1 f2) = - (HsJSONPB.object ["entity" .= f1, "last_commit_at" .= f2]) + ( 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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f2) + ) + ] + ) toEncodingPB (CommitInfoResponse_OldestEntity f1 f2) = - (HsJSONPB.pairs ["entity" .= f1, "last_commit_at" .= f2]) + ( 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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f2) + ) + ] + ) instance HsJSONPB.FromJSONPB CommitInfoResponse_OldestEntity where parseJSONPB = @@ -1507,8 +1801,16 @@ instance HsJSONPB.FromJSONPB CommitInfoResponse_OldestEntity where "CommitInfoResponse_OldestEntity" ( \obj -> (Hs.pure CommitInfoResponse_OldestEntity) - <*> obj .: "entity" - <*> obj .: "last_commit_at" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Crawler.Entity) + @(Hs.Maybe Monocle.Protob.Crawler.Entity) + (obj .: "entity") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (obj .: "last_commit_at") + ) ) ) @@ -1525,13 +1827,17 @@ data CommitInfoResponseResult Monocle.Protob.Crawler.CommitInfoError ) | CommitInfoResponseResultEntity Monocle.Protob.Crawler.CommitInfoResponse_OldestEntity - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Project instance HsProtobuf.Named Project where nameOf _ = (Hs.fromString "Project") @@ -1543,35 +1849,54 @@ instance HsProtobuf.Message Project where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - projectFullPath + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (projectFullPath) + ) ) ] ) decodeMessage _ = (Hs.pure Project) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "full_path") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "full_path") [] "" ) ] instance HsJSONPB.ToJSONPB Project where - toJSONPB (Project f1) = (HsJSONPB.object ["full_path" .= f1]) - toEncodingPB (Project f1) = (HsJSONPB.pairs ["full_path" .= f1]) + toJSONPB (Project 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 parseJSONPB = ( HsJSONPB.withObject "Project" - (\obj -> (Hs.pure Project) <*> obj .: "full_path") + ( \obj -> + (Hs.pure Project) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "full_path") + ) + ) ) instance HsJSONPB.ToJSON Project where diff --git a/codegen/Monocle/Protob/Issue.hs b/codegen/Monocle/Protob/Issue.hs index fdeaf5369..9df736592 100644 --- a/codegen/Monocle/Protob/Issue.hs +++ b/codegen/Monocle/Protob/Issue.hs @@ -30,18 +30,27 @@ import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs import Google.Protobuf.Timestamp qualified +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Monocle.Protob.Change qualified import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs data Ident = Ident {identUid :: Hs.Text, identMuid :: Hs.Text} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Ident instance HsProtobuf.Named Ident where nameOf _ = (Hs.fromString "Ident") @@ -53,36 +62,40 @@ instance HsProtobuf.Message Ident where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - identUid + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identUid)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - identMuid + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (identMuid)) ) ] ) decodeMessage _ = (Hs.pure Ident) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "uid") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "uid") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "muid") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "muid") [] "" ) @@ -90,15 +103,33 @@ instance HsProtobuf.Message Ident where instance HsJSONPB.ToJSONPB Ident where toJSONPB (Ident f1 f2) = - (HsJSONPB.object ["uid" .= f1, "muid" .= 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" .= f1, "muid" .= 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 parseJSONPB = ( HsJSONPB.withObject "Ident" - (\obj -> (Hs.pure Ident) <*> obj .: "uid" <*> obj .: "muid") + ( \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 @@ -123,7 +154,9 @@ data Issue = Issue , issueOptionalClosedAt :: Hs.Maybe IssueOptionalClosedAt , issueState :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Issue instance HsProtobuf.Named Issue where nameOf _ = (Hs.fromString "Issue") @@ -151,7 +184,7 @@ instance HsProtobuf.Message Issue where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - issueId + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueId)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -159,47 +192,53 @@ instance HsProtobuf.Message Issue where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - issueTitle + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueTitle)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - issueText + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueText)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) - issueUrl + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueUrl)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 13) - issueRepositoryPrefix + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueRepositoryPrefix) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 14) - issueRepositoryFullname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueRepositoryFullname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 15) - issueRepositoryShortname + ( 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 + (issueAuthor) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 20) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - issueCreatedAt + (issueCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 22) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - issueUpdatedAt + (issueUpdatedAt) ) ) , case issueOptionalClosedAt of @@ -216,62 +255,77 @@ instance HsProtobuf.Message Issue where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 24) - issueState + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (issueState)) ) ] ) decodeMessage _ = (Hs.pure Issue) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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 4) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 13) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 13) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 14) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 14) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 15) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 15) + ) ) - <*> ( Hs.coerce @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) @@ -282,118 +336,120 @@ instance HsProtobuf.Message Issue where [ ( (HsProtobuf.FieldNumber 23) , (Hs.pure (Hs.fmap IssueOptionalClosedAtClosedAt)) - <*> ( Hs.coerce - @(_ (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.decodeMessageField) ) ) ] ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 24) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 24) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "number") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "title") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "text") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "text") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 13) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_prefix") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 14) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_fullname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 15) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_shortname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 16) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_change" Hs.:| ["Ident"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["Ident"])) ) ) ) - (HsProtobuf.Single "author") + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 20) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "created_at") + (HsProtobufAST.Single "created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 22) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "updated_at") + (HsProtobufAST.Single "updated_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 24) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "state") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "state") [] "" ) @@ -402,17 +458,33 @@ instance HsProtobuf.Message 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" .= f1 + [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) , "number" .= f2 - , "title" .= f4 - , "text" .= f5 - , "url" .= f6 - , "repository_prefix" .= f13 - , "repository_fullname" .= f14 - , "repository_shortname" .= f15 - , "author" .= f16 - , "created_at" .= f20 - , "updated_at" .= f22 + , "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) + @(HsProtobuf.Nested 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) -> @@ -428,22 +500,39 @@ instance HsJSONPB.ToJSONPB Issue where options else encodeOptional_closed_at options ) - , "state" .= f24 + , "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" .= f1 + [ "id" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) , "number" .= f2 - , "title" .= f4 - , "text" .= f5 - , "url" .= f6 - , "repository_prefix" .= f13 - , "repository_fullname" .= f14 - , "repository_shortname" .= f15 - , "author" .= f16 - , "created_at" .= f20 - , "updated_at" .= f22 + , "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) + @(HsProtobuf.Nested 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) -> @@ -459,7 +548,8 @@ instance HsJSONPB.ToJSONPB Issue where options else encodeOptional_closed_at options ) - , "state" .= f24 + , "state" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f24)) ] ) @@ -469,17 +559,43 @@ instance HsJSONPB.FromJSONPB Issue where "Issue" ( \obj -> (Hs.pure Issue) - <*> obj .: "id" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "id") + ) <*> obj .: "number" - <*> obj .: "title" - <*> obj .: "text" - <*> obj .: "url" - <*> obj .: "repository_prefix" - <*> obj .: "repository_fullname" - <*> obj .: "repository_shortname" - <*> obj .: "author" - <*> obj .: "created_at" - <*> obj .: "updated_at" + <*> ( 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 + @(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") + ) <*> ( let parseOptional_closed_at parseObj = Hs.msum [ Hs.Just Hs.. IssueOptionalClosedAtClosedAt @@ -491,7 +607,9 @@ instance HsJSONPB.FromJSONPB Issue where ) <|> (parseOptional_closed_at obj) ) - <*> obj .: "state" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "state") + ) ) ) @@ -503,7 +621,9 @@ instance HsJSONPB.FromJSON Issue where parseJSON = HsJSONPB.parseJSONPB data IssueOptionalClosedAt = IssueOptionalClosedAtClosedAt Google.Protobuf.Timestamp.Timestamp - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData IssueOptionalClosedAt instance HsProtobuf.Named IssueOptionalClosedAt where nameOf _ = (Hs.fromString "IssueOptionalClosedAt") @@ -520,7 +640,9 @@ data IssueEvent = IssueEvent , issueEventUrl :: Hs.Text , issueEventType :: Hs.Maybe IssueEventType } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData IssueEvent instance HsProtobuf.Named IssueEvent where nameOf _ = (Hs.fromString "IssueEvent") @@ -544,33 +666,41 @@ instance HsProtobuf.Message IssueEvent where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - issueEventId + ( 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 + (issueEventCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Change.Ident) @(HsProtobuf.Nested Monocle.Protob.Change.Ident) - issueEventAuthor + (issueEventAuthor) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - issueEventRepositoryPrefix + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueEventRepositoryPrefix) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - issueEventRepositoryFullname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueEventRepositoryFullname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) - issueEventRepositoryShortname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueEventRepositoryShortname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 9) @@ -578,7 +708,9 @@ instance HsProtobuf.Message IssueEvent where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - issueEventUrl + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueEventUrl) + ) ) , case issueEventType of Hs.Nothing -> Hs.mempty @@ -612,142 +744,153 @@ instance HsProtobuf.Message IssueEvent where ) decodeMessage _ = (Hs.pure IssueEvent) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce @(_ (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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( 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.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 9) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 11) + <*> ( 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)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Issue.IssueCreatedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Issue.IssueCreatedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCreatedEvent) + @(Hs.Maybe Monocle.Protob.Issue.IssueCreatedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 16) , (Hs.pure (Hs.fmap IssueEventTypeIssueCommented)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Issue.IssueCommentedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Issue.IssueCommentedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueCommentedEvent) + @(Hs.Maybe Monocle.Protob.Issue.IssueCommentedEvent) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 21) , (Hs.pure (Hs.fmap IssueEventTypeIssueClosed)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Issue.IssueClosedEvent)) - @(_ (Hs.Maybe Monocle.Protob.Issue.IssueClosedEvent)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Issue.IssueClosedEvent) + @(Hs.Maybe Monocle.Protob.Issue.IssueClosedEvent) + (HsProtobuf.decodeMessageField) ) ) ] ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "created_at") + (HsProtobufAST.Single "created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_change" Hs.:| ["Ident"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_change" Hs.:| ["Ident"])) ) ) ) - (HsProtobuf.Single "author") + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_prefix") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_prefix") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_fullname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_shortname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_shortname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 9) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "number") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "number") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) @@ -756,14 +899,25 @@ instance HsProtobuf.Message 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" .= f1 - , "created_at" .= f2 - , "author" .= f3 - , "repository_prefix" .= f4 - , "repository_fullname" .= f5 - , "repository_shortname" .= f6 + [ "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" .= f11 + , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) , ( let encodeType = ( case f15_or_f16_or_f21 of Hs.Just (IssueEventTypeIssueCreated f15) -> @@ -784,14 +938,25 @@ instance HsJSONPB.ToJSONPB IssueEvent where toEncodingPB (IssueEvent f1 f2 f3 f4 f5 f6 f9 f11 f15_or_f16_or_f21) = ( HsJSONPB.pairs - [ "id" .= f1 - , "created_at" .= f2 - , "author" .= f3 - , "repository_prefix" .= f4 - , "repository_fullname" .= f5 - , "repository_shortname" .= f6 + [ "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" .= f11 + , "url" .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f11)) , ( let encodeType = ( case f15_or_f16_or_f21 of Hs.Just (IssueEventTypeIssueCreated f15) -> @@ -816,14 +981,32 @@ instance HsJSONPB.FromJSONPB IssueEvent where "IssueEvent" ( \obj -> (Hs.pure IssueEvent) - <*> obj .: "id" - <*> obj .: "created_at" - <*> obj .: "author" - <*> obj .: "repository_prefix" - <*> obj .: "repository_fullname" - <*> obj .: "repository_shortname" + <*> ( 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 + @(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" - <*> obj .: "url" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "url") + ) <*> ( let parseType parseObj = Hs.msum [ Hs.Just Hs.. IssueEventTypeIssueCreated @@ -851,13 +1034,17 @@ 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, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData IssueCreatedEvent instance HsProtobuf.Named IssueCreatedEvent where nameOf _ = (Hs.fromString "IssueCreatedEvent") @@ -891,7 +1078,9 @@ newtype IssueCommentedEvent = IssueCommentedEvent { issueCommentedEventComment :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData IssueCommentedEvent instance HsProtobuf.Named IssueCommentedEvent where nameOf _ = (Hs.fromString "IssueCommentedEvent") @@ -908,21 +1097,25 @@ instance HsProtobuf.Message IssueCommentedEvent where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - issueCommentedEventComment + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (issueCommentedEventComment) + ) ) ] ) decodeMessage _ = (Hs.pure IssueCommentedEvent) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "comment") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "comment") [] "" ) @@ -930,15 +1123,28 @@ instance HsProtobuf.Message IssueCommentedEvent where instance HsJSONPB.ToJSONPB IssueCommentedEvent where toJSONPB (IssueCommentedEvent f1) = - (HsJSONPB.object ["comment" .= f1]) + ( HsJSONPB.object + [ "comment" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (IssueCommentedEvent f1) = - (HsJSONPB.pairs ["comment" .= f1]) + ( 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) <*> obj .: "comment") + ( \obj -> + (Hs.pure IssueCommentedEvent) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "comment") + ) + ) ) instance HsJSONPB.ToJSON IssueCommentedEvent where @@ -949,7 +1155,9 @@ instance HsJSONPB.FromJSON IssueCommentedEvent where parseJSON = HsJSONPB.parseJSONPB data IssueClosedEvent = IssueClosedEvent {} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData IssueClosedEvent instance HsProtobuf.Named IssueClosedEvent where nameOf _ = (Hs.fromString "IssueClosedEvent") diff --git a/codegen/Monocle/Protob/Login.hs b/codegen/Monocle/Protob/Login.hs index 85c805c71..695ce7f0b 100644 --- a/codegen/Monocle/Protob/Login.hs +++ b/codegen/Monocle/Protob/Login.hs @@ -29,12 +29,19 @@ import Data.Vector qualified as Hs (Vector) import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs @@ -42,7 +49,9 @@ newtype LoginValidationRequest = LoginValidationRequest { loginValidationRequestUsername :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData LoginValidationRequest instance HsProtobuf.Named LoginValidationRequest where nameOf _ = (Hs.fromString "LoginValidationRequest") @@ -59,21 +68,25 @@ instance HsProtobuf.Message LoginValidationRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - loginValidationRequestUsername + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (loginValidationRequestUsername) + ) ) ] ) decodeMessage _ = (Hs.pure LoginValidationRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "username") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") [] "" ) @@ -81,15 +94,28 @@ instance HsProtobuf.Message LoginValidationRequest where instance HsJSONPB.ToJSONPB LoginValidationRequest where toJSONPB (LoginValidationRequest f1) = - (HsJSONPB.object ["username" .= f1]) + ( HsJSONPB.object + [ "username" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (LoginValidationRequest f1) = - (HsJSONPB.pairs ["username" .= f1]) + ( 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) <*> obj .: "username") + ( \obj -> + (Hs.pure LoginValidationRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "username") + ) + ) ) instance HsJSONPB.ToJSON LoginValidationRequest where @@ -103,7 +129,9 @@ newtype LoginValidationResponse = LoginValidationResponse { loginValidationResponseResult :: Hs.Maybe LoginValidationResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData LoginValidationResponse instance HsProtobuf.Named LoginValidationResponse where nameOf _ = (Hs.fromString "LoginValidationResponse") @@ -274,7 +302,9 @@ data LoginValidationResponseResult ( HsProtobuf.Enumerated Monocle.Protob.Login.LoginValidationResponse_ValidationResult ) - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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 3c6e9b3db..81ea5503f 100644 --- a/codegen/Monocle/Protob/Metric.hs +++ b/codegen/Monocle/Protob/Metric.hs @@ -29,12 +29,19 @@ import Data.Vector qualified as Hs (Vector) import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs @@ -44,7 +51,9 @@ data MetricInfo = MetricInfo , metricInfoLongDescription :: Hs.Text , metricInfoMetric :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData MetricInfo instance HsProtobuf.Named MetricInfo where nameOf _ = (Hs.fromString "MetricInfo") @@ -63,66 +72,82 @@ instance HsProtobuf.Message MetricInfo where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - metricInfoName + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (metricInfoName) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - metricInfoDescription + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (metricInfoDescription) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - metricInfoLongDescription + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (metricInfoLongDescription) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - metricInfoMetric + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (metricInfoMetric) + ) ) ] ) decodeMessage _ = (Hs.pure MetricInfo) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( 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.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "description") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "description") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "long_description") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "long_description") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "metric") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "metric") [] "" ) @@ -131,18 +156,26 @@ instance HsProtobuf.Message MetricInfo where instance HsJSONPB.ToJSONPB MetricInfo where toJSONPB (MetricInfo f1 f2 f3 f4) = ( HsJSONPB.object - [ "name" .= f1 - , "description" .= f2 - , "long_description" .= f3 - , "metric" .= f4 + [ "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" .= f1 - , "description" .= f2 - , "long_description" .= f3 - , "metric" .= f4 + [ "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)) ] ) @@ -152,10 +185,18 @@ instance HsJSONPB.FromJSONPB MetricInfo where "MetricInfo" ( \obj -> (Hs.pure MetricInfo) - <*> obj .: "name" - <*> obj .: "description" - <*> obj .: "long_description" - <*> obj .: "metric" + <*> ( 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") + ) ) ) @@ -167,7 +208,9 @@ instance HsJSONPB.FromJSON MetricInfo where parseJSON = HsJSONPB.parseJSONPB newtype ListRequest = ListRequest {listRequestVoid :: Hs.Text} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ListRequest instance HsProtobuf.Named ListRequest where nameOf _ = (Hs.fromString "ListRequest") @@ -179,35 +222,54 @@ instance HsProtobuf.Message ListRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - listRequestVoid + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (listRequestVoid) + ) ) ] ) decodeMessage _ = (Hs.pure ListRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "void") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") [] "" ) ] instance HsJSONPB.ToJSONPB ListRequest where - toJSONPB (ListRequest f1) = (HsJSONPB.object ["void" .= f1]) - toEncodingPB (ListRequest f1) = (HsJSONPB.pairs ["void" .= f1]) + toJSONPB (ListRequest 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 parseJSONPB = ( HsJSONPB.withObject "ListRequest" - (\obj -> (Hs.pure ListRequest) <*> obj .: "void") + ( \obj -> + (Hs.pure ListRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "void") + ) + ) ) instance HsJSONPB.ToJSON ListRequest where @@ -221,7 +283,9 @@ newtype ListResponse = ListResponse { listResponseMetrics :: Hs.Vector Monocle.Protob.Metric.MetricInfo } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ListResponse instance HsProtobuf.Named ListResponse where nameOf _ = (Hs.fromString "ListResponse") @@ -237,42 +301,65 @@ instance HsProtobuf.Message ListResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) - listResponseMetrics + (listResponseMetrics) ) ) ] ) decodeMessage _ = (Hs.pure ListResponse) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo)) - @(_ (Hs.Vector Monocle.Protob.Metric.MetricInfo)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) + @(Hs.Vector Monocle.Protob.Metric.MetricInfo) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "MetricInfo")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "MetricInfo")) ) - (HsProtobuf.Single "metrics") + (HsProtobufAST.Single "metrics") [] "" ) ] instance HsJSONPB.ToJSONPB ListResponse where - toJSONPB (ListResponse f1) = (HsJSONPB.object ["metrics" .= f1]) - toEncodingPB (ListResponse f1) = (HsJSONPB.pairs ["metrics" .= f1]) + toJSONPB (ListResponse f1) = + ( HsJSONPB.object + [ "metrics" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) + (f1) + ) + ] + ) + toEncodingPB (ListResponse f1) = + ( HsJSONPB.pairs + [ "metrics" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.MetricInfo) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.MetricInfo) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB ListResponse where parseJSONPB = ( HsJSONPB.withObject "ListResponse" - (\obj -> (Hs.pure ListResponse) <*> obj .: "metrics") + ( \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 @@ -283,7 +370,9 @@ instance HsJSONPB.FromJSON ListResponse where parseJSON = HsJSONPB.parseJSONPB newtype Trend = Trend {trendInterval :: Hs.Text} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Trend instance HsProtobuf.Named Trend where nameOf _ = (Hs.fromString "Trend") @@ -295,35 +384,54 @@ instance HsProtobuf.Message Trend where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - trendInterval + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (trendInterval) + ) ) ] ) decodeMessage _ = (Hs.pure Trend) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "interval") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "interval") [] "" ) ] instance HsJSONPB.ToJSONPB Trend where - toJSONPB (Trend f1) = (HsJSONPB.object ["interval" .= f1]) - toEncodingPB (Trend f1) = (HsJSONPB.pairs ["interval" .= f1]) + toJSONPB (Trend 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 parseJSONPB = ( HsJSONPB.withObject "Trend" - (\obj -> (Hs.pure Trend) <*> obj .: "interval") + ( \obj -> + (Hs.pure Trend) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "interval") + ) + ) ) instance HsJSONPB.ToJSON Trend where @@ -334,7 +442,9 @@ instance HsJSONPB.FromJSON Trend where parseJSON = HsJSONPB.parseJSONPB newtype Top = Top {topLimit :: Hs.Word32} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Top instance HsProtobuf.Named Top where nameOf _ = (Hs.fromString "Top") @@ -357,10 +467,10 @@ instance HsProtobuf.Message Top where (HsProtobuf.FieldNumber 1) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "limit") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "limit") [] "" ) @@ -385,7 +495,9 @@ instance HsJSONPB.FromJSON Top where parseJSON = HsJSONPB.parseJSONPB newtype Compute = Compute {computeVoid :: Hs.Text} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Compute instance HsProtobuf.Named Compute where nameOf _ = (Hs.fromString "Compute") @@ -397,35 +509,54 @@ instance HsProtobuf.Message Compute where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - computeVoid + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (computeVoid) + ) ) ] ) decodeMessage _ = (Hs.pure Compute) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "void") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "void") [] "" ) ] instance HsJSONPB.ToJSONPB Compute where - toJSONPB (Compute f1) = (HsJSONPB.object ["void" .= f1]) - toEncodingPB (Compute f1) = (HsJSONPB.pairs ["void" .= f1]) + toJSONPB (Compute 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 parseJSONPB = ( HsJSONPB.withObject "Compute" - (\obj -> (Hs.pure Compute) <*> obj .: "void") + ( \obj -> + (Hs.pure Compute) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "void") + ) + ) ) instance HsJSONPB.ToJSON Compute where @@ -442,7 +573,9 @@ data GetRequest = GetRequest , getRequestMetric :: Hs.Text , getRequestOptions :: Hs.Maybe GetRequestOptions } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetRequest instance HsProtobuf.Named GetRequest where nameOf _ = (Hs.fromString "GetRequest") @@ -462,19 +595,27 @@ instance HsProtobuf.Message GetRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - getRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - getRequestUsername + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getRequestUsername) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - getRequestQuery + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getRequestQuery) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - getRequestMetric + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (getRequestMetric) + ) ) , case getRequestOptions of Hs.Nothing -> Hs.mempty @@ -508,76 +649,87 @@ instance HsProtobuf.Message GetRequest where ) decodeMessage _ = (Hs.pure GetRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( 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.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) <*> ( HsProtobuf.oneof Hs.Nothing [ ( (HsProtobuf.FieldNumber 7) , (Hs.pure (Hs.fmap GetRequestOptionsCompute)) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Metric.Compute)) - @(_ (Hs.Maybe Monocle.Protob.Metric.Compute)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Compute) + @(Hs.Maybe Monocle.Protob.Metric.Compute) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 5) , (Hs.pure (Hs.fmap GetRequestOptionsTrend)) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Metric.Trend)) - @(_ (Hs.Maybe Monocle.Protob.Metric.Trend)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Trend) + @(Hs.Maybe Monocle.Protob.Metric.Trend) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 6) , (Hs.pure (Hs.fmap GetRequestOptionsTop)) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Metric.Top)) - @(_ (Hs.Maybe Monocle.Protob.Metric.Top)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Top) + @(Hs.Maybe Monocle.Protob.Metric.Top) + (HsProtobuf.decodeMessageField) ) ) ] ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "username") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "query") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "metric") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "metric") [] "" ) @@ -586,10 +738,14 @@ instance HsProtobuf.Message GetRequest where instance HsJSONPB.ToJSONPB GetRequest where toJSONPB (GetRequest f1 f2 f3 f4 f7_or_f5_or_f6) = ( HsJSONPB.object - [ "index" .= f1 - , "username" .= f2 - , "query" .= f3 - , "metric" .= f4 + [ "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) -> @@ -609,10 +765,14 @@ instance HsJSONPB.ToJSONPB GetRequest where ) toEncodingPB (GetRequest f1 f2 f3 f4 f7_or_f5_or_f6) = ( HsJSONPB.pairs - [ "index" .= f1 - , "username" .= f2 - , "query" .= f3 - , "metric" .= f4 + [ "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) -> @@ -637,10 +797,18 @@ instance HsJSONPB.FromJSONPB GetRequest where "GetRequest" ( \obj -> (Hs.pure GetRequest) - <*> obj .: "index" - <*> obj .: "username" - <*> obj .: "query" - <*> obj .: "metric" + <*> ( 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 @@ -670,13 +838,17 @@ 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, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData InfoRequest instance HsProtobuf.Named InfoRequest where nameOf _ = (Hs.fromString "InfoRequest") @@ -688,35 +860,54 @@ instance HsProtobuf.Message InfoRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - infoRequestMetric + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (infoRequestMetric) + ) ) ] ) decodeMessage _ = (Hs.pure InfoRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "metric") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "metric") [] "" ) ] instance HsJSONPB.ToJSONPB InfoRequest where - toJSONPB (InfoRequest f1) = (HsJSONPB.object ["metric" .= f1]) - toEncodingPB (InfoRequest f1) = (HsJSONPB.pairs ["metric" .= f1]) + toJSONPB (InfoRequest 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 parseJSONPB = ( HsJSONPB.withObject "InfoRequest" - (\obj -> (Hs.pure InfoRequest) <*> obj .: "metric") + ( \obj -> + (Hs.pure InfoRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "metric") + ) + ) ) instance HsJSONPB.ToJSON InfoRequest where @@ -730,7 +921,9 @@ data HistoInt = HistoInt { histoIntDate :: Hs.Text , histoIntCount :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData HistoInt instance HsProtobuf.Named HistoInt where nameOf _ = (Hs.fromString "HistoInt") @@ -747,7 +940,9 @@ instance HsProtobuf.Message HistoInt where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - histoIntDate + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (histoIntDate) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -757,26 +952,28 @@ instance HsProtobuf.Message HistoInt where ) decodeMessage _ = (Hs.pure HistoInt) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "date") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "date") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") [] "" ) @@ -784,15 +981,31 @@ instance HsProtobuf.Message HistoInt where instance HsJSONPB.ToJSONPB HistoInt where toJSONPB (HistoInt f1 f2) = - (HsJSONPB.object ["date" .= f1, "count" .= f2]) + ( HsJSONPB.object + [ "date" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "count" .= f2 + ] + ) toEncodingPB (HistoInt f1 f2) = - (HsJSONPB.pairs ["date" .= f1, "count" .= f2]) + ( 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) <*> obj .: "date" <*> obj .: "count") + ( \obj -> + (Hs.pure HistoInt) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "date") + ) + <*> obj .: "count" + ) ) instance HsJSONPB.ToJSON HistoInt where @@ -806,7 +1019,9 @@ data HistoFloat = HistoFloat { histoFloatDate :: Hs.Text , histoFloatCount :: Hs.Float } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData HistoFloat instance HsProtobuf.Named HistoFloat where nameOf _ = (Hs.fromString "HistoFloat") @@ -823,7 +1038,9 @@ instance HsProtobuf.Message HistoFloat where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - histoFloatDate + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (histoFloatDate) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -833,26 +1050,28 @@ instance HsProtobuf.Message HistoFloat where ) decodeMessage _ = (Hs.pure HistoFloat) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "date") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "date") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "count") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "count") [] "" ) @@ -860,16 +1079,30 @@ instance HsProtobuf.Message HistoFloat where instance HsJSONPB.ToJSONPB HistoFloat where toJSONPB (HistoFloat f1 f2) = - (HsJSONPB.object ["date" .= f1, "count" .= f2]) + ( HsJSONPB.object + [ "date" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "count" .= f2 + ] + ) toEncodingPB (HistoFloat f1 f2) = - (HsJSONPB.pairs ["date" .= f1, "count" .= f2]) + ( 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) <*> obj .: "date" <*> obj .: "count" + (Hs.pure HistoFloat) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "date") + ) + <*> obj .: "count" ) ) @@ -884,7 +1117,9 @@ newtype HistoIntStat = HistoIntStat { histoIntStatHisto :: Hs.Vector Monocle.Protob.Metric.HistoInt } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData HistoIntStat instance HsProtobuf.Named HistoIntStat where nameOf _ = (Hs.fromString "HistoIntStat") @@ -898,42 +1133,65 @@ instance HsProtobuf.Message HistoIntStat where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - histoIntStatHisto + (histoIntStatHisto) ) ) ] ) decodeMessage _ = (Hs.pure HistoIntStat) - <*> ( Hs.coerce - @(_ (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 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "HistoInt")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "HistoInt")) ) - (HsProtobuf.Single "histo") + (HsProtobufAST.Single "histo") [] "" ) ] instance HsJSONPB.ToJSONPB HistoIntStat where - toJSONPB (HistoIntStat f1) = (HsJSONPB.object ["histo" .= f1]) - toEncodingPB (HistoIntStat f1) = (HsJSONPB.pairs ["histo" .= f1]) + toJSONPB (HistoIntStat f1) = + ( HsJSONPB.object + [ "histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f1) + ) + ] + ) + toEncodingPB (HistoIntStat f1) = + ( HsJSONPB.pairs + [ "histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB HistoIntStat where parseJSONPB = ( HsJSONPB.withObject "HistoIntStat" - (\obj -> (Hs.pure HistoIntStat) <*> obj .: "histo") + ( \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 @@ -947,7 +1205,9 @@ newtype HistoFloatStat = HistoFloatStat { histoFloatStatHisto :: Hs.Vector Monocle.Protob.Metric.HistoFloat } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData HistoFloatStat instance HsProtobuf.Named HistoFloatStat where nameOf _ = (Hs.fromString "HistoFloatStat") @@ -963,42 +1223,65 @@ instance HsProtobuf.Message HistoFloatStat where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) - histoFloatStatHisto + (histoFloatStatHisto) ) ) ] ) decodeMessage _ = (Hs.pure HistoFloatStat) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat)) - @(_ (Hs.Vector Monocle.Protob.Metric.HistoFloat)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) + @(Hs.Vector Monocle.Protob.Metric.HistoFloat) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "HistoFloat")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "HistoFloat")) ) - (HsProtobuf.Single "histo") + (HsProtobufAST.Single "histo") [] "" ) ] instance HsJSONPB.ToJSONPB HistoFloatStat where - toJSONPB (HistoFloatStat f1) = (HsJSONPB.object ["histo" .= f1]) - toEncodingPB (HistoFloatStat f1) = (HsJSONPB.pairs ["histo" .= f1]) + toJSONPB (HistoFloatStat f1) = + ( HsJSONPB.object + [ "histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) + (f1) + ) + ] + ) + toEncodingPB (HistoFloatStat f1) = + ( HsJSONPB.pairs + [ "histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoFloat) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoFloat) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB HistoFloatStat where parseJSONPB = ( HsJSONPB.withObject "HistoFloatStat" - (\obj -> (Hs.pure HistoFloatStat) <*> obj .: "histo") + ( \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 @@ -1012,7 +1295,9 @@ data TermCountInt = TermCountInt { termCountIntTerm :: Hs.Text , termCountIntCount :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TermCountInt instance HsProtobuf.Named TermCountInt where nameOf _ = (Hs.fromString "TermCountInt") @@ -1029,7 +1314,9 @@ instance HsProtobuf.Message TermCountInt where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - termCountIntTerm + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (termCountIntTerm) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -1039,26 +1326,28 @@ instance HsProtobuf.Message TermCountInt where ) decodeMessage _ = (Hs.pure TermCountInt) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "term") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "term") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") [] "" ) @@ -1066,16 +1355,30 @@ instance HsProtobuf.Message TermCountInt where instance HsJSONPB.ToJSONPB TermCountInt where toJSONPB (TermCountInt f1 f2) = - (HsJSONPB.object ["term" .= f1, "count" .= f2]) + ( HsJSONPB.object + [ "term" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "count" .= f2 + ] + ) toEncodingPB (TermCountInt f1 f2) = - (HsJSONPB.pairs ["term" .= f1, "count" .= f2]) + ( 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) <*> obj .: "term" <*> obj .: "count" + (Hs.pure TermCountInt) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "term") + ) + <*> obj .: "count" ) ) @@ -1091,7 +1394,9 @@ data TermsCountInt = TermsCountInt Hs.Vector Monocle.Protob.Metric.TermCountInt , termsCountIntTotalHits :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TermsCountInt instance HsProtobuf.Named TermsCountInt where nameOf _ = (Hs.fromString "TermsCountInt") @@ -1110,7 +1415,7 @@ instance HsProtobuf.Message TermsCountInt where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) - termsCountIntTermcount + (termsCountIntTermcount) ) ) , ( HsProtobuf.encodeMessageField @@ -1121,9 +1426,9 @@ instance HsProtobuf.Message TermsCountInt where ) decodeMessage _ = (Hs.pure TermsCountInt) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt)) - @(_ (Hs.Vector Monocle.Protob.Metric.TermCountInt)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) + @(Hs.Vector Monocle.Protob.Metric.TermCountInt) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) @@ -1134,19 +1439,19 @@ instance HsProtobuf.Message TermsCountInt where (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "TermCountInt")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TermCountInt")) ) - (HsProtobuf.Single "termcount") + (HsProtobufAST.Single "termcount") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "total_hits") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "total_hits") [] "" ) @@ -1154,9 +1459,25 @@ instance HsProtobuf.Message TermsCountInt where instance HsJSONPB.ToJSONPB TermsCountInt where toJSONPB (TermsCountInt f1 f2) = - (HsJSONPB.object ["termcount" .= f1, "total_hits" .= f2]) + ( HsJSONPB.object + [ "termcount" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) + (f1) + ) + , "total_hits" .= f2 + ] + ) toEncodingPB (TermsCountInt f1 f2) = - (HsJSONPB.pairs ["termcount" .= f1, "total_hits" .= f2]) + ( 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 parseJSONPB = @@ -1164,7 +1485,11 @@ instance HsJSONPB.FromJSONPB TermsCountInt where "TermsCountInt" ( \obj -> (Hs.pure TermsCountInt) - <*> obj .: "termcount" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountInt) + @(Hs.Vector Monocle.Protob.Metric.TermCountInt) + (obj .: "termcount") + ) <*> obj .: "total_hits" ) ) @@ -1180,7 +1505,9 @@ data TermCountFloat = TermCountFloat { termCountFloatTerm :: Hs.Text , termCountFloatCount :: Hs.Float } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TermCountFloat instance HsProtobuf.Named TermCountFloat where nameOf _ = (Hs.fromString "TermCountFloat") @@ -1197,7 +1524,9 @@ instance HsProtobuf.Message TermCountFloat where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - termCountFloatTerm + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (termCountFloatTerm) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -1207,26 +1536,28 @@ instance HsProtobuf.Message TermCountFloat where ) decodeMessage _ = (Hs.pure TermCountFloat) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "term") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "term") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "count") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "count") [] "" ) @@ -1234,16 +1565,30 @@ instance HsProtobuf.Message TermCountFloat where instance HsJSONPB.ToJSONPB TermCountFloat where toJSONPB (TermCountFloat f1 f2) = - (HsJSONPB.object ["term" .= f1, "count" .= f2]) + ( HsJSONPB.object + [ "term" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "count" .= f2 + ] + ) toEncodingPB (TermCountFloat f1 f2) = - (HsJSONPB.pairs ["term" .= f1, "count" .= f2]) + ( 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) <*> obj .: "term" <*> obj .: "count" + (Hs.pure TermCountFloat) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "term") + ) + <*> obj .: "count" ) ) @@ -1259,7 +1604,9 @@ data TermsCountFloat = TermsCountFloat Hs.Vector Monocle.Protob.Metric.TermCountFloat , termsCountFloatTotalHits :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TermsCountFloat instance HsProtobuf.Named TermsCountFloat where nameOf _ = (Hs.fromString "TermsCountFloat") @@ -1279,7 +1626,7 @@ instance HsProtobuf.Message TermsCountFloat where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) - termsCountFloatTermcount + (termsCountFloatTermcount) ) ) , ( HsProtobuf.encodeMessageField @@ -1290,9 +1637,9 @@ instance HsProtobuf.Message TermsCountFloat where ) decodeMessage _ = (Hs.pure TermsCountFloat) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat)) - @(_ (Hs.Vector Monocle.Protob.Metric.TermCountFloat)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) + @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) @@ -1303,19 +1650,19 @@ instance HsProtobuf.Message TermsCountFloat where (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "TermCountFloat")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TermCountFloat")) ) - (HsProtobuf.Single "termcount") + (HsProtobufAST.Single "termcount") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "total_hits") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "total_hits") [] "" ) @@ -1323,9 +1670,25 @@ instance HsProtobuf.Message TermsCountFloat where instance HsJSONPB.ToJSONPB TermsCountFloat where toJSONPB (TermsCountFloat f1 f2) = - (HsJSONPB.object ["termcount" .= f1, "total_hits" .= f2]) + ( HsJSONPB.object + [ "termcount" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) + (f1) + ) + , "total_hits" .= f2 + ] + ) toEncodingPB (TermsCountFloat f1 f2) = - (HsJSONPB.pairs ["termcount" .= f1, "total_hits" .= f2]) + ( 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 parseJSONPB = @@ -1333,7 +1696,11 @@ instance HsJSONPB.FromJSONPB TermsCountFloat where "TermsCountFloat" ( \obj -> (Hs.pure TermsCountFloat) - <*> obj .: "termcount" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountFloat) + @(Hs.Vector Monocle.Protob.Metric.TermCountFloat) + (obj .: "termcount") + ) <*> obj .: "total_hits" ) ) @@ -1346,7 +1713,9 @@ instance HsJSONPB.FromJSON TermsCountFloat where parseJSON = HsJSONPB.parseJSONPB newtype Duration = Duration {durationValue :: Hs.Word32} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Duration instance HsProtobuf.Named Duration where nameOf _ = (Hs.fromString "Duration") @@ -1369,10 +1738,10 @@ instance HsProtobuf.Message Duration where (HsProtobuf.FieldNumber 1) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "value") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "value") [] "" ) @@ -1400,7 +1769,9 @@ data HistoDuration = HistoDuration { histoDurationDate :: Hs.Text , histoDurationCount :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData HistoDuration instance HsProtobuf.Named HistoDuration where nameOf _ = (Hs.fromString "HistoDuration") @@ -1417,7 +1788,9 @@ instance HsProtobuf.Message HistoDuration where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - histoDurationDate + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (histoDurationDate) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -1427,26 +1800,28 @@ instance HsProtobuf.Message HistoDuration where ) decodeMessage _ = (Hs.pure HistoDuration) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "date") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "date") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") [] "" ) @@ -1454,16 +1829,30 @@ instance HsProtobuf.Message HistoDuration where instance HsJSONPB.ToJSONPB HistoDuration where toJSONPB (HistoDuration f1 f2) = - (HsJSONPB.object ["date" .= f1, "count" .= f2]) + ( HsJSONPB.object + [ "date" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "count" .= f2 + ] + ) toEncodingPB (HistoDuration f1 f2) = - (HsJSONPB.pairs ["date" .= f1, "count" .= f2]) + ( 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) <*> obj .: "date" <*> obj .: "count" + (Hs.pure HistoDuration) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "date") + ) + <*> obj .: "count" ) ) @@ -1478,7 +1867,9 @@ newtype HistoDurationStat = HistoDurationStat { histoDurationStatHisto :: Hs.Vector Monocle.Protob.Metric.HistoDuration } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData HistoDurationStat instance HsProtobuf.Named HistoDurationStat where nameOf _ = (Hs.fromString "HistoDurationStat") @@ -1494,43 +1885,65 @@ instance HsProtobuf.Message HistoDurationStat where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) - histoDurationStatHisto + (histoDurationStatHisto) ) ) ] ) decodeMessage _ = (Hs.pure HistoDurationStat) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration)) - @(_ (Hs.Vector Monocle.Protob.Metric.HistoDuration)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) + @(Hs.Vector Monocle.Protob.Metric.HistoDuration) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "HistoDuration")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "HistoDuration")) ) - (HsProtobuf.Single "histo") + (HsProtobufAST.Single "histo") [] "" ) ] instance HsJSONPB.ToJSONPB HistoDurationStat where - toJSONPB (HistoDurationStat f1) = (HsJSONPB.object ["histo" .= f1]) + toJSONPB (HistoDurationStat f1) = + ( HsJSONPB.object + [ "histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) + (f1) + ) + ] + ) toEncodingPB (HistoDurationStat f1) = - (HsJSONPB.pairs ["histo" .= f1]) + ( HsJSONPB.pairs + [ "histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoDuration) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoDuration) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB HistoDurationStat where parseJSONPB = ( HsJSONPB.withObject "HistoDurationStat" - (\obj -> (Hs.pure HistoDurationStat) <*> obj .: "histo") + ( \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 @@ -1545,7 +1958,9 @@ data TermCountDuration = TermCountDuration Hs.Text , termCountDurationCount :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TermCountDuration instance HsProtobuf.Named TermCountDuration where nameOf _ = (Hs.fromString "TermCountDuration") @@ -1562,7 +1977,9 @@ instance HsProtobuf.Message TermCountDuration where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - termCountDurationTerm + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (termCountDurationTerm) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -1572,26 +1989,28 @@ instance HsProtobuf.Message TermCountDuration where ) decodeMessage _ = (Hs.pure TermCountDuration) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "term") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "term") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "count") [] "" ) @@ -1599,16 +2018,30 @@ instance HsProtobuf.Message TermCountDuration where instance HsJSONPB.ToJSONPB TermCountDuration where toJSONPB (TermCountDuration f1 f2) = - (HsJSONPB.object ["term" .= f1, "count" .= f2]) + ( HsJSONPB.object + [ "term" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "count" .= f2 + ] + ) toEncodingPB (TermCountDuration f1 f2) = - (HsJSONPB.pairs ["term" .= f1, "count" .= f2]) + ( 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) <*> obj .: "term" <*> obj .: "count" + (Hs.pure TermCountDuration) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "term") + ) + <*> obj .: "count" ) ) @@ -1624,7 +2057,9 @@ data TermsCountDuration = TermsCountDuration Hs.Vector Monocle.Protob.Metric.TermCountDuration , termsCountDurationTotalHits :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TermsCountDuration instance HsProtobuf.Named TermsCountDuration where nameOf _ = (Hs.fromString "TermsCountDuration") @@ -1644,7 +2079,7 @@ instance HsProtobuf.Message TermsCountDuration where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) - termsCountDurationTermcount + (termsCountDurationTermcount) ) ) , ( HsProtobuf.encodeMessageField @@ -1655,9 +2090,9 @@ instance HsProtobuf.Message TermsCountDuration where ) decodeMessage _ = (Hs.pure TermsCountDuration) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration)) - @(_ (Hs.Vector Monocle.Protob.Metric.TermCountDuration)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) + @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) @@ -1668,19 +2103,19 @@ instance HsProtobuf.Message TermsCountDuration where (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "TermCountDuration")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TermCountDuration")) ) - (HsProtobuf.Single "termcount") + (HsProtobufAST.Single "termcount") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "total_hits") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "total_hits") [] "" ) @@ -1688,9 +2123,25 @@ instance HsProtobuf.Message TermsCountDuration where instance HsJSONPB.ToJSONPB TermsCountDuration where toJSONPB (TermsCountDuration f1 f2) = - (HsJSONPB.object ["termcount" .= f1, "total_hits" .= f2]) + ( HsJSONPB.object + [ "termcount" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) + (f1) + ) + , "total_hits" .= f2 + ] + ) toEncodingPB (TermsCountDuration f1 f2) = - (HsJSONPB.pairs ["termcount" .= f1, "total_hits" .= f2]) + ( 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 parseJSONPB = @@ -1698,7 +2149,11 @@ instance HsJSONPB.FromJSONPB TermsCountDuration where "TermsCountDuration" ( \obj -> (Hs.pure TermsCountDuration) - <*> obj .: "termcount" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.TermCountDuration) + @(Hs.Vector Monocle.Protob.Metric.TermCountDuration) + (obj .: "termcount") + ) <*> obj .: "total_hits" ) ) @@ -1714,7 +2169,9 @@ newtype GetResponse = GetResponse { getResponseResult :: Hs.Maybe GetResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetResponse instance HsProtobuf.Named GetResponse where nameOf _ = (Hs.fromString "GetResponse") @@ -1731,7 +2188,9 @@ instance HsProtobuf.Message GetResponse where GetResponseResultError y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) GetResponseResultFloatValue y -> ( HsProtobuf.encodeMessageField @@ -1808,7 +2267,9 @@ instance HsProtobuf.Message GetResponse where [ ( (HsProtobuf.FieldNumber 1) , (Hs.pure (Hs.Just Hs.. GetResponseResultError)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) , ( (HsProtobuf.FieldNumber 2) @@ -1823,63 +2284,64 @@ instance HsProtobuf.Message GetResponse where , ( (HsProtobuf.FieldNumber 4) , (Hs.pure (Hs.fmap GetResponseResultHistoInt)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat)) - @(_ (Hs.Maybe Monocle.Protob.Metric.HistoIntStat)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 5) , (Hs.pure (Hs.fmap GetResponseResultHistoFloat)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.HistoFloatStat)) - @(_ (Hs.Maybe Monocle.Protob.Metric.HistoFloatStat)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoFloatStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoFloatStat) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 6) , (Hs.pure (Hs.fmap GetResponseResultTopInt)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt)) - @(_ (Hs.Maybe Monocle.Protob.Metric.TermsCountInt)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 7) , (Hs.pure (Hs.fmap GetResponseResultTopFloat)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.TermsCountFloat)) - @(_ (Hs.Maybe Monocle.Protob.Metric.TermsCountFloat)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountFloat) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountFloat) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 8) , (Hs.pure (Hs.fmap GetResponseResultDurationValue)) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Metric.Duration)) - @(_ (Hs.Maybe Monocle.Protob.Metric.Duration)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.Duration) + @(Hs.Maybe Monocle.Protob.Metric.Duration) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 9) , (Hs.pure (Hs.fmap GetResponseResultHistoDuration)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.HistoDurationStat)) - @(_ (Hs.Maybe Monocle.Protob.Metric.HistoDurationStat)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoDurationStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoDurationStat) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 10) , (Hs.pure (Hs.fmap GetResponseResultTopDuration)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.TermsCountDuration)) - @(_ (Hs.Maybe Monocle.Protob.Metric.TermsCountDuration)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountDuration) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountDuration) + (HsProtobuf.decodeMessageField) ) ) ] @@ -1894,7 +2356,11 @@ instance HsJSONPB.ToJSONPB GetResponse where ( 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" f1) + 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) -> @@ -1931,7 +2397,11 @@ instance HsJSONPB.ToJSONPB GetResponse where ( 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" f1) + 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) -> @@ -1968,7 +2438,9 @@ instance HsJSONPB.FromJSONPB GetResponse where (Hs.pure GetResponse) <*> ( let parseResult parseObj = Hs.msum - [ Hs.Just Hs.. GetResponseResultError + [ 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") @@ -2016,7 +2488,9 @@ data GetResponseResult | GetResponseResultDurationValue Monocle.Protob.Metric.Duration | GetResponseResultHistoDuration Monocle.Protob.Metric.HistoDurationStat | GetResponseResultTopDuration Monocle.Protob.Metric.TermsCountDuration - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData GetResponseResult instance HsProtobuf.Named GetResponseResult where nameOf _ = (Hs.fromString "GetResponseResult") @@ -2025,7 +2499,9 @@ newtype InfoResponse = InfoResponse { infoResponseResult :: Hs.Maybe InfoResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData InfoResponse instance HsProtobuf.Named InfoResponse where nameOf _ = (Hs.fromString "InfoResponse") @@ -2044,7 +2520,9 @@ instance HsProtobuf.Message InfoResponse where InfoResponseResultError y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) InfoResponseResultInfo y -> ( HsProtobuf.encodeMessageField @@ -2063,15 +2541,17 @@ instance HsProtobuf.Message InfoResponse where [ ( (HsProtobuf.FieldNumber 1) , (Hs.pure (Hs.Just Hs.. InfoResponseResultError)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.fmap InfoResponseResultInfo)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.MetricInfo)) - @(_ (Hs.Maybe Monocle.Protob.Metric.MetricInfo)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.MetricInfo) + @(Hs.Maybe Monocle.Protob.Metric.MetricInfo) + (HsProtobuf.decodeMessageField) ) ) ] @@ -2083,7 +2563,11 @@ instance HsJSONPB.ToJSONPB InfoResponse where ( HsJSONPB.object [ ( let encodeResult = ( case f1_or_f2 of - Hs.Just (InfoResponseResultError f1) -> (HsJSONPB.pair "error" f1) + 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 ) @@ -2100,7 +2584,11 @@ instance HsJSONPB.ToJSONPB InfoResponse where ( HsJSONPB.pairs [ ( let encodeResult = ( case f1_or_f2 of - Hs.Just (InfoResponseResultError f1) -> (HsJSONPB.pair "error" f1) + 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 ) @@ -2120,7 +2608,9 @@ instance HsJSONPB.FromJSONPB InfoResponse where (Hs.pure InfoResponse) <*> ( let parseResult parseObj = Hs.msum - [ Hs.Just Hs.. InfoResponseResultError + [ 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") @@ -2144,7 +2634,9 @@ instance HsJSONPB.FromJSON InfoResponse where data InfoResponseResult = InfoResponseResultError Hs.Text | InfoResponseResultInfo Monocle.Protob.Metric.MetricInfo - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +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 48ac7a47a..4ee0fd4f8 100644 --- a/codegen/Monocle/Protob/Search.hs +++ b/codegen/Monocle/Protob/Search.hs @@ -30,13 +30,20 @@ import Data.Word qualified as Hs (Word16, Word32, Word64) import GHC.Enum qualified as Hs import GHC.Generics qualified as Hs import Google.Protobuf.Timestamp qualified +import Google.Protobuf.Wrappers.Polymorphic qualified as HsProtobuf ( + Wrapped (..), + ) import Monocle.Protob.Metric qualified import Proto3.Suite.Class qualified as HsProtobuf -import Proto3.Suite.DotProto qualified as HsProtobuf +import Proto3.Suite.DotProto qualified as HsProtobufAST import Proto3.Suite.JSONPB ((.:), (.=)) import Proto3.Suite.JSONPB qualified as HsJSONPB import Proto3.Suite.Types qualified as HsProtobuf import Proto3.Wire qualified as HsProtobuf +import Proto3.Wire.Decode qualified as HsProtobuf ( + Parser, + RawField, + ) import Unsafe.Coerce qualified as Hs import Prelude qualified as Hs @@ -53,7 +60,9 @@ data TaskData = TaskData , taskDataScore :: Hs.Int32 , taskDataPrefix :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData TaskData instance HsProtobuf.Named TaskData where nameOf _ = (Hs.fromString "TaskData") @@ -80,38 +89,47 @@ instance HsProtobuf.Message TaskData where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - taskDataUpdatedAt + (taskDataUpdatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - taskDataChangeUrl + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (taskDataChangeUrl) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - taskDataTtype + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (taskDataTtype) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - taskDataTid + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (taskDataTid)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - taskDataUrl + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (taskDataUrl)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) - taskDataTitle + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (taskDataTitle) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) - taskDataSeverity + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (taskDataSeverity) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 8) - taskDataPriority + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (taskDataPriority) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 9) @@ -119,133 +137,150 @@ instance HsProtobuf.Message TaskData where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) - taskDataPrefix + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (taskDataPrefix) + ) ) ] ) decodeMessage _ = (Hs.pure TaskData) - <*> ( Hs.coerce - @(_ (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 1) ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 2) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 2) + ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 4) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 7) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 7) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 8) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 8) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 9) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 10) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 10) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "updated_at") + (HsProtobufAST.Single "updated_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "change_url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "ttype") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "ttype") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "tid") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "tid") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "title") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "severity") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "severity") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "priority") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "priority") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 9) - (HsProtobuf.Prim HsProtobuf.Int32) - (HsProtobuf.Single "score") + (HsProtobufAST.Prim HsProtobufAST.Int32) + (HsProtobufAST.Single "score") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "prefix") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "prefix") [] "" ) @@ -254,30 +289,56 @@ instance HsProtobuf.Message TaskData where instance HsJSONPB.ToJSONPB TaskData where toJSONPB (TaskData f1 f2 f3 f4 f5 f6 f7 f8 f9 f10) = ( HsJSONPB.object - [ "updated_at" .= f1 - , "change_url" .= f2 - , "ttype" .= f3 - , "tid" .= f4 - , "url" .= f5 - , "title" .= f6 - , "severity" .= f7 - , "priority" .= f8 + [ "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) + @(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" .= f10 + , "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" .= f1 - , "change_url" .= f2 - , "ttype" .= f3 - , "tid" .= f4 - , "url" .= f5 - , "title" .= f6 - , "severity" .= f7 - , "priority" .= f8 + [ "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) + @(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" .= f10 + , "prefix" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f10)) ] ) @@ -287,16 +348,38 @@ instance HsJSONPB.FromJSONPB TaskData where "TaskData" ( \obj -> (Hs.pure TaskData) - <*> obj .: "updated_at" - <*> obj .: "change_url" - <*> obj .: "ttype" - <*> obj .: "tid" - <*> obj .: "url" - <*> obj .: "title" - <*> obj .: "severity" - <*> obj .: "priority" + <*> ( 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 + @(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" - <*> obj .: "prefix" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "prefix") + ) ) ) @@ -311,7 +394,9 @@ newtype SuggestionsRequest = SuggestionsRequest { suggestionsRequestIndex :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData SuggestionsRequest instance HsProtobuf.Named SuggestionsRequest where nameOf _ = (Hs.fromString "SuggestionsRequest") @@ -328,21 +413,25 @@ instance HsProtobuf.Message SuggestionsRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - suggestionsRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (suggestionsRequestIndex) + ) ) ] ) decodeMessage _ = (Hs.pure SuggestionsRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) @@ -350,15 +439,28 @@ instance HsProtobuf.Message SuggestionsRequest where instance HsJSONPB.ToJSONPB SuggestionsRequest where toJSONPB (SuggestionsRequest f1) = - (HsJSONPB.object ["index" .= f1]) + ( HsJSONPB.object + [ "index" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (SuggestionsRequest f1) = - (HsJSONPB.pairs ["index" .= f1]) + ( 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) <*> obj .: "index") + ( \obj -> + (Hs.pure SuggestionsRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "index") + ) + ) ) instance HsJSONPB.ToJSON SuggestionsRequest where @@ -379,7 +481,9 @@ data SuggestionsResponse = SuggestionsResponse , suggestionsResponseGroups :: Hs.Vector Hs.Text , suggestionsResponseLabels :: Hs.Vector Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData SuggestionsResponse instance HsProtobuf.Named SuggestionsResponse where nameOf _ = (Hs.fromString "SuggestionsResponse") @@ -403,166 +507,182 @@ instance HsProtobuf.Message SuggestionsResponse where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - suggestionsResponseTaskTypes + ( 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 Hs.Text) - suggestionsResponseAuthors + ( 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 Hs.Text) - suggestionsResponseApprovals + ( 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 Hs.Text) - suggestionsResponsePriorities + ( 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 Hs.Text) - suggestionsResponseSeverities + ( 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 Hs.Text) - suggestionsResponseProjects + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (suggestionsResponseProjects) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec 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 Hs.Text) - suggestionsResponseLabels + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (suggestionsResponseLabels) ) ) ] ) decodeMessage _ = (Hs.pure SuggestionsResponse) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec Hs.Text)) - @(_ (Hs.Vector Hs.Text)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "task_types") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "task_types") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "authors") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "authors") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "approvals") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approvals") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "priorities") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "priorities") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "severities") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "severities") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "projects") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "projects") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "groups") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "groups") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "labels") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") [] "" ) @@ -571,26 +691,90 @@ instance HsProtobuf.Message SuggestionsResponse where instance HsJSONPB.ToJSONPB SuggestionsResponse where toJSONPB (SuggestionsResponse f1 f2 f3 f4 f5 f6 f7 f8) = ( HsJSONPB.object - [ "task_types" .= f1 - , "authors" .= f2 - , "approvals" .= f3 - , "priorities" .= f4 - , "severities" .= f5 - , "projects" .= f6 - , "groups" .= f7 - , "labels" .= f8 + [ "task_types" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f1) + ) + , "authors" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f2) + ) + , "approvals" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f3) + ) + , "priorities" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f4) + ) + , "severities" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f5) + ) + , "projects" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f6) + ) + , "groups" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f7) + ) + , "labels" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f8) + ) ] ) toEncodingPB (SuggestionsResponse f1 f2 f3 f4 f5 f6 f7 f8) = ( HsJSONPB.pairs - [ "task_types" .= f1 - , "authors" .= f2 - , "approvals" .= f3 - , "priorities" .= f4 - , "severities" .= f5 - , "projects" .= f6 - , "groups" .= f7 - , "labels" .= f8 + [ "task_types" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f1) + ) + , "authors" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f2) + ) + , "approvals" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f3) + ) + , "priorities" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f4) + ) + , "severities" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f5) + ) + , "projects" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f6) + ) + , "groups" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f7) + ) + , "labels" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f8) + ) ] ) @@ -600,14 +784,46 @@ instance HsJSONPB.FromJSONPB SuggestionsResponse where "SuggestionsResponse" ( \obj -> (Hs.pure SuggestionsResponse) - <*> obj .: "task_types" - <*> obj .: "authors" - <*> obj .: "approvals" - <*> obj .: "priorities" - <*> obj .: "severities" - <*> obj .: "projects" - <*> obj .: "groups" - <*> obj .: "labels" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "task_types") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "authors") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "approvals") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "priorities") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "severities") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "projects") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "groups") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "labels") + ) ) ) @@ -622,7 +838,9 @@ newtype FieldsRequest = FieldsRequest { fieldsRequestVersion :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData FieldsRequest instance HsProtobuf.Named FieldsRequest where nameOf _ = (Hs.fromString "FieldsRequest") @@ -636,36 +854,54 @@ instance HsProtobuf.Message FieldsRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - fieldsRequestVersion + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (fieldsRequestVersion) + ) ) ] ) decodeMessage _ = (Hs.pure FieldsRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "version") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "version") [] "" ) ] instance HsJSONPB.ToJSONPB FieldsRequest where - toJSONPB (FieldsRequest f1) = (HsJSONPB.object ["version" .= f1]) + toJSONPB (FieldsRequest f1) = + ( HsJSONPB.object + [ "version" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + ] + ) toEncodingPB (FieldsRequest f1) = - (HsJSONPB.pairs ["version" .= f1]) + ( 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) <*> obj .: "version") + ( \obj -> + (Hs.pure FieldsRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "version") + ) + ) ) instance HsJSONPB.ToJSON FieldsRequest where @@ -681,7 +917,9 @@ data Field = Field , fieldType :: HsProtobuf.Enumerated Monocle.Protob.Search.Field_Type } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Field instance HsProtobuf.Named Field where nameOf _ = (Hs.fromString "Field") @@ -699,11 +937,13 @@ instance HsProtobuf.Message Field where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - fieldName + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (fieldName)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - fieldDescription + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (fieldDescription) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) @@ -713,37 +953,43 @@ instance HsProtobuf.Message Field where ) decodeMessage _ = (Hs.pure Field) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "name") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "name") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "description") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "description") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Type"))) - (HsProtobuf.Single "type") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Type")) + ) + (HsProtobufAST.Single "type") [] "" ) @@ -752,11 +998,21 @@ instance HsProtobuf.Message Field where instance HsJSONPB.ToJSONPB Field where toJSONPB (Field f1 f2 f3) = ( HsJSONPB.object - ["name" .= f1, "description" .= f2, "type" .= f3] + [ "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" .= f1, "description" .= f2, "type" .= f3] + [ "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 @@ -765,8 +1021,12 @@ instance HsJSONPB.FromJSONPB Field where "Field" ( \obj -> (Hs.pure Field) - <*> obj .: "name" - <*> obj .: "description" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "name") + ) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "description") + ) <*> obj .: "type" ) ) @@ -844,7 +1104,9 @@ newtype FieldsResponse = FieldsResponse { fieldsResponseFields :: Hs.Vector Monocle.Protob.Search.Field } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData FieldsResponse instance HsProtobuf.Named FieldsResponse where nameOf _ = (Hs.fromString "FieldsResponse") @@ -860,42 +1122,65 @@ instance HsProtobuf.Message FieldsResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) - fieldsResponseFields + (fieldsResponseFields) ) ) ] ) decodeMessage _ = (Hs.pure FieldsResponse) - <*> ( Hs.coerce @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.Field)) - @(_ (Hs.Vector Monocle.Protob.Search.Field)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) + @(Hs.Vector Monocle.Protob.Search.Field) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Field")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Field")) ) - (HsProtobuf.Single "fields") + (HsProtobufAST.Single "fields") [] "" ) ] instance HsJSONPB.ToJSONPB FieldsResponse where - toJSONPB (FieldsResponse f1) = (HsJSONPB.object ["fields" .= f1]) + toJSONPB (FieldsResponse f1) = + ( HsJSONPB.object + [ "fields" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) + (f1) + ) + ] + ) toEncodingPB (FieldsResponse f1) = - (HsJSONPB.pairs ["fields" .= f1]) + ( HsJSONPB.pairs + [ "fields" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Field) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Field) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB FieldsResponse where parseJSONPB = ( HsJSONPB.withObject "FieldsResponse" - (\obj -> (Hs.pure FieldsResponse) <*> obj .: "fields") + ( \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 @@ -909,7 +1194,9 @@ data QueryError = QueryError { queryErrorMessage :: Hs.Text , queryErrorPosition :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData QueryError instance HsProtobuf.Named QueryError where nameOf _ = (Hs.fromString "QueryError") @@ -926,7 +1213,9 @@ instance HsProtobuf.Message QueryError where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - queryErrorMessage + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (queryErrorMessage) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -936,26 +1225,28 @@ instance HsProtobuf.Message QueryError where ) decodeMessage _ = (Hs.pure QueryError) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "message") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "message") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "position") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "position") [] "" ) @@ -963,16 +1254,30 @@ instance HsProtobuf.Message QueryError where instance HsJSONPB.ToJSONPB QueryError where toJSONPB (QueryError f1 f2) = - (HsJSONPB.object ["message" .= f1, "position" .= f2]) + ( HsJSONPB.object + [ "message" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "position" .= f2 + ] + ) toEncodingPB (QueryError f1 f2) = - (HsJSONPB.pairs ["message" .= f1, "position" .= f2]) + ( 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) <*> obj .: "message" <*> obj .: "position" + (Hs.pure QueryError) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "message") + ) + <*> obj .: "position" ) ) @@ -988,7 +1293,9 @@ data CheckRequest = CheckRequest , checkRequestUsername :: Hs.Text , checkRequestQuery :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CheckRequest instance HsProtobuf.Named CheckRequest where nameOf _ = (Hs.fromString "CheckRequest") @@ -1006,51 +1313,63 @@ instance HsProtobuf.Message CheckRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - checkRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (checkRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - checkRequestUsername + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (checkRequestUsername) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - checkRequestQuery + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (checkRequestQuery) + ) ) ] ) decodeMessage _ = (Hs.pure CheckRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "username") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "query") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") [] "" ) @@ -1059,10 +1378,24 @@ instance HsProtobuf.Message CheckRequest where instance HsJSONPB.ToJSONPB CheckRequest where toJSONPB (CheckRequest f1 f2 f3) = ( HsJSONPB.object - ["index" .= f1, "username" .= f2, "query" .= f3] + [ "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" .= f1, "username" .= f2, "query" .= 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 parseJSONPB = @@ -1070,9 +1403,15 @@ instance HsJSONPB.FromJSONPB CheckRequest where "CheckRequest" ( \obj -> (Hs.pure CheckRequest) - <*> obj .: "index" - <*> obj .: "username" - <*> obj .: "query" + <*> ( 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") + ) ) ) @@ -1087,7 +1426,9 @@ newtype CheckResponse = CheckResponse { checkResponseResult :: Hs.Maybe CheckResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CheckResponse instance HsProtobuf.Named CheckResponse where nameOf _ = (Hs.fromString "CheckResponse") @@ -1106,7 +1447,9 @@ instance HsProtobuf.Message CheckResponse where CheckResponseResultSuccess y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) CheckResponseResultError y -> ( HsProtobuf.encodeMessageField @@ -1125,15 +1468,17 @@ instance HsProtobuf.Message CheckResponse where [ ( (HsProtobuf.FieldNumber 1) , (Hs.pure (Hs.Just Hs.. CheckResponseResultSuccess)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.fmap CheckResponseResultError)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.QueryError)) - @(_ (Hs.Maybe Monocle.Protob.Search.QueryError)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) + @(Hs.Maybe Monocle.Protob.Search.QueryError) + (HsProtobuf.decodeMessageField) ) ) ] @@ -1146,7 +1491,10 @@ instance HsJSONPB.ToJSONPB CheckResponse where [ ( let encodeResult = ( case f1_or_f2 of Hs.Just (CheckResponseResultSuccess f1) -> - (HsJSONPB.pair "success" 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 ) @@ -1164,7 +1512,10 @@ instance HsJSONPB.ToJSONPB CheckResponse where [ ( let encodeResult = ( case f1_or_f2 of Hs.Just (CheckResponseResultSuccess f1) -> - (HsJSONPB.pair "success" 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 ) @@ -1184,7 +1535,9 @@ instance HsJSONPB.FromJSONPB CheckResponse where (Hs.pure CheckResponse) <*> ( let parseResult parseObj = Hs.msum - [ Hs.Just Hs.. CheckResponseResultSuccess + [ 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") @@ -1208,7 +1561,9 @@ instance HsJSONPB.FromJSON CheckResponse where data CheckResponseResult = CheckResponseResultSuccess Hs.Text | CheckResponseResultError Monocle.Protob.Search.QueryError - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData CheckResponseResult instance HsProtobuf.Named CheckResponseResult where nameOf _ = (Hs.fromString "CheckResponseResult") @@ -1218,7 +1573,9 @@ data Author = Author , authorAliases :: Hs.Vector Hs.Text , authorGroups :: Hs.Vector Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Author instance HsProtobuf.Named Author where nameOf _ = (Hs.fromString "Author") @@ -1236,61 +1593,67 @@ instance HsProtobuf.Message Author where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - authorMuid + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (authorMuid)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - authorAliases + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (authorAliases) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - authorGroups + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (authorGroups) ) ) ] ) decodeMessage _ = (Hs.pure Author) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "muid") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "muid") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "aliases") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "aliases") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "groups") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "groups") [] "" ) @@ -1298,9 +1661,37 @@ instance HsProtobuf.Message Author where instance HsJSONPB.ToJSONPB Author where toJSONPB (Author f1 f2 f3) = - (HsJSONPB.object ["muid" .= f1, "aliases" .= f2, "groups" .= f3]) + ( 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) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f3) + ) + ] + ) toEncodingPB (Author f1 f2 f3) = - (HsJSONPB.pairs ["muid" .= f1, "aliases" .= f2, "groups" .= f3]) + ( 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) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f3) + ) + ] + ) instance HsJSONPB.FromJSONPB Author where parseJSONPB = @@ -1308,9 +1699,19 @@ instance HsJSONPB.FromJSONPB Author where "Author" ( \obj -> (Hs.pure Author) - <*> obj .: "muid" - <*> obj .: "aliases" - <*> obj .: "groups" + <*> ( 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 + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "groups") + ) ) ) @@ -1325,7 +1726,9 @@ data AuthorRequest = AuthorRequest { authorRequestIndex :: Hs.Text , authorRequestQuery :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AuthorRequest instance HsProtobuf.Named AuthorRequest where nameOf _ = (Hs.fromString "AuthorRequest") @@ -1342,36 +1745,44 @@ instance HsProtobuf.Message AuthorRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - authorRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (authorRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - authorRequestQuery + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (authorRequestQuery) + ) ) ] ) decodeMessage _ = (Hs.pure AuthorRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "query") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") [] "" ) @@ -1379,16 +1790,34 @@ instance HsProtobuf.Message AuthorRequest where instance HsJSONPB.ToJSONPB AuthorRequest where toJSONPB (AuthorRequest f1 f2) = - (HsJSONPB.object ["index" .= f1, "query" .= 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" .= f1, "query" .= 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 parseJSONPB = ( HsJSONPB.withObject "AuthorRequest" ( \obj -> - (Hs.pure AuthorRequest) <*> obj .: "index" <*> obj .: "query" + (Hs.pure AuthorRequest) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "index") + ) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "query") + ) ) ) @@ -1403,7 +1832,9 @@ newtype AuthorResponse = AuthorResponse { authorResponseAuthors :: Hs.Vector Monocle.Protob.Search.Author } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AuthorResponse instance HsProtobuf.Named AuthorResponse where nameOf _ = (Hs.fromString "AuthorResponse") @@ -1419,42 +1850,65 @@ instance HsProtobuf.Message AuthorResponse where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) - authorResponseAuthors + (authorResponseAuthors) ) ) ] ) decodeMessage _ = (Hs.pure AuthorResponse) - <*> ( Hs.coerce @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.Author)) - @(_ (Hs.Vector Monocle.Protob.Search.Author)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) + @(Hs.Vector Monocle.Protob.Search.Author) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Author")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Author")) ) - (HsProtobuf.Single "authors") + (HsProtobufAST.Single "authors") [] "" ) ] instance HsJSONPB.ToJSONPB AuthorResponse where - toJSONPB (AuthorResponse f1) = (HsJSONPB.object ["authors" .= f1]) + toJSONPB (AuthorResponse f1) = + ( HsJSONPB.object + [ "authors" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) + (f1) + ) + ] + ) toEncodingPB (AuthorResponse f1) = - (HsJSONPB.pairs ["authors" .= f1]) + ( HsJSONPB.pairs + [ "authors" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Author) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Author) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB AuthorResponse where parseJSONPB = ( HsJSONPB.withObject "AuthorResponse" - (\obj -> (Hs.pure AuthorResponse) <*> obj .: "authors") + ( \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 @@ -1469,7 +1923,9 @@ data Order = Order , orderDirection :: HsProtobuf.Enumerated Monocle.Protob.Search.Order_Direction } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Order instance HsProtobuf.Named Order where nameOf _ = (Hs.fromString "Order") @@ -1483,7 +1939,7 @@ instance HsProtobuf.Message Order where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - orderField + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (orderField)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -1493,28 +1949,30 @@ instance HsProtobuf.Message Order where ) decodeMessage _ = (Hs.pure Order) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "field") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "field") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "Direction")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Direction")) ) - (HsProtobuf.Single "direction") + (HsProtobufAST.Single "direction") [] "" ) @@ -1522,16 +1980,30 @@ instance HsProtobuf.Message Order where instance HsJSONPB.ToJSONPB Order where toJSONPB (Order f1 f2) = - (HsJSONPB.object ["field" .= f1, "direction" .= f2]) + ( HsJSONPB.object + [ "field" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) + , "direction" .= f2 + ] + ) toEncodingPB (Order f1 f2) = - (HsJSONPB.pairs ["field" .= f1, "direction" .= f2]) + ( 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) <*> obj .: "field" <*> obj .: "direction" + (Hs.pure Order) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "field") + ) + <*> obj .: "direction" ) ) @@ -1597,7 +2069,9 @@ data QueryRequest = QueryRequest , queryRequestLimit :: Hs.Word32 , queryRequestChangeId :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData QueryRequest instance HsProtobuf.Named QueryRequest where nameOf _ = (Hs.fromString "QueryRequest") @@ -1619,15 +2093,21 @@ instance HsProtobuf.Message QueryRequest where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - queryRequestIndex + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (queryRequestIndex) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - queryRequestUsername + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (queryRequestUsername) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - queryRequestQuery + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (queryRequestQuery) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) @@ -1637,7 +2117,7 @@ instance HsProtobuf.Message QueryRequest where (HsProtobuf.FieldNumber 5) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Order) @(HsProtobuf.Nested Monocle.Protob.Search.Order) - queryRequestOrder + (queryRequestOrder) ) ) , ( HsProtobuf.encodeMessageField @@ -1646,30 +2126,39 @@ instance HsProtobuf.Message QueryRequest where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) - queryRequestChangeId + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (queryRequestChangeId) + ) ) ] ) decodeMessage _ = (Hs.pure QueryRequest) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 4) ) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Search.Order)) - @(_ (Hs.Maybe Monocle.Protob.Search.Order)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Order) + @(Hs.Maybe Monocle.Protob.Search.Order) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 5) @@ -1679,59 +2168,63 @@ instance HsProtobuf.Message QueryRequest where 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 7) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "index") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "index") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "username") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "username") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "query") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "query") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "QueryType")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "QueryType")) ) - (HsProtobuf.Single "query_type") + (HsProtobufAST.Single "query_type") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Order"))) - (HsProtobuf.Single "order") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Order")) + ) + (HsProtobufAST.Single "order") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "limit") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "limit") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "change_id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") [] "" ) @@ -1740,24 +2233,40 @@ instance HsProtobuf.Message QueryRequest where instance HsJSONPB.ToJSONPB QueryRequest where toJSONPB (QueryRequest f1 f2 f3 f4 f5 f6 f7) = ( HsJSONPB.object - [ "index" .= f1 - , "username" .= f2 - , "query" .= f3 + [ "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" .= f5 + , "order" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Order) + @(HsProtobuf.Nested Monocle.Protob.Search.Order) + (f5) + ) , "limit" .= f6 - , "change_id" .= f7 + , "change_id" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) ] ) toEncodingPB (QueryRequest f1 f2 f3 f4 f5 f6 f7) = ( HsJSONPB.pairs - [ "index" .= f1 - , "username" .= f2 - , "query" .= f3 + [ "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" .= f5 + , "order" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Order) + @(HsProtobuf.Nested Monocle.Protob.Search.Order) + (f5) + ) , "limit" .= f6 - , "change_id" .= f7 + , "change_id" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f7)) ] ) @@ -1767,13 +2276,25 @@ instance HsJSONPB.FromJSONPB QueryRequest where "QueryRequest" ( \obj -> (Hs.pure QueryRequest) - <*> obj .: "index" - <*> obj .: "username" - <*> obj .: "query" + <*> ( 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" - <*> obj .: "order" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Order) + @(Hs.Maybe Monocle.Protob.Search.Order) + (obj .: "order") + ) <*> obj .: "limit" - <*> obj .: "change_id" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "change_id") + ) ) ) @@ -1945,7 +2466,9 @@ data File = File , fileDeletions :: Hs.Word32 , filePath :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData File instance HsProtobuf.Named File where nameOf _ = (Hs.fromString "File") @@ -1971,7 +2494,7 @@ instance HsProtobuf.Message File where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - filePath + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (filePath)) ) ] ) @@ -1985,29 +2508,31 @@ instance HsProtobuf.Message File where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 2) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "additions") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "additions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "deletions") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "deletions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "path") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "path") [] "" ) @@ -2016,11 +2541,19 @@ instance HsProtobuf.Message File where instance HsJSONPB.ToJSONPB File where toJSONPB (File f1 f2 f3) = ( HsJSONPB.object - ["additions" .= f1, "deletions" .= f2, "path" .= f3] + [ "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" .= f3] + [ "additions" .= f1 + , "deletions" .= f2 + , "path" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f3)) + ] ) instance HsJSONPB.FromJSONPB File where @@ -2031,7 +2564,9 @@ instance HsJSONPB.FromJSONPB File where (Hs.pure File) <*> obj .: "additions" <*> obj .: "deletions" - <*> obj .: "path" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "path") + ) ) ) @@ -2052,7 +2587,9 @@ data Commit = Commit , commitAdditions :: Hs.Word32 , commitDeletions :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Commit instance HsProtobuf.Named Commit where nameOf _ = (Hs.fromString "Commit") @@ -2075,32 +2612,36 @@ instance HsProtobuf.Message Commit where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - commitSha + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (commitSha)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - commitTitle + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (commitTitle)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - commitAuthor + ( 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 + (commitAuthoredAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - commitCommitter + ( 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 + (commitCommittedAt) ) ) , ( HsProtobuf.encodeMessageField @@ -2115,33 +2656,41 @@ instance HsProtobuf.Message Commit where ) decodeMessage _ = (Hs.pure Commit) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) - <*> ( Hs.coerce - @(_ (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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 5) + ) ) - <*> ( Hs.coerce - @(_ (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) @@ -2156,71 +2705,71 @@ instance HsProtobuf.Message Commit where (HsProtobuf.FieldNumber 11) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "sha") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "sha") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "title") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "author") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "authored_at") + (HsProtobufAST.Single "authored_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "committer") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "committer") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "committed_at") + (HsProtobufAST.Single "committed_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "additions") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "additions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "deletions") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "deletions") [] "" ) @@ -2229,24 +2778,46 @@ instance HsProtobuf.Message Commit where instance HsJSONPB.ToJSONPB Commit where toJSONPB (Commit f1 f2 f3 f4 f5 f6 f10 f11) = ( HsJSONPB.object - [ "sha" .= f1 - , "title" .= f2 - , "author" .= f3 - , "authored_at" .= f4 - , "committer" .= f5 - , "committed_at" .= f6 + [ "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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f6) + ) , "additions" .= f10 , "deletions" .= f11 ] ) toEncodingPB (Commit f1 f2 f3 f4 f5 f6 f10 f11) = ( HsJSONPB.pairs - [ "sha" .= f1 - , "title" .= f2 - , "author" .= f3 - , "authored_at" .= f4 - , "committer" .= f5 - , "committed_at" .= f6 + [ "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) + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + (f6) + ) , "additions" .= f10 , "deletions" .= f11 ] @@ -2258,12 +2829,28 @@ instance HsJSONPB.FromJSONPB Commit where "Commit" ( \obj -> (Hs.pure Commit) - <*> obj .: "sha" - <*> obj .: "title" - <*> obj .: "author" - <*> obj .: "authored_at" - <*> obj .: "committer" - <*> obj .: "committed_at" + <*> ( 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 + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (obj .: "committed_at") + ) <*> obj .: "additions" <*> obj .: "deletions" ) @@ -2304,7 +2891,9 @@ data Change = Change , changeTaskData :: Hs.Vector Monocle.Protob.Search.TaskData , changeTtm :: Hs.Maybe ChangeTtm } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Change instance HsProtobuf.Named Change where nameOf _ = (Hs.fromString "Change") @@ -2345,55 +2934,65 @@ instance HsProtobuf.Message Change where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - changeChangeId + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeChangeId) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - changeAuthor + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeAuthor) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - changeTitle + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeTitle)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) - changeUrl + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeUrl)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) - changeRepositoryFullname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeRepositoryFullname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) - changeState + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeState)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 7) - changeBranch + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeBranch) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 8) - changeTargetBranch + ( 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 + (changeCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - changeUpdatedAt + (changeUpdatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - changeMergedAt + (changeMergedAt) ) ) , case changeMergedByM of @@ -2403,11 +3002,13 @@ instance HsProtobuf.Message Change where ChangeMergedByMMergedBy y -> ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 12) - (HsProtobuf.ForceEmit y) + ( HsProtobuf.ForceEmit + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (y)) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 15) - changeText + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (changeText)) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 20) @@ -2419,20 +3020,23 @@ instance HsProtobuf.Message Change where ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 25) - ( Hs.coerce @(Hs.Vector Hs.Text) @(HsProtobuf.UnpackedVec Hs.Text) - changeApproval + ( 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 Hs.Text) - changeAssignees + ( 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 Hs.Text) - changeLabels + ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (changeLabels) ) ) , ( HsProtobuf.encodeMessageField @@ -2447,7 +3051,7 @@ instance HsProtobuf.Message Change where (HsProtobuf.FieldNumber 50) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.File) @(HsProtobuf.NestedVec Monocle.Protob.Search.File) - changeChangedFiles + (changeChangedFiles) ) ) , ( HsProtobuf.encodeMessageField @@ -2458,7 +3062,7 @@ instance HsProtobuf.Message Change where (HsProtobuf.FieldNumber 60) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Commit) @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) - changeCommits + (changeCommits) ) ) , ( HsProtobuf.encodeMessageField @@ -2469,7 +3073,7 @@ instance HsProtobuf.Message Change where (HsProtobuf.FieldNumber 70) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.TaskData) @(HsProtobuf.NestedVec Monocle.Protob.Search.TaskData) - changeTaskData + (changeTaskData) ) ) , case changeTtm of @@ -2485,57 +3089,73 @@ instance HsProtobuf.Message Change where ) decodeMessage _ = (Hs.pure Change) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( 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.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 4) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 5) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 7) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 7) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 8) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 8) + ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) @@ -2546,13 +3166,17 @@ instance HsProtobuf.Message Change where [ ( (HsProtobuf.FieldNumber 12) , (Hs.pure (Hs.Just Hs.. ChangeMergedByMMergedBy)) - <*> HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (HsProtobuf.decodeMessageField) + ) ) ] ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 15) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 15) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField @@ -2562,22 +3186,25 @@ instance HsProtobuf.Message Change where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 21) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec Hs.Text)) - @(_ (Hs.Vector Hs.Text)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 25) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) ) ) - <*> ( Hs.coerce @(_ (HsProtobuf.UnpackedVec 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) @@ -2591,8 +3218,9 @@ instance HsProtobuf.Message Change where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 32) ) - <*> ( Hs.coerce @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.File)) - @(_ (Hs.Vector Monocle.Protob.Search.File)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.File) + @(Hs.Vector Monocle.Protob.Search.File) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 50) @@ -2602,8 +3230,9 @@ instance HsProtobuf.Message Change where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 51) ) - <*> ( Hs.coerce @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.Commit)) - @(_ (Hs.Vector Monocle.Protob.Search.Commit)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) + @(Hs.Vector Monocle.Protob.Search.Commit) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 60) @@ -2613,9 +3242,9 @@ instance HsProtobuf.Message Change where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 61) ) - <*> ( Hs.coerce - @(_ (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 70) @@ -2631,193 +3260,195 @@ instance HsProtobuf.Message Change where ] ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "change_id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "author") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "title") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "title") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "url") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "url") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "repository_fullname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "repository_fullname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "state") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "state") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 7) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 8) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "target_branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "target_branch") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 9) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "created_at") + (HsProtobufAST.Single "created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "updated_at") + (HsProtobufAST.Single "updated_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "merged_at") + (HsProtobufAST.Single "merged_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 15) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "text") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "text") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 20) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "additions") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "additions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 21) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "deletions") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "deletions") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 25) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "approval") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "approval") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 26) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "assignees") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "assignees") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 27) - (HsProtobuf.Repeated HsProtobuf.String) - (HsProtobuf.Single "labels") + (HsProtobufAST.Repeated HsProtobufAST.String) + (HsProtobufAST.Single "labels") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 30) - (HsProtobuf.Prim HsProtobuf.Bool) - (HsProtobuf.Single "draft") + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "draft") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 32) - (HsProtobuf.Prim HsProtobuf.Bool) - (HsProtobuf.Single "mergeable") + (HsProtobufAST.Prim HsProtobufAST.Bool) + (HsProtobufAST.Single "mergeable") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 50) - (HsProtobuf.Repeated (HsProtobuf.Named (HsProtobuf.Single "File"))) - (HsProtobuf.Single "changed_files") + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "File")) + ) + (HsProtobufAST.Single "changed_files") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 51) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "changed_files_count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "changed_files_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 60) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Commit")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Commit")) ) - (HsProtobuf.Single "commits") + (HsProtobufAST.Single "commits") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 61) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "commits_count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "commits_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 70) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "TaskData")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "TaskData")) ) - (HsProtobuf.Single "task_data") + (HsProtobufAST.Single "task_data") [] "" ) @@ -2854,21 +3485,43 @@ instance HsJSONPB.ToJSONPB Change where f80 ) = ( HsJSONPB.object - [ "change_id" .= f1 - , "author" .= f2 - , "title" .= f3 - , "url" .= f4 - , "repository_fullname" .= f5 - , "state" .= f6 - , "branch" .= f7 - , "target_branch" .= f8 - , "created_at" .= f9 - , "updated_at" .= f10 - , "merged_at" .= f11 + [ "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) + @(HsProtobuf.Nested 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" f12) + ( HsJSONPB.pair + "merged_by" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f12)) + ) Hs.Nothing -> Hs.mempty ) in \options -> @@ -2880,19 +3533,44 @@ instance HsJSONPB.ToJSONPB Change where options else encodeMerged_byM options ) - , "text" .= f15 + , "text" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) , "additions" .= f20 , "deletions" .= f21 - , "approval" .= f25 - , "assignees" .= f26 - , "labels" .= f27 + , "approval" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f25) + ) + , "assignees" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f26) + ) + , "labels" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f27) + ) , "draft" .= f30 , "mergeable" .= f32 - , "changed_files" .= f50 + , "changed_files" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.File) + @(HsProtobuf.NestedVec Monocle.Protob.Search.File) + (f50) + ) , "changed_files_count" .= f51 - , "commits" .= f60 + , "commits" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Commit) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) + (f60) + ) , "commits_count" .= f61 - , "task_data" .= f70 + , "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) @@ -2935,21 +3613,43 @@ instance HsJSONPB.ToJSONPB Change where f80 ) = ( HsJSONPB.pairs - [ "change_id" .= f1 - , "author" .= f2 - , "title" .= f3 - , "url" .= f4 - , "repository_fullname" .= f5 - , "state" .= f6 - , "branch" .= f7 - , "target_branch" .= f8 - , "created_at" .= f9 - , "updated_at" .= f10 - , "merged_at" .= f11 + [ "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) + @(HsProtobuf.Nested 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" f12) + ( HsJSONPB.pair + "merged_by" + (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f12)) + ) Hs.Nothing -> Hs.mempty ) in \options -> @@ -2959,19 +3659,44 @@ instance HsJSONPB.ToJSONPB Change where options else encodeMerged_byM options ) - , "text" .= f15 + , "text" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f15)) , "additions" .= f20 , "deletions" .= f21 - , "approval" .= f25 - , "assignees" .= f26 - , "labels" .= f27 + , "approval" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f25) + ) + , "assignees" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f26) + ) + , "labels" + .= ( Hs.coerce @(Hs.Vector Hs.Text) + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + (f27) + ) , "draft" .= f30 , "mergeable" .= f32 - , "changed_files" .= f50 + , "changed_files" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.File) + @(HsProtobuf.NestedVec Monocle.Protob.Search.File) + (f50) + ) , "changed_files_count" .= f51 - , "commits" .= f60 + , "commits" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Commit) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) + (f60) + ) , "commits_count" .= f61 - , "task_data" .= f70 + , "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) @@ -2991,20 +3716,50 @@ instance HsJSONPB.FromJSONPB Change where "Change" ( \obj -> (Hs.pure Change) - <*> obj .: "change_id" - <*> obj .: "author" - <*> obj .: "title" - <*> obj .: "url" - <*> obj .: "repository_fullname" - <*> obj .: "state" - <*> obj .: "branch" - <*> obj .: "target_branch" - <*> obj .: "created_at" - <*> obj .: "updated_at" - <*> obj .: "merged_at" + <*> ( 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) + (obj .: "created_at") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) + @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) + (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.Just + Hs.. ChangeMergedByMMergedBy + Hs.. Hs.coerce @(HsProtobuf.String Hs.Text) @(Hs.Text) <$> (HsJSONPB.parseField parseObj "merged_by") , Hs.pure Hs.Nothing ] @@ -3013,19 +3768,45 @@ instance HsJSONPB.FromJSONPB Change where ) <|> (parseMerged_byM obj) ) - <*> obj .: "text" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "text") + ) <*> obj .: "additions" <*> obj .: "deletions" - <*> obj .: "approval" - <*> obj .: "assignees" - <*> obj .: "labels" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "approval") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "assignees") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.UnpackedVec (HsProtobuf.String Hs.Text)) + @(Hs.Vector Hs.Text) + (obj .: "labels") + ) <*> obj .: "draft" <*> obj .: "mergeable" - <*> obj .: "changed_files" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.File) + @(Hs.Vector Monocle.Protob.Search.File) + (obj .: "changed_files") + ) <*> obj .: "changed_files_count" - <*> obj .: "commits" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Commit) + @(Hs.Vector Monocle.Protob.Search.Commit) + (obj .: "commits") + ) <*> obj .: "commits_count" - <*> obj .: "task_data" + <*> ( 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 @@ -3046,13 +3827,17 @@ instance HsJSONPB.FromJSON Change where parseJSON = HsJSONPB.parseJSONPB data ChangeMergedByM = ChangeMergedByMMergedBy Hs.Text - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + 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 - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeTtm instance HsProtobuf.Named ChangeTtm where nameOf _ = (Hs.fromString "ChangeTtm") @@ -3061,7 +3846,9 @@ newtype Changes = Changes { changesChanges :: Hs.Vector Monocle.Protob.Search.Change } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Changes instance HsProtobuf.Named Changes where nameOf _ = (Hs.fromString "Changes") @@ -3075,41 +3862,65 @@ instance HsProtobuf.Message Changes where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Change) @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) - changesChanges + (changesChanges) ) ) ] ) decodeMessage _ = (Hs.pure Changes) - <*> ( Hs.coerce @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.Change)) - @(_ (Hs.Vector Monocle.Protob.Search.Change)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) + @(Hs.Vector Monocle.Protob.Search.Change) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "Change")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "Change")) ) - (HsProtobuf.Single "changes") + (HsProtobufAST.Single "changes") [] "" ) ] instance HsJSONPB.ToJSONPB Changes where - toJSONPB (Changes f1) = (HsJSONPB.object ["changes" .= f1]) - toEncodingPB (Changes f1) = (HsJSONPB.pairs ["changes" .= f1]) + toJSONPB (Changes f1) = + ( HsJSONPB.object + [ "changes" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Change) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) + (f1) + ) + ] + ) + toEncodingPB (Changes f1) = + ( HsJSONPB.pairs + [ "changes" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.Change) + @(HsProtobuf.NestedVec Monocle.Protob.Search.Change) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB Changes where parseJSONPB = ( HsJSONPB.withObject "Changes" - (\obj -> (Hs.pure Changes) <*> obj .: "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 @@ -3120,7 +3931,9 @@ instance HsJSONPB.FromJSON Changes where parseJSON = HsJSONPB.parseJSONPB newtype Ratio = Ratio {ratioRatio :: Hs.Float} - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData Ratio instance HsProtobuf.Named Ratio where nameOf _ = (Hs.fromString "Ratio") @@ -3143,10 +3956,10 @@ instance HsProtobuf.Message Ratio where (HsProtobuf.FieldNumber 1) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "ratio") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "ratio") [] "" ) @@ -3182,7 +3995,9 @@ data ChangeEvent = ChangeEvent , changeEventOnAuthor :: Hs.Text , changeEventBranch :: Hs.Text } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeEvent instance HsProtobuf.Named ChangeEvent where nameOf _ = (Hs.fromString "ChangeEvent") @@ -3205,152 +4020,176 @@ instance HsProtobuf.Message ChangeEvent where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - changeEventId + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventId) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - changeEventType + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventType) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) - changeEventChangeId + ( 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 + (changeEventCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 6) ( Hs.coerce @(Hs.Maybe Google.Protobuf.Timestamp.Timestamp) @(HsProtobuf.Nested Google.Protobuf.Timestamp.Timestamp) - changeEventOnCreatedAt + (changeEventOnCreatedAt) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 10) - changeEventAuthor + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventAuthor) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) - changeEventOnAuthor + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventOnAuthor) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 20) - changeEventBranch + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (changeEventBranch) + ) ) ] ) decodeMessage _ = (Hs.pure ChangeEvent) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 3) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 3) + ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 10) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 11) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 11) + ) ) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 20) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 20) + ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "type") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "type") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "change_id") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "change_id") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "created_at") + (HsProtobufAST.Single "created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("google" Hs.:| ["protobuf", "Timestamp"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("google" Hs.:| ["protobuf", "Timestamp"])) ) ) ) - (HsProtobuf.Single "on_created_at") + (HsProtobufAST.Single "on_created_at") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "author") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "on_author") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "on_author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 20) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "branch") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "branch") [] "" ) @@ -3359,26 +4198,50 @@ instance HsProtobuf.Message ChangeEvent where instance HsJSONPB.ToJSONPB ChangeEvent where toJSONPB (ChangeEvent f1 f2 f3 f5 f6 f10 f11 f20) = ( HsJSONPB.object - [ "id" .= f1 - , "type" .= f2 - , "change_id" .= f3 - , "created_at" .= f5 - , "on_created_at" .= f6 - , "author" .= f10 - , "on_author" .= f11 - , "branch" .= f20 + [ "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) + @(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)) ] ) toEncodingPB (ChangeEvent f1 f2 f3 f5 f6 f10 f11 f20) = ( HsJSONPB.pairs - [ "id" .= f1 - , "type" .= f2 - , "change_id" .= f3 - , "created_at" .= f5 - , "on_created_at" .= f6 - , "author" .= f10 - , "on_author" .= f11 - , "branch" .= f20 + [ "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) + @(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)) ] ) @@ -3388,14 +4251,34 @@ instance HsJSONPB.FromJSONPB ChangeEvent where "ChangeEvent" ( \obj -> (Hs.pure ChangeEvent) - <*> obj .: "id" - <*> obj .: "type" - <*> obj .: "change_id" - <*> obj .: "created_at" - <*> obj .: "on_created_at" - <*> obj .: "author" - <*> obj .: "on_author" - <*> obj .: "branch" + <*> ( 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 + @(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") + ) ) ) @@ -3412,7 +4295,9 @@ data ChangeAndEvents = ChangeAndEvents , changeAndEventsEvents :: Hs.Vector Monocle.Protob.Search.ChangeEvent } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangeAndEvents instance HsProtobuf.Named ChangeAndEvents where nameOf _ = (Hs.fromString "ChangeAndEvents") @@ -3431,49 +4316,52 @@ instance HsProtobuf.Message ChangeAndEvents where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.Change) @(HsProtobuf.Nested Monocle.Protob.Search.Change) - changeAndEventsChange + (changeAndEventsChange) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.ChangeEvent) @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) - changeAndEventsEvents + (changeAndEventsEvents) ) ) ] ) decodeMessage _ = (Hs.pure ChangeAndEvents) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Search.Change)) - @(_ (Hs.Maybe Monocle.Protob.Search.Change)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Change) + @(Hs.Maybe Monocle.Protob.Search.Change) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) - <*> ( Hs.coerce - @(_ (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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim (HsProtobuf.Named (HsProtobuf.Single "Change"))) - (HsProtobuf.Single "change") + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "Change")) + ) + (HsProtobufAST.Single "change") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "ChangeEvent")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "ChangeEvent")) ) - (HsProtobuf.Single "events") + (HsProtobufAST.Single "events") [] "" ) @@ -3481,16 +4369,50 @@ instance HsProtobuf.Message ChangeAndEvents where instance HsJSONPB.ToJSONPB ChangeAndEvents where toJSONPB (ChangeAndEvents f1 f2) = - (HsJSONPB.object ["change" .= f1, "events" .= f2]) + ( 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) + @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) + (f2) + ) + ] + ) toEncodingPB (ChangeAndEvents f1 f2) = - (HsJSONPB.pairs ["change" .= f1, "events" .= f2]) + ( 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) + @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) + (f2) + ) + ] + ) instance HsJSONPB.FromJSONPB ChangeAndEvents where parseJSONPB = ( HsJSONPB.withObject "ChangeAndEvents" ( \obj -> - (Hs.pure ChangeAndEvents) <*> obj .: "change" <*> obj .: "events" + (Hs.pure ChangeAndEvents) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Change) + @(Hs.Maybe Monocle.Protob.Search.Change) + (obj .: "change") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.ChangeEvent) + @(Hs.Vector Monocle.Protob.Search.ChangeEvent) + (obj .: "events") + ) ) ) @@ -3506,7 +4428,9 @@ data ReviewCount = ReviewCount Hs.Word32 , reviewCountEventsCount :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ReviewCount instance HsProtobuf.Named ReviewCount where nameOf _ = (Hs.fromString "ReviewCount") @@ -3542,17 +4466,17 @@ instance HsProtobuf.Message ReviewCount where (HsProtobuf.FieldNumber 2) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "authors_count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "authors_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "events_count") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "events_count") [] "" ) @@ -3593,7 +4517,9 @@ data ReviewStats = ReviewStats Hs.Vector Monocle.Protob.Metric.HistoInt , reviewStatsReviewHisto :: Hs.Vector Monocle.Protob.Metric.HistoInt } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ReviewStats instance HsProtobuf.Named ReviewStats where nameOf _ = (Hs.fromString "ReviewStats") @@ -3616,14 +4542,14 @@ instance HsProtobuf.Message ReviewStats where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - reviewStatsCommentCount + (reviewStatsCommentCount) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - reviewStatsReviewCount + (reviewStatsReviewCount) ) ) , ( HsProtobuf.encodeMessageField @@ -3638,31 +4564,31 @@ instance HsProtobuf.Message ReviewStats where (HsProtobuf.FieldNumber 10) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - reviewStatsCommentHisto + (reviewStatsCommentHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - reviewStatsReviewHisto + (reviewStatsReviewHisto) ) ) ] ) decodeMessage _ = (Hs.pure ReviewStats) - <*> ( Hs.coerce - @(_ (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 1) ) ) - <*> ( Hs.coerce - @(_ (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) @@ -3676,78 +4602,78 @@ instance HsProtobuf.Message ReviewStats where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 6) ) - <*> ( Hs.coerce - @(_ (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 10) ) ) - <*> ( Hs.coerce - @(_ (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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "ReviewCount")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) ) - (HsProtobuf.Single "comment_count") + (HsProtobufAST.Single "comment_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "ReviewCount")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) ) - (HsProtobuf.Single "review_count") + (HsProtobufAST.Single "review_count") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "comment_delay") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "comment_delay") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "review_delay") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "review_delay") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "comment_histo") + (HsProtobufAST.Single "comment_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "review_histo") + (HsProtobufAST.Single "review_histo") [] "" ) @@ -3756,22 +4682,54 @@ instance HsProtobuf.Message ReviewStats where instance HsJSONPB.ToJSONPB ReviewStats where toJSONPB (ReviewStats f1 f2 f5 f6 f10 f11) = ( HsJSONPB.object - [ "comment_count" .= f1 - , "review_count" .= f2 + [ "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) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + (f2) + ) , "comment_delay" .= f5 , "review_delay" .= f6 - , "comment_histo" .= f10 - , "review_histo" .= f11 + , "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) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f11) + ) ] ) toEncodingPB (ReviewStats f1 f2 f5 f6 f10 f11) = ( HsJSONPB.pairs - [ "comment_count" .= f1 - , "review_count" .= f2 + [ "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) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + (f2) + ) , "comment_delay" .= f5 , "review_delay" .= f6 - , "comment_histo" .= f10 - , "review_histo" .= f11 + , "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) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f11) + ) ] ) @@ -3781,12 +4739,28 @@ instance HsJSONPB.FromJSONPB ReviewStats where "ReviewStats" ( \obj -> (Hs.pure ReviewStats) - <*> obj .: "comment_count" - <*> obj .: "review_count" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + (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" - <*> obj .: "comment_histo" - <*> obj .: "review_histo" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "comment_histo") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "review_histo") + ) ) ) @@ -3809,7 +4783,9 @@ data ActivityStats = ActivityStats , activityStatsChangesHisto :: Hs.Vector Monocle.Protob.Metric.HistoInt } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ActivityStats instance HsProtobuf.Named ActivityStats where nameOf _ = (Hs.fromString "ActivityStats") @@ -3845,21 +4821,21 @@ instance HsProtobuf.Message ActivityStats where (HsProtobuf.FieldNumber 10) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - activityStatsCommentsHisto + (activityStatsCommentsHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 11) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - activityStatsReviewsHisto + (activityStatsReviewsHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 12) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - activityStatsChangesHisto + (activityStatsChangesHisto) ) ) ] @@ -3878,88 +4854,88 @@ instance HsProtobuf.Message ActivityStats where HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) - <*> ( Hs.coerce - @(_ (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 10) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "change_authors") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "change_authors") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "comment_authors") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "comment_authors") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "review_authors") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "review_authors") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 10) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "comments_histo") + (HsProtobufAST.Single "comments_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "reviews_histo") + (HsProtobufAST.Single "reviews_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 12) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "changes_histo") + (HsProtobufAST.Single "changes_histo") [] "" ) @@ -3971,9 +4947,21 @@ instance HsJSONPB.ToJSONPB ActivityStats where [ "change_authors" .= f1 , "comment_authors" .= f2 , "review_authors" .= f3 - , "comments_histo" .= f10 - , "reviews_histo" .= f11 - , "changes_histo" .= f12 + , "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) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f11) + ) + , "changes_histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f12) + ) ] ) toEncodingPB (ActivityStats f1 f2 f3 f10 f11 f12) = @@ -3981,9 +4969,21 @@ instance HsJSONPB.ToJSONPB ActivityStats where [ "change_authors" .= f1 , "comment_authors" .= f2 , "review_authors" .= f3 - , "comments_histo" .= f10 - , "reviews_histo" .= f11 - , "changes_histo" .= f12 + , "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) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f11) + ) + , "changes_histo" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f12) + ) ] ) @@ -3996,9 +4996,21 @@ instance HsJSONPB.FromJSONPB ActivityStats where <*> obj .: "change_authors" <*> obj .: "comment_authors" <*> obj .: "review_authors" - <*> obj .: "comments_histo" - <*> obj .: "reviews_histo" - <*> obj .: "changes_histo" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "comments_histo") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "reviews_histo") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "changes_histo") + ) ) ) @@ -4013,7 +5025,9 @@ newtype QueryResponse = QueryResponse { queryResponseResult :: Hs.Maybe QueryResponseResult } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData QueryResponse instance HsProtobuf.Named QueryResponse where nameOf _ = (Hs.fromString "QueryResponse") @@ -4139,99 +5153,100 @@ instance HsProtobuf.Message QueryResponse where [ ( (HsProtobuf.FieldNumber 1) , (Hs.pure (Hs.fmap QueryResponseResultError)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.QueryError)) - @(_ (Hs.Maybe Monocle.Protob.Search.QueryError)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.QueryError) + @(Hs.Maybe Monocle.Protob.Search.QueryError) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 2) , (Hs.pure (Hs.fmap QueryResponseResultChanges)) - <*> ( Hs.coerce @(_ (HsProtobuf.Nested Monocle.Protob.Search.Changes)) - @(_ (Hs.Maybe Monocle.Protob.Search.Changes)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.Changes) + @(Hs.Maybe Monocle.Protob.Search.Changes) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 3) , (Hs.pure (Hs.fmap QueryResponseResultReposSummary)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.ReposSummary)) - @(_ (Hs.Maybe Monocle.Protob.Search.ReposSummary)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReposSummary) + @(Hs.Maybe Monocle.Protob.Search.ReposSummary) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 4) , (Hs.pure (Hs.fmap QueryResponseResultTopAuthors)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt)) - @(_ (Hs.Maybe Monocle.Protob.Metric.TermsCountInt)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 5) , (Hs.pure (Hs.fmap QueryResponseResultAuthorsPeers)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.AuthorsPeers)) - @(_ (Hs.Maybe Monocle.Protob.Search.AuthorsPeers)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.AuthorsPeers) + @(Hs.Maybe Monocle.Protob.Search.AuthorsPeers) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 6) , (Hs.pure (Hs.fmap QueryResponseResultNewAuthors)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt)) - @(_ (Hs.Maybe Monocle.Protob.Metric.TermsCountInt)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 20) , (Hs.pure (Hs.fmap QueryResponseResultReviewStats)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.ReviewStats)) - @(_ (Hs.Maybe Monocle.Protob.Search.ReviewStats)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewStats) + @(Hs.Maybe Monocle.Protob.Search.ReviewStats) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 21) , (Hs.pure (Hs.fmap QueryResponseResultLifecycleStats)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.LifecycleStats)) - @(_ (Hs.Maybe Monocle.Protob.Search.LifecycleStats)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.LifecycleStats) + @(Hs.Maybe Monocle.Protob.Search.LifecycleStats) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 22) , (Hs.pure (Hs.fmap QueryResponseResultActivityStats)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.ActivityStats)) - @(_ (Hs.Maybe Monocle.Protob.Search.ActivityStats)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ActivityStats) + @(Hs.Maybe Monocle.Protob.Search.ActivityStats) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 30) , (Hs.pure (Hs.fmap QueryResponseResultChangeEvents)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.ChangeAndEvents)) - @(_ (Hs.Maybe Monocle.Protob.Search.ChangeAndEvents)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ChangeAndEvents) + @(Hs.Maybe Monocle.Protob.Search.ChangeAndEvents) + (HsProtobuf.decodeMessageField) ) ) , ( (HsProtobuf.FieldNumber 31) , (Hs.pure (Hs.fmap QueryResponseResultChangesTops)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Search.ChangesTops)) - @(_ (Hs.Maybe Monocle.Protob.Search.ChangesTops)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Search.ChangesTops) + @(Hs.Maybe Monocle.Protob.Search.ChangesTops) + (HsProtobuf.decodeMessageField) ) ) , @@ -4242,10 +5257,10 @@ instance HsProtobuf.Message QueryResponse where , ( (HsProtobuf.FieldNumber 50) , (Hs.pure (Hs.fmap QueryResponseResultHisto)) - <*> ( Hs.coerce - @(_ (HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat)) - @(_ (Hs.Maybe Monocle.Protob.Metric.HistoIntStat)) - HsProtobuf.decodeMessageField + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.HistoIntStat) + @(Hs.Maybe Monocle.Protob.Metric.HistoIntStat) + (HsProtobuf.decodeMessageField) ) ) ] @@ -4403,7 +5418,9 @@ data QueryResponseResult | QueryResponseResultChangesTops Monocle.Protob.Search.ChangesTops | QueryResponseResultRatio Hs.Float | QueryResponseResultHisto Monocle.Protob.Metric.HistoIntStat - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData QueryResponseResult instance HsProtobuf.Named QueryResponseResult where nameOf _ = (Hs.fromString "QueryResponseResult") @@ -4430,7 +5447,9 @@ data LifecycleStats = LifecycleStats , lifecycleStatsIterationsPerChange :: Hs.Float , lifecycleStatsCommitsPerChange :: Hs.Float } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData LifecycleStats instance HsProtobuf.Named LifecycleStats where nameOf _ = (Hs.fromString "LifecycleStats") @@ -4464,35 +5483,35 @@ instance HsProtobuf.Message LifecycleStats where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - lifecycleStatsCreatedHisto + (lifecycleStatsCreatedHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - lifecycleStatsUpdatedHisto + (lifecycleStatsUpdatedHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - lifecycleStatsMergedHisto + (lifecycleStatsMergedHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 4) ( Hs.coerce @(Hs.Vector Monocle.Protob.Metric.HistoInt) @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) - lifecycleStatsAbandonedHisto + (lifecycleStatsAbandonedHisto) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 5) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) - lifecycleStatsCreated + (lifecycleStatsCreated) ) ) , ( HsProtobuf.encodeMessageField @@ -4539,41 +5558,41 @@ instance HsProtobuf.Message LifecycleStats where ) decodeMessage _ = (Hs.pure LifecycleStats) - <*> ( Hs.coerce - @(_ (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 1) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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) @@ -4620,134 +5639,134 @@ instance HsProtobuf.Message LifecycleStats where (HsProtobuf.FieldNumber 35) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "created_histo") + (HsProtobufAST.Single "created_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "updated_histo") + (HsProtobufAST.Single "updated_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "merged_histo") + (HsProtobufAST.Single "merged_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - ( HsProtobuf.Repeated - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["HistoInt"])) + ( HsProtobufAST.Repeated + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["HistoInt"])) ) ) ) - (HsProtobuf.Single "abandoned_histo") + (HsProtobufAST.Single "abandoned_histo") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - ( HsProtobuf.Prim - (HsProtobuf.Named (HsProtobuf.Single "ReviewCount")) + ( HsProtobufAST.Prim + (HsProtobufAST.Named (HsProtobufAST.Single "ReviewCount")) ) - (HsProtobuf.Single "created") + (HsProtobufAST.Single "created") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 11) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "abandoned") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "abandoned") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 13) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "merged") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "merged") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 15) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "self_merged") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "self_merged") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 16) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "self_merged_ratio") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "self_merged_ratio") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 30) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "ttm_mean") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "ttm_mean") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 31) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "ttm_variability") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "ttm_variability") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 32) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "updates_of_changes") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "updates_of_changes") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 33) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "changes_with_tests") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "changes_with_tests") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 34) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "iterations_per_change") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "iterations_per_change") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 35) - (HsProtobuf.Prim HsProtobuf.Float) - (HsProtobuf.Single "commits_per_change") + (HsProtobufAST.Prim HsProtobufAST.Float) + (HsProtobufAST.Single "commits_per_change") [] "" ) @@ -4773,11 +5792,31 @@ instance HsJSONPB.ToJSONPB LifecycleStats where f35 ) = ( HsJSONPB.object - [ "created_histo" .= f1 - , "updated_histo" .= f2 - , "merged_histo" .= f3 - , "abandoned_histo" .= f4 - , "created" .= f5 + [ "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) + @(HsProtobuf.NestedVec 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) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f4) + ) + , "created" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + (f5) + ) , "abandoned" .= f11 , "merged" .= f13 , "self_merged" .= f15 @@ -4809,11 +5848,31 @@ instance HsJSONPB.ToJSONPB LifecycleStats where f35 ) = ( HsJSONPB.pairs - [ "created_histo" .= f1 - , "updated_histo" .= f2 - , "merged_histo" .= f3 - , "abandoned_histo" .= f4 - , "created" .= f5 + [ "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) + @(HsProtobuf.NestedVec 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) + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + (f4) + ) + , "created" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Search.ReviewCount) + @(HsProtobuf.Nested Monocle.Protob.Search.ReviewCount) + (f5) + ) , "abandoned" .= f11 , "merged" .= f13 , "self_merged" .= f15 @@ -4833,11 +5892,31 @@ instance HsJSONPB.FromJSONPB LifecycleStats where "LifecycleStats" ( \obj -> (Hs.pure LifecycleStats) - <*> obj .: "created_histo" - <*> obj .: "updated_histo" - <*> obj .: "merged_histo" - <*> obj .: "abandoned_histo" - <*> obj .: "created" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "created_histo") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "updated_histo") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (obj .: "merged_histo") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Metric.HistoInt) + @(Hs.Vector Monocle.Protob.Metric.HistoInt) + (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" @@ -4866,7 +5945,9 @@ data RepoSummary = RepoSummary , repoSummaryUpdatedChanges :: Hs.Word32 , repoSummaryOpenChanges :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData RepoSummary instance HsProtobuf.Named RepoSummary where nameOf _ = (Hs.fromString "RepoSummary") @@ -4887,7 +5968,9 @@ instance HsProtobuf.Message RepoSummary where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - repoSummaryFullname + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (repoSummaryFullname) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) @@ -4913,9 +5996,11 @@ instance HsProtobuf.Message RepoSummary where ) decodeMessage _ = (Hs.pure RepoSummary) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + ( HsProtobuf.at + HsProtobuf.decodeMessageField + (HsProtobuf.FieldNumber 1) + ) ) <*> ( HsProtobuf.at HsProtobuf.decodeMessageField @@ -4938,45 +6023,45 @@ instance HsProtobuf.Message RepoSummary where (HsProtobuf.FieldNumber 6) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "fullname") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "fullname") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "created_changes") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "created_changes") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "abandoned_changes") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "abandoned_changes") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 4) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "merged_changes") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "merged_changes") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 5) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "updated_changes") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "updated_changes") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 6) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "open_changes") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "open_changes") [] "" ) @@ -4985,7 +6070,8 @@ instance HsProtobuf.Message RepoSummary where instance HsJSONPB.ToJSONPB RepoSummary where toJSONPB (RepoSummary f1 f2 f3 f4 f5 f6) = ( HsJSONPB.object - [ "fullname" .= f1 + [ "fullname" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) , "created_changes" .= f2 , "abandoned_changes" .= f3 , "merged_changes" .= f4 @@ -4995,7 +6081,8 @@ instance HsJSONPB.ToJSONPB RepoSummary where ) toEncodingPB (RepoSummary f1 f2 f3 f4 f5 f6) = ( HsJSONPB.pairs - [ "fullname" .= f1 + [ "fullname" + .= (Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) (f1)) , "created_changes" .= f2 , "abandoned_changes" .= f3 , "merged_changes" .= f4 @@ -5010,7 +6097,9 @@ instance HsJSONPB.FromJSONPB RepoSummary where "RepoSummary" ( \obj -> (Hs.pure RepoSummary) - <*> obj .: "fullname" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "fullname") + ) <*> obj .: "created_changes" <*> obj .: "abandoned_changes" <*> obj .: "merged_changes" @@ -5030,7 +6119,9 @@ newtype ReposSummary = ReposSummary { reposSummaryReposum :: Hs.Vector Monocle.Protob.Search.RepoSummary } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ReposSummary instance HsProtobuf.Named ReposSummary where nameOf _ = (Hs.fromString "ReposSummary") @@ -5046,42 +6137,65 @@ instance HsProtobuf.Message ReposSummary where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) - reposSummaryReposum + (reposSummaryReposum) ) ) ] ) decodeMessage _ = (Hs.pure ReposSummary) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary)) - @(_ (Hs.Vector Monocle.Protob.Search.RepoSummary)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) + @(Hs.Vector Monocle.Protob.Search.RepoSummary) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "RepoSummary")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "RepoSummary")) ) - (HsProtobuf.Single "reposum") + (HsProtobufAST.Single "reposum") [] "" ) ] instance HsJSONPB.ToJSONPB ReposSummary where - toJSONPB (ReposSummary f1) = (HsJSONPB.object ["reposum" .= f1]) - toEncodingPB (ReposSummary f1) = (HsJSONPB.pairs ["reposum" .= f1]) + toJSONPB (ReposSummary f1) = + ( HsJSONPB.object + [ "reposum" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) + @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) + (f1) + ) + ] + ) + toEncodingPB (ReposSummary f1) = + ( HsJSONPB.pairs + [ "reposum" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.RepoSummary) + @(HsProtobuf.NestedVec Monocle.Protob.Search.RepoSummary) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB ReposSummary where parseJSONPB = ( HsJSONPB.withObject "ReposSummary" - (\obj -> (Hs.pure ReposSummary) <*> obj .: "reposum") + ( \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 @@ -5096,7 +6210,9 @@ data AuthorPeer = AuthorPeer , authorPeerPeer :: Hs.Text , authorPeerStrength :: Hs.Word32 } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AuthorPeer instance HsProtobuf.Named AuthorPeer where nameOf _ = (Hs.fromString "AuthorPeer") @@ -5114,11 +6230,15 @@ instance HsProtobuf.Message AuthorPeer where ( Hs.mconcat [ ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1) - authorPeerAuthor + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (authorPeerAuthor) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) - authorPeerPeer + ( Hs.coerce @(Hs.Text) @(HsProtobuf.String Hs.Text) + (authorPeerPeer) + ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) @@ -5128,37 +6248,41 @@ instance HsProtobuf.Message AuthorPeer where ) decodeMessage _ = (Hs.pure AuthorPeer) - <*> ( HsProtobuf.at - HsProtobuf.decodeMessageField - (HsProtobuf.FieldNumber 1) + <*> ( 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.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 3) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "author") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "author") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - (HsProtobuf.Prim HsProtobuf.String) - (HsProtobuf.Single "peer") + (HsProtobufAST.Prim HsProtobufAST.String) + (HsProtobufAST.Single "peer") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - (HsProtobuf.Prim HsProtobuf.UInt32) - (HsProtobuf.Single "strength") + (HsProtobufAST.Prim HsProtobufAST.UInt32) + (HsProtobufAST.Single "strength") [] "" ) @@ -5167,10 +6291,20 @@ instance HsProtobuf.Message AuthorPeer where instance HsJSONPB.ToJSONPB AuthorPeer where toJSONPB (AuthorPeer f1 f2 f3) = ( HsJSONPB.object - ["author" .= f1, "peer" .= f2, "strength" .= f3] + [ "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" .= f1, "peer" .= f2, "strength" .= 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 parseJSONPB = @@ -5178,8 +6312,12 @@ instance HsJSONPB.FromJSONPB AuthorPeer where "AuthorPeer" ( \obj -> (Hs.pure AuthorPeer) - <*> obj .: "author" - <*> obj .: "peer" + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "author") + ) + <*> ( HsProtobuf.coerceOver @(HsProtobuf.String Hs.Text) @(Hs.Text) + (obj .: "peer") + ) <*> obj .: "strength" ) ) @@ -5195,7 +6333,9 @@ newtype AuthorsPeers = AuthorsPeers { authorsPeersAuthorPeer :: Hs.Vector Monocle.Protob.Search.AuthorPeer } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData AuthorsPeers instance HsProtobuf.Named AuthorsPeers where nameOf _ = (Hs.fromString "AuthorsPeers") @@ -5211,28 +6351,28 @@ instance HsProtobuf.Message AuthorsPeers where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) - authorsPeersAuthorPeer + (authorsPeersAuthorPeer) ) ) ] ) decodeMessage _ = (Hs.pure AuthorsPeers) - <*> ( Hs.coerce - @(_ (HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer)) - @(_ (Hs.Vector Monocle.Protob.Search.AuthorPeer)) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) + @(Hs.Vector Monocle.Protob.Search.AuthorPeer) ( HsProtobuf.at HsProtobuf.decodeMessageField (HsProtobuf.FieldNumber 1) ) ) dotProto _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Repeated - (HsProtobuf.Named (HsProtobuf.Single "AuthorPeer")) + ( HsProtobufAST.Repeated + (HsProtobufAST.Named (HsProtobufAST.Single "AuthorPeer")) ) - (HsProtobuf.Single "author_peer") + (HsProtobufAST.Single "author_peer") [] "" ) @@ -5240,15 +6380,36 @@ instance HsProtobuf.Message AuthorsPeers where instance HsJSONPB.ToJSONPB AuthorsPeers where toJSONPB (AuthorsPeers f1) = - (HsJSONPB.object ["author_peer" .= f1]) + ( HsJSONPB.object + [ "author_peer" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) + @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) + (f1) + ) + ] + ) toEncodingPB (AuthorsPeers f1) = - (HsJSONPB.pairs ["author_peer" .= f1]) + ( HsJSONPB.pairs + [ "author_peer" + .= ( Hs.coerce @(Hs.Vector Monocle.Protob.Search.AuthorPeer) + @(HsProtobuf.NestedVec Monocle.Protob.Search.AuthorPeer) + (f1) + ) + ] + ) instance HsJSONPB.FromJSONPB AuthorsPeers where parseJSONPB = ( HsJSONPB.withObject "AuthorsPeers" - (\obj -> (Hs.pure AuthorsPeers) <*> obj .: "author_peer") + ( \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 @@ -5265,7 +6426,9 @@ data ChangesTops = ChangesTops , changesTopsApprovals :: Hs.Maybe Monocle.Protob.Metric.TermsCountInt } - deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData) + deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic) + +instance Hs.NFData ChangesTops instance HsProtobuf.Named ChangesTops where nameOf _ = (Hs.fromString "ChangesTops") @@ -5285,88 +6448,88 @@ instance HsProtobuf.Message ChangesTops where (HsProtobuf.FieldNumber 1) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - changesTopsAuthors + (changesTopsAuthors) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 2) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - changesTopsRepos + (changesTopsRepos) ) ) , ( HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 3) ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) - changesTopsApprovals + (changesTopsApprovals) ) ) ] ) decodeMessage _ = (Hs.pure ChangesTops) - <*> ( Hs.coerce - @(_ (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 1) ) ) - <*> ( Hs.coerce - @(_ (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) ) ) - <*> ( Hs.coerce - @(_ (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 _ = - [ ( HsProtobuf.DotProtoField + [ ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 1) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) ) ) ) - (HsProtobuf.Single "authors") + (HsProtobufAST.Single "authors") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 2) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) ) ) ) - (HsProtobuf.Single "repos") + (HsProtobufAST.Single "repos") [] "" ) - , ( HsProtobuf.DotProtoField + , ( HsProtobufAST.DotProtoField (HsProtobuf.FieldNumber 3) - ( HsProtobuf.Prim - ( HsProtobuf.Named - ( HsProtobuf.Dots - (HsProtobuf.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) + ( HsProtobufAST.Prim + ( HsProtobufAST.Named + ( HsProtobufAST.Dots + (HsProtobufAST.Path ("monocle_metric" Hs.:| ["TermsCountInt"])) ) ) ) - (HsProtobuf.Single "approvals") + (HsProtobufAST.Single "approvals") [] "" ) @@ -5375,11 +6538,41 @@ instance HsProtobuf.Message ChangesTops where instance HsJSONPB.ToJSONPB ChangesTops where toJSONPB (ChangesTops f1 f2 f3) = ( HsJSONPB.object - ["authors" .= f1, "repos" .= f2, "approvals" .= f3] + [ "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) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + (f2) + ) + , "approvals" + .= ( Hs.coerce @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + (f3) + ) + ] ) toEncodingPB (ChangesTops f1 f2 f3) = ( HsJSONPB.pairs - ["authors" .= f1, "repos" .= f2, "approvals" .= f3] + [ "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) + @(HsProtobuf.Nested 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 @@ -5388,9 +6581,21 @@ instance HsJSONPB.FromJSONPB ChangesTops where "ChangesTops" ( \obj -> (Hs.pure ChangesTops) - <*> obj .: "authors" - <*> obj .: "repos" - <*> obj .: "approvals" + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + (obj .: "authors") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + (obj .: "repos") + ) + <*> ( HsProtobuf.coerceOver + @(HsProtobuf.Nested Monocle.Protob.Metric.TermsCountInt) + @(Hs.Maybe Monocle.Protob.Metric.TermsCountInt) + (obj .: "approvals") + ) ) )