content: module Io.Superposition.Model.ListOrganisationInput (
      setCount,
      setPage,
      setAll',
      build,
      ListOrganisationInputBuilder,
      ListOrganisationInput,
      count,
      page,
      all'
  ) where
  import qualified Control.Applicative
  import qualified Control.Monad.State.Strict
  import qualified Data.Aeson
  import qualified Data.Either
  import qualified Data.Eq
  import qualified Data.Functor
  import qualified Data.Int
  import qualified Data.Maybe
  import qualified Data.Text
  import qualified GHC.Generics
  import qualified GHC.Show
  import qualified Io.Superposition.Utility
  import qualified Network.HTTP.Types.Method
  
  data ListOrganisationInput = ListOrganisationInput {
      count :: Data.Maybe.Maybe Data.Int.Int32,
      page :: Data.Maybe.Maybe Data.Int.Int32,
      all' :: Data.Maybe.Maybe Bool
  } deriving (
    GHC.Show.Show,
    Data.Eq.Eq,
    GHC.Generics.Generic
    )
  
  instance Data.Aeson.ToJSON ListOrganisationInput where
      toJSON a = Data.Aeson.object [
          "count" Data.Aeson..= count a,
          "page" Data.Aeson..= page a,
          "all" Data.Aeson..= all' a
          ]
      
  
  instance Io.Superposition.Utility.SerializeBody ListOrganisationInput
  
  instance Data.Aeson.FromJSON ListOrganisationInput where
      parseJSON = Data.Aeson.withObject "ListOrganisationInput" $ \v -> ListOrganisationInput
          Data.Functor.<$> (v Data.Aeson..: "count")
          Control.Applicative.<*> (v Data.Aeson..: "page")
          Control.Applicative.<*> (v Data.Aeson..: "all")
      
  
  
  
  data ListOrganisationInputBuilderState = ListOrganisationInputBuilderState {
      countBuilderState :: Data.Maybe.Maybe Data.Int.Int32,
      pageBuilderState :: Data.Maybe.Maybe Data.Int.Int32,
      all'BuilderState :: Data.Maybe.Maybe Bool
  } deriving (
    GHC.Generics.Generic
    )
  
  defaultBuilderState :: ListOrganisationInputBuilderState
  defaultBuilderState = ListOrganisationInputBuilderState {
      countBuilderState = Data.Maybe.Nothing,
      pageBuilderState = Data.Maybe.Nothing,
      all'BuilderState = Data.Maybe.Nothing
  }
  
  type ListOrganisationInputBuilder = Control.Monad.State.Strict.State ListOrganisationInputBuilderState
  
  setCount :: Data.Maybe.Maybe Data.Int.Int32 -> ListOrganisationInputBuilder ()
  setCount value =
     Control.Monad.State.Strict.modify (\s -> (s { countBuilderState = value }))
  
  setPage :: Data.Maybe.Maybe Data.Int.Int32 -> ListOrganisationInputBuilder ()
  setPage value =
     Control.Monad.State.Strict.modify (\s -> (s { pageBuilderState = value }))
  
  setAll' :: Data.Maybe.Maybe Bool -> ListOrganisationInputBuilder ()
  setAll' value =
     Control.Monad.State.Strict.modify (\s -> (s { all'BuilderState = value }))
  
  build :: ListOrganisationInputBuilder () -> Data.Either.Either Data.Text.Text ListOrganisationInput
  build builder = do
      let (_, st) = Control.Monad.State.Strict.runState builder defaultBuilderState
      count' <- Data.Either.Right (countBuilderState st)
      page' <- Data.Either.Right (pageBuilderState st)
      all'' <- Data.Either.Right (all'BuilderState st)
      Data.Either.Right (ListOrganisationInput { 
          count = count',
          page = page',
          all' = all''
      })
  
  
  instance Io.Superposition.Utility.IntoRequestBuilder ListOrganisationInput where
      intoRequestBuilder self = do
          Io.Superposition.Utility.setMethod Network.HTTP.Types.Method.methodGet
          Io.Superposition.Utility.setPath [
              "superposition",
              "organisations"
              ]
          Io.Superposition.Utility.serQuery "all" (all' self)
          Io.Superposition.Utility.serQuery "count" (count self)
          Io.Superposition.Utility.serQuery "page" (page self)
          
          
  
  