{-# 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.UpdateGatewaySoftwareNow
(
UpdateGatewaySoftwareNow (..),
newUpdateGatewaySoftwareNow,
updateGatewaySoftwareNow_gatewayARN,
UpdateGatewaySoftwareNowResponse (..),
newUpdateGatewaySoftwareNowResponse,
updateGatewaySoftwareNowResponse_gatewayARN,
updateGatewaySoftwareNowResponse_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 UpdateGatewaySoftwareNow = UpdateGatewaySoftwareNow'
{ UpdateGatewaySoftwareNow -> Text
gatewayARN :: Prelude.Text
}
deriving (UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool
(UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool)
-> (UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool)
-> Eq UpdateGatewaySoftwareNow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool
$c/= :: UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool
== :: UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool
$c== :: UpdateGatewaySoftwareNow -> UpdateGatewaySoftwareNow -> Bool
Prelude.Eq, ReadPrec [UpdateGatewaySoftwareNow]
ReadPrec UpdateGatewaySoftwareNow
Int -> ReadS UpdateGatewaySoftwareNow
ReadS [UpdateGatewaySoftwareNow]
(Int -> ReadS UpdateGatewaySoftwareNow)
-> ReadS [UpdateGatewaySoftwareNow]
-> ReadPrec UpdateGatewaySoftwareNow
-> ReadPrec [UpdateGatewaySoftwareNow]
-> Read UpdateGatewaySoftwareNow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGatewaySoftwareNow]
$creadListPrec :: ReadPrec [UpdateGatewaySoftwareNow]
readPrec :: ReadPrec UpdateGatewaySoftwareNow
$creadPrec :: ReadPrec UpdateGatewaySoftwareNow
readList :: ReadS [UpdateGatewaySoftwareNow]
$creadList :: ReadS [UpdateGatewaySoftwareNow]
readsPrec :: Int -> ReadS UpdateGatewaySoftwareNow
$creadsPrec :: Int -> ReadS UpdateGatewaySoftwareNow
Prelude.Read, Int -> UpdateGatewaySoftwareNow -> ShowS
[UpdateGatewaySoftwareNow] -> ShowS
UpdateGatewaySoftwareNow -> String
(Int -> UpdateGatewaySoftwareNow -> ShowS)
-> (UpdateGatewaySoftwareNow -> String)
-> ([UpdateGatewaySoftwareNow] -> ShowS)
-> Show UpdateGatewaySoftwareNow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGatewaySoftwareNow] -> ShowS
$cshowList :: [UpdateGatewaySoftwareNow] -> ShowS
show :: UpdateGatewaySoftwareNow -> String
$cshow :: UpdateGatewaySoftwareNow -> String
showsPrec :: Int -> UpdateGatewaySoftwareNow -> ShowS
$cshowsPrec :: Int -> UpdateGatewaySoftwareNow -> ShowS
Prelude.Show, (forall x.
UpdateGatewaySoftwareNow -> Rep UpdateGatewaySoftwareNow x)
-> (forall x.
Rep UpdateGatewaySoftwareNow x -> UpdateGatewaySoftwareNow)
-> Generic UpdateGatewaySoftwareNow
forall x.
Rep UpdateGatewaySoftwareNow x -> UpdateGatewaySoftwareNow
forall x.
UpdateGatewaySoftwareNow -> Rep UpdateGatewaySoftwareNow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGatewaySoftwareNow x -> UpdateGatewaySoftwareNow
$cfrom :: forall x.
UpdateGatewaySoftwareNow -> Rep UpdateGatewaySoftwareNow x
Prelude.Generic)
newUpdateGatewaySoftwareNow ::
Prelude.Text ->
UpdateGatewaySoftwareNow
newUpdateGatewaySoftwareNow :: Text -> UpdateGatewaySoftwareNow
newUpdateGatewaySoftwareNow Text
pGatewayARN_ =
UpdateGatewaySoftwareNow' :: Text -> UpdateGatewaySoftwareNow
UpdateGatewaySoftwareNow'
{ $sel:gatewayARN:UpdateGatewaySoftwareNow' :: Text
gatewayARN =
Text
pGatewayARN_
}
updateGatewaySoftwareNow_gatewayARN :: Lens.Lens' UpdateGatewaySoftwareNow Prelude.Text
updateGatewaySoftwareNow_gatewayARN :: (Text -> f Text)
-> UpdateGatewaySoftwareNow -> f UpdateGatewaySoftwareNow
updateGatewaySoftwareNow_gatewayARN = (UpdateGatewaySoftwareNow -> Text)
-> (UpdateGatewaySoftwareNow -> Text -> UpdateGatewaySoftwareNow)
-> Lens UpdateGatewaySoftwareNow UpdateGatewaySoftwareNow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewaySoftwareNow' {Text
gatewayARN :: Text
$sel:gatewayARN:UpdateGatewaySoftwareNow' :: UpdateGatewaySoftwareNow -> Text
gatewayARN} -> Text
gatewayARN) (\s :: UpdateGatewaySoftwareNow
s@UpdateGatewaySoftwareNow' {} Text
a -> UpdateGatewaySoftwareNow
s {$sel:gatewayARN:UpdateGatewaySoftwareNow' :: Text
gatewayARN = Text
a} :: UpdateGatewaySoftwareNow)
instance Core.AWSRequest UpdateGatewaySoftwareNow where
type
AWSResponse UpdateGatewaySoftwareNow =
UpdateGatewaySoftwareNowResponse
request :: UpdateGatewaySoftwareNow -> Request UpdateGatewaySoftwareNow
request = Service
-> UpdateGatewaySoftwareNow -> Request UpdateGatewaySoftwareNow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateGatewaySoftwareNow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateGatewaySoftwareNow)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateGatewaySoftwareNow))
-> Logger
-> Service
-> Proxy UpdateGatewaySoftwareNow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateGatewaySoftwareNow)))
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 -> UpdateGatewaySoftwareNowResponse
UpdateGatewaySoftwareNowResponse'
(Maybe Text -> Int -> UpdateGatewaySoftwareNowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateGatewaySoftwareNowResponse)
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
"GatewayARN")
Either String (Int -> UpdateGatewaySoftwareNowResponse)
-> Either String Int
-> Either String UpdateGatewaySoftwareNowResponse
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 UpdateGatewaySoftwareNow
instance Prelude.NFData UpdateGatewaySoftwareNow
instance Core.ToHeaders UpdateGatewaySoftwareNow where
toHeaders :: UpdateGatewaySoftwareNow -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateGatewaySoftwareNow -> 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.UpdateGatewaySoftwareNow" ::
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 UpdateGatewaySoftwareNow where
toJSON :: UpdateGatewaySoftwareNow -> Value
toJSON UpdateGatewaySoftwareNow' {Text
gatewayARN :: Text
$sel:gatewayARN:UpdateGatewaySoftwareNow' :: UpdateGatewaySoftwareNow -> 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
"GatewayARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayARN)]
)
instance Core.ToPath UpdateGatewaySoftwareNow where
toPath :: UpdateGatewaySoftwareNow -> ByteString
toPath = ByteString -> UpdateGatewaySoftwareNow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateGatewaySoftwareNow where
toQuery :: UpdateGatewaySoftwareNow -> QueryString
toQuery = QueryString -> UpdateGatewaySoftwareNow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateGatewaySoftwareNowResponse = UpdateGatewaySoftwareNowResponse'
{ UpdateGatewaySoftwareNowResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
UpdateGatewaySoftwareNowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool
(UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool)
-> (UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool)
-> Eq UpdateGatewaySoftwareNowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool
$c/= :: UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool
== :: UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool
$c== :: UpdateGatewaySoftwareNowResponse
-> UpdateGatewaySoftwareNowResponse -> Bool
Prelude.Eq, ReadPrec [UpdateGatewaySoftwareNowResponse]
ReadPrec UpdateGatewaySoftwareNowResponse
Int -> ReadS UpdateGatewaySoftwareNowResponse
ReadS [UpdateGatewaySoftwareNowResponse]
(Int -> ReadS UpdateGatewaySoftwareNowResponse)
-> ReadS [UpdateGatewaySoftwareNowResponse]
-> ReadPrec UpdateGatewaySoftwareNowResponse
-> ReadPrec [UpdateGatewaySoftwareNowResponse]
-> Read UpdateGatewaySoftwareNowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGatewaySoftwareNowResponse]
$creadListPrec :: ReadPrec [UpdateGatewaySoftwareNowResponse]
readPrec :: ReadPrec UpdateGatewaySoftwareNowResponse
$creadPrec :: ReadPrec UpdateGatewaySoftwareNowResponse
readList :: ReadS [UpdateGatewaySoftwareNowResponse]
$creadList :: ReadS [UpdateGatewaySoftwareNowResponse]
readsPrec :: Int -> ReadS UpdateGatewaySoftwareNowResponse
$creadsPrec :: Int -> ReadS UpdateGatewaySoftwareNowResponse
Prelude.Read, Int -> UpdateGatewaySoftwareNowResponse -> ShowS
[UpdateGatewaySoftwareNowResponse] -> ShowS
UpdateGatewaySoftwareNowResponse -> String
(Int -> UpdateGatewaySoftwareNowResponse -> ShowS)
-> (UpdateGatewaySoftwareNowResponse -> String)
-> ([UpdateGatewaySoftwareNowResponse] -> ShowS)
-> Show UpdateGatewaySoftwareNowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGatewaySoftwareNowResponse] -> ShowS
$cshowList :: [UpdateGatewaySoftwareNowResponse] -> ShowS
show :: UpdateGatewaySoftwareNowResponse -> String
$cshow :: UpdateGatewaySoftwareNowResponse -> String
showsPrec :: Int -> UpdateGatewaySoftwareNowResponse -> ShowS
$cshowsPrec :: Int -> UpdateGatewaySoftwareNowResponse -> ShowS
Prelude.Show, (forall x.
UpdateGatewaySoftwareNowResponse
-> Rep UpdateGatewaySoftwareNowResponse x)
-> (forall x.
Rep UpdateGatewaySoftwareNowResponse x
-> UpdateGatewaySoftwareNowResponse)
-> Generic UpdateGatewaySoftwareNowResponse
forall x.
Rep UpdateGatewaySoftwareNowResponse x
-> UpdateGatewaySoftwareNowResponse
forall x.
UpdateGatewaySoftwareNowResponse
-> Rep UpdateGatewaySoftwareNowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGatewaySoftwareNowResponse x
-> UpdateGatewaySoftwareNowResponse
$cfrom :: forall x.
UpdateGatewaySoftwareNowResponse
-> Rep UpdateGatewaySoftwareNowResponse x
Prelude.Generic)
newUpdateGatewaySoftwareNowResponse ::
Prelude.Int ->
UpdateGatewaySoftwareNowResponse
newUpdateGatewaySoftwareNowResponse :: Int -> UpdateGatewaySoftwareNowResponse
newUpdateGatewaySoftwareNowResponse Int
pHttpStatus_ =
UpdateGatewaySoftwareNowResponse' :: Maybe Text -> Int -> UpdateGatewaySoftwareNowResponse
UpdateGatewaySoftwareNowResponse'
{ $sel:gatewayARN:UpdateGatewaySoftwareNowResponse' :: Maybe Text
gatewayARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateGatewaySoftwareNowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateGatewaySoftwareNowResponse_gatewayARN :: Lens.Lens' UpdateGatewaySoftwareNowResponse (Prelude.Maybe Prelude.Text)
updateGatewaySoftwareNowResponse_gatewayARN :: (Maybe Text -> f (Maybe Text))
-> UpdateGatewaySoftwareNowResponse
-> f UpdateGatewaySoftwareNowResponse
updateGatewaySoftwareNowResponse_gatewayARN = (UpdateGatewaySoftwareNowResponse -> Maybe Text)
-> (UpdateGatewaySoftwareNowResponse
-> Maybe Text -> UpdateGatewaySoftwareNowResponse)
-> Lens
UpdateGatewaySoftwareNowResponse
UpdateGatewaySoftwareNowResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewaySoftwareNowResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:UpdateGatewaySoftwareNowResponse' :: UpdateGatewaySoftwareNowResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: UpdateGatewaySoftwareNowResponse
s@UpdateGatewaySoftwareNowResponse' {} Maybe Text
a -> UpdateGatewaySoftwareNowResponse
s {$sel:gatewayARN:UpdateGatewaySoftwareNowResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: UpdateGatewaySoftwareNowResponse)
updateGatewaySoftwareNowResponse_httpStatus :: Lens.Lens' UpdateGatewaySoftwareNowResponse Prelude.Int
updateGatewaySoftwareNowResponse_httpStatus :: (Int -> f Int)
-> UpdateGatewaySoftwareNowResponse
-> f UpdateGatewaySoftwareNowResponse
updateGatewaySoftwareNowResponse_httpStatus = (UpdateGatewaySoftwareNowResponse -> Int)
-> (UpdateGatewaySoftwareNowResponse
-> Int -> UpdateGatewaySoftwareNowResponse)
-> Lens
UpdateGatewaySoftwareNowResponse
UpdateGatewaySoftwareNowResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewaySoftwareNowResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateGatewaySoftwareNowResponse' :: UpdateGatewaySoftwareNowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateGatewaySoftwareNowResponse
s@UpdateGatewaySoftwareNowResponse' {} Int
a -> UpdateGatewaySoftwareNowResponse
s {$sel:httpStatus:UpdateGatewaySoftwareNowResponse' :: Int
httpStatus = Int
a} :: UpdateGatewaySoftwareNowResponse)
instance
Prelude.NFData
UpdateGatewaySoftwareNowResponse