{-# 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 #-}
module Amazonka.StorageGateway.DeleteChapCredentials
(
DeleteChapCredentials (..),
newDeleteChapCredentials,
deleteChapCredentials_targetARN,
deleteChapCredentials_initiatorName,
DeleteChapCredentialsResponse (..),
newDeleteChapCredentialsResponse,
deleteChapCredentialsResponse_targetARN,
deleteChapCredentialsResponse_initiatorName,
deleteChapCredentialsResponse_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
data DeleteChapCredentials = DeleteChapCredentials'
{
DeleteChapCredentials -> Text
targetARN :: Prelude.Text,
DeleteChapCredentials -> Text
initiatorName :: Prelude.Text
}
deriving (DeleteChapCredentials -> DeleteChapCredentials -> Bool
(DeleteChapCredentials -> DeleteChapCredentials -> Bool)
-> (DeleteChapCredentials -> DeleteChapCredentials -> Bool)
-> Eq DeleteChapCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChapCredentials -> DeleteChapCredentials -> Bool
$c/= :: DeleteChapCredentials -> DeleteChapCredentials -> Bool
== :: DeleteChapCredentials -> DeleteChapCredentials -> Bool
$c== :: DeleteChapCredentials -> DeleteChapCredentials -> Bool
Prelude.Eq, ReadPrec [DeleteChapCredentials]
ReadPrec DeleteChapCredentials
Int -> ReadS DeleteChapCredentials
ReadS [DeleteChapCredentials]
(Int -> ReadS DeleteChapCredentials)
-> ReadS [DeleteChapCredentials]
-> ReadPrec DeleteChapCredentials
-> ReadPrec [DeleteChapCredentials]
-> Read DeleteChapCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChapCredentials]
$creadListPrec :: ReadPrec [DeleteChapCredentials]
readPrec :: ReadPrec DeleteChapCredentials
$creadPrec :: ReadPrec DeleteChapCredentials
readList :: ReadS [DeleteChapCredentials]
$creadList :: ReadS [DeleteChapCredentials]
readsPrec :: Int -> ReadS DeleteChapCredentials
$creadsPrec :: Int -> ReadS DeleteChapCredentials
Prelude.Read, Int -> DeleteChapCredentials -> ShowS
[DeleteChapCredentials] -> ShowS
DeleteChapCredentials -> String
(Int -> DeleteChapCredentials -> ShowS)
-> (DeleteChapCredentials -> String)
-> ([DeleteChapCredentials] -> ShowS)
-> Show DeleteChapCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChapCredentials] -> ShowS
$cshowList :: [DeleteChapCredentials] -> ShowS
show :: DeleteChapCredentials -> String
$cshow :: DeleteChapCredentials -> String
showsPrec :: Int -> DeleteChapCredentials -> ShowS
$cshowsPrec :: Int -> DeleteChapCredentials -> ShowS
Prelude.Show, (forall x. DeleteChapCredentials -> Rep DeleteChapCredentials x)
-> (forall x. Rep DeleteChapCredentials x -> DeleteChapCredentials)
-> Generic DeleteChapCredentials
forall x. Rep DeleteChapCredentials x -> DeleteChapCredentials
forall x. DeleteChapCredentials -> Rep DeleteChapCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteChapCredentials x -> DeleteChapCredentials
$cfrom :: forall x. DeleteChapCredentials -> Rep DeleteChapCredentials x
Prelude.Generic)
newDeleteChapCredentials ::
Prelude.Text ->
Prelude.Text ->
DeleteChapCredentials
newDeleteChapCredentials :: Text -> Text -> DeleteChapCredentials
newDeleteChapCredentials Text
pTargetARN_ Text
pInitiatorName_ =
DeleteChapCredentials' :: Text -> Text -> DeleteChapCredentials
DeleteChapCredentials'
{ $sel:targetARN:DeleteChapCredentials' :: Text
targetARN = Text
pTargetARN_,
$sel:initiatorName:DeleteChapCredentials' :: Text
initiatorName = Text
pInitiatorName_
}
deleteChapCredentials_targetARN :: Lens.Lens' DeleteChapCredentials Prelude.Text
deleteChapCredentials_targetARN :: (Text -> f Text)
-> DeleteChapCredentials -> f DeleteChapCredentials
deleteChapCredentials_targetARN = (DeleteChapCredentials -> Text)
-> (DeleteChapCredentials -> Text -> DeleteChapCredentials)
-> Lens DeleteChapCredentials DeleteChapCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChapCredentials' {Text
targetARN :: Text
$sel:targetARN:DeleteChapCredentials' :: DeleteChapCredentials -> Text
targetARN} -> Text
targetARN) (\s :: DeleteChapCredentials
s@DeleteChapCredentials' {} Text
a -> DeleteChapCredentials
s {$sel:targetARN:DeleteChapCredentials' :: Text
targetARN = Text
a} :: DeleteChapCredentials)
deleteChapCredentials_initiatorName :: Lens.Lens' DeleteChapCredentials Prelude.Text
deleteChapCredentials_initiatorName :: (Text -> f Text)
-> DeleteChapCredentials -> f DeleteChapCredentials
deleteChapCredentials_initiatorName = (DeleteChapCredentials -> Text)
-> (DeleteChapCredentials -> Text -> DeleteChapCredentials)
-> Lens DeleteChapCredentials DeleteChapCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChapCredentials' {Text
initiatorName :: Text
$sel:initiatorName:DeleteChapCredentials' :: DeleteChapCredentials -> Text
initiatorName} -> Text
initiatorName) (\s :: DeleteChapCredentials
s@DeleteChapCredentials' {} Text
a -> DeleteChapCredentials
s {$sel:initiatorName:DeleteChapCredentials' :: Text
initiatorName = Text
a} :: DeleteChapCredentials)
instance Core.AWSRequest DeleteChapCredentials where
type
AWSResponse DeleteChapCredentials =
DeleteChapCredentialsResponse
request :: DeleteChapCredentials -> Request DeleteChapCredentials
request = Service -> DeleteChapCredentials -> Request DeleteChapCredentials
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteChapCredentials
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteChapCredentials)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteChapCredentials))
-> Logger
-> Service
-> Proxy DeleteChapCredentials
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteChapCredentials)))
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 -> DeleteChapCredentialsResponse
DeleteChapCredentialsResponse'
(Maybe Text -> Maybe Text -> Int -> DeleteChapCredentialsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> DeleteChapCredentialsResponse)
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 -> DeleteChapCredentialsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteChapCredentialsResponse)
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 -> DeleteChapCredentialsResponse)
-> Either String Int -> Either String DeleteChapCredentialsResponse
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 DeleteChapCredentials
instance Prelude.NFData DeleteChapCredentials
instance Core.ToHeaders DeleteChapCredentials where
toHeaders :: DeleteChapCredentials -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteChapCredentials -> 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.DeleteChapCredentials" ::
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 DeleteChapCredentials where
toJSON :: DeleteChapCredentials -> Value
toJSON DeleteChapCredentials' {Text
initiatorName :: Text
targetARN :: Text
$sel:initiatorName:DeleteChapCredentials' :: DeleteChapCredentials -> Text
$sel:targetARN:DeleteChapCredentials' :: DeleteChapCredentials -> 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
"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
"InitiatorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
initiatorName)
]
)
instance Core.ToPath DeleteChapCredentials where
toPath :: DeleteChapCredentials -> ByteString
toPath = ByteString -> DeleteChapCredentials -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteChapCredentials where
toQuery :: DeleteChapCredentials -> QueryString
toQuery = QueryString -> DeleteChapCredentials -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteChapCredentialsResponse = DeleteChapCredentialsResponse'
{
DeleteChapCredentialsResponse -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
DeleteChapCredentialsResponse -> Maybe Text
initiatorName :: Prelude.Maybe Prelude.Text,
DeleteChapCredentialsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool
(DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool)
-> (DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool)
-> Eq DeleteChapCredentialsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool
$c/= :: DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool
== :: DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool
$c== :: DeleteChapCredentialsResponse
-> DeleteChapCredentialsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteChapCredentialsResponse]
ReadPrec DeleteChapCredentialsResponse
Int -> ReadS DeleteChapCredentialsResponse
ReadS [DeleteChapCredentialsResponse]
(Int -> ReadS DeleteChapCredentialsResponse)
-> ReadS [DeleteChapCredentialsResponse]
-> ReadPrec DeleteChapCredentialsResponse
-> ReadPrec [DeleteChapCredentialsResponse]
-> Read DeleteChapCredentialsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChapCredentialsResponse]
$creadListPrec :: ReadPrec [DeleteChapCredentialsResponse]
readPrec :: ReadPrec DeleteChapCredentialsResponse
$creadPrec :: ReadPrec DeleteChapCredentialsResponse
readList :: ReadS [DeleteChapCredentialsResponse]
$creadList :: ReadS [DeleteChapCredentialsResponse]
readsPrec :: Int -> ReadS DeleteChapCredentialsResponse
$creadsPrec :: Int -> ReadS DeleteChapCredentialsResponse
Prelude.Read, Int -> DeleteChapCredentialsResponse -> ShowS
[DeleteChapCredentialsResponse] -> ShowS
DeleteChapCredentialsResponse -> String
(Int -> DeleteChapCredentialsResponse -> ShowS)
-> (DeleteChapCredentialsResponse -> String)
-> ([DeleteChapCredentialsResponse] -> ShowS)
-> Show DeleteChapCredentialsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChapCredentialsResponse] -> ShowS
$cshowList :: [DeleteChapCredentialsResponse] -> ShowS
show :: DeleteChapCredentialsResponse -> String
$cshow :: DeleteChapCredentialsResponse -> String
showsPrec :: Int -> DeleteChapCredentialsResponse -> ShowS
$cshowsPrec :: Int -> DeleteChapCredentialsResponse -> ShowS
Prelude.Show, (forall x.
DeleteChapCredentialsResponse
-> Rep DeleteChapCredentialsResponse x)
-> (forall x.
Rep DeleteChapCredentialsResponse x
-> DeleteChapCredentialsResponse)
-> Generic DeleteChapCredentialsResponse
forall x.
Rep DeleteChapCredentialsResponse x
-> DeleteChapCredentialsResponse
forall x.
DeleteChapCredentialsResponse
-> Rep DeleteChapCredentialsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteChapCredentialsResponse x
-> DeleteChapCredentialsResponse
$cfrom :: forall x.
DeleteChapCredentialsResponse
-> Rep DeleteChapCredentialsResponse x
Prelude.Generic)
newDeleteChapCredentialsResponse ::
Prelude.Int ->
DeleteChapCredentialsResponse
newDeleteChapCredentialsResponse :: Int -> DeleteChapCredentialsResponse
newDeleteChapCredentialsResponse Int
pHttpStatus_ =
DeleteChapCredentialsResponse' :: Maybe Text -> Maybe Text -> Int -> DeleteChapCredentialsResponse
DeleteChapCredentialsResponse'
{ $sel:targetARN:DeleteChapCredentialsResponse' :: Maybe Text
targetARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:initiatorName:DeleteChapCredentialsResponse' :: Maybe Text
initiatorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteChapCredentialsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteChapCredentialsResponse_targetARN :: Lens.Lens' DeleteChapCredentialsResponse (Prelude.Maybe Prelude.Text)
deleteChapCredentialsResponse_targetARN :: (Maybe Text -> f (Maybe Text))
-> DeleteChapCredentialsResponse -> f DeleteChapCredentialsResponse
deleteChapCredentialsResponse_targetARN = (DeleteChapCredentialsResponse -> Maybe Text)
-> (DeleteChapCredentialsResponse
-> Maybe Text -> DeleteChapCredentialsResponse)
-> Lens
DeleteChapCredentialsResponse
DeleteChapCredentialsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChapCredentialsResponse' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:DeleteChapCredentialsResponse' :: DeleteChapCredentialsResponse -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: DeleteChapCredentialsResponse
s@DeleteChapCredentialsResponse' {} Maybe Text
a -> DeleteChapCredentialsResponse
s {$sel:targetARN:DeleteChapCredentialsResponse' :: Maybe Text
targetARN = Maybe Text
a} :: DeleteChapCredentialsResponse)
deleteChapCredentialsResponse_initiatorName :: Lens.Lens' DeleteChapCredentialsResponse (Prelude.Maybe Prelude.Text)
deleteChapCredentialsResponse_initiatorName :: (Maybe Text -> f (Maybe Text))
-> DeleteChapCredentialsResponse -> f DeleteChapCredentialsResponse
deleteChapCredentialsResponse_initiatorName = (DeleteChapCredentialsResponse -> Maybe Text)
-> (DeleteChapCredentialsResponse
-> Maybe Text -> DeleteChapCredentialsResponse)
-> Lens
DeleteChapCredentialsResponse
DeleteChapCredentialsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChapCredentialsResponse' {Maybe Text
initiatorName :: Maybe Text
$sel:initiatorName:DeleteChapCredentialsResponse' :: DeleteChapCredentialsResponse -> Maybe Text
initiatorName} -> Maybe Text
initiatorName) (\s :: DeleteChapCredentialsResponse
s@DeleteChapCredentialsResponse' {} Maybe Text
a -> DeleteChapCredentialsResponse
s {$sel:initiatorName:DeleteChapCredentialsResponse' :: Maybe Text
initiatorName = Maybe Text
a} :: DeleteChapCredentialsResponse)
deleteChapCredentialsResponse_httpStatus :: Lens.Lens' DeleteChapCredentialsResponse Prelude.Int
deleteChapCredentialsResponse_httpStatus :: (Int -> f Int)
-> DeleteChapCredentialsResponse -> f DeleteChapCredentialsResponse
deleteChapCredentialsResponse_httpStatus = (DeleteChapCredentialsResponse -> Int)
-> (DeleteChapCredentialsResponse
-> Int -> DeleteChapCredentialsResponse)
-> Lens
DeleteChapCredentialsResponse DeleteChapCredentialsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChapCredentialsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteChapCredentialsResponse' :: DeleteChapCredentialsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteChapCredentialsResponse
s@DeleteChapCredentialsResponse' {} Int
a -> DeleteChapCredentialsResponse
s {$sel:httpStatus:DeleteChapCredentialsResponse' :: Int
httpStatus = Int
a} :: DeleteChapCredentialsResponse)
instance Prelude.NFData DeleteChapCredentialsResponse