{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AppFlow.Types.InforNexusSourceProperties
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AppFlow.Types.InforNexusSourceProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The properties that are applied when Infor Nexus is being used as a
-- source.
--
-- /See:/ 'newInforNexusSourceProperties' smart constructor.
data InforNexusSourceProperties = InforNexusSourceProperties'
  { -- | The object specified in the Infor Nexus flow source.
    InforNexusSourceProperties -> Text
object' :: Prelude.Text
  }
  deriving (InforNexusSourceProperties -> InforNexusSourceProperties -> Bool
(InforNexusSourceProperties -> InforNexusSourceProperties -> Bool)
-> (InforNexusSourceProperties
    -> InforNexusSourceProperties -> Bool)
-> Eq InforNexusSourceProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InforNexusSourceProperties -> InforNexusSourceProperties -> Bool
$c/= :: InforNexusSourceProperties -> InforNexusSourceProperties -> Bool
== :: InforNexusSourceProperties -> InforNexusSourceProperties -> Bool
$c== :: InforNexusSourceProperties -> InforNexusSourceProperties -> Bool
Prelude.Eq, ReadPrec [InforNexusSourceProperties]
ReadPrec InforNexusSourceProperties
Int -> ReadS InforNexusSourceProperties
ReadS [InforNexusSourceProperties]
(Int -> ReadS InforNexusSourceProperties)
-> ReadS [InforNexusSourceProperties]
-> ReadPrec InforNexusSourceProperties
-> ReadPrec [InforNexusSourceProperties]
-> Read InforNexusSourceProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InforNexusSourceProperties]
$creadListPrec :: ReadPrec [InforNexusSourceProperties]
readPrec :: ReadPrec InforNexusSourceProperties
$creadPrec :: ReadPrec InforNexusSourceProperties
readList :: ReadS [InforNexusSourceProperties]
$creadList :: ReadS [InforNexusSourceProperties]
readsPrec :: Int -> ReadS InforNexusSourceProperties
$creadsPrec :: Int -> ReadS InforNexusSourceProperties
Prelude.Read, Int -> InforNexusSourceProperties -> ShowS
[InforNexusSourceProperties] -> ShowS
InforNexusSourceProperties -> String
(Int -> InforNexusSourceProperties -> ShowS)
-> (InforNexusSourceProperties -> String)
-> ([InforNexusSourceProperties] -> ShowS)
-> Show InforNexusSourceProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InforNexusSourceProperties] -> ShowS
$cshowList :: [InforNexusSourceProperties] -> ShowS
show :: InforNexusSourceProperties -> String
$cshow :: InforNexusSourceProperties -> String
showsPrec :: Int -> InforNexusSourceProperties -> ShowS
$cshowsPrec :: Int -> InforNexusSourceProperties -> ShowS
Prelude.Show, (forall x.
 InforNexusSourceProperties -> Rep InforNexusSourceProperties x)
-> (forall x.
    Rep InforNexusSourceProperties x -> InforNexusSourceProperties)
-> Generic InforNexusSourceProperties
forall x.
Rep InforNexusSourceProperties x -> InforNexusSourceProperties
forall x.
InforNexusSourceProperties -> Rep InforNexusSourceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InforNexusSourceProperties x -> InforNexusSourceProperties
$cfrom :: forall x.
InforNexusSourceProperties -> Rep InforNexusSourceProperties x
Prelude.Generic)

-- |
-- Create a value of 'InforNexusSourceProperties' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'object'', 'inforNexusSourceProperties_object' - The object specified in the Infor Nexus flow source.
newInforNexusSourceProperties ::
  -- | 'object''
  Prelude.Text ->
  InforNexusSourceProperties
newInforNexusSourceProperties :: Text -> InforNexusSourceProperties
newInforNexusSourceProperties Text
pObject_ =
  InforNexusSourceProperties' :: Text -> InforNexusSourceProperties
InforNexusSourceProperties' {$sel:object':InforNexusSourceProperties' :: Text
object' = Text
pObject_}

-- | The object specified in the Infor Nexus flow source.
inforNexusSourceProperties_object :: Lens.Lens' InforNexusSourceProperties Prelude.Text
inforNexusSourceProperties_object :: (Text -> f Text)
-> InforNexusSourceProperties -> f InforNexusSourceProperties
inforNexusSourceProperties_object = (InforNexusSourceProperties -> Text)
-> (InforNexusSourceProperties
    -> Text -> InforNexusSourceProperties)
-> Lens
     InforNexusSourceProperties InforNexusSourceProperties Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InforNexusSourceProperties' {Text
object' :: Text
$sel:object':InforNexusSourceProperties' :: InforNexusSourceProperties -> Text
object'} -> Text
object') (\s :: InforNexusSourceProperties
s@InforNexusSourceProperties' {} Text
a -> InforNexusSourceProperties
s {$sel:object':InforNexusSourceProperties' :: Text
object' = Text
a} :: InforNexusSourceProperties)

instance Core.FromJSON InforNexusSourceProperties where
  parseJSON :: Value -> Parser InforNexusSourceProperties
parseJSON =
    String
-> (Object -> Parser InforNexusSourceProperties)
-> Value
-> Parser InforNexusSourceProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InforNexusSourceProperties"
      ( \Object
x ->
          Text -> InforNexusSourceProperties
InforNexusSourceProperties'
            (Text -> InforNexusSourceProperties)
-> Parser Text -> Parser InforNexusSourceProperties
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"object")
      )

instance Prelude.Hashable InforNexusSourceProperties

instance Prelude.NFData InforNexusSourceProperties

instance Core.ToJSON InforNexusSourceProperties where
  toJSON :: InforNexusSourceProperties -> Value
toJSON InforNexusSourceProperties' {Text
object' :: Text
$sel:object':InforNexusSourceProperties' :: InforNexusSourceProperties -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"object" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
object')]
      )