{-# 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.CloudFormation.Types.DeploymentTargets where
import Amazonka.CloudFormation.Types.AccountFilterType
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
data DeploymentTargets = DeploymentTargets'
{
DeploymentTargets -> Maybe AccountFilterType
accountFilterType :: Prelude.Maybe AccountFilterType,
DeploymentTargets -> Maybe [Text]
accounts :: Prelude.Maybe [Prelude.Text],
DeploymentTargets -> Maybe Text
accountsUrl :: Prelude.Maybe Prelude.Text,
DeploymentTargets -> Maybe [Text]
organizationalUnitIds :: Prelude.Maybe [Prelude.Text]
}
deriving (DeploymentTargets -> DeploymentTargets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentTargets -> DeploymentTargets -> Bool
$c/= :: DeploymentTargets -> DeploymentTargets -> Bool
== :: DeploymentTargets -> DeploymentTargets -> Bool
$c== :: DeploymentTargets -> DeploymentTargets -> Bool
Prelude.Eq, ReadPrec [DeploymentTargets]
ReadPrec DeploymentTargets
Int -> ReadS DeploymentTargets
ReadS [DeploymentTargets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentTargets]
$creadListPrec :: ReadPrec [DeploymentTargets]
readPrec :: ReadPrec DeploymentTargets
$creadPrec :: ReadPrec DeploymentTargets
readList :: ReadS [DeploymentTargets]
$creadList :: ReadS [DeploymentTargets]
readsPrec :: Int -> ReadS DeploymentTargets
$creadsPrec :: Int -> ReadS DeploymentTargets
Prelude.Read, Int -> DeploymentTargets -> ShowS
[DeploymentTargets] -> ShowS
DeploymentTargets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentTargets] -> ShowS
$cshowList :: [DeploymentTargets] -> ShowS
show :: DeploymentTargets -> String
$cshow :: DeploymentTargets -> String
showsPrec :: Int -> DeploymentTargets -> ShowS
$cshowsPrec :: Int -> DeploymentTargets -> ShowS
Prelude.Show, forall x. Rep DeploymentTargets x -> DeploymentTargets
forall x. DeploymentTargets -> Rep DeploymentTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentTargets x -> DeploymentTargets
$cfrom :: forall x. DeploymentTargets -> Rep DeploymentTargets x
Prelude.Generic)
newDeploymentTargets ::
DeploymentTargets
newDeploymentTargets :: DeploymentTargets
newDeploymentTargets =
DeploymentTargets'
{ $sel:accountFilterType:DeploymentTargets' :: Maybe AccountFilterType
accountFilterType =
forall a. Maybe a
Prelude.Nothing,
$sel:accounts:DeploymentTargets' :: Maybe [Text]
accounts = forall a. Maybe a
Prelude.Nothing,
$sel:accountsUrl:DeploymentTargets' :: Maybe Text
accountsUrl = forall a. Maybe a
Prelude.Nothing,
$sel:organizationalUnitIds:DeploymentTargets' :: Maybe [Text]
organizationalUnitIds = forall a. Maybe a
Prelude.Nothing
}
deploymentTargets_accountFilterType :: Lens.Lens' DeploymentTargets (Prelude.Maybe AccountFilterType)
deploymentTargets_accountFilterType :: Lens' DeploymentTargets (Maybe AccountFilterType)
deploymentTargets_accountFilterType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentTargets' {Maybe AccountFilterType
accountFilterType :: Maybe AccountFilterType
$sel:accountFilterType:DeploymentTargets' :: DeploymentTargets -> Maybe AccountFilterType
accountFilterType} -> Maybe AccountFilterType
accountFilterType) (\s :: DeploymentTargets
s@DeploymentTargets' {} Maybe AccountFilterType
a -> DeploymentTargets
s {$sel:accountFilterType:DeploymentTargets' :: Maybe AccountFilterType
accountFilterType = Maybe AccountFilterType
a} :: DeploymentTargets)
deploymentTargets_accounts :: Lens.Lens' DeploymentTargets (Prelude.Maybe [Prelude.Text])
deploymentTargets_accounts :: Lens' DeploymentTargets (Maybe [Text])
deploymentTargets_accounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentTargets' {Maybe [Text]
accounts :: Maybe [Text]
$sel:accounts:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
accounts} -> Maybe [Text]
accounts) (\s :: DeploymentTargets
s@DeploymentTargets' {} Maybe [Text]
a -> DeploymentTargets
s {$sel:accounts:DeploymentTargets' :: Maybe [Text]
accounts = Maybe [Text]
a} :: DeploymentTargets) 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
deploymentTargets_accountsUrl :: Lens.Lens' DeploymentTargets (Prelude.Maybe Prelude.Text)
deploymentTargets_accountsUrl :: Lens' DeploymentTargets (Maybe Text)
deploymentTargets_accountsUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentTargets' {Maybe Text
accountsUrl :: Maybe Text
$sel:accountsUrl:DeploymentTargets' :: DeploymentTargets -> Maybe Text
accountsUrl} -> Maybe Text
accountsUrl) (\s :: DeploymentTargets
s@DeploymentTargets' {} Maybe Text
a -> DeploymentTargets
s {$sel:accountsUrl:DeploymentTargets' :: Maybe Text
accountsUrl = Maybe Text
a} :: DeploymentTargets)
deploymentTargets_organizationalUnitIds :: Lens.Lens' DeploymentTargets (Prelude.Maybe [Prelude.Text])
deploymentTargets_organizationalUnitIds :: Lens' DeploymentTargets (Maybe [Text])
deploymentTargets_organizationalUnitIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentTargets' {Maybe [Text]
organizationalUnitIds :: Maybe [Text]
$sel:organizationalUnitIds:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
organizationalUnitIds} -> Maybe [Text]
organizationalUnitIds) (\s :: DeploymentTargets
s@DeploymentTargets' {} Maybe [Text]
a -> DeploymentTargets
s {$sel:organizationalUnitIds:DeploymentTargets' :: Maybe [Text]
organizationalUnitIds = Maybe [Text]
a} :: DeploymentTargets) 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
instance Data.FromXML DeploymentTargets where
parseXML :: [Node] -> Either String DeploymentTargets
parseXML [Node]
x =
Maybe AccountFilterType
-> Maybe [Text] -> Maybe Text -> Maybe [Text] -> DeploymentTargets
DeploymentTargets'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AccountFilterType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Accounts"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AccountsUrl")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"OrganizationalUnitIds"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
instance Prelude.Hashable DeploymentTargets where
hashWithSalt :: Int -> DeploymentTargets -> Int
hashWithSalt Int
_salt DeploymentTargets' {Maybe [Text]
Maybe Text
Maybe AccountFilterType
organizationalUnitIds :: Maybe [Text]
accountsUrl :: Maybe Text
accounts :: Maybe [Text]
accountFilterType :: Maybe AccountFilterType
$sel:organizationalUnitIds:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
$sel:accountsUrl:DeploymentTargets' :: DeploymentTargets -> Maybe Text
$sel:accounts:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
$sel:accountFilterType:DeploymentTargets' :: DeploymentTargets -> Maybe AccountFilterType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccountFilterType
accountFilterType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
accounts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountsUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
organizationalUnitIds
instance Prelude.NFData DeploymentTargets where
rnf :: DeploymentTargets -> ()
rnf DeploymentTargets' {Maybe [Text]
Maybe Text
Maybe AccountFilterType
organizationalUnitIds :: Maybe [Text]
accountsUrl :: Maybe Text
accounts :: Maybe [Text]
accountFilterType :: Maybe AccountFilterType
$sel:organizationalUnitIds:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
$sel:accountsUrl:DeploymentTargets' :: DeploymentTargets -> Maybe Text
$sel:accounts:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
$sel:accountFilterType:DeploymentTargets' :: DeploymentTargets -> Maybe AccountFilterType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AccountFilterType
accountFilterType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
accounts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountsUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
organizationalUnitIds
instance Data.ToQuery DeploymentTargets where
toQuery :: DeploymentTargets -> QueryString
toQuery DeploymentTargets' {Maybe [Text]
Maybe Text
Maybe AccountFilterType
organizationalUnitIds :: Maybe [Text]
accountsUrl :: Maybe Text
accounts :: Maybe [Text]
accountFilterType :: Maybe AccountFilterType
$sel:organizationalUnitIds:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
$sel:accountsUrl:DeploymentTargets' :: DeploymentTargets -> Maybe Text
$sel:accounts:DeploymentTargets' :: DeploymentTargets -> Maybe [Text]
$sel:accountFilterType:DeploymentTargets' :: DeploymentTargets -> Maybe AccountFilterType
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"AccountFilterType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AccountFilterType
accountFilterType,
ByteString
"Accounts"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
accounts),
ByteString
"AccountsUrl" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
accountsUrl,
ByteString
"OrganizationalUnitIds"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
organizationalUnitIds
)
]