{-# 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.EC2.Types.AccessScopePath where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.PathStatement
import Amazonka.EC2.Types.ThroughResourcesStatement
import qualified Amazonka.Prelude as Prelude
data AccessScopePath = AccessScopePath'
{
AccessScopePath -> Maybe PathStatement
destination :: Prelude.Maybe PathStatement,
AccessScopePath -> Maybe PathStatement
source :: Prelude.Maybe PathStatement,
AccessScopePath -> Maybe [ThroughResourcesStatement]
throughResources :: Prelude.Maybe [ThroughResourcesStatement]
}
deriving (AccessScopePath -> AccessScopePath -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessScopePath -> AccessScopePath -> Bool
$c/= :: AccessScopePath -> AccessScopePath -> Bool
== :: AccessScopePath -> AccessScopePath -> Bool
$c== :: AccessScopePath -> AccessScopePath -> Bool
Prelude.Eq, ReadPrec [AccessScopePath]
ReadPrec AccessScopePath
Int -> ReadS AccessScopePath
ReadS [AccessScopePath]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessScopePath]
$creadListPrec :: ReadPrec [AccessScopePath]
readPrec :: ReadPrec AccessScopePath
$creadPrec :: ReadPrec AccessScopePath
readList :: ReadS [AccessScopePath]
$creadList :: ReadS [AccessScopePath]
readsPrec :: Int -> ReadS AccessScopePath
$creadsPrec :: Int -> ReadS AccessScopePath
Prelude.Read, Int -> AccessScopePath -> ShowS
[AccessScopePath] -> ShowS
AccessScopePath -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessScopePath] -> ShowS
$cshowList :: [AccessScopePath] -> ShowS
show :: AccessScopePath -> String
$cshow :: AccessScopePath -> String
showsPrec :: Int -> AccessScopePath -> ShowS
$cshowsPrec :: Int -> AccessScopePath -> ShowS
Prelude.Show, forall x. Rep AccessScopePath x -> AccessScopePath
forall x. AccessScopePath -> Rep AccessScopePath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessScopePath x -> AccessScopePath
$cfrom :: forall x. AccessScopePath -> Rep AccessScopePath x
Prelude.Generic)
newAccessScopePath ::
AccessScopePath
newAccessScopePath :: AccessScopePath
newAccessScopePath =
AccessScopePath'
{ $sel:destination:AccessScopePath' :: Maybe PathStatement
destination = forall a. Maybe a
Prelude.Nothing,
$sel:source:AccessScopePath' :: Maybe PathStatement
source = forall a. Maybe a
Prelude.Nothing,
$sel:throughResources:AccessScopePath' :: Maybe [ThroughResourcesStatement]
throughResources = forall a. Maybe a
Prelude.Nothing
}
accessScopePath_destination :: Lens.Lens' AccessScopePath (Prelude.Maybe PathStatement)
accessScopePath_destination :: Lens' AccessScopePath (Maybe PathStatement)
accessScopePath_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessScopePath' {Maybe PathStatement
destination :: Maybe PathStatement
$sel:destination:AccessScopePath' :: AccessScopePath -> Maybe PathStatement
destination} -> Maybe PathStatement
destination) (\s :: AccessScopePath
s@AccessScopePath' {} Maybe PathStatement
a -> AccessScopePath
s {$sel:destination:AccessScopePath' :: Maybe PathStatement
destination = Maybe PathStatement
a} :: AccessScopePath)
accessScopePath_source :: Lens.Lens' AccessScopePath (Prelude.Maybe PathStatement)
accessScopePath_source :: Lens' AccessScopePath (Maybe PathStatement)
accessScopePath_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessScopePath' {Maybe PathStatement
source :: Maybe PathStatement
$sel:source:AccessScopePath' :: AccessScopePath -> Maybe PathStatement
source} -> Maybe PathStatement
source) (\s :: AccessScopePath
s@AccessScopePath' {} Maybe PathStatement
a -> AccessScopePath
s {$sel:source:AccessScopePath' :: Maybe PathStatement
source = Maybe PathStatement
a} :: AccessScopePath)
accessScopePath_throughResources :: Lens.Lens' AccessScopePath (Prelude.Maybe [ThroughResourcesStatement])
accessScopePath_throughResources :: Lens' AccessScopePath (Maybe [ThroughResourcesStatement])
accessScopePath_throughResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessScopePath' {Maybe [ThroughResourcesStatement]
throughResources :: Maybe [ThroughResourcesStatement]
$sel:throughResources:AccessScopePath' :: AccessScopePath -> Maybe [ThroughResourcesStatement]
throughResources} -> Maybe [ThroughResourcesStatement]
throughResources) (\s :: AccessScopePath
s@AccessScopePath' {} Maybe [ThroughResourcesStatement]
a -> AccessScopePath
s {$sel:throughResources:AccessScopePath' :: Maybe [ThroughResourcesStatement]
throughResources = Maybe [ThroughResourcesStatement]
a} :: AccessScopePath) 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 AccessScopePath where
parseXML :: [Node] -> Either String AccessScopePath
parseXML [Node]
x =
Maybe PathStatement
-> Maybe PathStatement
-> Maybe [ThroughResourcesStatement]
-> AccessScopePath
AccessScopePath'
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
"destination")
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
"source")
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
"throughResourceSet"
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
"item")
)
instance Prelude.Hashable AccessScopePath where
hashWithSalt :: Int -> AccessScopePath -> Int
hashWithSalt Int
_salt AccessScopePath' {Maybe [ThroughResourcesStatement]
Maybe PathStatement
throughResources :: Maybe [ThroughResourcesStatement]
source :: Maybe PathStatement
destination :: Maybe PathStatement
$sel:throughResources:AccessScopePath' :: AccessScopePath -> Maybe [ThroughResourcesStatement]
$sel:source:AccessScopePath' :: AccessScopePath -> Maybe PathStatement
$sel:destination:AccessScopePath' :: AccessScopePath -> Maybe PathStatement
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PathStatement
destination
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PathStatement
source
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ThroughResourcesStatement]
throughResources
instance Prelude.NFData AccessScopePath where
rnf :: AccessScopePath -> ()
rnf AccessScopePath' {Maybe [ThroughResourcesStatement]
Maybe PathStatement
throughResources :: Maybe [ThroughResourcesStatement]
source :: Maybe PathStatement
destination :: Maybe PathStatement
$sel:throughResources:AccessScopePath' :: AccessScopePath -> Maybe [ThroughResourcesStatement]
$sel:source:AccessScopePath' :: AccessScopePath -> Maybe PathStatement
$sel:destination:AccessScopePath' :: AccessScopePath -> Maybe PathStatement
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe PathStatement
destination
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PathStatement
source
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ThroughResourcesStatement]
throughResources