{-# 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.SetLocalConsolePassword
(
SetLocalConsolePassword (..),
newSetLocalConsolePassword,
setLocalConsolePassword_gatewayARN,
setLocalConsolePassword_localConsolePassword,
SetLocalConsolePasswordResponse (..),
newSetLocalConsolePasswordResponse,
setLocalConsolePasswordResponse_gatewayARN,
setLocalConsolePasswordResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types
data SetLocalConsolePassword = SetLocalConsolePassword'
{ SetLocalConsolePassword -> Text
gatewayARN :: Prelude.Text,
SetLocalConsolePassword -> Sensitive Text
localConsolePassword :: Data.Sensitive Prelude.Text
}
deriving (SetLocalConsolePassword -> SetLocalConsolePassword -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetLocalConsolePassword -> SetLocalConsolePassword -> Bool
$c/= :: SetLocalConsolePassword -> SetLocalConsolePassword -> Bool
== :: SetLocalConsolePassword -> SetLocalConsolePassword -> Bool
$c== :: SetLocalConsolePassword -> SetLocalConsolePassword -> Bool
Prelude.Eq, Int -> SetLocalConsolePassword -> ShowS
[SetLocalConsolePassword] -> ShowS
SetLocalConsolePassword -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetLocalConsolePassword] -> ShowS
$cshowList :: [SetLocalConsolePassword] -> ShowS
show :: SetLocalConsolePassword -> String
$cshow :: SetLocalConsolePassword -> String
showsPrec :: Int -> SetLocalConsolePassword -> ShowS
$cshowsPrec :: Int -> SetLocalConsolePassword -> ShowS
Prelude.Show, forall x. Rep SetLocalConsolePassword x -> SetLocalConsolePassword
forall x. SetLocalConsolePassword -> Rep SetLocalConsolePassword x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetLocalConsolePassword x -> SetLocalConsolePassword
$cfrom :: forall x. SetLocalConsolePassword -> Rep SetLocalConsolePassword x
Prelude.Generic)
newSetLocalConsolePassword ::
Prelude.Text ->
Prelude.Text ->
SetLocalConsolePassword
newSetLocalConsolePassword :: Text -> Text -> SetLocalConsolePassword
newSetLocalConsolePassword
Text
pGatewayARN_
Text
pLocalConsolePassword_ =
SetLocalConsolePassword'
{ $sel:gatewayARN:SetLocalConsolePassword' :: Text
gatewayARN = Text
pGatewayARN_,
$sel:localConsolePassword:SetLocalConsolePassword' :: Sensitive Text
localConsolePassword =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pLocalConsolePassword_
}
setLocalConsolePassword_gatewayARN :: Lens.Lens' SetLocalConsolePassword Prelude.Text
setLocalConsolePassword_gatewayARN :: Lens' SetLocalConsolePassword Text
setLocalConsolePassword_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLocalConsolePassword' {Text
gatewayARN :: Text
$sel:gatewayARN:SetLocalConsolePassword' :: SetLocalConsolePassword -> Text
gatewayARN} -> Text
gatewayARN) (\s :: SetLocalConsolePassword
s@SetLocalConsolePassword' {} Text
a -> SetLocalConsolePassword
s {$sel:gatewayARN:SetLocalConsolePassword' :: Text
gatewayARN = Text
a} :: SetLocalConsolePassword)
setLocalConsolePassword_localConsolePassword :: Lens.Lens' SetLocalConsolePassword Prelude.Text
setLocalConsolePassword_localConsolePassword :: Lens' SetLocalConsolePassword Text
setLocalConsolePassword_localConsolePassword = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLocalConsolePassword' {Sensitive Text
localConsolePassword :: Sensitive Text
$sel:localConsolePassword:SetLocalConsolePassword' :: SetLocalConsolePassword -> Sensitive Text
localConsolePassword} -> Sensitive Text
localConsolePassword) (\s :: SetLocalConsolePassword
s@SetLocalConsolePassword' {} Sensitive Text
a -> SetLocalConsolePassword
s {$sel:localConsolePassword:SetLocalConsolePassword' :: Sensitive Text
localConsolePassword = Sensitive Text
a} :: SetLocalConsolePassword) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Core.AWSRequest SetLocalConsolePassword where
type
AWSResponse SetLocalConsolePassword =
SetLocalConsolePasswordResponse
request :: (Service -> Service)
-> SetLocalConsolePassword -> Request SetLocalConsolePassword
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SetLocalConsolePassword
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetLocalConsolePassword)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> SetLocalConsolePasswordResponse
SetLocalConsolePasswordResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GatewayARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable SetLocalConsolePassword where
hashWithSalt :: Int -> SetLocalConsolePassword -> Int
hashWithSalt Int
_salt SetLocalConsolePassword' {Text
Sensitive Text
localConsolePassword :: Sensitive Text
gatewayARN :: Text
$sel:localConsolePassword:SetLocalConsolePassword' :: SetLocalConsolePassword -> Sensitive Text
$sel:gatewayARN:SetLocalConsolePassword' :: SetLocalConsolePassword -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
localConsolePassword
instance Prelude.NFData SetLocalConsolePassword where
rnf :: SetLocalConsolePassword -> ()
rnf SetLocalConsolePassword' {Text
Sensitive Text
localConsolePassword :: Sensitive Text
gatewayARN :: Text
$sel:localConsolePassword:SetLocalConsolePassword' :: SetLocalConsolePassword -> Sensitive Text
$sel:gatewayARN:SetLocalConsolePassword' :: SetLocalConsolePassword -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
localConsolePassword
instance Data.ToHeaders SetLocalConsolePassword where
toHeaders :: SetLocalConsolePassword -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StorageGateway_20130630.SetLocalConsolePassword" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON SetLocalConsolePassword where
toJSON :: SetLocalConsolePassword -> Value
toJSON SetLocalConsolePassword' {Text
Sensitive Text
localConsolePassword :: Sensitive Text
gatewayARN :: Text
$sel:localConsolePassword:SetLocalConsolePassword' :: SetLocalConsolePassword -> Sensitive Text
$sel:gatewayARN:SetLocalConsolePassword' :: SetLocalConsolePassword -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"GatewayARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayARN),
forall a. a -> Maybe a
Prelude.Just
( Key
"LocalConsolePassword"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
localConsolePassword
)
]
)
instance Data.ToPath SetLocalConsolePassword where
toPath :: SetLocalConsolePassword -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery SetLocalConsolePassword where
toQuery :: SetLocalConsolePassword -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data SetLocalConsolePasswordResponse = SetLocalConsolePasswordResponse'
{ SetLocalConsolePasswordResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
SetLocalConsolePasswordResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetLocalConsolePasswordResponse
-> SetLocalConsolePasswordResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetLocalConsolePasswordResponse
-> SetLocalConsolePasswordResponse -> Bool
$c/= :: SetLocalConsolePasswordResponse
-> SetLocalConsolePasswordResponse -> Bool
== :: SetLocalConsolePasswordResponse
-> SetLocalConsolePasswordResponse -> Bool
$c== :: SetLocalConsolePasswordResponse
-> SetLocalConsolePasswordResponse -> Bool
Prelude.Eq, ReadPrec [SetLocalConsolePasswordResponse]
ReadPrec SetLocalConsolePasswordResponse
Int -> ReadS SetLocalConsolePasswordResponse
ReadS [SetLocalConsolePasswordResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetLocalConsolePasswordResponse]
$creadListPrec :: ReadPrec [SetLocalConsolePasswordResponse]
readPrec :: ReadPrec SetLocalConsolePasswordResponse
$creadPrec :: ReadPrec SetLocalConsolePasswordResponse
readList :: ReadS [SetLocalConsolePasswordResponse]
$creadList :: ReadS [SetLocalConsolePasswordResponse]
readsPrec :: Int -> ReadS SetLocalConsolePasswordResponse
$creadsPrec :: Int -> ReadS SetLocalConsolePasswordResponse
Prelude.Read, Int -> SetLocalConsolePasswordResponse -> ShowS
[SetLocalConsolePasswordResponse] -> ShowS
SetLocalConsolePasswordResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetLocalConsolePasswordResponse] -> ShowS
$cshowList :: [SetLocalConsolePasswordResponse] -> ShowS
show :: SetLocalConsolePasswordResponse -> String
$cshow :: SetLocalConsolePasswordResponse -> String
showsPrec :: Int -> SetLocalConsolePasswordResponse -> ShowS
$cshowsPrec :: Int -> SetLocalConsolePasswordResponse -> ShowS
Prelude.Show, forall x.
Rep SetLocalConsolePasswordResponse x
-> SetLocalConsolePasswordResponse
forall x.
SetLocalConsolePasswordResponse
-> Rep SetLocalConsolePasswordResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetLocalConsolePasswordResponse x
-> SetLocalConsolePasswordResponse
$cfrom :: forall x.
SetLocalConsolePasswordResponse
-> Rep SetLocalConsolePasswordResponse x
Prelude.Generic)
newSetLocalConsolePasswordResponse ::
Prelude.Int ->
SetLocalConsolePasswordResponse
newSetLocalConsolePasswordResponse :: Int -> SetLocalConsolePasswordResponse
newSetLocalConsolePasswordResponse Int
pHttpStatus_ =
SetLocalConsolePasswordResponse'
{ $sel:gatewayARN:SetLocalConsolePasswordResponse' :: Maybe Text
gatewayARN =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SetLocalConsolePasswordResponse' :: Int
httpStatus = Int
pHttpStatus_
}
setLocalConsolePasswordResponse_gatewayARN :: Lens.Lens' SetLocalConsolePasswordResponse (Prelude.Maybe Prelude.Text)
setLocalConsolePasswordResponse_gatewayARN :: Lens' SetLocalConsolePasswordResponse (Maybe Text)
setLocalConsolePasswordResponse_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLocalConsolePasswordResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:SetLocalConsolePasswordResponse' :: SetLocalConsolePasswordResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: SetLocalConsolePasswordResponse
s@SetLocalConsolePasswordResponse' {} Maybe Text
a -> SetLocalConsolePasswordResponse
s {$sel:gatewayARN:SetLocalConsolePasswordResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: SetLocalConsolePasswordResponse)
setLocalConsolePasswordResponse_httpStatus :: Lens.Lens' SetLocalConsolePasswordResponse Prelude.Int
setLocalConsolePasswordResponse_httpStatus :: Lens' SetLocalConsolePasswordResponse Int
setLocalConsolePasswordResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLocalConsolePasswordResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetLocalConsolePasswordResponse' :: SetLocalConsolePasswordResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetLocalConsolePasswordResponse
s@SetLocalConsolePasswordResponse' {} Int
a -> SetLocalConsolePasswordResponse
s {$sel:httpStatus:SetLocalConsolePasswordResponse' :: Int
httpStatus = Int
a} :: SetLocalConsolePasswordResponse)
instance
Prelude.NFData
SetLocalConsolePasswordResponse
where
rnf :: SetLocalConsolePasswordResponse -> ()
rnf SetLocalConsolePasswordResponse' {Int
Maybe Text
httpStatus :: Int
gatewayARN :: Maybe Text
$sel:httpStatus:SetLocalConsolePasswordResponse' :: SetLocalConsolePasswordResponse -> Int
$sel:gatewayARN:SetLocalConsolePasswordResponse' :: SetLocalConsolePasswordResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus