{-# 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.Location.UpdateMap
(
UpdateMap (..),
newUpdateMap,
updateMap_pricingPlan,
updateMap_description,
updateMap_mapName,
UpdateMapResponse (..),
newUpdateMapResponse,
updateMapResponse_httpStatus,
updateMapResponse_mapArn,
updateMapResponse_mapName,
updateMapResponse_updateTime,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateMap = UpdateMap'
{
UpdateMap -> Maybe PricingPlan
pricingPlan :: Prelude.Maybe PricingPlan,
UpdateMap -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateMap -> Text
mapName :: Prelude.Text
}
deriving (UpdateMap -> UpdateMap -> Bool
(UpdateMap -> UpdateMap -> Bool)
-> (UpdateMap -> UpdateMap -> Bool) -> Eq UpdateMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMap -> UpdateMap -> Bool
$c/= :: UpdateMap -> UpdateMap -> Bool
== :: UpdateMap -> UpdateMap -> Bool
$c== :: UpdateMap -> UpdateMap -> Bool
Prelude.Eq, ReadPrec [UpdateMap]
ReadPrec UpdateMap
Int -> ReadS UpdateMap
ReadS [UpdateMap]
(Int -> ReadS UpdateMap)
-> ReadS [UpdateMap]
-> ReadPrec UpdateMap
-> ReadPrec [UpdateMap]
-> Read UpdateMap
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMap]
$creadListPrec :: ReadPrec [UpdateMap]
readPrec :: ReadPrec UpdateMap
$creadPrec :: ReadPrec UpdateMap
readList :: ReadS [UpdateMap]
$creadList :: ReadS [UpdateMap]
readsPrec :: Int -> ReadS UpdateMap
$creadsPrec :: Int -> ReadS UpdateMap
Prelude.Read, Int -> UpdateMap -> ShowS
[UpdateMap] -> ShowS
UpdateMap -> String
(Int -> UpdateMap -> ShowS)
-> (UpdateMap -> String)
-> ([UpdateMap] -> ShowS)
-> Show UpdateMap
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMap] -> ShowS
$cshowList :: [UpdateMap] -> ShowS
show :: UpdateMap -> String
$cshow :: UpdateMap -> String
showsPrec :: Int -> UpdateMap -> ShowS
$cshowsPrec :: Int -> UpdateMap -> ShowS
Prelude.Show, (forall x. UpdateMap -> Rep UpdateMap x)
-> (forall x. Rep UpdateMap x -> UpdateMap) -> Generic UpdateMap
forall x. Rep UpdateMap x -> UpdateMap
forall x. UpdateMap -> Rep UpdateMap x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMap x -> UpdateMap
$cfrom :: forall x. UpdateMap -> Rep UpdateMap x
Prelude.Generic)
newUpdateMap ::
Prelude.Text ->
UpdateMap
newUpdateMap :: Text -> UpdateMap
newUpdateMap Text
pMapName_ =
UpdateMap' :: Maybe PricingPlan -> Maybe Text -> Text -> UpdateMap
UpdateMap'
{ $sel:pricingPlan:UpdateMap' :: Maybe PricingPlan
pricingPlan = Maybe PricingPlan
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateMap' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mapName:UpdateMap' :: Text
mapName = Text
pMapName_
}
updateMap_pricingPlan :: Lens.Lens' UpdateMap (Prelude.Maybe PricingPlan)
updateMap_pricingPlan :: (Maybe PricingPlan -> f (Maybe PricingPlan))
-> UpdateMap -> f UpdateMap
updateMap_pricingPlan = (UpdateMap -> Maybe PricingPlan)
-> (UpdateMap -> Maybe PricingPlan -> UpdateMap)
-> Lens UpdateMap UpdateMap (Maybe PricingPlan) (Maybe PricingPlan)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMap' {Maybe PricingPlan
pricingPlan :: Maybe PricingPlan
$sel:pricingPlan:UpdateMap' :: UpdateMap -> Maybe PricingPlan
pricingPlan} -> Maybe PricingPlan
pricingPlan) (\s :: UpdateMap
s@UpdateMap' {} Maybe PricingPlan
a -> UpdateMap
s {$sel:pricingPlan:UpdateMap' :: Maybe PricingPlan
pricingPlan = Maybe PricingPlan
a} :: UpdateMap)
updateMap_description :: Lens.Lens' UpdateMap (Prelude.Maybe Prelude.Text)
updateMap_description :: (Maybe Text -> f (Maybe Text)) -> UpdateMap -> f UpdateMap
updateMap_description = (UpdateMap -> Maybe Text)
-> (UpdateMap -> Maybe Text -> UpdateMap)
-> Lens UpdateMap UpdateMap (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMap' {Maybe Text
description :: Maybe Text
$sel:description:UpdateMap' :: UpdateMap -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateMap
s@UpdateMap' {} Maybe Text
a -> UpdateMap
s {$sel:description:UpdateMap' :: Maybe Text
description = Maybe Text
a} :: UpdateMap)
updateMap_mapName :: Lens.Lens' UpdateMap Prelude.Text
updateMap_mapName :: (Text -> f Text) -> UpdateMap -> f UpdateMap
updateMap_mapName = (UpdateMap -> Text)
-> (UpdateMap -> Text -> UpdateMap)
-> Lens UpdateMap UpdateMap Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMap' {Text
mapName :: Text
$sel:mapName:UpdateMap' :: UpdateMap -> Text
mapName} -> Text
mapName) (\s :: UpdateMap
s@UpdateMap' {} Text
a -> UpdateMap
s {$sel:mapName:UpdateMap' :: Text
mapName = Text
a} :: UpdateMap)
instance Core.AWSRequest UpdateMap where
type AWSResponse UpdateMap = UpdateMapResponse
request :: UpdateMap -> Request UpdateMap
request = Service -> UpdateMap -> Request UpdateMap
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateMap
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateMap)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateMap))
-> Logger
-> Service
-> Proxy UpdateMap
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateMap)))
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 ->
Int -> Text -> Text -> POSIX -> UpdateMapResponse
UpdateMapResponse'
(Int -> Text -> Text -> POSIX -> UpdateMapResponse)
-> Either String Int
-> Either String (Text -> Text -> POSIX -> UpdateMapResponse)
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))
Either String (Text -> Text -> POSIX -> UpdateMapResponse)
-> Either String Text
-> Either String (Text -> POSIX -> UpdateMapResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"MapArn")
Either String (Text -> POSIX -> UpdateMapResponse)
-> Either String Text -> Either String (POSIX -> UpdateMapResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"MapName")
Either String (POSIX -> UpdateMapResponse)
-> Either String POSIX -> Either String UpdateMapResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UpdateTime")
)
instance Prelude.Hashable UpdateMap
instance Prelude.NFData UpdateMap
instance Core.ToHeaders UpdateMap where
toHeaders :: UpdateMap -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateMap -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 UpdateMap where
toJSON :: UpdateMap -> Value
toJSON UpdateMap' {Maybe Text
Maybe PricingPlan
Text
mapName :: Text
description :: Maybe Text
pricingPlan :: Maybe PricingPlan
$sel:mapName:UpdateMap' :: UpdateMap -> Text
$sel:description:UpdateMap' :: UpdateMap -> Maybe Text
$sel:pricingPlan:UpdateMap' :: UpdateMap -> Maybe PricingPlan
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PricingPlan" Text -> PricingPlan -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PricingPlan -> Pair) -> Maybe PricingPlan -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PricingPlan
pricingPlan,
(Text
"Description" 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
description
]
)
instance Core.ToPath UpdateMap where
toPath :: UpdateMap -> ByteString
toPath UpdateMap' {Maybe Text
Maybe PricingPlan
Text
mapName :: Text
description :: Maybe Text
pricingPlan :: Maybe PricingPlan
$sel:mapName:UpdateMap' :: UpdateMap -> Text
$sel:description:UpdateMap' :: UpdateMap -> Maybe Text
$sel:pricingPlan:UpdateMap' :: UpdateMap -> Maybe PricingPlan
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/maps/v0/maps/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
mapName]
instance Core.ToQuery UpdateMap where
toQuery :: UpdateMap -> QueryString
toQuery = QueryString -> UpdateMap -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateMapResponse = UpdateMapResponse'
{
UpdateMapResponse -> Int
httpStatus :: Prelude.Int,
UpdateMapResponse -> Text
mapArn :: Prelude.Text,
UpdateMapResponse -> Text
mapName :: Prelude.Text,
UpdateMapResponse -> POSIX
updateTime :: Core.POSIX
}
deriving (UpdateMapResponse -> UpdateMapResponse -> Bool
(UpdateMapResponse -> UpdateMapResponse -> Bool)
-> (UpdateMapResponse -> UpdateMapResponse -> Bool)
-> Eq UpdateMapResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMapResponse -> UpdateMapResponse -> Bool
$c/= :: UpdateMapResponse -> UpdateMapResponse -> Bool
== :: UpdateMapResponse -> UpdateMapResponse -> Bool
$c== :: UpdateMapResponse -> UpdateMapResponse -> Bool
Prelude.Eq, ReadPrec [UpdateMapResponse]
ReadPrec UpdateMapResponse
Int -> ReadS UpdateMapResponse
ReadS [UpdateMapResponse]
(Int -> ReadS UpdateMapResponse)
-> ReadS [UpdateMapResponse]
-> ReadPrec UpdateMapResponse
-> ReadPrec [UpdateMapResponse]
-> Read UpdateMapResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMapResponse]
$creadListPrec :: ReadPrec [UpdateMapResponse]
readPrec :: ReadPrec UpdateMapResponse
$creadPrec :: ReadPrec UpdateMapResponse
readList :: ReadS [UpdateMapResponse]
$creadList :: ReadS [UpdateMapResponse]
readsPrec :: Int -> ReadS UpdateMapResponse
$creadsPrec :: Int -> ReadS UpdateMapResponse
Prelude.Read, Int -> UpdateMapResponse -> ShowS
[UpdateMapResponse] -> ShowS
UpdateMapResponse -> String
(Int -> UpdateMapResponse -> ShowS)
-> (UpdateMapResponse -> String)
-> ([UpdateMapResponse] -> ShowS)
-> Show UpdateMapResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMapResponse] -> ShowS
$cshowList :: [UpdateMapResponse] -> ShowS
show :: UpdateMapResponse -> String
$cshow :: UpdateMapResponse -> String
showsPrec :: Int -> UpdateMapResponse -> ShowS
$cshowsPrec :: Int -> UpdateMapResponse -> ShowS
Prelude.Show, (forall x. UpdateMapResponse -> Rep UpdateMapResponse x)
-> (forall x. Rep UpdateMapResponse x -> UpdateMapResponse)
-> Generic UpdateMapResponse
forall x. Rep UpdateMapResponse x -> UpdateMapResponse
forall x. UpdateMapResponse -> Rep UpdateMapResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMapResponse x -> UpdateMapResponse
$cfrom :: forall x. UpdateMapResponse -> Rep UpdateMapResponse x
Prelude.Generic)
newUpdateMapResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
UpdateMapResponse
newUpdateMapResponse :: Int -> Text -> Text -> UTCTime -> UpdateMapResponse
newUpdateMapResponse
Int
pHttpStatus_
Text
pMapArn_
Text
pMapName_
UTCTime
pUpdateTime_ =
UpdateMapResponse' :: Int -> Text -> Text -> POSIX -> UpdateMapResponse
UpdateMapResponse'
{ $sel:httpStatus:UpdateMapResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:mapArn:UpdateMapResponse' :: Text
mapArn = Text
pMapArn_,
$sel:mapName:UpdateMapResponse' :: Text
mapName = Text
pMapName_,
$sel:updateTime:UpdateMapResponse' :: POSIX
updateTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
}
updateMapResponse_httpStatus :: Lens.Lens' UpdateMapResponse Prelude.Int
updateMapResponse_httpStatus :: (Int -> f Int) -> UpdateMapResponse -> f UpdateMapResponse
updateMapResponse_httpStatus = (UpdateMapResponse -> Int)
-> (UpdateMapResponse -> Int -> UpdateMapResponse)
-> Lens UpdateMapResponse UpdateMapResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMapResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMapResponse' :: UpdateMapResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMapResponse
s@UpdateMapResponse' {} Int
a -> UpdateMapResponse
s {$sel:httpStatus:UpdateMapResponse' :: Int
httpStatus = Int
a} :: UpdateMapResponse)
updateMapResponse_mapArn :: Lens.Lens' UpdateMapResponse Prelude.Text
updateMapResponse_mapArn :: (Text -> f Text) -> UpdateMapResponse -> f UpdateMapResponse
updateMapResponse_mapArn = (UpdateMapResponse -> Text)
-> (UpdateMapResponse -> Text -> UpdateMapResponse)
-> Lens UpdateMapResponse UpdateMapResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMapResponse' {Text
mapArn :: Text
$sel:mapArn:UpdateMapResponse' :: UpdateMapResponse -> Text
mapArn} -> Text
mapArn) (\s :: UpdateMapResponse
s@UpdateMapResponse' {} Text
a -> UpdateMapResponse
s {$sel:mapArn:UpdateMapResponse' :: Text
mapArn = Text
a} :: UpdateMapResponse)
updateMapResponse_mapName :: Lens.Lens' UpdateMapResponse Prelude.Text
updateMapResponse_mapName :: (Text -> f Text) -> UpdateMapResponse -> f UpdateMapResponse
updateMapResponse_mapName = (UpdateMapResponse -> Text)
-> (UpdateMapResponse -> Text -> UpdateMapResponse)
-> Lens UpdateMapResponse UpdateMapResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMapResponse' {Text
mapName :: Text
$sel:mapName:UpdateMapResponse' :: UpdateMapResponse -> Text
mapName} -> Text
mapName) (\s :: UpdateMapResponse
s@UpdateMapResponse' {} Text
a -> UpdateMapResponse
s {$sel:mapName:UpdateMapResponse' :: Text
mapName = Text
a} :: UpdateMapResponse)
updateMapResponse_updateTime :: Lens.Lens' UpdateMapResponse Prelude.UTCTime
updateMapResponse_updateTime :: (UTCTime -> f UTCTime) -> UpdateMapResponse -> f UpdateMapResponse
updateMapResponse_updateTime = (UpdateMapResponse -> POSIX)
-> (UpdateMapResponse -> POSIX -> UpdateMapResponse)
-> Lens UpdateMapResponse UpdateMapResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMapResponse' {POSIX
updateTime :: POSIX
$sel:updateTime:UpdateMapResponse' :: UpdateMapResponse -> POSIX
updateTime} -> POSIX
updateTime) (\s :: UpdateMapResponse
s@UpdateMapResponse' {} POSIX
a -> UpdateMapResponse
s {$sel:updateTime:UpdateMapResponse' :: POSIX
updateTime = POSIX
a} :: UpdateMapResponse) ((POSIX -> f POSIX) -> UpdateMapResponse -> f UpdateMapResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> UpdateMapResponse
-> f UpdateMapResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Prelude.NFData UpdateMapResponse