{-# 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.StorageGateway.Types.ChapInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ChapInfo = ChapInfo'
{
ChapInfo -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
ChapInfo -> Maybe (Sensitive Text)
secretToAuthenticateInitiator :: Prelude.Maybe (Core.Sensitive Prelude.Text),
ChapInfo -> Maybe Text
initiatorName :: Prelude.Maybe Prelude.Text,
ChapInfo -> Maybe (Sensitive Text)
secretToAuthenticateTarget :: Prelude.Maybe (Core.Sensitive Prelude.Text)
}
deriving (ChapInfo -> ChapInfo -> Bool
(ChapInfo -> ChapInfo -> Bool)
-> (ChapInfo -> ChapInfo -> Bool) -> Eq ChapInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChapInfo -> ChapInfo -> Bool
$c/= :: ChapInfo -> ChapInfo -> Bool
== :: ChapInfo -> ChapInfo -> Bool
$c== :: ChapInfo -> ChapInfo -> Bool
Prelude.Eq, Int -> ChapInfo -> ShowS
[ChapInfo] -> ShowS
ChapInfo -> String
(Int -> ChapInfo -> ShowS)
-> (ChapInfo -> String) -> ([ChapInfo] -> ShowS) -> Show ChapInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChapInfo] -> ShowS
$cshowList :: [ChapInfo] -> ShowS
show :: ChapInfo -> String
$cshow :: ChapInfo -> String
showsPrec :: Int -> ChapInfo -> ShowS
$cshowsPrec :: Int -> ChapInfo -> ShowS
Prelude.Show, (forall x. ChapInfo -> Rep ChapInfo x)
-> (forall x. Rep ChapInfo x -> ChapInfo) -> Generic ChapInfo
forall x. Rep ChapInfo x -> ChapInfo
forall x. ChapInfo -> Rep ChapInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChapInfo x -> ChapInfo
$cfrom :: forall x. ChapInfo -> Rep ChapInfo x
Prelude.Generic)
newChapInfo ::
ChapInfo
newChapInfo :: ChapInfo
newChapInfo =
ChapInfo' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> ChapInfo
ChapInfo'
{ $sel:targetARN:ChapInfo' :: Maybe Text
targetARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretToAuthenticateInitiator:ChapInfo' :: Maybe (Sensitive Text)
secretToAuthenticateInitiator = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:initiatorName:ChapInfo' :: Maybe Text
initiatorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretToAuthenticateTarget:ChapInfo' :: Maybe (Sensitive Text)
secretToAuthenticateTarget = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
}
chapInfo_targetARN :: Lens.Lens' ChapInfo (Prelude.Maybe Prelude.Text)
chapInfo_targetARN :: (Maybe Text -> f (Maybe Text)) -> ChapInfo -> f ChapInfo
chapInfo_targetARN = (ChapInfo -> Maybe Text)
-> (ChapInfo -> Maybe Text -> ChapInfo)
-> Lens ChapInfo ChapInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChapInfo' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:ChapInfo' :: ChapInfo -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: ChapInfo
s@ChapInfo' {} Maybe Text
a -> ChapInfo
s {$sel:targetARN:ChapInfo' :: Maybe Text
targetARN = Maybe Text
a} :: ChapInfo)
chapInfo_secretToAuthenticateInitiator :: Lens.Lens' ChapInfo (Prelude.Maybe Prelude.Text)
chapInfo_secretToAuthenticateInitiator :: (Maybe Text -> f (Maybe Text)) -> ChapInfo -> f ChapInfo
chapInfo_secretToAuthenticateInitiator = (ChapInfo -> Maybe (Sensitive Text))
-> (ChapInfo -> Maybe (Sensitive Text) -> ChapInfo)
-> Lens
ChapInfo ChapInfo (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChapInfo' {Maybe (Sensitive Text)
secretToAuthenticateInitiator :: Maybe (Sensitive Text)
$sel:secretToAuthenticateInitiator:ChapInfo' :: ChapInfo -> Maybe (Sensitive Text)
secretToAuthenticateInitiator} -> Maybe (Sensitive Text)
secretToAuthenticateInitiator) (\s :: ChapInfo
s@ChapInfo' {} Maybe (Sensitive Text)
a -> ChapInfo
s {$sel:secretToAuthenticateInitiator:ChapInfo' :: Maybe (Sensitive Text)
secretToAuthenticateInitiator = Maybe (Sensitive Text)
a} :: ChapInfo) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> ChapInfo -> f ChapInfo)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ChapInfo
-> f ChapInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
chapInfo_initiatorName :: Lens.Lens' ChapInfo (Prelude.Maybe Prelude.Text)
chapInfo_initiatorName :: (Maybe Text -> f (Maybe Text)) -> ChapInfo -> f ChapInfo
chapInfo_initiatorName = (ChapInfo -> Maybe Text)
-> (ChapInfo -> Maybe Text -> ChapInfo)
-> Lens ChapInfo ChapInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChapInfo' {Maybe Text
initiatorName :: Maybe Text
$sel:initiatorName:ChapInfo' :: ChapInfo -> Maybe Text
initiatorName} -> Maybe Text
initiatorName) (\s :: ChapInfo
s@ChapInfo' {} Maybe Text
a -> ChapInfo
s {$sel:initiatorName:ChapInfo' :: Maybe Text
initiatorName = Maybe Text
a} :: ChapInfo)
chapInfo_secretToAuthenticateTarget :: Lens.Lens' ChapInfo (Prelude.Maybe Prelude.Text)
chapInfo_secretToAuthenticateTarget :: (Maybe Text -> f (Maybe Text)) -> ChapInfo -> f ChapInfo
chapInfo_secretToAuthenticateTarget = (ChapInfo -> Maybe (Sensitive Text))
-> (ChapInfo -> Maybe (Sensitive Text) -> ChapInfo)
-> Lens
ChapInfo ChapInfo (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChapInfo' {Maybe (Sensitive Text)
secretToAuthenticateTarget :: Maybe (Sensitive Text)
$sel:secretToAuthenticateTarget:ChapInfo' :: ChapInfo -> Maybe (Sensitive Text)
secretToAuthenticateTarget} -> Maybe (Sensitive Text)
secretToAuthenticateTarget) (\s :: ChapInfo
s@ChapInfo' {} Maybe (Sensitive Text)
a -> ChapInfo
s {$sel:secretToAuthenticateTarget:ChapInfo' :: Maybe (Sensitive Text)
secretToAuthenticateTarget = Maybe (Sensitive Text)
a} :: ChapInfo) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> ChapInfo -> f ChapInfo)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ChapInfo
-> f ChapInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.FromJSON ChapInfo where
parseJSON :: Value -> Parser ChapInfo
parseJSON =
String -> (Object -> Parser ChapInfo) -> Value -> Parser ChapInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChapInfo"
( \Object
x ->
Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> ChapInfo
ChapInfo'
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> ChapInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Maybe (Sensitive Text) -> ChapInfo)
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
"TargetARN")
Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Maybe (Sensitive Text) -> ChapInfo)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Maybe (Sensitive Text) -> ChapInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecretToAuthenticateInitiator")
Parser (Maybe Text -> Maybe (Sensitive Text) -> ChapInfo)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive Text) -> ChapInfo)
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
"InitiatorName")
Parser (Maybe (Sensitive Text) -> ChapInfo)
-> Parser (Maybe (Sensitive Text)) -> Parser ChapInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecretToAuthenticateTarget")
)
instance Prelude.Hashable ChapInfo
instance Prelude.NFData ChapInfo