{-# 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.Route53.Types.ChangeBatch where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
import Amazonka.Route53.Types.Change
data ChangeBatch = ChangeBatch'
{
:: Prelude.Maybe Prelude.Text,
ChangeBatch -> NonEmpty Change
changes :: Prelude.NonEmpty Change
}
deriving (ChangeBatch -> ChangeBatch -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeBatch -> ChangeBatch -> Bool
$c/= :: ChangeBatch -> ChangeBatch -> Bool
== :: ChangeBatch -> ChangeBatch -> Bool
$c== :: ChangeBatch -> ChangeBatch -> Bool
Prelude.Eq, ReadPrec [ChangeBatch]
ReadPrec ChangeBatch
Int -> ReadS ChangeBatch
ReadS [ChangeBatch]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeBatch]
$creadListPrec :: ReadPrec [ChangeBatch]
readPrec :: ReadPrec ChangeBatch
$creadPrec :: ReadPrec ChangeBatch
readList :: ReadS [ChangeBatch]
$creadList :: ReadS [ChangeBatch]
readsPrec :: Int -> ReadS ChangeBatch
$creadsPrec :: Int -> ReadS ChangeBatch
Prelude.Read, Int -> ChangeBatch -> ShowS
[ChangeBatch] -> ShowS
ChangeBatch -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeBatch] -> ShowS
$cshowList :: [ChangeBatch] -> ShowS
show :: ChangeBatch -> String
$cshow :: ChangeBatch -> String
showsPrec :: Int -> ChangeBatch -> ShowS
$cshowsPrec :: Int -> ChangeBatch -> ShowS
Prelude.Show, forall x. Rep ChangeBatch x -> ChangeBatch
forall x. ChangeBatch -> Rep ChangeBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChangeBatch x -> ChangeBatch
$cfrom :: forall x. ChangeBatch -> Rep ChangeBatch x
Prelude.Generic)
newChangeBatch ::
Prelude.NonEmpty Change ->
ChangeBatch
newChangeBatch :: NonEmpty Change -> ChangeBatch
newChangeBatch NonEmpty Change
pChanges_ =
ChangeBatch'
{ $sel:comment:ChangeBatch' :: Maybe Text
comment = forall a. Maybe a
Prelude.Nothing,
$sel:changes:ChangeBatch' :: NonEmpty Change
changes = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Change
pChanges_
}
changeBatch_comment :: Lens.Lens' ChangeBatch (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeBatch' {Maybe Text
comment :: Maybe Text
$sel:comment:ChangeBatch' :: ChangeBatch -> Maybe Text
comment} -> Maybe Text
comment) (\s :: ChangeBatch
s@ChangeBatch' {} Maybe Text
a -> ChangeBatch
s {$sel:comment:ChangeBatch' :: Maybe Text
comment = Maybe Text
a} :: ChangeBatch)
changeBatch_changes :: Lens.Lens' ChangeBatch (Prelude.NonEmpty Change)
changeBatch_changes :: Lens' ChangeBatch (NonEmpty Change)
changeBatch_changes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeBatch' {NonEmpty Change
changes :: NonEmpty Change
$sel:changes:ChangeBatch' :: ChangeBatch -> NonEmpty Change
changes} -> NonEmpty Change
changes) (\s :: ChangeBatch
s@ChangeBatch' {} NonEmpty Change
a -> ChangeBatch
s {$sel:changes:ChangeBatch' :: NonEmpty Change
changes = NonEmpty Change
a} :: ChangeBatch) 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 Prelude.Hashable ChangeBatch where
hashWithSalt :: Int -> ChangeBatch -> Int
hashWithSalt Int
_salt ChangeBatch' {Maybe Text
NonEmpty Change
changes :: NonEmpty Change
comment :: Maybe Text
$sel:changes:ChangeBatch' :: ChangeBatch -> NonEmpty Change
$sel:comment:ChangeBatch' :: ChangeBatch -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Change
changes
instance Prelude.NFData ChangeBatch where
rnf :: ChangeBatch -> ()
rnf ChangeBatch' {Maybe Text
NonEmpty Change
changes :: NonEmpty Change
comment :: Maybe Text
$sel:changes:ChangeBatch' :: ChangeBatch -> NonEmpty Change
$sel:comment:ChangeBatch' :: ChangeBatch -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Change
changes
instance Data.ToXML ChangeBatch where
toXML :: ChangeBatch -> XML
toXML ChangeBatch' {Maybe Text
NonEmpty Change
changes :: NonEmpty Change
comment :: Maybe Text
$sel:changes:ChangeBatch' :: ChangeBatch -> NonEmpty Change
$sel:comment:ChangeBatch' :: ChangeBatch -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Comment" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
comment,
Name
"Changes" forall a. ToXML a => Name -> a -> XML
Data.@= forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Data.toXMLList Name
"Change" NonEmpty Change
changes
]