{-# 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 #-}
module Amazonka.DataPipeline.Types.PipelineDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataPipeline.Types.Field
import Amazonka.DataPipeline.Types.Tag
import qualified Amazonka.Prelude as Prelude
data PipelineDescription = PipelineDescription'
{
PipelineDescription -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
PipelineDescription -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
PipelineDescription -> Text
pipelineId :: Prelude.Text,
PipelineDescription -> Text
name :: Prelude.Text,
PipelineDescription -> [Field]
fields :: [Field]
}
deriving (PipelineDescription -> PipelineDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineDescription -> PipelineDescription -> Bool
$c/= :: PipelineDescription -> PipelineDescription -> Bool
== :: PipelineDescription -> PipelineDescription -> Bool
$c== :: PipelineDescription -> PipelineDescription -> Bool
Prelude.Eq, ReadPrec [PipelineDescription]
ReadPrec PipelineDescription
Int -> ReadS PipelineDescription
ReadS [PipelineDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineDescription]
$creadListPrec :: ReadPrec [PipelineDescription]
readPrec :: ReadPrec PipelineDescription
$creadPrec :: ReadPrec PipelineDescription
readList :: ReadS [PipelineDescription]
$creadList :: ReadS [PipelineDescription]
readsPrec :: Int -> ReadS PipelineDescription
$creadsPrec :: Int -> ReadS PipelineDescription
Prelude.Read, Int -> PipelineDescription -> ShowS
[PipelineDescription] -> ShowS
PipelineDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineDescription] -> ShowS
$cshowList :: [PipelineDescription] -> ShowS
show :: PipelineDescription -> String
$cshow :: PipelineDescription -> String
showsPrec :: Int -> PipelineDescription -> ShowS
$cshowsPrec :: Int -> PipelineDescription -> ShowS
Prelude.Show, forall x. Rep PipelineDescription x -> PipelineDescription
forall x. PipelineDescription -> Rep PipelineDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PipelineDescription x -> PipelineDescription
$cfrom :: forall x. PipelineDescription -> Rep PipelineDescription x
Prelude.Generic)
newPipelineDescription ::
Prelude.Text ->
Prelude.Text ->
PipelineDescription
newPipelineDescription :: Text -> Text -> PipelineDescription
newPipelineDescription Text
pPipelineId_ Text
pName_ =
PipelineDescription'
{ $sel:description:PipelineDescription' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:tags:PipelineDescription' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:pipelineId:PipelineDescription' :: Text
pipelineId = Text
pPipelineId_,
$sel:name:PipelineDescription' :: Text
name = Text
pName_,
$sel:fields:PipelineDescription' :: [Field]
fields = forall a. Monoid a => a
Prelude.mempty
}
pipelineDescription_description :: Lens.Lens' PipelineDescription (Prelude.Maybe Prelude.Text)
pipelineDescription_description :: Lens' PipelineDescription (Maybe Text)
pipelineDescription_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDescription' {Maybe Text
description :: Maybe Text
$sel:description:PipelineDescription' :: PipelineDescription -> Maybe Text
description} -> Maybe Text
description) (\s :: PipelineDescription
s@PipelineDescription' {} Maybe Text
a -> PipelineDescription
s {$sel:description:PipelineDescription' :: Maybe Text
description = Maybe Text
a} :: PipelineDescription)
pipelineDescription_tags :: Lens.Lens' PipelineDescription (Prelude.Maybe [Tag])
pipelineDescription_tags :: Lens' PipelineDescription (Maybe [Tag])
pipelineDescription_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDescription' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:PipelineDescription' :: PipelineDescription -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: PipelineDescription
s@PipelineDescription' {} Maybe [Tag]
a -> PipelineDescription
s {$sel:tags:PipelineDescription' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: PipelineDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
pipelineDescription_pipelineId :: Lens.Lens' PipelineDescription Prelude.Text
pipelineDescription_pipelineId :: Lens' PipelineDescription Text
pipelineDescription_pipelineId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDescription' {Text
pipelineId :: Text
$sel:pipelineId:PipelineDescription' :: PipelineDescription -> Text
pipelineId} -> Text
pipelineId) (\s :: PipelineDescription
s@PipelineDescription' {} Text
a -> PipelineDescription
s {$sel:pipelineId:PipelineDescription' :: Text
pipelineId = Text
a} :: PipelineDescription)
pipelineDescription_name :: Lens.Lens' PipelineDescription Prelude.Text
pipelineDescription_name :: Lens' PipelineDescription Text
pipelineDescription_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDescription' {Text
name :: Text
$sel:name:PipelineDescription' :: PipelineDescription -> Text
name} -> Text
name) (\s :: PipelineDescription
s@PipelineDescription' {} Text
a -> PipelineDescription
s {$sel:name:PipelineDescription' :: Text
name = Text
a} :: PipelineDescription)
pipelineDescription_fields :: Lens.Lens' PipelineDescription [Field]
pipelineDescription_fields :: Lens' PipelineDescription [Field]
pipelineDescription_fields = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDescription' {[Field]
fields :: [Field]
$sel:fields:PipelineDescription' :: PipelineDescription -> [Field]
fields} -> [Field]
fields) (\s :: PipelineDescription
s@PipelineDescription' {} [Field]
a -> PipelineDescription
s {$sel:fields:PipelineDescription' :: [Field]
fields = [Field]
a} :: PipelineDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON PipelineDescription where
parseJSON :: Value -> Parser PipelineDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PipelineDescription"
( \Object
x ->
Maybe Text
-> Maybe [Tag] -> Text -> Text -> [Field] -> PipelineDescription
PipelineDescription'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"pipelineId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fields" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable PipelineDescription where
hashWithSalt :: Int -> PipelineDescription -> Int
hashWithSalt Int
_salt PipelineDescription' {[Field]
Maybe [Tag]
Maybe Text
Text
fields :: [Field]
name :: Text
pipelineId :: Text
tags :: Maybe [Tag]
description :: Maybe Text
$sel:fields:PipelineDescription' :: PipelineDescription -> [Field]
$sel:name:PipelineDescription' :: PipelineDescription -> Text
$sel:pipelineId:PipelineDescription' :: PipelineDescription -> Text
$sel:tags:PipelineDescription' :: PipelineDescription -> Maybe [Tag]
$sel:description:PipelineDescription' :: PipelineDescription -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pipelineId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Field]
fields
instance Prelude.NFData PipelineDescription where
rnf :: PipelineDescription -> ()
rnf PipelineDescription' {[Field]
Maybe [Tag]
Maybe Text
Text
fields :: [Field]
name :: Text
pipelineId :: Text
tags :: Maybe [Tag]
description :: Maybe Text
$sel:fields:PipelineDescription' :: PipelineDescription -> [Field]
$sel:name:PipelineDescription' :: PipelineDescription -> Text
$sel:pipelineId:PipelineDescription' :: PipelineDescription -> Text
$sel:tags:PipelineDescription' :: PipelineDescription -> Maybe [Tag]
$sel:description:PipelineDescription' :: PipelineDescription -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
pipelineId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Field]
fields