{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudHSM.DescribeHapg
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This is documentation for __AWS CloudHSM Classic__. For more
-- information, see
-- <http://aws.amazon.com/cloudhsm/faqs-classic/ AWS CloudHSM Classic FAQs>,
-- the
-- <https://docs.aws.amazon.com/cloudhsm/classic/userguide/ AWS CloudHSM Classic User Guide>,
-- and the
-- <https://docs.aws.amazon.com/cloudhsm/classic/APIReference/ AWS CloudHSM Classic API Reference>.
--
-- __For information about the current version of AWS CloudHSM__, see
-- <http://aws.amazon.com/cloudhsm/ AWS CloudHSM>, the
-- <https://docs.aws.amazon.com/cloudhsm/latest/userguide/ AWS CloudHSM User Guide>,
-- and the
-- <https://docs.aws.amazon.com/cloudhsm/latest/APIReference/ AWS CloudHSM API Reference>.
--
-- Retrieves information about a high-availability partition group.
module Amazonka.CloudHSM.DescribeHapg
  ( -- * Creating a Request
    DescribeHapg (..),
    newDescribeHapg,

    -- * Request Lenses
    describeHapg_hapgArn,

    -- * Destructuring the Response
    DescribeHapgResponse (..),
    newDescribeHapgResponse,

    -- * Response Lenses
    describeHapgResponse_state,
    describeHapgResponse_lastModifiedTimestamp,
    describeHapgResponse_hsmsPendingRegistration,
    describeHapgResponse_hsmsPendingDeletion,
    describeHapgResponse_hapgSerial,
    describeHapgResponse_hsmsLastActionFailed,
    describeHapgResponse_partitionSerialList,
    describeHapgResponse_hapgArn,
    describeHapgResponse_label,
    describeHapgResponse_httpStatus,
  )
where

import Amazonka.CloudHSM.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Contains the inputs for the DescribeHapg action.
--
-- /See:/ 'newDescribeHapg' smart constructor.
data DescribeHapg = DescribeHapg'
  { -- | The ARN of the high-availability partition group to describe.
    DescribeHapg -> Text
hapgArn :: Prelude.Text
  }
  deriving (DescribeHapg -> DescribeHapg -> Bool
(DescribeHapg -> DescribeHapg -> Bool)
-> (DescribeHapg -> DescribeHapg -> Bool) -> Eq DescribeHapg
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHapg -> DescribeHapg -> Bool
$c/= :: DescribeHapg -> DescribeHapg -> Bool
== :: DescribeHapg -> DescribeHapg -> Bool
$c== :: DescribeHapg -> DescribeHapg -> Bool
Prelude.Eq, ReadPrec [DescribeHapg]
ReadPrec DescribeHapg
Int -> ReadS DescribeHapg
ReadS [DescribeHapg]
(Int -> ReadS DescribeHapg)
-> ReadS [DescribeHapg]
-> ReadPrec DescribeHapg
-> ReadPrec [DescribeHapg]
-> Read DescribeHapg
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHapg]
$creadListPrec :: ReadPrec [DescribeHapg]
readPrec :: ReadPrec DescribeHapg
$creadPrec :: ReadPrec DescribeHapg
readList :: ReadS [DescribeHapg]
$creadList :: ReadS [DescribeHapg]
readsPrec :: Int -> ReadS DescribeHapg
$creadsPrec :: Int -> ReadS DescribeHapg
Prelude.Read, Int -> DescribeHapg -> ShowS
[DescribeHapg] -> ShowS
DescribeHapg -> String
(Int -> DescribeHapg -> ShowS)
-> (DescribeHapg -> String)
-> ([DescribeHapg] -> ShowS)
-> Show DescribeHapg
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHapg] -> ShowS
$cshowList :: [DescribeHapg] -> ShowS
show :: DescribeHapg -> String
$cshow :: DescribeHapg -> String
showsPrec :: Int -> DescribeHapg -> ShowS
$cshowsPrec :: Int -> DescribeHapg -> ShowS
Prelude.Show, (forall x. DescribeHapg -> Rep DescribeHapg x)
-> (forall x. Rep DescribeHapg x -> DescribeHapg)
-> Generic DescribeHapg
forall x. Rep DescribeHapg x -> DescribeHapg
forall x. DescribeHapg -> Rep DescribeHapg x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeHapg x -> DescribeHapg
$cfrom :: forall x. DescribeHapg -> Rep DescribeHapg x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHapg' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'hapgArn', 'describeHapg_hapgArn' - The ARN of the high-availability partition group to describe.
newDescribeHapg ::
  -- | 'hapgArn'
  Prelude.Text ->
  DescribeHapg
newDescribeHapg :: Text -> DescribeHapg
newDescribeHapg Text
pHapgArn_ =
  DescribeHapg' :: Text -> DescribeHapg
DescribeHapg' {$sel:hapgArn:DescribeHapg' :: Text
hapgArn = Text
pHapgArn_}

-- | The ARN of the high-availability partition group to describe.
describeHapg_hapgArn :: Lens.Lens' DescribeHapg Prelude.Text
describeHapg_hapgArn :: (Text -> f Text) -> DescribeHapg -> f DescribeHapg
describeHapg_hapgArn = (DescribeHapg -> Text)
-> (DescribeHapg -> Text -> DescribeHapg)
-> Lens DescribeHapg DescribeHapg Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapg' {Text
hapgArn :: Text
$sel:hapgArn:DescribeHapg' :: DescribeHapg -> Text
hapgArn} -> Text
hapgArn) (\s :: DescribeHapg
s@DescribeHapg' {} Text
a -> DescribeHapg
s {$sel:hapgArn:DescribeHapg' :: Text
hapgArn = Text
a} :: DescribeHapg)

instance Core.AWSRequest DescribeHapg where
  type AWSResponse DescribeHapg = DescribeHapgResponse
  request :: DescribeHapg -> Request DescribeHapg
request = Service -> DescribeHapg -> Request DescribeHapg
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeHapg
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeHapg)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeHapg))
-> Logger
-> Service
-> Proxy DescribeHapg
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeHapg)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CloudHsmObjectState
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeHapgResponse
DescribeHapgResponse'
            (Maybe CloudHsmObjectState
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> DescribeHapgResponse)
-> Either String (Maybe CloudHsmObjectState)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeHapgResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CloudHsmObjectState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"State")
            Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeHapgResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModifiedTimestamp")
            Either
  String
  (Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeHapgResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HsmsPendingRegistration"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeHapgResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HsmsPendingDeletion"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeHapgResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HapgSerial")
            Either
  String
  (Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeHapgResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe [Text]
      -> Maybe Text -> Maybe Text -> Int -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HsmsLastActionFailed"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [Text]
   -> Maybe Text -> Maybe Text -> Int -> DescribeHapgResponse)
-> Either String (Maybe [Text])
-> Either
     String (Maybe Text -> Maybe Text -> Int -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PartitionSerialList"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (Maybe Text -> Maybe Text -> Int -> DescribeHapgResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HapgArn")
            Either String (Maybe Text -> Int -> DescribeHapgResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeHapgResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Label")
            Either String (Int -> DescribeHapgResponse)
-> Either String Int -> Either String DescribeHapgResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeHapg

instance Prelude.NFData DescribeHapg

instance Core.ToHeaders DescribeHapg where
  toHeaders :: DescribeHapg -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeHapg -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CloudHsmFrontendService.DescribeHapg" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeHapg where
  toJSON :: DescribeHapg -> Value
toJSON DescribeHapg' {Text
hapgArn :: Text
$sel:hapgArn:DescribeHapg' :: DescribeHapg -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"HapgArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
hapgArn)]
      )

instance Core.ToPath DescribeHapg where
  toPath :: DescribeHapg -> ByteString
toPath = ByteString -> DescribeHapg -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeHapg where
  toQuery :: DescribeHapg -> QueryString
toQuery = QueryString -> DescribeHapg -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Contains the output of the DescribeHapg action.
--
-- /See:/ 'newDescribeHapgResponse' smart constructor.
data DescribeHapgResponse = DescribeHapgResponse'
  { -- | The state of the high-availability partition group.
    DescribeHapgResponse -> Maybe CloudHsmObjectState
state :: Prelude.Maybe CloudHsmObjectState,
    -- | The date and time the high-availability partition group was last
    -- modified.
    DescribeHapgResponse -> Maybe Text
lastModifiedTimestamp :: Prelude.Maybe Prelude.Text,
    DescribeHapgResponse -> Maybe [Text]
hsmsPendingRegistration :: Prelude.Maybe [Prelude.Text],
    DescribeHapgResponse -> Maybe [Text]
hsmsPendingDeletion :: Prelude.Maybe [Prelude.Text],
    -- | The serial number of the high-availability partition group.
    DescribeHapgResponse -> Maybe Text
hapgSerial :: Prelude.Maybe Prelude.Text,
    DescribeHapgResponse -> Maybe [Text]
hsmsLastActionFailed :: Prelude.Maybe [Prelude.Text],
    -- | The list of partition serial numbers that belong to the
    -- high-availability partition group.
    DescribeHapgResponse -> Maybe [Text]
partitionSerialList :: Prelude.Maybe [Prelude.Text],
    -- | The ARN of the high-availability partition group.
    DescribeHapgResponse -> Maybe Text
hapgArn :: Prelude.Maybe Prelude.Text,
    -- | The label for the high-availability partition group.
    DescribeHapgResponse -> Maybe Text
label :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeHapgResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeHapgResponse -> DescribeHapgResponse -> Bool
(DescribeHapgResponse -> DescribeHapgResponse -> Bool)
-> (DescribeHapgResponse -> DescribeHapgResponse -> Bool)
-> Eq DescribeHapgResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHapgResponse -> DescribeHapgResponse -> Bool
$c/= :: DescribeHapgResponse -> DescribeHapgResponse -> Bool
== :: DescribeHapgResponse -> DescribeHapgResponse -> Bool
$c== :: DescribeHapgResponse -> DescribeHapgResponse -> Bool
Prelude.Eq, ReadPrec [DescribeHapgResponse]
ReadPrec DescribeHapgResponse
Int -> ReadS DescribeHapgResponse
ReadS [DescribeHapgResponse]
(Int -> ReadS DescribeHapgResponse)
-> ReadS [DescribeHapgResponse]
-> ReadPrec DescribeHapgResponse
-> ReadPrec [DescribeHapgResponse]
-> Read DescribeHapgResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHapgResponse]
$creadListPrec :: ReadPrec [DescribeHapgResponse]
readPrec :: ReadPrec DescribeHapgResponse
$creadPrec :: ReadPrec DescribeHapgResponse
readList :: ReadS [DescribeHapgResponse]
$creadList :: ReadS [DescribeHapgResponse]
readsPrec :: Int -> ReadS DescribeHapgResponse
$creadsPrec :: Int -> ReadS DescribeHapgResponse
Prelude.Read, Int -> DescribeHapgResponse -> ShowS
[DescribeHapgResponse] -> ShowS
DescribeHapgResponse -> String
(Int -> DescribeHapgResponse -> ShowS)
-> (DescribeHapgResponse -> String)
-> ([DescribeHapgResponse] -> ShowS)
-> Show DescribeHapgResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHapgResponse] -> ShowS
$cshowList :: [DescribeHapgResponse] -> ShowS
show :: DescribeHapgResponse -> String
$cshow :: DescribeHapgResponse -> String
showsPrec :: Int -> DescribeHapgResponse -> ShowS
$cshowsPrec :: Int -> DescribeHapgResponse -> ShowS
Prelude.Show, (forall x. DescribeHapgResponse -> Rep DescribeHapgResponse x)
-> (forall x. Rep DescribeHapgResponse x -> DescribeHapgResponse)
-> Generic DescribeHapgResponse
forall x. Rep DescribeHapgResponse x -> DescribeHapgResponse
forall x. DescribeHapgResponse -> Rep DescribeHapgResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeHapgResponse x -> DescribeHapgResponse
$cfrom :: forall x. DescribeHapgResponse -> Rep DescribeHapgResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHapgResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'state', 'describeHapgResponse_state' - The state of the high-availability partition group.
--
-- 'lastModifiedTimestamp', 'describeHapgResponse_lastModifiedTimestamp' - The date and time the high-availability partition group was last
-- modified.
--
-- 'hsmsPendingRegistration', 'describeHapgResponse_hsmsPendingRegistration' -
--
-- 'hsmsPendingDeletion', 'describeHapgResponse_hsmsPendingDeletion' -
--
-- 'hapgSerial', 'describeHapgResponse_hapgSerial' - The serial number of the high-availability partition group.
--
-- 'hsmsLastActionFailed', 'describeHapgResponse_hsmsLastActionFailed' -
--
-- 'partitionSerialList', 'describeHapgResponse_partitionSerialList' - The list of partition serial numbers that belong to the
-- high-availability partition group.
--
-- 'hapgArn', 'describeHapgResponse_hapgArn' - The ARN of the high-availability partition group.
--
-- 'label', 'describeHapgResponse_label' - The label for the high-availability partition group.
--
-- 'httpStatus', 'describeHapgResponse_httpStatus' - The response's http status code.
newDescribeHapgResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeHapgResponse
newDescribeHapgResponse :: Int -> DescribeHapgResponse
newDescribeHapgResponse Int
pHttpStatus_ =
  DescribeHapgResponse' :: Maybe CloudHsmObjectState
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeHapgResponse
DescribeHapgResponse'
    { $sel:state:DescribeHapgResponse' :: Maybe CloudHsmObjectState
state = Maybe CloudHsmObjectState
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimestamp:DescribeHapgResponse' :: Maybe Text
lastModifiedTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hsmsPendingRegistration:DescribeHapgResponse' :: Maybe [Text]
hsmsPendingRegistration = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:hsmsPendingDeletion:DescribeHapgResponse' :: Maybe [Text]
hsmsPendingDeletion = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:hapgSerial:DescribeHapgResponse' :: Maybe Text
hapgSerial = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hsmsLastActionFailed:DescribeHapgResponse' :: Maybe [Text]
hsmsLastActionFailed = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:partitionSerialList:DescribeHapgResponse' :: Maybe [Text]
partitionSerialList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:hapgArn:DescribeHapgResponse' :: Maybe Text
hapgArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:label:DescribeHapgResponse' :: Maybe Text
label = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeHapgResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The state of the high-availability partition group.
describeHapgResponse_state :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe CloudHsmObjectState)
describeHapgResponse_state :: (Maybe CloudHsmObjectState -> f (Maybe CloudHsmObjectState))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_state = (DescribeHapgResponse -> Maybe CloudHsmObjectState)
-> (DescribeHapgResponse
    -> Maybe CloudHsmObjectState -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse
     DescribeHapgResponse
     (Maybe CloudHsmObjectState)
     (Maybe CloudHsmObjectState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe CloudHsmObjectState
state :: Maybe CloudHsmObjectState
$sel:state:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe CloudHsmObjectState
state} -> Maybe CloudHsmObjectState
state) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe CloudHsmObjectState
a -> DescribeHapgResponse
s {$sel:state:DescribeHapgResponse' :: Maybe CloudHsmObjectState
state = Maybe CloudHsmObjectState
a} :: DescribeHapgResponse)

-- | The date and time the high-availability partition group was last
-- modified.
describeHapgResponse_lastModifiedTimestamp :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe Prelude.Text)
describeHapgResponse_lastModifiedTimestamp :: (Maybe Text -> f (Maybe Text))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_lastModifiedTimestamp = (DescribeHapgResponse -> Maybe Text)
-> (DescribeHapgResponse -> Maybe Text -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse DescribeHapgResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe Text
lastModifiedTimestamp :: Maybe Text
$sel:lastModifiedTimestamp:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe Text
lastModifiedTimestamp} -> Maybe Text
lastModifiedTimestamp) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe Text
a -> DescribeHapgResponse
s {$sel:lastModifiedTimestamp:DescribeHapgResponse' :: Maybe Text
lastModifiedTimestamp = Maybe Text
a} :: DescribeHapgResponse)

-- |
describeHapgResponse_hsmsPendingRegistration :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe [Prelude.Text])
describeHapgResponse_hsmsPendingRegistration :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_hsmsPendingRegistration = (DescribeHapgResponse -> Maybe [Text])
-> (DescribeHapgResponse -> Maybe [Text] -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse
     DescribeHapgResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe [Text]
hsmsPendingRegistration :: Maybe [Text]
$sel:hsmsPendingRegistration:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe [Text]
hsmsPendingRegistration} -> Maybe [Text]
hsmsPendingRegistration) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe [Text]
a -> DescribeHapgResponse
s {$sel:hsmsPendingRegistration:DescribeHapgResponse' :: Maybe [Text]
hsmsPendingRegistration = Maybe [Text]
a} :: DescribeHapgResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeHapgResponse -> f DescribeHapgResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse
-> f DescribeHapgResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- |
describeHapgResponse_hsmsPendingDeletion :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe [Prelude.Text])
describeHapgResponse_hsmsPendingDeletion :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_hsmsPendingDeletion = (DescribeHapgResponse -> Maybe [Text])
-> (DescribeHapgResponse -> Maybe [Text] -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse
     DescribeHapgResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe [Text]
hsmsPendingDeletion :: Maybe [Text]
$sel:hsmsPendingDeletion:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe [Text]
hsmsPendingDeletion} -> Maybe [Text]
hsmsPendingDeletion) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe [Text]
a -> DescribeHapgResponse
s {$sel:hsmsPendingDeletion:DescribeHapgResponse' :: Maybe [Text]
hsmsPendingDeletion = Maybe [Text]
a} :: DescribeHapgResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeHapgResponse -> f DescribeHapgResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse
-> f DescribeHapgResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The serial number of the high-availability partition group.
describeHapgResponse_hapgSerial :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe Prelude.Text)
describeHapgResponse_hapgSerial :: (Maybe Text -> f (Maybe Text))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_hapgSerial = (DescribeHapgResponse -> Maybe Text)
-> (DescribeHapgResponse -> Maybe Text -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse DescribeHapgResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe Text
hapgSerial :: Maybe Text
$sel:hapgSerial:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe Text
hapgSerial} -> Maybe Text
hapgSerial) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe Text
a -> DescribeHapgResponse
s {$sel:hapgSerial:DescribeHapgResponse' :: Maybe Text
hapgSerial = Maybe Text
a} :: DescribeHapgResponse)

-- |
describeHapgResponse_hsmsLastActionFailed :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe [Prelude.Text])
describeHapgResponse_hsmsLastActionFailed :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_hsmsLastActionFailed = (DescribeHapgResponse -> Maybe [Text])
-> (DescribeHapgResponse -> Maybe [Text] -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse
     DescribeHapgResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe [Text]
hsmsLastActionFailed :: Maybe [Text]
$sel:hsmsLastActionFailed:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe [Text]
hsmsLastActionFailed} -> Maybe [Text]
hsmsLastActionFailed) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe [Text]
a -> DescribeHapgResponse
s {$sel:hsmsLastActionFailed:DescribeHapgResponse' :: Maybe [Text]
hsmsLastActionFailed = Maybe [Text]
a} :: DescribeHapgResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeHapgResponse -> f DescribeHapgResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse
-> f DescribeHapgResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of partition serial numbers that belong to the
-- high-availability partition group.
describeHapgResponse_partitionSerialList :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe [Prelude.Text])
describeHapgResponse_partitionSerialList :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_partitionSerialList = (DescribeHapgResponse -> Maybe [Text])
-> (DescribeHapgResponse -> Maybe [Text] -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse
     DescribeHapgResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe [Text]
partitionSerialList :: Maybe [Text]
$sel:partitionSerialList:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe [Text]
partitionSerialList} -> Maybe [Text]
partitionSerialList) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe [Text]
a -> DescribeHapgResponse
s {$sel:partitionSerialList:DescribeHapgResponse' :: Maybe [Text]
partitionSerialList = Maybe [Text]
a} :: DescribeHapgResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeHapgResponse -> f DescribeHapgResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeHapgResponse
-> f DescribeHapgResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the high-availability partition group.
describeHapgResponse_hapgArn :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe Prelude.Text)
describeHapgResponse_hapgArn :: (Maybe Text -> f (Maybe Text))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_hapgArn = (DescribeHapgResponse -> Maybe Text)
-> (DescribeHapgResponse -> Maybe Text -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse DescribeHapgResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe Text
hapgArn :: Maybe Text
$sel:hapgArn:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe Text
hapgArn} -> Maybe Text
hapgArn) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe Text
a -> DescribeHapgResponse
s {$sel:hapgArn:DescribeHapgResponse' :: Maybe Text
hapgArn = Maybe Text
a} :: DescribeHapgResponse)

-- | The label for the high-availability partition group.
describeHapgResponse_label :: Lens.Lens' DescribeHapgResponse (Prelude.Maybe Prelude.Text)
describeHapgResponse_label :: (Maybe Text -> f (Maybe Text))
-> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_label = (DescribeHapgResponse -> Maybe Text)
-> (DescribeHapgResponse -> Maybe Text -> DescribeHapgResponse)
-> Lens
     DescribeHapgResponse DescribeHapgResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Maybe Text
label :: Maybe Text
$sel:label:DescribeHapgResponse' :: DescribeHapgResponse -> Maybe Text
label} -> Maybe Text
label) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Maybe Text
a -> DescribeHapgResponse
s {$sel:label:DescribeHapgResponse' :: Maybe Text
label = Maybe Text
a} :: DescribeHapgResponse)

-- | The response's http status code.
describeHapgResponse_httpStatus :: Lens.Lens' DescribeHapgResponse Prelude.Int
describeHapgResponse_httpStatus :: (Int -> f Int) -> DescribeHapgResponse -> f DescribeHapgResponse
describeHapgResponse_httpStatus = (DescribeHapgResponse -> Int)
-> (DescribeHapgResponse -> Int -> DescribeHapgResponse)
-> Lens DescribeHapgResponse DescribeHapgResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHapgResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeHapgResponse' :: DescribeHapgResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeHapgResponse
s@DescribeHapgResponse' {} Int
a -> DescribeHapgResponse
s {$sel:httpStatus:DescribeHapgResponse' :: Int
httpStatus = Int
a} :: DescribeHapgResponse)

instance Prelude.NFData DescribeHapgResponse