{-# 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.ModifyHsm
-- 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>.
--
-- Modifies an HSM.
--
-- This operation can result in the HSM being offline for up to 15 minutes
-- while the AWS CloudHSM service is reconfigured. If you are modifying a
-- production HSM, you should ensure that your AWS CloudHSM service is
-- configured for high availability, and consider executing this operation
-- during a maintenance window.
module Amazonka.CloudHSM.ModifyHsm
  ( -- * Creating a Request
    ModifyHsm (..),
    newModifyHsm,

    -- * Request Lenses
    modifyHsm_iamRoleArn,
    modifyHsm_subnetId,
    modifyHsm_syslogIp,
    modifyHsm_externalId,
    modifyHsm_eniIp,
    modifyHsm_hsmArn,

    -- * Destructuring the Response
    ModifyHsmResponse (..),
    newModifyHsmResponse,

    -- * Response Lenses
    modifyHsmResponse_hsmArn,
    modifyHsmResponse_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 ModifyHsm operation.
--
-- /See:/ 'newModifyHsm' smart constructor.
data ModifyHsm = ModifyHsm'
  { -- | The new IAM role ARN.
    ModifyHsm -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The new identifier of the subnet that the HSM is in. The new subnet must
    -- be in the same Availability Zone as the current subnet.
    ModifyHsm -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The new IP address for the syslog monitoring server. The AWS CloudHSM
    -- service only supports one syslog monitoring server.
    ModifyHsm -> Maybe Text
syslogIp :: Prelude.Maybe Prelude.Text,
    -- | The new external ID.
    ModifyHsm -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
    -- | The new IP address for the elastic network interface (ENI) attached to
    -- the HSM.
    --
    -- If the HSM is moved to a different subnet, and an IP address is not
    -- specified, an IP address will be randomly chosen from the CIDR range of
    -- the new subnet.
    ModifyHsm -> Maybe Text
eniIp :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the HSM to modify.
    ModifyHsm -> Text
hsmArn :: Prelude.Text
  }
  deriving (ModifyHsm -> ModifyHsm -> Bool
(ModifyHsm -> ModifyHsm -> Bool)
-> (ModifyHsm -> ModifyHsm -> Bool) -> Eq ModifyHsm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyHsm -> ModifyHsm -> Bool
$c/= :: ModifyHsm -> ModifyHsm -> Bool
== :: ModifyHsm -> ModifyHsm -> Bool
$c== :: ModifyHsm -> ModifyHsm -> Bool
Prelude.Eq, ReadPrec [ModifyHsm]
ReadPrec ModifyHsm
Int -> ReadS ModifyHsm
ReadS [ModifyHsm]
(Int -> ReadS ModifyHsm)
-> ReadS [ModifyHsm]
-> ReadPrec ModifyHsm
-> ReadPrec [ModifyHsm]
-> Read ModifyHsm
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyHsm]
$creadListPrec :: ReadPrec [ModifyHsm]
readPrec :: ReadPrec ModifyHsm
$creadPrec :: ReadPrec ModifyHsm
readList :: ReadS [ModifyHsm]
$creadList :: ReadS [ModifyHsm]
readsPrec :: Int -> ReadS ModifyHsm
$creadsPrec :: Int -> ReadS ModifyHsm
Prelude.Read, Int -> ModifyHsm -> ShowS
[ModifyHsm] -> ShowS
ModifyHsm -> String
(Int -> ModifyHsm -> ShowS)
-> (ModifyHsm -> String)
-> ([ModifyHsm] -> ShowS)
-> Show ModifyHsm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyHsm] -> ShowS
$cshowList :: [ModifyHsm] -> ShowS
show :: ModifyHsm -> String
$cshow :: ModifyHsm -> String
showsPrec :: Int -> ModifyHsm -> ShowS
$cshowsPrec :: Int -> ModifyHsm -> ShowS
Prelude.Show, (forall x. ModifyHsm -> Rep ModifyHsm x)
-> (forall x. Rep ModifyHsm x -> ModifyHsm) -> Generic ModifyHsm
forall x. Rep ModifyHsm x -> ModifyHsm
forall x. ModifyHsm -> Rep ModifyHsm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyHsm x -> ModifyHsm
$cfrom :: forall x. ModifyHsm -> Rep ModifyHsm x
Prelude.Generic)

-- |
-- Create a value of 'ModifyHsm' 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:
--
-- 'iamRoleArn', 'modifyHsm_iamRoleArn' - The new IAM role ARN.
--
-- 'subnetId', 'modifyHsm_subnetId' - The new identifier of the subnet that the HSM is in. The new subnet must
-- be in the same Availability Zone as the current subnet.
--
-- 'syslogIp', 'modifyHsm_syslogIp' - The new IP address for the syslog monitoring server. The AWS CloudHSM
-- service only supports one syslog monitoring server.
--
-- 'externalId', 'modifyHsm_externalId' - The new external ID.
--
-- 'eniIp', 'modifyHsm_eniIp' - The new IP address for the elastic network interface (ENI) attached to
-- the HSM.
--
-- If the HSM is moved to a different subnet, and an IP address is not
-- specified, an IP address will be randomly chosen from the CIDR range of
-- the new subnet.
--
-- 'hsmArn', 'modifyHsm_hsmArn' - The ARN of the HSM to modify.
newModifyHsm ::
  -- | 'hsmArn'
  Prelude.Text ->
  ModifyHsm
newModifyHsm :: Text -> ModifyHsm
newModifyHsm Text
pHsmArn_ =
  ModifyHsm' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> ModifyHsm
ModifyHsm'
    { $sel:iamRoleArn:ModifyHsm' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:ModifyHsm' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:syslogIp:ModifyHsm' :: Maybe Text
syslogIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:externalId:ModifyHsm' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eniIp:ModifyHsm' :: Maybe Text
eniIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hsmArn:ModifyHsm' :: Text
hsmArn = Text
pHsmArn_
    }

-- | The new IAM role ARN.
modifyHsm_iamRoleArn :: Lens.Lens' ModifyHsm (Prelude.Maybe Prelude.Text)
modifyHsm_iamRoleArn :: (Maybe Text -> f (Maybe Text)) -> ModifyHsm -> f ModifyHsm
modifyHsm_iamRoleArn = (ModifyHsm -> Maybe Text)
-> (ModifyHsm -> Maybe Text -> ModifyHsm)
-> Lens ModifyHsm ModifyHsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsm' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:ModifyHsm' :: ModifyHsm -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: ModifyHsm
s@ModifyHsm' {} Maybe Text
a -> ModifyHsm
s {$sel:iamRoleArn:ModifyHsm' :: Maybe Text
iamRoleArn = Maybe Text
a} :: ModifyHsm)

-- | The new identifier of the subnet that the HSM is in. The new subnet must
-- be in the same Availability Zone as the current subnet.
modifyHsm_subnetId :: Lens.Lens' ModifyHsm (Prelude.Maybe Prelude.Text)
modifyHsm_subnetId :: (Maybe Text -> f (Maybe Text)) -> ModifyHsm -> f ModifyHsm
modifyHsm_subnetId = (ModifyHsm -> Maybe Text)
-> (ModifyHsm -> Maybe Text -> ModifyHsm)
-> Lens ModifyHsm ModifyHsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsm' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:ModifyHsm' :: ModifyHsm -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: ModifyHsm
s@ModifyHsm' {} Maybe Text
a -> ModifyHsm
s {$sel:subnetId:ModifyHsm' :: Maybe Text
subnetId = Maybe Text
a} :: ModifyHsm)

-- | The new IP address for the syslog monitoring server. The AWS CloudHSM
-- service only supports one syslog monitoring server.
modifyHsm_syslogIp :: Lens.Lens' ModifyHsm (Prelude.Maybe Prelude.Text)
modifyHsm_syslogIp :: (Maybe Text -> f (Maybe Text)) -> ModifyHsm -> f ModifyHsm
modifyHsm_syslogIp = (ModifyHsm -> Maybe Text)
-> (ModifyHsm -> Maybe Text -> ModifyHsm)
-> Lens ModifyHsm ModifyHsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsm' {Maybe Text
syslogIp :: Maybe Text
$sel:syslogIp:ModifyHsm' :: ModifyHsm -> Maybe Text
syslogIp} -> Maybe Text
syslogIp) (\s :: ModifyHsm
s@ModifyHsm' {} Maybe Text
a -> ModifyHsm
s {$sel:syslogIp:ModifyHsm' :: Maybe Text
syslogIp = Maybe Text
a} :: ModifyHsm)

-- | The new external ID.
modifyHsm_externalId :: Lens.Lens' ModifyHsm (Prelude.Maybe Prelude.Text)
modifyHsm_externalId :: (Maybe Text -> f (Maybe Text)) -> ModifyHsm -> f ModifyHsm
modifyHsm_externalId = (ModifyHsm -> Maybe Text)
-> (ModifyHsm -> Maybe Text -> ModifyHsm)
-> Lens ModifyHsm ModifyHsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsm' {Maybe Text
externalId :: Maybe Text
$sel:externalId:ModifyHsm' :: ModifyHsm -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: ModifyHsm
s@ModifyHsm' {} Maybe Text
a -> ModifyHsm
s {$sel:externalId:ModifyHsm' :: Maybe Text
externalId = Maybe Text
a} :: ModifyHsm)

-- | The new IP address for the elastic network interface (ENI) attached to
-- the HSM.
--
-- If the HSM is moved to a different subnet, and an IP address is not
-- specified, an IP address will be randomly chosen from the CIDR range of
-- the new subnet.
modifyHsm_eniIp :: Lens.Lens' ModifyHsm (Prelude.Maybe Prelude.Text)
modifyHsm_eniIp :: (Maybe Text -> f (Maybe Text)) -> ModifyHsm -> f ModifyHsm
modifyHsm_eniIp = (ModifyHsm -> Maybe Text)
-> (ModifyHsm -> Maybe Text -> ModifyHsm)
-> Lens ModifyHsm ModifyHsm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsm' {Maybe Text
eniIp :: Maybe Text
$sel:eniIp:ModifyHsm' :: ModifyHsm -> Maybe Text
eniIp} -> Maybe Text
eniIp) (\s :: ModifyHsm
s@ModifyHsm' {} Maybe Text
a -> ModifyHsm
s {$sel:eniIp:ModifyHsm' :: Maybe Text
eniIp = Maybe Text
a} :: ModifyHsm)

-- | The ARN of the HSM to modify.
modifyHsm_hsmArn :: Lens.Lens' ModifyHsm Prelude.Text
modifyHsm_hsmArn :: (Text -> f Text) -> ModifyHsm -> f ModifyHsm
modifyHsm_hsmArn = (ModifyHsm -> Text)
-> (ModifyHsm -> Text -> ModifyHsm)
-> Lens ModifyHsm ModifyHsm Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsm' {Text
hsmArn :: Text
$sel:hsmArn:ModifyHsm' :: ModifyHsm -> Text
hsmArn} -> Text
hsmArn) (\s :: ModifyHsm
s@ModifyHsm' {} Text
a -> ModifyHsm
s {$sel:hsmArn:ModifyHsm' :: Text
hsmArn = Text
a} :: ModifyHsm)

instance Core.AWSRequest ModifyHsm where
  type AWSResponse ModifyHsm = ModifyHsmResponse
  request :: ModifyHsm -> Request ModifyHsm
request = Service -> ModifyHsm -> Request ModifyHsm
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyHsm
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyHsm)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ModifyHsm))
-> Logger
-> Service
-> Proxy ModifyHsm
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyHsm)))
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 Text -> Int -> ModifyHsmResponse
ModifyHsmResponse'
            (Maybe Text -> Int -> ModifyHsmResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ModifyHsmResponse)
forall (f :: * -> *) a b. Functor 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
"HsmArn")
            Either String (Int -> ModifyHsmResponse)
-> Either String Int -> Either String ModifyHsmResponse
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 ModifyHsm

instance Prelude.NFData ModifyHsm

instance Core.ToHeaders ModifyHsm where
  toHeaders :: ModifyHsm -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ModifyHsm -> 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.ModifyHsm" ::
                          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 ModifyHsm where
  toJSON :: ModifyHsm -> Value
toJSON ModifyHsm' {Maybe Text
Text
hsmArn :: Text
eniIp :: Maybe Text
externalId :: Maybe Text
syslogIp :: Maybe Text
subnetId :: Maybe Text
iamRoleArn :: Maybe Text
$sel:hsmArn:ModifyHsm' :: ModifyHsm -> Text
$sel:eniIp:ModifyHsm' :: ModifyHsm -> Maybe Text
$sel:externalId:ModifyHsm' :: ModifyHsm -> Maybe Text
$sel:syslogIp:ModifyHsm' :: ModifyHsm -> Maybe Text
$sel:subnetId:ModifyHsm' :: ModifyHsm -> Maybe Text
$sel:iamRoleArn:ModifyHsm' :: ModifyHsm -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IamRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
iamRoleArn,
            (Text
"SubnetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subnetId,
            (Text
"SyslogIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
syslogIp,
            (Text
"ExternalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
externalId,
            (Text
"EniIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
eniIp,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"HsmArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
hsmArn)
          ]
      )

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

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

-- | Contains the output of the ModifyHsm operation.
--
-- /See:/ 'newModifyHsmResponse' smart constructor.
data ModifyHsmResponse = ModifyHsmResponse'
  { -- | The ARN of the HSM.
    ModifyHsmResponse -> Maybe Text
hsmArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ModifyHsmResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyHsmResponse -> ModifyHsmResponse -> Bool
(ModifyHsmResponse -> ModifyHsmResponse -> Bool)
-> (ModifyHsmResponse -> ModifyHsmResponse -> Bool)
-> Eq ModifyHsmResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyHsmResponse -> ModifyHsmResponse -> Bool
$c/= :: ModifyHsmResponse -> ModifyHsmResponse -> Bool
== :: ModifyHsmResponse -> ModifyHsmResponse -> Bool
$c== :: ModifyHsmResponse -> ModifyHsmResponse -> Bool
Prelude.Eq, ReadPrec [ModifyHsmResponse]
ReadPrec ModifyHsmResponse
Int -> ReadS ModifyHsmResponse
ReadS [ModifyHsmResponse]
(Int -> ReadS ModifyHsmResponse)
-> ReadS [ModifyHsmResponse]
-> ReadPrec ModifyHsmResponse
-> ReadPrec [ModifyHsmResponse]
-> Read ModifyHsmResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyHsmResponse]
$creadListPrec :: ReadPrec [ModifyHsmResponse]
readPrec :: ReadPrec ModifyHsmResponse
$creadPrec :: ReadPrec ModifyHsmResponse
readList :: ReadS [ModifyHsmResponse]
$creadList :: ReadS [ModifyHsmResponse]
readsPrec :: Int -> ReadS ModifyHsmResponse
$creadsPrec :: Int -> ReadS ModifyHsmResponse
Prelude.Read, Int -> ModifyHsmResponse -> ShowS
[ModifyHsmResponse] -> ShowS
ModifyHsmResponse -> String
(Int -> ModifyHsmResponse -> ShowS)
-> (ModifyHsmResponse -> String)
-> ([ModifyHsmResponse] -> ShowS)
-> Show ModifyHsmResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyHsmResponse] -> ShowS
$cshowList :: [ModifyHsmResponse] -> ShowS
show :: ModifyHsmResponse -> String
$cshow :: ModifyHsmResponse -> String
showsPrec :: Int -> ModifyHsmResponse -> ShowS
$cshowsPrec :: Int -> ModifyHsmResponse -> ShowS
Prelude.Show, (forall x. ModifyHsmResponse -> Rep ModifyHsmResponse x)
-> (forall x. Rep ModifyHsmResponse x -> ModifyHsmResponse)
-> Generic ModifyHsmResponse
forall x. Rep ModifyHsmResponse x -> ModifyHsmResponse
forall x. ModifyHsmResponse -> Rep ModifyHsmResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyHsmResponse x -> ModifyHsmResponse
$cfrom :: forall x. ModifyHsmResponse -> Rep ModifyHsmResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyHsmResponse' 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:
--
-- 'hsmArn', 'modifyHsmResponse_hsmArn' - The ARN of the HSM.
--
-- 'httpStatus', 'modifyHsmResponse_httpStatus' - The response's http status code.
newModifyHsmResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyHsmResponse
newModifyHsmResponse :: Int -> ModifyHsmResponse
newModifyHsmResponse Int
pHttpStatus_ =
  ModifyHsmResponse' :: Maybe Text -> Int -> ModifyHsmResponse
ModifyHsmResponse'
    { $sel:hsmArn:ModifyHsmResponse' :: Maybe Text
hsmArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyHsmResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the HSM.
modifyHsmResponse_hsmArn :: Lens.Lens' ModifyHsmResponse (Prelude.Maybe Prelude.Text)
modifyHsmResponse_hsmArn :: (Maybe Text -> f (Maybe Text))
-> ModifyHsmResponse -> f ModifyHsmResponse
modifyHsmResponse_hsmArn = (ModifyHsmResponse -> Maybe Text)
-> (ModifyHsmResponse -> Maybe Text -> ModifyHsmResponse)
-> Lens
     ModifyHsmResponse ModifyHsmResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyHsmResponse' {Maybe Text
hsmArn :: Maybe Text
$sel:hsmArn:ModifyHsmResponse' :: ModifyHsmResponse -> Maybe Text
hsmArn} -> Maybe Text
hsmArn) (\s :: ModifyHsmResponse
s@ModifyHsmResponse' {} Maybe Text
a -> ModifyHsmResponse
s {$sel:hsmArn:ModifyHsmResponse' :: Maybe Text
hsmArn = Maybe Text
a} :: ModifyHsmResponse)

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

instance Prelude.NFData ModifyHsmResponse