{-# 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.WorkSpaces.Types.WorkspacesIpGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkSpaces.Types.IpRuleItem
data WorkspacesIpGroup = WorkspacesIpGroup'
{
WorkspacesIpGroup -> Maybe Text
groupDesc :: Prelude.Maybe Prelude.Text,
WorkspacesIpGroup -> Maybe [IpRuleItem]
userRules :: Prelude.Maybe [IpRuleItem],
WorkspacesIpGroup -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
WorkspacesIpGroup -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text
}
deriving (WorkspacesIpGroup -> WorkspacesIpGroup -> Bool
(WorkspacesIpGroup -> WorkspacesIpGroup -> Bool)
-> (WorkspacesIpGroup -> WorkspacesIpGroup -> Bool)
-> Eq WorkspacesIpGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspacesIpGroup -> WorkspacesIpGroup -> Bool
$c/= :: WorkspacesIpGroup -> WorkspacesIpGroup -> Bool
== :: WorkspacesIpGroup -> WorkspacesIpGroup -> Bool
$c== :: WorkspacesIpGroup -> WorkspacesIpGroup -> Bool
Prelude.Eq, ReadPrec [WorkspacesIpGroup]
ReadPrec WorkspacesIpGroup
Int -> ReadS WorkspacesIpGroup
ReadS [WorkspacesIpGroup]
(Int -> ReadS WorkspacesIpGroup)
-> ReadS [WorkspacesIpGroup]
-> ReadPrec WorkspacesIpGroup
-> ReadPrec [WorkspacesIpGroup]
-> Read WorkspacesIpGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkspacesIpGroup]
$creadListPrec :: ReadPrec [WorkspacesIpGroup]
readPrec :: ReadPrec WorkspacesIpGroup
$creadPrec :: ReadPrec WorkspacesIpGroup
readList :: ReadS [WorkspacesIpGroup]
$creadList :: ReadS [WorkspacesIpGroup]
readsPrec :: Int -> ReadS WorkspacesIpGroup
$creadsPrec :: Int -> ReadS WorkspacesIpGroup
Prelude.Read, Int -> WorkspacesIpGroup -> ShowS
[WorkspacesIpGroup] -> ShowS
WorkspacesIpGroup -> String
(Int -> WorkspacesIpGroup -> ShowS)
-> (WorkspacesIpGroup -> String)
-> ([WorkspacesIpGroup] -> ShowS)
-> Show WorkspacesIpGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspacesIpGroup] -> ShowS
$cshowList :: [WorkspacesIpGroup] -> ShowS
show :: WorkspacesIpGroup -> String
$cshow :: WorkspacesIpGroup -> String
showsPrec :: Int -> WorkspacesIpGroup -> ShowS
$cshowsPrec :: Int -> WorkspacesIpGroup -> ShowS
Prelude.Show, (forall x. WorkspacesIpGroup -> Rep WorkspacesIpGroup x)
-> (forall x. Rep WorkspacesIpGroup x -> WorkspacesIpGroup)
-> Generic WorkspacesIpGroup
forall x. Rep WorkspacesIpGroup x -> WorkspacesIpGroup
forall x. WorkspacesIpGroup -> Rep WorkspacesIpGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkspacesIpGroup x -> WorkspacesIpGroup
$cfrom :: forall x. WorkspacesIpGroup -> Rep WorkspacesIpGroup x
Prelude.Generic)
newWorkspacesIpGroup ::
WorkspacesIpGroup
newWorkspacesIpGroup :: WorkspacesIpGroup
newWorkspacesIpGroup =
WorkspacesIpGroup' :: Maybe Text
-> Maybe [IpRuleItem]
-> Maybe Text
-> Maybe Text
-> WorkspacesIpGroup
WorkspacesIpGroup'
{ $sel:groupDesc:WorkspacesIpGroup' :: Maybe Text
groupDesc = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userRules:WorkspacesIpGroup' :: Maybe [IpRuleItem]
userRules = Maybe [IpRuleItem]
forall a. Maybe a
Prelude.Nothing,
$sel:groupId:WorkspacesIpGroup' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groupName:WorkspacesIpGroup' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
workspacesIpGroup_groupDesc :: Lens.Lens' WorkspacesIpGroup (Prelude.Maybe Prelude.Text)
workspacesIpGroup_groupDesc :: (Maybe Text -> f (Maybe Text))
-> WorkspacesIpGroup -> f WorkspacesIpGroup
workspacesIpGroup_groupDesc = (WorkspacesIpGroup -> Maybe Text)
-> (WorkspacesIpGroup -> Maybe Text -> WorkspacesIpGroup)
-> Lens
WorkspacesIpGroup WorkspacesIpGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspacesIpGroup' {Maybe Text
groupDesc :: Maybe Text
$sel:groupDesc:WorkspacesIpGroup' :: WorkspacesIpGroup -> Maybe Text
groupDesc} -> Maybe Text
groupDesc) (\s :: WorkspacesIpGroup
s@WorkspacesIpGroup' {} Maybe Text
a -> WorkspacesIpGroup
s {$sel:groupDesc:WorkspacesIpGroup' :: Maybe Text
groupDesc = Maybe Text
a} :: WorkspacesIpGroup)
workspacesIpGroup_userRules :: Lens.Lens' WorkspacesIpGroup (Prelude.Maybe [IpRuleItem])
workspacesIpGroup_userRules :: (Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> WorkspacesIpGroup -> f WorkspacesIpGroup
workspacesIpGroup_userRules = (WorkspacesIpGroup -> Maybe [IpRuleItem])
-> (WorkspacesIpGroup -> Maybe [IpRuleItem] -> WorkspacesIpGroup)
-> Lens
WorkspacesIpGroup
WorkspacesIpGroup
(Maybe [IpRuleItem])
(Maybe [IpRuleItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspacesIpGroup' {Maybe [IpRuleItem]
userRules :: Maybe [IpRuleItem]
$sel:userRules:WorkspacesIpGroup' :: WorkspacesIpGroup -> Maybe [IpRuleItem]
userRules} -> Maybe [IpRuleItem]
userRules) (\s :: WorkspacesIpGroup
s@WorkspacesIpGroup' {} Maybe [IpRuleItem]
a -> WorkspacesIpGroup
s {$sel:userRules:WorkspacesIpGroup' :: Maybe [IpRuleItem]
userRules = Maybe [IpRuleItem]
a} :: WorkspacesIpGroup) ((Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> WorkspacesIpGroup -> f WorkspacesIpGroup)
-> ((Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> (Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> WorkspacesIpGroup
-> f WorkspacesIpGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IpRuleItem] [IpRuleItem] [IpRuleItem] [IpRuleItem]
-> Iso
(Maybe [IpRuleItem])
(Maybe [IpRuleItem])
(Maybe [IpRuleItem])
(Maybe [IpRuleItem])
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 AnIso [IpRuleItem] [IpRuleItem] [IpRuleItem] [IpRuleItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
workspacesIpGroup_groupId :: Lens.Lens' WorkspacesIpGroup (Prelude.Maybe Prelude.Text)
workspacesIpGroup_groupId :: (Maybe Text -> f (Maybe Text))
-> WorkspacesIpGroup -> f WorkspacesIpGroup
workspacesIpGroup_groupId = (WorkspacesIpGroup -> Maybe Text)
-> (WorkspacesIpGroup -> Maybe Text -> WorkspacesIpGroup)
-> Lens
WorkspacesIpGroup WorkspacesIpGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspacesIpGroup' {Maybe Text
groupId :: Maybe Text
$sel:groupId:WorkspacesIpGroup' :: WorkspacesIpGroup -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: WorkspacesIpGroup
s@WorkspacesIpGroup' {} Maybe Text
a -> WorkspacesIpGroup
s {$sel:groupId:WorkspacesIpGroup' :: Maybe Text
groupId = Maybe Text
a} :: WorkspacesIpGroup)
workspacesIpGroup_groupName :: Lens.Lens' WorkspacesIpGroup (Prelude.Maybe Prelude.Text)
workspacesIpGroup_groupName :: (Maybe Text -> f (Maybe Text))
-> WorkspacesIpGroup -> f WorkspacesIpGroup
workspacesIpGroup_groupName = (WorkspacesIpGroup -> Maybe Text)
-> (WorkspacesIpGroup -> Maybe Text -> WorkspacesIpGroup)
-> Lens
WorkspacesIpGroup WorkspacesIpGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspacesIpGroup' {Maybe Text
groupName :: Maybe Text
$sel:groupName:WorkspacesIpGroup' :: WorkspacesIpGroup -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: WorkspacesIpGroup
s@WorkspacesIpGroup' {} Maybe Text
a -> WorkspacesIpGroup
s {$sel:groupName:WorkspacesIpGroup' :: Maybe Text
groupName = Maybe Text
a} :: WorkspacesIpGroup)
instance Core.FromJSON WorkspacesIpGroup where
parseJSON :: Value -> Parser WorkspacesIpGroup
parseJSON =
String
-> (Object -> Parser WorkspacesIpGroup)
-> Value
-> Parser WorkspacesIpGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkspacesIpGroup"
( \Object
x ->
Maybe Text
-> Maybe [IpRuleItem]
-> Maybe Text
-> Maybe Text
-> WorkspacesIpGroup
WorkspacesIpGroup'
(Maybe Text
-> Maybe [IpRuleItem]
-> Maybe Text
-> Maybe Text
-> WorkspacesIpGroup)
-> Parser (Maybe Text)
-> Parser
(Maybe [IpRuleItem]
-> Maybe Text -> Maybe Text -> WorkspacesIpGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"groupDesc")
Parser
(Maybe [IpRuleItem]
-> Maybe Text -> Maybe Text -> WorkspacesIpGroup)
-> Parser (Maybe [IpRuleItem])
-> Parser (Maybe Text -> Maybe Text -> WorkspacesIpGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [IpRuleItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userRules" Parser (Maybe (Maybe [IpRuleItem]))
-> Maybe [IpRuleItem] -> Parser (Maybe [IpRuleItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [IpRuleItem]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> WorkspacesIpGroup)
-> Parser (Maybe Text) -> Parser (Maybe Text -> WorkspacesIpGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"groupId")
Parser (Maybe Text -> WorkspacesIpGroup)
-> Parser (Maybe Text) -> Parser WorkspacesIpGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"groupName")
)
instance Prelude.Hashable WorkspacesIpGroup
instance Prelude.NFData WorkspacesIpGroup