{- This file was auto-generated from combinators.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies,
  UndecidableInstances, MultiParamTypeClasses, FlexibleContexts,
  FlexibleInstances, PatternSynonyms, MagicHash #-}
{-# OPTIONS_GHC -fno-warn-unused-imports#-}
module Proto.Combinators where
import qualified Prelude
import qualified Data.Int
import qualified Data.Word
import qualified Data.ProtoLens.Reexport.Data.ProtoLens
       as Data.ProtoLens
import qualified
       Data.ProtoLens.Reexport.Data.ProtoLens.Message.Enum
       as Data.ProtoLens.Message.Enum
import qualified Data.ProtoLens.Reexport.Lens.Family2
       as Lens.Family2
import qualified Data.ProtoLens.Reexport.Lens.Family2.Unchecked
       as Lens.Family2.Unchecked
import qualified Data.ProtoLens.Reexport.Data.Default.Class
       as Data.Default.Class
import qualified Data.ProtoLens.Reexport.Data.Text as Data.Text
import qualified Data.ProtoLens.Reexport.Data.Map as Data.Map
import qualified Data.ProtoLens.Reexport.Data.ByteString
       as Data.ByteString
import qualified Data.ProtoLens.Reexport.Lens.Labels as Lens.Labels

data Foo = Foo{_Foo'quux :: !(Prelude.Maybe Data.Int.Int32),
               _Foo'foo :: !(Prelude.Maybe Foo'Bar),
               _Foo'bar :: !(Prelude.Maybe Foo'Bar),
               _Foo'baz :: !(Prelude.Maybe Foo'Bar)}
         deriving (Prelude.Show, Prelude.Eq)

instance (a ~ Data.Int.Int32, b ~ Data.Int.Int32,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "quux" f Foo Foo a b
         where
        lensOf _
          = (Prelude..) maybe'quux
              (Data.ProtoLens.maybeLens Data.ProtoLens.fieldDefault)

instance (a ~ Prelude.Maybe Data.Int.Int32,
          b ~ Prelude.Maybe Data.Int.Int32, Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'quux" f Foo Foo a b
         where
        lensOf _
          = Lens.Family2.Unchecked.lens _Foo'quux
              (\ x__ y__ -> x__{_Foo'quux = y__})

instance (a ~ Foo'Bar, b ~ Foo'Bar, Prelude.Functor f) =>
         Lens.Labels.HasLens "foo" f Foo Foo a b
         where
        lensOf _
          = (Prelude..) maybe'foo
              (Data.ProtoLens.maybeLens Data.Default.Class.def)

instance (a ~ Prelude.Maybe Foo'Bar, b ~ Prelude.Maybe Foo'Bar,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'foo" f Foo Foo a b
         where
        lensOf _
          = Lens.Family2.Unchecked.lens _Foo'foo
              (\ x__ y__ -> x__{_Foo'foo = y__})

instance (a ~ Foo'Bar, b ~ Foo'Bar, Prelude.Functor f) =>
         Lens.Labels.HasLens "bar" f Foo Foo a b
         where
        lensOf _
          = (Prelude..) maybe'bar
              (Data.ProtoLens.maybeLens Data.Default.Class.def)

instance (a ~ Prelude.Maybe Foo'Bar, b ~ Prelude.Maybe Foo'Bar,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'bar" f Foo Foo a b
         where
        lensOf _
          = Lens.Family2.Unchecked.lens _Foo'bar
              (\ x__ y__ -> x__{_Foo'bar = y__})

instance (a ~ Foo'Bar, b ~ Foo'Bar, Prelude.Functor f) =>
         Lens.Labels.HasLens "baz" f Foo Foo a b
         where
        lensOf _
          = (Prelude..) maybe'baz
              (Data.ProtoLens.maybeLens Data.Default.Class.def)

instance (a ~ Prelude.Maybe Foo'Bar, b ~ Prelude.Maybe Foo'Bar,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'baz" f Foo Foo a b
         where
        lensOf _
          = Lens.Family2.Unchecked.lens _Foo'baz
              (\ x__ y__ -> x__{_Foo'baz = y__})

instance Data.Default.Class.Default Foo where
        def
          = Foo{_Foo'quux = Prelude.Nothing, _Foo'foo = Prelude.Nothing,
                _Foo'bar = Prelude.Nothing, _Foo'baz = Prelude.Nothing}

instance Data.ProtoLens.Message Foo where
        descriptor
          = let quux__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "quux"
                      (Data.ProtoLens.Int32Field ::
                         Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32)
                      (Data.ProtoLens.OptionalField maybe'quux)
                      :: Data.ProtoLens.FieldDescriptor Foo
                foo__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "foo"
                      (Data.ProtoLens.MessageField ::
                         Data.ProtoLens.FieldTypeDescriptor Foo'Bar)
                      (Data.ProtoLens.OptionalField maybe'foo)
                      :: Data.ProtoLens.FieldDescriptor Foo
                bar__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "bar"
                      (Data.ProtoLens.MessageField ::
                         Data.ProtoLens.FieldTypeDescriptor Foo'Bar)
                      (Data.ProtoLens.OptionalField maybe'bar)
                      :: Data.ProtoLens.FieldDescriptor Foo
                baz__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "baz"
                      (Data.ProtoLens.MessageField ::
                         Data.ProtoLens.FieldTypeDescriptor Foo'Bar)
                      (Data.ProtoLens.OptionalField maybe'baz)
                      :: Data.ProtoLens.FieldDescriptor Foo
              in
              Data.ProtoLens.MessageDescriptor
                (Data.Map.fromList
                   [(Data.ProtoLens.Tag 1, quux__field_descriptor),
                    (Data.ProtoLens.Tag 2, foo__field_descriptor),
                    (Data.ProtoLens.Tag 3, bar__field_descriptor),
                    (Data.ProtoLens.Tag 4, baz__field_descriptor)])
                (Data.Map.fromList
                   [("quux", quux__field_descriptor), ("foo", foo__field_descriptor),
                    ("bar", bar__field_descriptor), ("baz", baz__field_descriptor)])

data Foo'Bar = Foo'Bar{_Foo'Bar'fizz ::
                       !(Prelude.Maybe Data.Int.Int32),
                       _Foo'Bar'buzz :: !(Prelude.Maybe Data.Text.Text)}
             deriving (Prelude.Show, Prelude.Eq)

instance (a ~ Data.Int.Int32, b ~ Data.Int.Int32,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "fizz" f Foo'Bar Foo'Bar a b
         where
        lensOf _
          = (Prelude..) maybe'fizz
              (Data.ProtoLens.maybeLens Data.ProtoLens.fieldDefault)

instance (a ~ Prelude.Maybe Data.Int.Int32,
          b ~ Prelude.Maybe Data.Int.Int32, Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'fizz" f Foo'Bar Foo'Bar a b
         where
        lensOf _
          = Lens.Family2.Unchecked.lens _Foo'Bar'fizz
              (\ x__ y__ -> x__{_Foo'Bar'fizz = y__})

instance (a ~ Data.Text.Text, b ~ Data.Text.Text,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "buzz" f Foo'Bar Foo'Bar a b
         where
        lensOf _
          = (Prelude..) maybe'buzz
              (Data.ProtoLens.maybeLens Data.ProtoLens.fieldDefault)

instance (a ~ Prelude.Maybe Data.Text.Text,
          b ~ Prelude.Maybe Data.Text.Text, Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'buzz" f Foo'Bar Foo'Bar a b
         where
        lensOf _
          = Lens.Family2.Unchecked.lens _Foo'Bar'buzz
              (\ x__ y__ -> x__{_Foo'Bar'buzz = y__})

instance Data.Default.Class.Default Foo'Bar where
        def
          = Foo'Bar{_Foo'Bar'fizz = Prelude.Nothing,
                    _Foo'Bar'buzz = Prelude.Nothing}

instance Data.ProtoLens.Message Foo'Bar where
        descriptor
          = let fizz__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "fizz"
                      (Data.ProtoLens.Int32Field ::
                         Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32)
                      (Data.ProtoLens.OptionalField maybe'fizz)
                      :: Data.ProtoLens.FieldDescriptor Foo'Bar
                buzz__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "buzz"
                      (Data.ProtoLens.StringField ::
                         Data.ProtoLens.FieldTypeDescriptor Data.Text.Text)
                      (Data.ProtoLens.OptionalField maybe'buzz)
                      :: Data.ProtoLens.FieldDescriptor Foo'Bar
              in
              Data.ProtoLens.MessageDescriptor
                (Data.Map.fromList
                   [(Data.ProtoLens.Tag 1, fizz__field_descriptor),
                    (Data.ProtoLens.Tag 2, buzz__field_descriptor)])
                (Data.Map.fromList
                   [("fizz", fizz__field_descriptor),
                    ("buzz", buzz__field_descriptor)])

bar ::
    forall x f s t a b .
      (Prelude.Functor f, Lens.Labels.HasLens "bar" f s t a b) =>
      Lens.Family2.LensLike f s t a b
bar
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "bar")

baz ::
    forall x f s t a b .
      (Prelude.Functor f, Lens.Labels.HasLens "baz" f s t a b) =>
      Lens.Family2.LensLike f s t a b
baz
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "baz")

buzz ::
     forall x f s t a b .
       (Prelude.Functor f, Lens.Labels.HasLens "buzz" f s t a b) =>
       Lens.Family2.LensLike f s t a b
buzz
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "buzz")

fizz ::
     forall x f s t a b .
       (Prelude.Functor f, Lens.Labels.HasLens "fizz" f s t a b) =>
       Lens.Family2.LensLike f s t a b
fizz
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "fizz")

foo ::
    forall x f s t a b .
      (Prelude.Functor f, Lens.Labels.HasLens "foo" f s t a b) =>
      Lens.Family2.LensLike f s t a b
foo
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "foo")

maybe'bar ::
          forall x f s t a b .
            (Prelude.Functor f, Lens.Labels.HasLens "maybe'bar" f s t a b) =>
            Lens.Family2.LensLike f s t a b
maybe'bar
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'bar")

maybe'baz ::
          forall x f s t a b .
            (Prelude.Functor f, Lens.Labels.HasLens "maybe'baz" f s t a b) =>
            Lens.Family2.LensLike f s t a b
maybe'baz
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'baz")

maybe'buzz ::
           forall x f s t a b .
             (Prelude.Functor f, Lens.Labels.HasLens "maybe'buzz" f s t a b) =>
             Lens.Family2.LensLike f s t a b
maybe'buzz
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'buzz")

maybe'fizz ::
           forall x f s t a b .
             (Prelude.Functor f, Lens.Labels.HasLens "maybe'fizz" f s t a b) =>
             Lens.Family2.LensLike f s t a b
maybe'fizz
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'fizz")

maybe'foo ::
          forall x f s t a b .
            (Prelude.Functor f, Lens.Labels.HasLens "maybe'foo" f s t a b) =>
            Lens.Family2.LensLike f s t a b
maybe'foo
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'foo")

maybe'quux ::
           forall x f s t a b .
             (Prelude.Functor f, Lens.Labels.HasLens "maybe'quux" f s t a b) =>
             Lens.Family2.LensLike f s t a b
maybe'quux
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'quux")

quux ::
     forall x f s t a b .
       (Prelude.Functor f, Lens.Labels.HasLens "quux" f s t a b) =>
       Lens.Family2.LensLike f s t a b
quux
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "quux")