{-# 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.Snowball.UpdateLongTermPricing
(
UpdateLongTermPricing (..),
newUpdateLongTermPricing,
updateLongTermPricing_isLongTermPricingAutoRenew,
updateLongTermPricing_replacementJob,
updateLongTermPricing_longTermPricingId,
UpdateLongTermPricingResponse (..),
newUpdateLongTermPricingResponse,
updateLongTermPricingResponse_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.Snowball.Types
data UpdateLongTermPricing = UpdateLongTermPricing'
{
UpdateLongTermPricing -> Maybe Bool
isLongTermPricingAutoRenew :: Prelude.Maybe Prelude.Bool,
UpdateLongTermPricing -> Maybe Text
replacementJob :: Prelude.Maybe Prelude.Text,
UpdateLongTermPricing -> Text
longTermPricingId :: Prelude.Text
}
deriving (UpdateLongTermPricing -> UpdateLongTermPricing -> Bool
(UpdateLongTermPricing -> UpdateLongTermPricing -> Bool)
-> (UpdateLongTermPricing -> UpdateLongTermPricing -> Bool)
-> Eq UpdateLongTermPricing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLongTermPricing -> UpdateLongTermPricing -> Bool
$c/= :: UpdateLongTermPricing -> UpdateLongTermPricing -> Bool
== :: UpdateLongTermPricing -> UpdateLongTermPricing -> Bool
$c== :: UpdateLongTermPricing -> UpdateLongTermPricing -> Bool
Prelude.Eq, ReadPrec [UpdateLongTermPricing]
ReadPrec UpdateLongTermPricing
Int -> ReadS UpdateLongTermPricing
ReadS [UpdateLongTermPricing]
(Int -> ReadS UpdateLongTermPricing)
-> ReadS [UpdateLongTermPricing]
-> ReadPrec UpdateLongTermPricing
-> ReadPrec [UpdateLongTermPricing]
-> Read UpdateLongTermPricing
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLongTermPricing]
$creadListPrec :: ReadPrec [UpdateLongTermPricing]
readPrec :: ReadPrec UpdateLongTermPricing
$creadPrec :: ReadPrec UpdateLongTermPricing
readList :: ReadS [UpdateLongTermPricing]
$creadList :: ReadS [UpdateLongTermPricing]
readsPrec :: Int -> ReadS UpdateLongTermPricing
$creadsPrec :: Int -> ReadS UpdateLongTermPricing
Prelude.Read, Int -> UpdateLongTermPricing -> ShowS
[UpdateLongTermPricing] -> ShowS
UpdateLongTermPricing -> String
(Int -> UpdateLongTermPricing -> ShowS)
-> (UpdateLongTermPricing -> String)
-> ([UpdateLongTermPricing] -> ShowS)
-> Show UpdateLongTermPricing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLongTermPricing] -> ShowS
$cshowList :: [UpdateLongTermPricing] -> ShowS
show :: UpdateLongTermPricing -> String
$cshow :: UpdateLongTermPricing -> String
showsPrec :: Int -> UpdateLongTermPricing -> ShowS
$cshowsPrec :: Int -> UpdateLongTermPricing -> ShowS
Prelude.Show, (forall x. UpdateLongTermPricing -> Rep UpdateLongTermPricing x)
-> (forall x. Rep UpdateLongTermPricing x -> UpdateLongTermPricing)
-> Generic UpdateLongTermPricing
forall x. Rep UpdateLongTermPricing x -> UpdateLongTermPricing
forall x. UpdateLongTermPricing -> Rep UpdateLongTermPricing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLongTermPricing x -> UpdateLongTermPricing
$cfrom :: forall x. UpdateLongTermPricing -> Rep UpdateLongTermPricing x
Prelude.Generic)
newUpdateLongTermPricing ::
Prelude.Text ->
UpdateLongTermPricing
newUpdateLongTermPricing :: Text -> UpdateLongTermPricing
newUpdateLongTermPricing Text
pLongTermPricingId_ =
UpdateLongTermPricing' :: Maybe Bool -> Maybe Text -> Text -> UpdateLongTermPricing
UpdateLongTermPricing'
{ $sel:isLongTermPricingAutoRenew:UpdateLongTermPricing' :: Maybe Bool
isLongTermPricingAutoRenew =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:replacementJob:UpdateLongTermPricing' :: Maybe Text
replacementJob = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:longTermPricingId:UpdateLongTermPricing' :: Text
longTermPricingId = Text
pLongTermPricingId_
}
updateLongTermPricing_isLongTermPricingAutoRenew :: Lens.Lens' UpdateLongTermPricing (Prelude.Maybe Prelude.Bool)
updateLongTermPricing_isLongTermPricingAutoRenew :: (Maybe Bool -> f (Maybe Bool))
-> UpdateLongTermPricing -> f UpdateLongTermPricing
updateLongTermPricing_isLongTermPricingAutoRenew = (UpdateLongTermPricing -> Maybe Bool)
-> (UpdateLongTermPricing -> Maybe Bool -> UpdateLongTermPricing)
-> Lens
UpdateLongTermPricing
UpdateLongTermPricing
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLongTermPricing' {Maybe Bool
isLongTermPricingAutoRenew :: Maybe Bool
$sel:isLongTermPricingAutoRenew:UpdateLongTermPricing' :: UpdateLongTermPricing -> Maybe Bool
isLongTermPricingAutoRenew} -> Maybe Bool
isLongTermPricingAutoRenew) (\s :: UpdateLongTermPricing
s@UpdateLongTermPricing' {} Maybe Bool
a -> UpdateLongTermPricing
s {$sel:isLongTermPricingAutoRenew:UpdateLongTermPricing' :: Maybe Bool
isLongTermPricingAutoRenew = Maybe Bool
a} :: UpdateLongTermPricing)
updateLongTermPricing_replacementJob :: Lens.Lens' UpdateLongTermPricing (Prelude.Maybe Prelude.Text)
updateLongTermPricing_replacementJob :: (Maybe Text -> f (Maybe Text))
-> UpdateLongTermPricing -> f UpdateLongTermPricing
updateLongTermPricing_replacementJob = (UpdateLongTermPricing -> Maybe Text)
-> (UpdateLongTermPricing -> Maybe Text -> UpdateLongTermPricing)
-> Lens
UpdateLongTermPricing
UpdateLongTermPricing
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLongTermPricing' {Maybe Text
replacementJob :: Maybe Text
$sel:replacementJob:UpdateLongTermPricing' :: UpdateLongTermPricing -> Maybe Text
replacementJob} -> Maybe Text
replacementJob) (\s :: UpdateLongTermPricing
s@UpdateLongTermPricing' {} Maybe Text
a -> UpdateLongTermPricing
s {$sel:replacementJob:UpdateLongTermPricing' :: Maybe Text
replacementJob = Maybe Text
a} :: UpdateLongTermPricing)
updateLongTermPricing_longTermPricingId :: Lens.Lens' UpdateLongTermPricing Prelude.Text
updateLongTermPricing_longTermPricingId :: (Text -> f Text)
-> UpdateLongTermPricing -> f UpdateLongTermPricing
updateLongTermPricing_longTermPricingId = (UpdateLongTermPricing -> Text)
-> (UpdateLongTermPricing -> Text -> UpdateLongTermPricing)
-> Lens UpdateLongTermPricing UpdateLongTermPricing Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLongTermPricing' {Text
longTermPricingId :: Text
$sel:longTermPricingId:UpdateLongTermPricing' :: UpdateLongTermPricing -> Text
longTermPricingId} -> Text
longTermPricingId) (\s :: UpdateLongTermPricing
s@UpdateLongTermPricing' {} Text
a -> UpdateLongTermPricing
s {$sel:longTermPricingId:UpdateLongTermPricing' :: Text
longTermPricingId = Text
a} :: UpdateLongTermPricing)
instance Core.AWSRequest UpdateLongTermPricing where
type
AWSResponse UpdateLongTermPricing =
UpdateLongTermPricingResponse
request :: UpdateLongTermPricing -> Request UpdateLongTermPricing
request = Service -> UpdateLongTermPricing -> Request UpdateLongTermPricing
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateLongTermPricing
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateLongTermPricing)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateLongTermPricing))
-> Logger
-> Service
-> Proxy UpdateLongTermPricing
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateLongTermPricing)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateLongTermPricingResponse
UpdateLongTermPricingResponse'
(Int -> UpdateLongTermPricingResponse)
-> Either String Int -> Either String UpdateLongTermPricingResponse
forall (f :: * -> *) a b. Functor 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 UpdateLongTermPricing
instance Prelude.NFData UpdateLongTermPricing
instance Core.ToHeaders UpdateLongTermPricing where
toHeaders :: UpdateLongTermPricing -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateLongTermPricing -> 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
"AWSIESnowballJobManagementService.UpdateLongTermPricing" ::
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 UpdateLongTermPricing where
toJSON :: UpdateLongTermPricing -> Value
toJSON UpdateLongTermPricing' {Maybe Bool
Maybe Text
Text
longTermPricingId :: Text
replacementJob :: Maybe Text
isLongTermPricingAutoRenew :: Maybe Bool
$sel:longTermPricingId:UpdateLongTermPricing' :: UpdateLongTermPricing -> Text
$sel:replacementJob:UpdateLongTermPricing' :: UpdateLongTermPricing -> Maybe Text
$sel:isLongTermPricingAutoRenew:UpdateLongTermPricing' :: UpdateLongTermPricing -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IsLongTermPricingAutoRenew" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isLongTermPricingAutoRenew,
(Text
"ReplacementJob" 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
replacementJob,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"LongTermPricingId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
longTermPricingId)
]
)
instance Core.ToPath UpdateLongTermPricing where
toPath :: UpdateLongTermPricing -> ByteString
toPath = ByteString -> UpdateLongTermPricing -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateLongTermPricing where
toQuery :: UpdateLongTermPricing -> QueryString
toQuery = QueryString -> UpdateLongTermPricing -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateLongTermPricingResponse = UpdateLongTermPricingResponse'
{
UpdateLongTermPricingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool
(UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool)
-> (UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool)
-> Eq UpdateLongTermPricingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool
$c/= :: UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool
== :: UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool
$c== :: UpdateLongTermPricingResponse
-> UpdateLongTermPricingResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLongTermPricingResponse]
ReadPrec UpdateLongTermPricingResponse
Int -> ReadS UpdateLongTermPricingResponse
ReadS [UpdateLongTermPricingResponse]
(Int -> ReadS UpdateLongTermPricingResponse)
-> ReadS [UpdateLongTermPricingResponse]
-> ReadPrec UpdateLongTermPricingResponse
-> ReadPrec [UpdateLongTermPricingResponse]
-> Read UpdateLongTermPricingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLongTermPricingResponse]
$creadListPrec :: ReadPrec [UpdateLongTermPricingResponse]
readPrec :: ReadPrec UpdateLongTermPricingResponse
$creadPrec :: ReadPrec UpdateLongTermPricingResponse
readList :: ReadS [UpdateLongTermPricingResponse]
$creadList :: ReadS [UpdateLongTermPricingResponse]
readsPrec :: Int -> ReadS UpdateLongTermPricingResponse
$creadsPrec :: Int -> ReadS UpdateLongTermPricingResponse
Prelude.Read, Int -> UpdateLongTermPricingResponse -> ShowS
[UpdateLongTermPricingResponse] -> ShowS
UpdateLongTermPricingResponse -> String
(Int -> UpdateLongTermPricingResponse -> ShowS)
-> (UpdateLongTermPricingResponse -> String)
-> ([UpdateLongTermPricingResponse] -> ShowS)
-> Show UpdateLongTermPricingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLongTermPricingResponse] -> ShowS
$cshowList :: [UpdateLongTermPricingResponse] -> ShowS
show :: UpdateLongTermPricingResponse -> String
$cshow :: UpdateLongTermPricingResponse -> String
showsPrec :: Int -> UpdateLongTermPricingResponse -> ShowS
$cshowsPrec :: Int -> UpdateLongTermPricingResponse -> ShowS
Prelude.Show, (forall x.
UpdateLongTermPricingResponse
-> Rep UpdateLongTermPricingResponse x)
-> (forall x.
Rep UpdateLongTermPricingResponse x
-> UpdateLongTermPricingResponse)
-> Generic UpdateLongTermPricingResponse
forall x.
Rep UpdateLongTermPricingResponse x
-> UpdateLongTermPricingResponse
forall x.
UpdateLongTermPricingResponse
-> Rep UpdateLongTermPricingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLongTermPricingResponse x
-> UpdateLongTermPricingResponse
$cfrom :: forall x.
UpdateLongTermPricingResponse
-> Rep UpdateLongTermPricingResponse x
Prelude.Generic)
newUpdateLongTermPricingResponse ::
Prelude.Int ->
UpdateLongTermPricingResponse
newUpdateLongTermPricingResponse :: Int -> UpdateLongTermPricingResponse
newUpdateLongTermPricingResponse Int
pHttpStatus_ =
UpdateLongTermPricingResponse' :: Int -> UpdateLongTermPricingResponse
UpdateLongTermPricingResponse'
{ $sel:httpStatus:UpdateLongTermPricingResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateLongTermPricingResponse_httpStatus :: Lens.Lens' UpdateLongTermPricingResponse Prelude.Int
updateLongTermPricingResponse_httpStatus :: (Int -> f Int)
-> UpdateLongTermPricingResponse -> f UpdateLongTermPricingResponse
updateLongTermPricingResponse_httpStatus = (UpdateLongTermPricingResponse -> Int)
-> (UpdateLongTermPricingResponse
-> Int -> UpdateLongTermPricingResponse)
-> Lens
UpdateLongTermPricingResponse UpdateLongTermPricingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLongTermPricingResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLongTermPricingResponse' :: UpdateLongTermPricingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateLongTermPricingResponse
s@UpdateLongTermPricingResponse' {} Int
a -> UpdateLongTermPricingResponse
s {$sel:httpStatus:UpdateLongTermPricingResponse' :: Int
httpStatus = Int
a} :: UpdateLongTermPricingResponse)
instance Prelude.NFData UpdateLongTermPricingResponse