{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Location.CreateMap
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a map resource in your AWS account, which provides map tiles of
-- different styles sourced from global location data providers.
module Amazonka.Location.CreateMap
  ( -- * Creating a Request
    CreateMap (..),
    newCreateMap,

    -- * Request Lenses
    createMap_description,
    createMap_tags,
    createMap_configuration,
    createMap_mapName,
    createMap_pricingPlan,

    -- * Destructuring the Response
    CreateMapResponse (..),
    newCreateMapResponse,

    -- * Response Lenses
    createMapResponse_httpStatus,
    createMapResponse_createTime,
    createMapResponse_mapArn,
    createMapResponse_mapName,
  )
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

-- | /See:/ 'newCreateMap' smart constructor.
data CreateMap = CreateMap'
  { -- | An optional description for the map resource.
    CreateMap -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Applies one or more tags to the map resource. A tag is a key-value pair
    -- helps manage, identify, search, and filter your resources by labelling
    -- them.
    --
    -- Format: @\"key\" : \"value\"@
    --
    -- Restrictions:
    --
    -- -   Maximum 50 tags per resource
    --
    -- -   Each resource tag must be unique with a maximum of one value.
    --
    -- -   Maximum key length: 128 Unicode characters in UTF-8
    --
    -- -   Maximum value length: 256 Unicode characters in UTF-8
    --
    -- -   Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
    --     characters: + - = . _ : \/ \@.
    CreateMap -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies the map style selected from an available data provider.
    CreateMap -> MapConfiguration
configuration :: MapConfiguration,
    -- | The name for the map resource.
    --
    -- Requirements:
    --
    -- -   Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens
    --     (-), periods (.), and underscores (_).
    --
    -- -   Must be a unique map resource name.
    --
    -- -   No spaces allowed. For example, @ExampleMap@.
    CreateMap -> Text
mapName :: Prelude.Text,
    -- | Specifies the pricing plan for your map resource.
    --
    -- For additional details and restrictions on each pricing plan option, see
    -- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
    CreateMap -> PricingPlan
pricingPlan :: PricingPlan
  }
  deriving (CreateMap -> CreateMap -> Bool
(CreateMap -> CreateMap -> Bool)
-> (CreateMap -> CreateMap -> Bool) -> Eq CreateMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMap -> CreateMap -> Bool
$c/= :: CreateMap -> CreateMap -> Bool
== :: CreateMap -> CreateMap -> Bool
$c== :: CreateMap -> CreateMap -> Bool
Prelude.Eq, ReadPrec [CreateMap]
ReadPrec CreateMap
Int -> ReadS CreateMap
ReadS [CreateMap]
(Int -> ReadS CreateMap)
-> ReadS [CreateMap]
-> ReadPrec CreateMap
-> ReadPrec [CreateMap]
-> Read CreateMap
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMap]
$creadListPrec :: ReadPrec [CreateMap]
readPrec :: ReadPrec CreateMap
$creadPrec :: ReadPrec CreateMap
readList :: ReadS [CreateMap]
$creadList :: ReadS [CreateMap]
readsPrec :: Int -> ReadS CreateMap
$creadsPrec :: Int -> ReadS CreateMap
Prelude.Read, Int -> CreateMap -> ShowS
[CreateMap] -> ShowS
CreateMap -> String
(Int -> CreateMap -> ShowS)
-> (CreateMap -> String)
-> ([CreateMap] -> ShowS)
-> Show CreateMap
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMap] -> ShowS
$cshowList :: [CreateMap] -> ShowS
show :: CreateMap -> String
$cshow :: CreateMap -> String
showsPrec :: Int -> CreateMap -> ShowS
$cshowsPrec :: Int -> CreateMap -> ShowS
Prelude.Show, (forall x. CreateMap -> Rep CreateMap x)
-> (forall x. Rep CreateMap x -> CreateMap) -> Generic CreateMap
forall x. Rep CreateMap x -> CreateMap
forall x. CreateMap -> Rep CreateMap x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMap x -> CreateMap
$cfrom :: forall x. CreateMap -> Rep CreateMap x
Prelude.Generic)

-- |
-- Create a value of 'CreateMap' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'description', 'createMap_description' - An optional description for the map resource.
--
-- 'tags', 'createMap_tags' - Applies one or more tags to the map resource. A tag is a key-value pair
-- helps manage, identify, search, and filter your resources by labelling
-- them.
--
-- Format: @\"key\" : \"value\"@
--
-- Restrictions:
--
-- -   Maximum 50 tags per resource
--
-- -   Each resource tag must be unique with a maximum of one value.
--
-- -   Maximum key length: 128 Unicode characters in UTF-8
--
-- -   Maximum value length: 256 Unicode characters in UTF-8
--
-- -   Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
--     characters: + - = . _ : \/ \@.
--
-- 'configuration', 'createMap_configuration' - Specifies the map style selected from an available data provider.
--
-- 'mapName', 'createMap_mapName' - The name for the map resource.
--
-- Requirements:
--
-- -   Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens
--     (-), periods (.), and underscores (_).
--
-- -   Must be a unique map resource name.
--
-- -   No spaces allowed. For example, @ExampleMap@.
--
-- 'pricingPlan', 'createMap_pricingPlan' - Specifies the pricing plan for your map resource.
--
-- For additional details and restrictions on each pricing plan option, see
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
newCreateMap ::
  -- | 'configuration'
  MapConfiguration ->
  -- | 'mapName'
  Prelude.Text ->
  -- | 'pricingPlan'
  PricingPlan ->
  CreateMap
newCreateMap :: MapConfiguration -> Text -> PricingPlan -> CreateMap
newCreateMap MapConfiguration
pConfiguration_ Text
pMapName_ PricingPlan
pPricingPlan_ =
  CreateMap' :: Maybe Text
-> Maybe (HashMap Text Text)
-> MapConfiguration
-> Text
-> PricingPlan
-> CreateMap
CreateMap'
    { $sel:description:CreateMap' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateMap' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:CreateMap' :: MapConfiguration
configuration = MapConfiguration
pConfiguration_,
      $sel:mapName:CreateMap' :: Text
mapName = Text
pMapName_,
      $sel:pricingPlan:CreateMap' :: PricingPlan
pricingPlan = PricingPlan
pPricingPlan_
    }

-- | An optional description for the map resource.
createMap_description :: Lens.Lens' CreateMap (Prelude.Maybe Prelude.Text)
createMap_description :: (Maybe Text -> f (Maybe Text)) -> CreateMap -> f CreateMap
createMap_description = (CreateMap -> Maybe Text)
-> (CreateMap -> Maybe Text -> CreateMap)
-> Lens CreateMap CreateMap (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMap' {Maybe Text
description :: Maybe Text
$sel:description:CreateMap' :: CreateMap -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateMap
s@CreateMap' {} Maybe Text
a -> CreateMap
s {$sel:description:CreateMap' :: Maybe Text
description = Maybe Text
a} :: CreateMap)

-- | Applies one or more tags to the map resource. A tag is a key-value pair
-- helps manage, identify, search, and filter your resources by labelling
-- them.
--
-- Format: @\"key\" : \"value\"@
--
-- Restrictions:
--
-- -   Maximum 50 tags per resource
--
-- -   Each resource tag must be unique with a maximum of one value.
--
-- -   Maximum key length: 128 Unicode characters in UTF-8
--
-- -   Maximum value length: 256 Unicode characters in UTF-8
--
-- -   Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
--     characters: + - = . _ : \/ \@.
createMap_tags :: Lens.Lens' CreateMap (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createMap_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateMap -> f CreateMap
createMap_tags = (CreateMap -> Maybe (HashMap Text Text))
-> (CreateMap -> Maybe (HashMap Text Text) -> CreateMap)
-> Lens
     CreateMap
     CreateMap
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMap' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateMap' :: CreateMap -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateMap
s@CreateMap' {} Maybe (HashMap Text Text)
a -> CreateMap
s {$sel:tags:CreateMap' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateMap) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateMap -> f CreateMap)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateMap
-> f CreateMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the map style selected from an available data provider.
createMap_configuration :: Lens.Lens' CreateMap MapConfiguration
createMap_configuration :: (MapConfiguration -> f MapConfiguration)
-> CreateMap -> f CreateMap
createMap_configuration = (CreateMap -> MapConfiguration)
-> (CreateMap -> MapConfiguration -> CreateMap)
-> Lens CreateMap CreateMap MapConfiguration MapConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMap' {MapConfiguration
configuration :: MapConfiguration
$sel:configuration:CreateMap' :: CreateMap -> MapConfiguration
configuration} -> MapConfiguration
configuration) (\s :: CreateMap
s@CreateMap' {} MapConfiguration
a -> CreateMap
s {$sel:configuration:CreateMap' :: MapConfiguration
configuration = MapConfiguration
a} :: CreateMap)

-- | The name for the map resource.
--
-- Requirements:
--
-- -   Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens
--     (-), periods (.), and underscores (_).
--
-- -   Must be a unique map resource name.
--
-- -   No spaces allowed. For example, @ExampleMap@.
createMap_mapName :: Lens.Lens' CreateMap Prelude.Text
createMap_mapName :: (Text -> f Text) -> CreateMap -> f CreateMap
createMap_mapName = (CreateMap -> Text)
-> (CreateMap -> Text -> CreateMap)
-> Lens CreateMap CreateMap Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMap' {Text
mapName :: Text
$sel:mapName:CreateMap' :: CreateMap -> Text
mapName} -> Text
mapName) (\s :: CreateMap
s@CreateMap' {} Text
a -> CreateMap
s {$sel:mapName:CreateMap' :: Text
mapName = Text
a} :: CreateMap)

-- | Specifies the pricing plan for your map resource.
--
-- For additional details and restrictions on each pricing plan option, see
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
createMap_pricingPlan :: Lens.Lens' CreateMap PricingPlan
createMap_pricingPlan :: (PricingPlan -> f PricingPlan) -> CreateMap -> f CreateMap
createMap_pricingPlan = (CreateMap -> PricingPlan)
-> (CreateMap -> PricingPlan -> CreateMap)
-> Lens CreateMap CreateMap PricingPlan PricingPlan
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMap' {PricingPlan
pricingPlan :: PricingPlan
$sel:pricingPlan:CreateMap' :: CreateMap -> PricingPlan
pricingPlan} -> PricingPlan
pricingPlan) (\s :: CreateMap
s@CreateMap' {} PricingPlan
a -> CreateMap
s {$sel:pricingPlan:CreateMap' :: PricingPlan
pricingPlan = PricingPlan
a} :: CreateMap)

instance Core.AWSRequest CreateMap where
  type AWSResponse CreateMap = CreateMapResponse
  request :: CreateMap -> Request CreateMap
request = Service -> CreateMap -> Request CreateMap
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateMap
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMap)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateMap))
-> Logger
-> Service
-> Proxy CreateMap
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMap)))
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 -> POSIX -> Text -> Text -> CreateMapResponse
CreateMapResponse'
            (Int -> POSIX -> Text -> Text -> CreateMapResponse)
-> Either String Int
-> Either String (POSIX -> Text -> Text -> CreateMapResponse)
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 (POSIX -> Text -> Text -> CreateMapResponse)
-> Either String POSIX
-> Either String (Text -> Text -> CreateMapResponse)
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
"CreateTime")
            Either String (Text -> Text -> CreateMapResponse)
-> Either String Text -> Either String (Text -> CreateMapResponse)
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 -> CreateMapResponse)
-> Either String Text -> Either String CreateMapResponse
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")
      )

instance Prelude.Hashable CreateMap

instance Prelude.NFData CreateMap

instance Core.ToHeaders CreateMap where
  toHeaders :: CreateMap -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateMap -> 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 CreateMap where
  toJSON :: CreateMap -> Value
toJSON CreateMap' {Maybe Text
Maybe (HashMap Text Text)
Text
MapConfiguration
PricingPlan
pricingPlan :: PricingPlan
mapName :: Text
configuration :: MapConfiguration
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:pricingPlan:CreateMap' :: CreateMap -> PricingPlan
$sel:mapName:CreateMap' :: CreateMap -> Text
$sel:configuration:CreateMap' :: CreateMap -> MapConfiguration
$sel:tags:CreateMap' :: CreateMap -> Maybe (HashMap Text Text)
$sel:description:CreateMap' :: CreateMap -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Configuration" Text -> MapConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MapConfiguration
configuration),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MapName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
mapName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PricingPlan" Text -> PricingPlan -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PricingPlan
pricingPlan)
          ]
      )

instance Core.ToPath CreateMap where
  toPath :: CreateMap -> ByteString
toPath = ByteString -> CreateMap -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/maps/v0/maps"

instance Core.ToQuery CreateMap where
  toQuery :: CreateMap -> QueryString
toQuery = QueryString -> CreateMap -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateMapResponse' smart constructor.
data CreateMapResponse = CreateMapResponse'
  { -- | The response's http status code.
    CreateMapResponse -> Int
httpStatus :: Prelude.Int,
    -- | The timestamp for when the map resource was created in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
    CreateMapResponse -> POSIX
createTime :: Core.POSIX,
    -- | The Amazon Resource Name (ARN) for the map resource. Used to specify a
    -- resource across all AWS.
    --
    -- -   Format example: @arn:aws:geo:region:account-id:maps\/ExampleMap@
    CreateMapResponse -> Text
mapArn :: Prelude.Text,
    -- | The name of the map resource.
    CreateMapResponse -> Text
mapName :: Prelude.Text
  }
  deriving (CreateMapResponse -> CreateMapResponse -> Bool
(CreateMapResponse -> CreateMapResponse -> Bool)
-> (CreateMapResponse -> CreateMapResponse -> Bool)
-> Eq CreateMapResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMapResponse -> CreateMapResponse -> Bool
$c/= :: CreateMapResponse -> CreateMapResponse -> Bool
== :: CreateMapResponse -> CreateMapResponse -> Bool
$c== :: CreateMapResponse -> CreateMapResponse -> Bool
Prelude.Eq, ReadPrec [CreateMapResponse]
ReadPrec CreateMapResponse
Int -> ReadS CreateMapResponse
ReadS [CreateMapResponse]
(Int -> ReadS CreateMapResponse)
-> ReadS [CreateMapResponse]
-> ReadPrec CreateMapResponse
-> ReadPrec [CreateMapResponse]
-> Read CreateMapResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMapResponse]
$creadListPrec :: ReadPrec [CreateMapResponse]
readPrec :: ReadPrec CreateMapResponse
$creadPrec :: ReadPrec CreateMapResponse
readList :: ReadS [CreateMapResponse]
$creadList :: ReadS [CreateMapResponse]
readsPrec :: Int -> ReadS CreateMapResponse
$creadsPrec :: Int -> ReadS CreateMapResponse
Prelude.Read, Int -> CreateMapResponse -> ShowS
[CreateMapResponse] -> ShowS
CreateMapResponse -> String
(Int -> CreateMapResponse -> ShowS)
-> (CreateMapResponse -> String)
-> ([CreateMapResponse] -> ShowS)
-> Show CreateMapResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMapResponse] -> ShowS
$cshowList :: [CreateMapResponse] -> ShowS
show :: CreateMapResponse -> String
$cshow :: CreateMapResponse -> String
showsPrec :: Int -> CreateMapResponse -> ShowS
$cshowsPrec :: Int -> CreateMapResponse -> ShowS
Prelude.Show, (forall x. CreateMapResponse -> Rep CreateMapResponse x)
-> (forall x. Rep CreateMapResponse x -> CreateMapResponse)
-> Generic CreateMapResponse
forall x. Rep CreateMapResponse x -> CreateMapResponse
forall x. CreateMapResponse -> Rep CreateMapResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMapResponse x -> CreateMapResponse
$cfrom :: forall x. CreateMapResponse -> Rep CreateMapResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateMapResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'createMapResponse_httpStatus' - The response's http status code.
--
-- 'createTime', 'createMapResponse_createTime' - The timestamp for when the map resource was created in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
--
-- 'mapArn', 'createMapResponse_mapArn' - The Amazon Resource Name (ARN) for the map resource. Used to specify a
-- resource across all AWS.
--
-- -   Format example: @arn:aws:geo:region:account-id:maps\/ExampleMap@
--
-- 'mapName', 'createMapResponse_mapName' - The name of the map resource.
newCreateMapResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'createTime'
  Prelude.UTCTime ->
  -- | 'mapArn'
  Prelude.Text ->
  -- | 'mapName'
  Prelude.Text ->
  CreateMapResponse
newCreateMapResponse :: Int -> UTCTime -> Text -> Text -> CreateMapResponse
newCreateMapResponse
  Int
pHttpStatus_
  UTCTime
pCreateTime_
  Text
pMapArn_
  Text
pMapName_ =
    CreateMapResponse' :: Int -> POSIX -> Text -> Text -> CreateMapResponse
CreateMapResponse'
      { $sel:httpStatus:CreateMapResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:createTime:CreateMapResponse' :: POSIX
createTime = 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
pCreateTime_,
        $sel:mapArn:CreateMapResponse' :: Text
mapArn = Text
pMapArn_,
        $sel:mapName:CreateMapResponse' :: Text
mapName = Text
pMapName_
      }

-- | The response's http status code.
createMapResponse_httpStatus :: Lens.Lens' CreateMapResponse Prelude.Int
createMapResponse_httpStatus :: (Int -> f Int) -> CreateMapResponse -> f CreateMapResponse
createMapResponse_httpStatus = (CreateMapResponse -> Int)
-> (CreateMapResponse -> Int -> CreateMapResponse)
-> Lens CreateMapResponse CreateMapResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMapResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMapResponse' :: CreateMapResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMapResponse
s@CreateMapResponse' {} Int
a -> CreateMapResponse
s {$sel:httpStatus:CreateMapResponse' :: Int
httpStatus = Int
a} :: CreateMapResponse)

-- | The timestamp for when the map resource was created in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
createMapResponse_createTime :: Lens.Lens' CreateMapResponse Prelude.UTCTime
createMapResponse_createTime :: (UTCTime -> f UTCTime) -> CreateMapResponse -> f CreateMapResponse
createMapResponse_createTime = (CreateMapResponse -> POSIX)
-> (CreateMapResponse -> POSIX -> CreateMapResponse)
-> Lens CreateMapResponse CreateMapResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMapResponse' {POSIX
createTime :: POSIX
$sel:createTime:CreateMapResponse' :: CreateMapResponse -> POSIX
createTime} -> POSIX
createTime) (\s :: CreateMapResponse
s@CreateMapResponse' {} POSIX
a -> CreateMapResponse
s {$sel:createTime:CreateMapResponse' :: POSIX
createTime = POSIX
a} :: CreateMapResponse) ((POSIX -> f POSIX) -> CreateMapResponse -> f CreateMapResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateMapResponse
-> f CreateMapResponse
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

-- | The Amazon Resource Name (ARN) for the map resource. Used to specify a
-- resource across all AWS.
--
-- -   Format example: @arn:aws:geo:region:account-id:maps\/ExampleMap@
createMapResponse_mapArn :: Lens.Lens' CreateMapResponse Prelude.Text
createMapResponse_mapArn :: (Text -> f Text) -> CreateMapResponse -> f CreateMapResponse
createMapResponse_mapArn = (CreateMapResponse -> Text)
-> (CreateMapResponse -> Text -> CreateMapResponse)
-> Lens CreateMapResponse CreateMapResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMapResponse' {Text
mapArn :: Text
$sel:mapArn:CreateMapResponse' :: CreateMapResponse -> Text
mapArn} -> Text
mapArn) (\s :: CreateMapResponse
s@CreateMapResponse' {} Text
a -> CreateMapResponse
s {$sel:mapArn:CreateMapResponse' :: Text
mapArn = Text
a} :: CreateMapResponse)

-- | The name of the map resource.
createMapResponse_mapName :: Lens.Lens' CreateMapResponse Prelude.Text
createMapResponse_mapName :: (Text -> f Text) -> CreateMapResponse -> f CreateMapResponse
createMapResponse_mapName = (CreateMapResponse -> Text)
-> (CreateMapResponse -> Text -> CreateMapResponse)
-> Lens CreateMapResponse CreateMapResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMapResponse' {Text
mapName :: Text
$sel:mapName:CreateMapResponse' :: CreateMapResponse -> Text
mapName} -> Text
mapName) (\s :: CreateMapResponse
s@CreateMapResponse' {} Text
a -> CreateMapResponse
s {$sel:mapName:CreateMapResponse' :: Text
mapName = Text
a} :: CreateMapResponse)

instance Prelude.NFData CreateMapResponse