{-# 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.StorageGateway.UpdateChapCredentials
-- 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)
--
-- Updates the Challenge-Handshake Authentication Protocol (CHAP)
-- credentials for a specified iSCSI target. By default, a gateway does not
-- have CHAP enabled; however, for added security, you might use it. This
-- operation is supported in the volume and tape gateway types.
--
-- When you update CHAP credentials, all existing connections on the target
-- are closed and initiators must reconnect with the new credentials.
module Amazonka.StorageGateway.UpdateChapCredentials
  ( -- * Creating a Request
    UpdateChapCredentials (..),
    newUpdateChapCredentials,

    -- * Request Lenses
    updateChapCredentials_secretToAuthenticateTarget,
    updateChapCredentials_targetARN,
    updateChapCredentials_secretToAuthenticateInitiator,
    updateChapCredentials_initiatorName,

    -- * Destructuring the Response
    UpdateChapCredentialsResponse (..),
    newUpdateChapCredentialsResponse,

    -- * Response Lenses
    updateChapCredentialsResponse_targetARN,
    updateChapCredentialsResponse_initiatorName,
    updateChapCredentialsResponse_httpStatus,
  )
where

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
import Amazonka.StorageGateway.Types

-- | A JSON object containing one or more of the following fields:
--
-- -   UpdateChapCredentialsInput$InitiatorName
--
-- -   UpdateChapCredentialsInput$SecretToAuthenticateInitiator
--
-- -   UpdateChapCredentialsInput$SecretToAuthenticateTarget
--
-- -   UpdateChapCredentialsInput$TargetARN
--
-- /See:/ 'newUpdateChapCredentials' smart constructor.
data UpdateChapCredentials = UpdateChapCredentials'
  { -- | The secret key that the target must provide to participate in mutual
    -- CHAP with the initiator (e.g. Windows client).
    --
    -- Byte constraints: Minimum bytes of 12. Maximum bytes of 16.
    --
    -- The secret key must be between 12 and 16 bytes when encoded in UTF-8.
    UpdateChapCredentials -> Maybe (Sensitive Text)
secretToAuthenticateTarget :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
    -- DescribeStorediSCSIVolumes operation to return the TargetARN for
    -- specified VolumeARN.
    UpdateChapCredentials -> Text
targetARN :: Prelude.Text,
    -- | The secret key that the initiator (for example, the Windows client) must
    -- provide to participate in mutual CHAP with the target.
    --
    -- The secret key must be between 12 and 16 bytes when encoded in UTF-8.
    UpdateChapCredentials -> Sensitive Text
secretToAuthenticateInitiator :: Core.Sensitive Prelude.Text,
    -- | The iSCSI initiator that connects to the target.
    UpdateChapCredentials -> Text
initiatorName :: Prelude.Text
  }
  deriving (UpdateChapCredentials -> UpdateChapCredentials -> Bool
(UpdateChapCredentials -> UpdateChapCredentials -> Bool)
-> (UpdateChapCredentials -> UpdateChapCredentials -> Bool)
-> Eq UpdateChapCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChapCredentials -> UpdateChapCredentials -> Bool
$c/= :: UpdateChapCredentials -> UpdateChapCredentials -> Bool
== :: UpdateChapCredentials -> UpdateChapCredentials -> Bool
$c== :: UpdateChapCredentials -> UpdateChapCredentials -> Bool
Prelude.Eq, Int -> UpdateChapCredentials -> ShowS
[UpdateChapCredentials] -> ShowS
UpdateChapCredentials -> String
(Int -> UpdateChapCredentials -> ShowS)
-> (UpdateChapCredentials -> String)
-> ([UpdateChapCredentials] -> ShowS)
-> Show UpdateChapCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChapCredentials] -> ShowS
$cshowList :: [UpdateChapCredentials] -> ShowS
show :: UpdateChapCredentials -> String
$cshow :: UpdateChapCredentials -> String
showsPrec :: Int -> UpdateChapCredentials -> ShowS
$cshowsPrec :: Int -> UpdateChapCredentials -> ShowS
Prelude.Show, (forall x. UpdateChapCredentials -> Rep UpdateChapCredentials x)
-> (forall x. Rep UpdateChapCredentials x -> UpdateChapCredentials)
-> Generic UpdateChapCredentials
forall x. Rep UpdateChapCredentials x -> UpdateChapCredentials
forall x. UpdateChapCredentials -> Rep UpdateChapCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChapCredentials x -> UpdateChapCredentials
$cfrom :: forall x. UpdateChapCredentials -> Rep UpdateChapCredentials x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChapCredentials' 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:
--
-- 'secretToAuthenticateTarget', 'updateChapCredentials_secretToAuthenticateTarget' - The secret key that the target must provide to participate in mutual
-- CHAP with the initiator (e.g. Windows client).
--
-- Byte constraints: Minimum bytes of 12. Maximum bytes of 16.
--
-- The secret key must be between 12 and 16 bytes when encoded in UTF-8.
--
-- 'targetARN', 'updateChapCredentials_targetARN' - The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
-- DescribeStorediSCSIVolumes operation to return the TargetARN for
-- specified VolumeARN.
--
-- 'secretToAuthenticateInitiator', 'updateChapCredentials_secretToAuthenticateInitiator' - The secret key that the initiator (for example, the Windows client) must
-- provide to participate in mutual CHAP with the target.
--
-- The secret key must be between 12 and 16 bytes when encoded in UTF-8.
--
-- 'initiatorName', 'updateChapCredentials_initiatorName' - The iSCSI initiator that connects to the target.
newUpdateChapCredentials ::
  -- | 'targetARN'
  Prelude.Text ->
  -- | 'secretToAuthenticateInitiator'
  Prelude.Text ->
  -- | 'initiatorName'
  Prelude.Text ->
  UpdateChapCredentials
newUpdateChapCredentials :: Text -> Text -> Text -> UpdateChapCredentials
newUpdateChapCredentials
  Text
pTargetARN_
  Text
pSecretToAuthenticateInitiator_
  Text
pInitiatorName_ =
    UpdateChapCredentials' :: Maybe (Sensitive Text)
-> Text -> Sensitive Text -> Text -> UpdateChapCredentials
UpdateChapCredentials'
      { $sel:secretToAuthenticateTarget:UpdateChapCredentials' :: Maybe (Sensitive Text)
secretToAuthenticateTarget =
          Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:targetARN:UpdateChapCredentials' :: Text
targetARN = Text
pTargetARN_,
        $sel:secretToAuthenticateInitiator:UpdateChapCredentials' :: Sensitive Text
secretToAuthenticateInitiator =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive
            (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pSecretToAuthenticateInitiator_,
        $sel:initiatorName:UpdateChapCredentials' :: Text
initiatorName = Text
pInitiatorName_
      }

-- | The secret key that the target must provide to participate in mutual
-- CHAP with the initiator (e.g. Windows client).
--
-- Byte constraints: Minimum bytes of 12. Maximum bytes of 16.
--
-- The secret key must be between 12 and 16 bytes when encoded in UTF-8.
updateChapCredentials_secretToAuthenticateTarget :: Lens.Lens' UpdateChapCredentials (Prelude.Maybe Prelude.Text)
updateChapCredentials_secretToAuthenticateTarget :: (Maybe Text -> f (Maybe Text))
-> UpdateChapCredentials -> f UpdateChapCredentials
updateChapCredentials_secretToAuthenticateTarget = (UpdateChapCredentials -> Maybe (Sensitive Text))
-> (UpdateChapCredentials
    -> Maybe (Sensitive Text) -> UpdateChapCredentials)
-> Lens
     UpdateChapCredentials
     UpdateChapCredentials
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChapCredentials' {Maybe (Sensitive Text)
secretToAuthenticateTarget :: Maybe (Sensitive Text)
$sel:secretToAuthenticateTarget:UpdateChapCredentials' :: UpdateChapCredentials -> Maybe (Sensitive Text)
secretToAuthenticateTarget} -> Maybe (Sensitive Text)
secretToAuthenticateTarget) (\s :: UpdateChapCredentials
s@UpdateChapCredentials' {} Maybe (Sensitive Text)
a -> UpdateChapCredentials
s {$sel:secretToAuthenticateTarget:UpdateChapCredentials' :: Maybe (Sensitive Text)
secretToAuthenticateTarget = Maybe (Sensitive Text)
a} :: UpdateChapCredentials) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateChapCredentials -> f UpdateChapCredentials)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateChapCredentials
-> f UpdateChapCredentials
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

-- | The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
-- DescribeStorediSCSIVolumes operation to return the TargetARN for
-- specified VolumeARN.
updateChapCredentials_targetARN :: Lens.Lens' UpdateChapCredentials Prelude.Text
updateChapCredentials_targetARN :: (Text -> f Text)
-> UpdateChapCredentials -> f UpdateChapCredentials
updateChapCredentials_targetARN = (UpdateChapCredentials -> Text)
-> (UpdateChapCredentials -> Text -> UpdateChapCredentials)
-> Lens UpdateChapCredentials UpdateChapCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChapCredentials' {Text
targetARN :: Text
$sel:targetARN:UpdateChapCredentials' :: UpdateChapCredentials -> Text
targetARN} -> Text
targetARN) (\s :: UpdateChapCredentials
s@UpdateChapCredentials' {} Text
a -> UpdateChapCredentials
s {$sel:targetARN:UpdateChapCredentials' :: Text
targetARN = Text
a} :: UpdateChapCredentials)

-- | The secret key that the initiator (for example, the Windows client) must
-- provide to participate in mutual CHAP with the target.
--
-- The secret key must be between 12 and 16 bytes when encoded in UTF-8.
updateChapCredentials_secretToAuthenticateInitiator :: Lens.Lens' UpdateChapCredentials Prelude.Text
updateChapCredentials_secretToAuthenticateInitiator :: (Text -> f Text)
-> UpdateChapCredentials -> f UpdateChapCredentials
updateChapCredentials_secretToAuthenticateInitiator = (UpdateChapCredentials -> Sensitive Text)
-> (UpdateChapCredentials
    -> Sensitive Text -> UpdateChapCredentials)
-> Lens
     UpdateChapCredentials
     UpdateChapCredentials
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChapCredentials' {Sensitive Text
secretToAuthenticateInitiator :: Sensitive Text
$sel:secretToAuthenticateInitiator:UpdateChapCredentials' :: UpdateChapCredentials -> Sensitive Text
secretToAuthenticateInitiator} -> Sensitive Text
secretToAuthenticateInitiator) (\s :: UpdateChapCredentials
s@UpdateChapCredentials' {} Sensitive Text
a -> UpdateChapCredentials
s {$sel:secretToAuthenticateInitiator:UpdateChapCredentials' :: Sensitive Text
secretToAuthenticateInitiator = Sensitive Text
a} :: UpdateChapCredentials) ((Sensitive Text -> f (Sensitive Text))
 -> UpdateChapCredentials -> f UpdateChapCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateChapCredentials
-> f UpdateChapCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The iSCSI initiator that connects to the target.
updateChapCredentials_initiatorName :: Lens.Lens' UpdateChapCredentials Prelude.Text
updateChapCredentials_initiatorName :: (Text -> f Text)
-> UpdateChapCredentials -> f UpdateChapCredentials
updateChapCredentials_initiatorName = (UpdateChapCredentials -> Text)
-> (UpdateChapCredentials -> Text -> UpdateChapCredentials)
-> Lens UpdateChapCredentials UpdateChapCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChapCredentials' {Text
initiatorName :: Text
$sel:initiatorName:UpdateChapCredentials' :: UpdateChapCredentials -> Text
initiatorName} -> Text
initiatorName) (\s :: UpdateChapCredentials
s@UpdateChapCredentials' {} Text
a -> UpdateChapCredentials
s {$sel:initiatorName:UpdateChapCredentials' :: Text
initiatorName = Text
a} :: UpdateChapCredentials)

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

instance Prelude.NFData UpdateChapCredentials

instance Core.ToHeaders UpdateChapCredentials where
  toHeaders :: UpdateChapCredentials -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateChapCredentials -> 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
"StorageGateway_20130630.UpdateChapCredentials" ::
                          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 UpdateChapCredentials where
  toJSON :: UpdateChapCredentials -> Value
toJSON UpdateChapCredentials' {Maybe (Sensitive Text)
Text
Sensitive Text
initiatorName :: Text
secretToAuthenticateInitiator :: Sensitive Text
targetARN :: Text
secretToAuthenticateTarget :: Maybe (Sensitive Text)
$sel:initiatorName:UpdateChapCredentials' :: UpdateChapCredentials -> Text
$sel:secretToAuthenticateInitiator:UpdateChapCredentials' :: UpdateChapCredentials -> Sensitive Text
$sel:targetARN:UpdateChapCredentials' :: UpdateChapCredentials -> Text
$sel:secretToAuthenticateTarget:UpdateChapCredentials' :: UpdateChapCredentials -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SecretToAuthenticateTarget" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
secretToAuthenticateTarget,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TargetARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetARN),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"SecretToAuthenticateInitiator"
                  Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
secretToAuthenticateInitiator
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InitiatorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
initiatorName)
          ]
      )

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

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

-- | A JSON object containing the following fields:
--
-- /See:/ 'newUpdateChapCredentialsResponse' smart constructor.
data UpdateChapCredentialsResponse = UpdateChapCredentialsResponse'
  { -- | The Amazon Resource Name (ARN) of the target. This is the same target
    -- specified in the request.
    UpdateChapCredentialsResponse -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
    -- | The iSCSI initiator that connects to the target. This is the same
    -- initiator name specified in the request.
    UpdateChapCredentialsResponse -> Maybe Text
initiatorName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateChapCredentialsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateChapCredentialsResponse
-> UpdateChapCredentialsResponse -> Bool
(UpdateChapCredentialsResponse
 -> UpdateChapCredentialsResponse -> Bool)
-> (UpdateChapCredentialsResponse
    -> UpdateChapCredentialsResponse -> Bool)
-> Eq UpdateChapCredentialsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChapCredentialsResponse
-> UpdateChapCredentialsResponse -> Bool
$c/= :: UpdateChapCredentialsResponse
-> UpdateChapCredentialsResponse -> Bool
== :: UpdateChapCredentialsResponse
-> UpdateChapCredentialsResponse -> Bool
$c== :: UpdateChapCredentialsResponse
-> UpdateChapCredentialsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateChapCredentialsResponse]
ReadPrec UpdateChapCredentialsResponse
Int -> ReadS UpdateChapCredentialsResponse
ReadS [UpdateChapCredentialsResponse]
(Int -> ReadS UpdateChapCredentialsResponse)
-> ReadS [UpdateChapCredentialsResponse]
-> ReadPrec UpdateChapCredentialsResponse
-> ReadPrec [UpdateChapCredentialsResponse]
-> Read UpdateChapCredentialsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChapCredentialsResponse]
$creadListPrec :: ReadPrec [UpdateChapCredentialsResponse]
readPrec :: ReadPrec UpdateChapCredentialsResponse
$creadPrec :: ReadPrec UpdateChapCredentialsResponse
readList :: ReadS [UpdateChapCredentialsResponse]
$creadList :: ReadS [UpdateChapCredentialsResponse]
readsPrec :: Int -> ReadS UpdateChapCredentialsResponse
$creadsPrec :: Int -> ReadS UpdateChapCredentialsResponse
Prelude.Read, Int -> UpdateChapCredentialsResponse -> ShowS
[UpdateChapCredentialsResponse] -> ShowS
UpdateChapCredentialsResponse -> String
(Int -> UpdateChapCredentialsResponse -> ShowS)
-> (UpdateChapCredentialsResponse -> String)
-> ([UpdateChapCredentialsResponse] -> ShowS)
-> Show UpdateChapCredentialsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChapCredentialsResponse] -> ShowS
$cshowList :: [UpdateChapCredentialsResponse] -> ShowS
show :: UpdateChapCredentialsResponse -> String
$cshow :: UpdateChapCredentialsResponse -> String
showsPrec :: Int -> UpdateChapCredentialsResponse -> ShowS
$cshowsPrec :: Int -> UpdateChapCredentialsResponse -> ShowS
Prelude.Show, (forall x.
 UpdateChapCredentialsResponse
 -> Rep UpdateChapCredentialsResponse x)
-> (forall x.
    Rep UpdateChapCredentialsResponse x
    -> UpdateChapCredentialsResponse)
-> Generic UpdateChapCredentialsResponse
forall x.
Rep UpdateChapCredentialsResponse x
-> UpdateChapCredentialsResponse
forall x.
UpdateChapCredentialsResponse
-> Rep UpdateChapCredentialsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateChapCredentialsResponse x
-> UpdateChapCredentialsResponse
$cfrom :: forall x.
UpdateChapCredentialsResponse
-> Rep UpdateChapCredentialsResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChapCredentialsResponse' 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:
--
-- 'targetARN', 'updateChapCredentialsResponse_targetARN' - The Amazon Resource Name (ARN) of the target. This is the same target
-- specified in the request.
--
-- 'initiatorName', 'updateChapCredentialsResponse_initiatorName' - The iSCSI initiator that connects to the target. This is the same
-- initiator name specified in the request.
--
-- 'httpStatus', 'updateChapCredentialsResponse_httpStatus' - The response's http status code.
newUpdateChapCredentialsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateChapCredentialsResponse
newUpdateChapCredentialsResponse :: Int -> UpdateChapCredentialsResponse
newUpdateChapCredentialsResponse Int
pHttpStatus_ =
  UpdateChapCredentialsResponse' :: Maybe Text -> Maybe Text -> Int -> UpdateChapCredentialsResponse
UpdateChapCredentialsResponse'
    { $sel:targetARN:UpdateChapCredentialsResponse' :: Maybe Text
targetARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:initiatorName:UpdateChapCredentialsResponse' :: Maybe Text
initiatorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateChapCredentialsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the target. This is the same target
-- specified in the request.
updateChapCredentialsResponse_targetARN :: Lens.Lens' UpdateChapCredentialsResponse (Prelude.Maybe Prelude.Text)
updateChapCredentialsResponse_targetARN :: (Maybe Text -> f (Maybe Text))
-> UpdateChapCredentialsResponse -> f UpdateChapCredentialsResponse
updateChapCredentialsResponse_targetARN = (UpdateChapCredentialsResponse -> Maybe Text)
-> (UpdateChapCredentialsResponse
    -> Maybe Text -> UpdateChapCredentialsResponse)
-> Lens
     UpdateChapCredentialsResponse
     UpdateChapCredentialsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChapCredentialsResponse' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:UpdateChapCredentialsResponse' :: UpdateChapCredentialsResponse -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: UpdateChapCredentialsResponse
s@UpdateChapCredentialsResponse' {} Maybe Text
a -> UpdateChapCredentialsResponse
s {$sel:targetARN:UpdateChapCredentialsResponse' :: Maybe Text
targetARN = Maybe Text
a} :: UpdateChapCredentialsResponse)

-- | The iSCSI initiator that connects to the target. This is the same
-- initiator name specified in the request.
updateChapCredentialsResponse_initiatorName :: Lens.Lens' UpdateChapCredentialsResponse (Prelude.Maybe Prelude.Text)
updateChapCredentialsResponse_initiatorName :: (Maybe Text -> f (Maybe Text))
-> UpdateChapCredentialsResponse -> f UpdateChapCredentialsResponse
updateChapCredentialsResponse_initiatorName = (UpdateChapCredentialsResponse -> Maybe Text)
-> (UpdateChapCredentialsResponse
    -> Maybe Text -> UpdateChapCredentialsResponse)
-> Lens
     UpdateChapCredentialsResponse
     UpdateChapCredentialsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChapCredentialsResponse' {Maybe Text
initiatorName :: Maybe Text
$sel:initiatorName:UpdateChapCredentialsResponse' :: UpdateChapCredentialsResponse -> Maybe Text
initiatorName} -> Maybe Text
initiatorName) (\s :: UpdateChapCredentialsResponse
s@UpdateChapCredentialsResponse' {} Maybe Text
a -> UpdateChapCredentialsResponse
s {$sel:initiatorName:UpdateChapCredentialsResponse' :: Maybe Text
initiatorName = Maybe Text
a} :: UpdateChapCredentialsResponse)

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

instance Prelude.NFData UpdateChapCredentialsResponse