{-# 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.LicenseManagerUserSubscriptions.Types.UpdateSettings 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
data UpdateSettings = UpdateSettings'
{
UpdateSettings -> Maybe Text
securityGroupId :: Prelude.Maybe Prelude.Text,
UpdateSettings -> [Text]
addSubnets :: [Prelude.Text],
UpdateSettings -> [Text]
removeSubnets :: [Prelude.Text]
}
deriving (UpdateSettings -> UpdateSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSettings -> UpdateSettings -> Bool
$c/= :: UpdateSettings -> UpdateSettings -> Bool
== :: UpdateSettings -> UpdateSettings -> Bool
$c== :: UpdateSettings -> UpdateSettings -> Bool
Prelude.Eq, ReadPrec [UpdateSettings]
ReadPrec UpdateSettings
Int -> ReadS UpdateSettings
ReadS [UpdateSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSettings]
$creadListPrec :: ReadPrec [UpdateSettings]
readPrec :: ReadPrec UpdateSettings
$creadPrec :: ReadPrec UpdateSettings
readList :: ReadS [UpdateSettings]
$creadList :: ReadS [UpdateSettings]
readsPrec :: Int -> ReadS UpdateSettings
$creadsPrec :: Int -> ReadS UpdateSettings
Prelude.Read, Int -> UpdateSettings -> ShowS
[UpdateSettings] -> ShowS
UpdateSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSettings] -> ShowS
$cshowList :: [UpdateSettings] -> ShowS
show :: UpdateSettings -> String
$cshow :: UpdateSettings -> String
showsPrec :: Int -> UpdateSettings -> ShowS
$cshowsPrec :: Int -> UpdateSettings -> ShowS
Prelude.Show, forall x. Rep UpdateSettings x -> UpdateSettings
forall x. UpdateSettings -> Rep UpdateSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSettings x -> UpdateSettings
$cfrom :: forall x. UpdateSettings -> Rep UpdateSettings x
Prelude.Generic)
newUpdateSettings ::
UpdateSettings
newUpdateSettings :: UpdateSettings
newUpdateSettings =
UpdateSettings'
{ $sel:securityGroupId:UpdateSettings' :: Maybe Text
securityGroupId = forall a. Maybe a
Prelude.Nothing,
$sel:addSubnets:UpdateSettings' :: [Text]
addSubnets = forall a. Monoid a => a
Prelude.mempty,
$sel:removeSubnets:UpdateSettings' :: [Text]
removeSubnets = forall a. Monoid a => a
Prelude.mempty
}
updateSettings_securityGroupId :: Lens.Lens' UpdateSettings (Prelude.Maybe Prelude.Text)
updateSettings_securityGroupId :: Lens' UpdateSettings (Maybe Text)
updateSettings_securityGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSettings' {Maybe Text
securityGroupId :: Maybe Text
$sel:securityGroupId:UpdateSettings' :: UpdateSettings -> Maybe Text
securityGroupId} -> Maybe Text
securityGroupId) (\s :: UpdateSettings
s@UpdateSettings' {} Maybe Text
a -> UpdateSettings
s {$sel:securityGroupId:UpdateSettings' :: Maybe Text
securityGroupId = Maybe Text
a} :: UpdateSettings)
updateSettings_addSubnets :: Lens.Lens' UpdateSettings [Prelude.Text]
updateSettings_addSubnets :: Lens' UpdateSettings [Text]
updateSettings_addSubnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSettings' {[Text]
addSubnets :: [Text]
$sel:addSubnets:UpdateSettings' :: UpdateSettings -> [Text]
addSubnets} -> [Text]
addSubnets) (\s :: UpdateSettings
s@UpdateSettings' {} [Text]
a -> UpdateSettings
s {$sel:addSubnets:UpdateSettings' :: [Text]
addSubnets = [Text]
a} :: UpdateSettings) 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
updateSettings_removeSubnets :: Lens.Lens' UpdateSettings [Prelude.Text]
updateSettings_removeSubnets :: Lens' UpdateSettings [Text]
updateSettings_removeSubnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSettings' {[Text]
removeSubnets :: [Text]
$sel:removeSubnets:UpdateSettings' :: UpdateSettings -> [Text]
removeSubnets} -> [Text]
removeSubnets) (\s :: UpdateSettings
s@UpdateSettings' {} [Text]
a -> UpdateSettings
s {$sel:removeSubnets:UpdateSettings' :: [Text]
removeSubnets = [Text]
a} :: UpdateSettings) 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 UpdateSettings where
hashWithSalt :: Int -> UpdateSettings -> Int
hashWithSalt Int
_salt UpdateSettings' {[Text]
Maybe Text
removeSubnets :: [Text]
addSubnets :: [Text]
securityGroupId :: Maybe Text
$sel:removeSubnets:UpdateSettings' :: UpdateSettings -> [Text]
$sel:addSubnets:UpdateSettings' :: UpdateSettings -> [Text]
$sel:securityGroupId:UpdateSettings' :: UpdateSettings -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
securityGroupId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
addSubnets
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
removeSubnets
instance Prelude.NFData UpdateSettings where
rnf :: UpdateSettings -> ()
rnf UpdateSettings' {[Text]
Maybe Text
removeSubnets :: [Text]
addSubnets :: [Text]
securityGroupId :: Maybe Text
$sel:removeSubnets:UpdateSettings' :: UpdateSettings -> [Text]
$sel:addSubnets:UpdateSettings' :: UpdateSettings -> [Text]
$sel:securityGroupId:UpdateSettings' :: UpdateSettings -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityGroupId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
addSubnets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
removeSubnets
instance Data.ToJSON UpdateSettings where
toJSON :: UpdateSettings -> Value
toJSON UpdateSettings' {[Text]
Maybe Text
removeSubnets :: [Text]
addSubnets :: [Text]
securityGroupId :: Maybe Text
$sel:removeSubnets:UpdateSettings' :: UpdateSettings -> [Text]
$sel:addSubnets:UpdateSettings' :: UpdateSettings -> [Text]
$sel:securityGroupId:UpdateSettings' :: UpdateSettings -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SecurityGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
securityGroupId,
forall a. a -> Maybe a
Prelude.Just (Key
"AddSubnets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
addSubnets),
forall a. a -> Maybe a
Prelude.Just
(Key
"RemoveSubnets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
removeSubnets)
]
)