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