{-# 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.CloudHSMV2.Types.Hsm where
import Amazonka.CloudHSMV2.Types.HsmState
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Hsm = Hsm'
{
Hsm -> Maybe Text
stateMessage :: Prelude.Maybe Prelude.Text,
Hsm -> Maybe HsmState
state :: Prelude.Maybe HsmState,
Hsm -> Maybe Text
eniId :: Prelude.Maybe Prelude.Text,
Hsm -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
Hsm -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
Hsm -> Maybe Text
clusterId :: Prelude.Maybe Prelude.Text,
Hsm -> Maybe Text
eniIp :: Prelude.Maybe Prelude.Text,
Hsm -> Text
hsmId :: Prelude.Text
}
deriving (Hsm -> Hsm -> Bool
(Hsm -> Hsm -> Bool) -> (Hsm -> Hsm -> Bool) -> Eq Hsm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Hsm -> Hsm -> Bool
$c/= :: Hsm -> Hsm -> Bool
== :: Hsm -> Hsm -> Bool
$c== :: Hsm -> Hsm -> Bool
Prelude.Eq, ReadPrec [Hsm]
ReadPrec Hsm
Int -> ReadS Hsm
ReadS [Hsm]
(Int -> ReadS Hsm)
-> ReadS [Hsm] -> ReadPrec Hsm -> ReadPrec [Hsm] -> Read Hsm
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Hsm]
$creadListPrec :: ReadPrec [Hsm]
readPrec :: ReadPrec Hsm
$creadPrec :: ReadPrec Hsm
readList :: ReadS [Hsm]
$creadList :: ReadS [Hsm]
readsPrec :: Int -> ReadS Hsm
$creadsPrec :: Int -> ReadS Hsm
Prelude.Read, Int -> Hsm -> ShowS
[Hsm] -> ShowS
Hsm -> String
(Int -> Hsm -> ShowS)
-> (Hsm -> String) -> ([Hsm] -> ShowS) -> Show Hsm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Hsm] -> ShowS
$cshowList :: [Hsm] -> ShowS
show :: Hsm -> String
$cshow :: Hsm -> String
showsPrec :: Int -> Hsm -> ShowS
$cshowsPrec :: Int -> Hsm -> ShowS
Prelude.Show, (forall x. Hsm -> Rep Hsm x)
-> (forall x. Rep Hsm x -> Hsm) -> Generic Hsm
forall x. Rep Hsm x -> Hsm
forall x. Hsm -> Rep Hsm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Hsm x -> Hsm
$cfrom :: forall x. Hsm -> Rep Hsm x
Prelude.Generic)
newHsm ::
Prelude.Text ->
Hsm
newHsm :: Text -> Hsm
newHsm Text
pHsmId_ =
Hsm' :: Maybe Text
-> Maybe HsmState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm
Hsm'
{ $sel:stateMessage:Hsm' :: Maybe Text
stateMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:state:Hsm' :: Maybe HsmState
state = Maybe HsmState
forall a. Maybe a
Prelude.Nothing,
$sel:eniId:Hsm' :: Maybe Text
eniId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subnetId:Hsm' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:Hsm' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterId:Hsm' :: Maybe Text
clusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eniIp:Hsm' :: Maybe Text
eniIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hsmId:Hsm' :: Text
hsmId = Text
pHsmId_
}
hsm_stateMessage :: Lens.Lens' Hsm (Prelude.Maybe Prelude.Text)
hsm_stateMessage :: (Maybe Text -> f (Maybe Text)) -> Hsm -> f Hsm
hsm_stateMessage = (Hsm -> Maybe Text)
-> (Hsm -> Maybe Text -> Hsm)
-> Lens Hsm Hsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe Text
stateMessage :: Maybe Text
$sel:stateMessage:Hsm' :: Hsm -> Maybe Text
stateMessage} -> Maybe Text
stateMessage) (\s :: Hsm
s@Hsm' {} Maybe Text
a -> Hsm
s {$sel:stateMessage:Hsm' :: Maybe Text
stateMessage = Maybe Text
a} :: Hsm)
hsm_state :: Lens.Lens' Hsm (Prelude.Maybe HsmState)
hsm_state :: (Maybe HsmState -> f (Maybe HsmState)) -> Hsm -> f Hsm
hsm_state = (Hsm -> Maybe HsmState)
-> (Hsm -> Maybe HsmState -> Hsm)
-> Lens Hsm Hsm (Maybe HsmState) (Maybe HsmState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe HsmState
state :: Maybe HsmState
$sel:state:Hsm' :: Hsm -> Maybe HsmState
state} -> Maybe HsmState
state) (\s :: Hsm
s@Hsm' {} Maybe HsmState
a -> Hsm
s {$sel:state:Hsm' :: Maybe HsmState
state = Maybe HsmState
a} :: Hsm)
hsm_eniId :: Lens.Lens' Hsm (Prelude.Maybe Prelude.Text)
hsm_eniId :: (Maybe Text -> f (Maybe Text)) -> Hsm -> f Hsm
hsm_eniId = (Hsm -> Maybe Text)
-> (Hsm -> Maybe Text -> Hsm)
-> Lens Hsm Hsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe Text
eniId :: Maybe Text
$sel:eniId:Hsm' :: Hsm -> Maybe Text
eniId} -> Maybe Text
eniId) (\s :: Hsm
s@Hsm' {} Maybe Text
a -> Hsm
s {$sel:eniId:Hsm' :: Maybe Text
eniId = Maybe Text
a} :: Hsm)
hsm_subnetId :: Lens.Lens' Hsm (Prelude.Maybe Prelude.Text)
hsm_subnetId :: (Maybe Text -> f (Maybe Text)) -> Hsm -> f Hsm
hsm_subnetId = (Hsm -> Maybe Text)
-> (Hsm -> Maybe Text -> Hsm)
-> Lens Hsm Hsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:Hsm' :: Hsm -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: Hsm
s@Hsm' {} Maybe Text
a -> Hsm
s {$sel:subnetId:Hsm' :: Maybe Text
subnetId = Maybe Text
a} :: Hsm)
hsm_availabilityZone :: Lens.Lens' Hsm (Prelude.Maybe Prelude.Text)
hsm_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> Hsm -> f Hsm
hsm_availabilityZone = (Hsm -> Maybe Text)
-> (Hsm -> Maybe Text -> Hsm)
-> Lens Hsm Hsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:Hsm' :: Hsm -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: Hsm
s@Hsm' {} Maybe Text
a -> Hsm
s {$sel:availabilityZone:Hsm' :: Maybe Text
availabilityZone = Maybe Text
a} :: Hsm)
hsm_clusterId :: Lens.Lens' Hsm (Prelude.Maybe Prelude.Text)
hsm_clusterId :: (Maybe Text -> f (Maybe Text)) -> Hsm -> f Hsm
hsm_clusterId = (Hsm -> Maybe Text)
-> (Hsm -> Maybe Text -> Hsm)
-> Lens Hsm Hsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe Text
clusterId :: Maybe Text
$sel:clusterId:Hsm' :: Hsm -> Maybe Text
clusterId} -> Maybe Text
clusterId) (\s :: Hsm
s@Hsm' {} Maybe Text
a -> Hsm
s {$sel:clusterId:Hsm' :: Maybe Text
clusterId = Maybe Text
a} :: Hsm)
hsm_eniIp :: Lens.Lens' Hsm (Prelude.Maybe Prelude.Text)
hsm_eniIp :: (Maybe Text -> f (Maybe Text)) -> Hsm -> f Hsm
hsm_eniIp = (Hsm -> Maybe Text)
-> (Hsm -> Maybe Text -> Hsm)
-> Lens Hsm Hsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Maybe Text
eniIp :: Maybe Text
$sel:eniIp:Hsm' :: Hsm -> Maybe Text
eniIp} -> Maybe Text
eniIp) (\s :: Hsm
s@Hsm' {} Maybe Text
a -> Hsm
s {$sel:eniIp:Hsm' :: Maybe Text
eniIp = Maybe Text
a} :: Hsm)
hsm_hsmId :: Lens.Lens' Hsm Prelude.Text
hsm_hsmId :: (Text -> f Text) -> Hsm -> f Hsm
hsm_hsmId = (Hsm -> Text) -> (Hsm -> Text -> Hsm) -> Lens Hsm Hsm Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hsm' {Text
hsmId :: Text
$sel:hsmId:Hsm' :: Hsm -> Text
hsmId} -> Text
hsmId) (\s :: Hsm
s@Hsm' {} Text
a -> Hsm
s {$sel:hsmId:Hsm' :: Text
hsmId = Text
a} :: Hsm)
instance Core.FromJSON Hsm where
parseJSON :: Value -> Parser Hsm
parseJSON =
String -> (Object -> Parser Hsm) -> Value -> Parser Hsm
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Hsm"
( \Object
x ->
Maybe Text
-> Maybe HsmState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm
Hsm'
(Maybe Text
-> Maybe HsmState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm)
-> Parser (Maybe Text)
-> Parser
(Maybe HsmState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm)
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
"StateMessage")
Parser
(Maybe HsmState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm)
-> Parser (Maybe HsmState)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HsmState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Hsm)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Text -> Hsm)
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
"EniId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Text -> Hsm)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Text -> Hsm)
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
"SubnetId")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Text -> Hsm)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Text -> Hsm)
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
"AvailabilityZone")
Parser (Maybe Text -> Maybe Text -> Text -> Hsm)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Text -> Hsm)
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
"ClusterId")
Parser (Maybe Text -> Text -> Hsm)
-> Parser (Maybe Text) -> Parser (Text -> Hsm)
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
"EniIp")
Parser (Text -> Hsm) -> Parser Text -> Parser Hsm
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"HsmId")
)
instance Prelude.Hashable Hsm
instance Prelude.NFData Hsm