{-# 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.CreateGeofenceCollection
-- 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 geofence collection, which manages and stores geofences.
module Amazonka.Location.CreateGeofenceCollection
  ( -- * Creating a Request
    CreateGeofenceCollection (..),
    newCreateGeofenceCollection,

    -- * Request Lenses
    createGeofenceCollection_pricingPlanDataSource,
    createGeofenceCollection_kmsKeyId,
    createGeofenceCollection_description,
    createGeofenceCollection_tags,
    createGeofenceCollection_collectionName,
    createGeofenceCollection_pricingPlan,

    -- * Destructuring the Response
    CreateGeofenceCollectionResponse (..),
    newCreateGeofenceCollectionResponse,

    -- * Response Lenses
    createGeofenceCollectionResponse_httpStatus,
    createGeofenceCollectionResponse_collectionArn,
    createGeofenceCollectionResponse_collectionName,
    createGeofenceCollectionResponse_createTime,
  )
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:/ 'newCreateGeofenceCollection' smart constructor.
data CreateGeofenceCollection = CreateGeofenceCollection'
  { -- | Specifies the data provider for the geofence collection.
    --
    -- -   Required value for the following pricing plans:
    --     @MobileAssetTracking @| @MobileAssetManagement@
    --
    -- For more information about
    -- <https://aws.amazon.com/location/data-providers/ Data Providers>, and
    -- <https://aws.amazon.com/location/pricing/ Pricing plans>, see the Amazon
    -- Location Service product page.
    --
    -- Amazon Location Service only uses @PricingPlanDataSource@ to calculate
    -- billing for your geofence collection. Your data won\'t be shared with
    -- the data provider, and will remain in your AWS account or Region unless
    -- you move it.
    --
    -- Valid Values: @Esri @| @Here@
    CreateGeofenceCollection -> Maybe Text
pricingPlanDataSource :: Prelude.Maybe Prelude.Text,
    -- | A key identifier for an
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html AWS KMS customer managed key>.
    -- Enter a key ID, key ARN, alias name, or alias ARN.
    CreateGeofenceCollection -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | An optional description for the geofence collection.
    CreateGeofenceCollection -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Applies one or more tags to the geofence collection. 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: + - = . _ : \/ \@.
    CreateGeofenceCollection -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A custom name for the geofence collection.
    --
    -- Requirements:
    --
    -- -   Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-),
    --     periods (.), and underscores (_).
    --
    -- -   Must be a unique geofence collection name.
    --
    -- -   No spaces allowed. For example, @ExampleGeofenceCollection@.
    CreateGeofenceCollection -> Text
collectionName :: Prelude.Text,
    -- | Specifies the pricing plan for the geofence collection.
    --
    -- For additional details and restrictions on each pricing plan option, see
    -- the
    -- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing page>.
    CreateGeofenceCollection -> PricingPlan
pricingPlan :: PricingPlan
  }
  deriving (CreateGeofenceCollection -> CreateGeofenceCollection -> Bool
(CreateGeofenceCollection -> CreateGeofenceCollection -> Bool)
-> (CreateGeofenceCollection -> CreateGeofenceCollection -> Bool)
-> Eq CreateGeofenceCollection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGeofenceCollection -> CreateGeofenceCollection -> Bool
$c/= :: CreateGeofenceCollection -> CreateGeofenceCollection -> Bool
== :: CreateGeofenceCollection -> CreateGeofenceCollection -> Bool
$c== :: CreateGeofenceCollection -> CreateGeofenceCollection -> Bool
Prelude.Eq, ReadPrec [CreateGeofenceCollection]
ReadPrec CreateGeofenceCollection
Int -> ReadS CreateGeofenceCollection
ReadS [CreateGeofenceCollection]
(Int -> ReadS CreateGeofenceCollection)
-> ReadS [CreateGeofenceCollection]
-> ReadPrec CreateGeofenceCollection
-> ReadPrec [CreateGeofenceCollection]
-> Read CreateGeofenceCollection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGeofenceCollection]
$creadListPrec :: ReadPrec [CreateGeofenceCollection]
readPrec :: ReadPrec CreateGeofenceCollection
$creadPrec :: ReadPrec CreateGeofenceCollection
readList :: ReadS [CreateGeofenceCollection]
$creadList :: ReadS [CreateGeofenceCollection]
readsPrec :: Int -> ReadS CreateGeofenceCollection
$creadsPrec :: Int -> ReadS CreateGeofenceCollection
Prelude.Read, Int -> CreateGeofenceCollection -> ShowS
[CreateGeofenceCollection] -> ShowS
CreateGeofenceCollection -> String
(Int -> CreateGeofenceCollection -> ShowS)
-> (CreateGeofenceCollection -> String)
-> ([CreateGeofenceCollection] -> ShowS)
-> Show CreateGeofenceCollection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGeofenceCollection] -> ShowS
$cshowList :: [CreateGeofenceCollection] -> ShowS
show :: CreateGeofenceCollection -> String
$cshow :: CreateGeofenceCollection -> String
showsPrec :: Int -> CreateGeofenceCollection -> ShowS
$cshowsPrec :: Int -> CreateGeofenceCollection -> ShowS
Prelude.Show, (forall x.
 CreateGeofenceCollection -> Rep CreateGeofenceCollection x)
-> (forall x.
    Rep CreateGeofenceCollection x -> CreateGeofenceCollection)
-> Generic CreateGeofenceCollection
forall x.
Rep CreateGeofenceCollection x -> CreateGeofenceCollection
forall x.
CreateGeofenceCollection -> Rep CreateGeofenceCollection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGeofenceCollection x -> CreateGeofenceCollection
$cfrom :: forall x.
CreateGeofenceCollection -> Rep CreateGeofenceCollection x
Prelude.Generic)

-- |
-- Create a value of 'CreateGeofenceCollection' 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:
--
-- 'pricingPlanDataSource', 'createGeofenceCollection_pricingPlanDataSource' - Specifies the data provider for the geofence collection.
--
-- -   Required value for the following pricing plans:
--     @MobileAssetTracking @| @MobileAssetManagement@
--
-- For more information about
-- <https://aws.amazon.com/location/data-providers/ Data Providers>, and
-- <https://aws.amazon.com/location/pricing/ Pricing plans>, see the Amazon
-- Location Service product page.
--
-- Amazon Location Service only uses @PricingPlanDataSource@ to calculate
-- billing for your geofence collection. Your data won\'t be shared with
-- the data provider, and will remain in your AWS account or Region unless
-- you move it.
--
-- Valid Values: @Esri @| @Here@
--
-- 'kmsKeyId', 'createGeofenceCollection_kmsKeyId' - A key identifier for an
-- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html AWS KMS customer managed key>.
-- Enter a key ID, key ARN, alias name, or alias ARN.
--
-- 'description', 'createGeofenceCollection_description' - An optional description for the geofence collection.
--
-- 'tags', 'createGeofenceCollection_tags' - Applies one or more tags to the geofence collection. 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: + - = . _ : \/ \@.
--
-- 'collectionName', 'createGeofenceCollection_collectionName' - A custom name for the geofence collection.
--
-- Requirements:
--
-- -   Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-),
--     periods (.), and underscores (_).
--
-- -   Must be a unique geofence collection name.
--
-- -   No spaces allowed. For example, @ExampleGeofenceCollection@.
--
-- 'pricingPlan', 'createGeofenceCollection_pricingPlan' - Specifies the pricing plan for the geofence collection.
--
-- For additional details and restrictions on each pricing plan option, see
-- the
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing page>.
newCreateGeofenceCollection ::
  -- | 'collectionName'
  Prelude.Text ->
  -- | 'pricingPlan'
  PricingPlan ->
  CreateGeofenceCollection
newCreateGeofenceCollection :: Text -> PricingPlan -> CreateGeofenceCollection
newCreateGeofenceCollection
  Text
pCollectionName_
  PricingPlan
pPricingPlan_ =
    CreateGeofenceCollection' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> PricingPlan
-> CreateGeofenceCollection
CreateGeofenceCollection'
      { $sel:pricingPlanDataSource:CreateGeofenceCollection' :: Maybe Text
pricingPlanDataSource =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CreateGeofenceCollection' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateGeofenceCollection' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateGeofenceCollection' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:collectionName:CreateGeofenceCollection' :: Text
collectionName = Text
pCollectionName_,
        $sel:pricingPlan:CreateGeofenceCollection' :: PricingPlan
pricingPlan = PricingPlan
pPricingPlan_
      }

-- | Specifies the data provider for the geofence collection.
--
-- -   Required value for the following pricing plans:
--     @MobileAssetTracking @| @MobileAssetManagement@
--
-- For more information about
-- <https://aws.amazon.com/location/data-providers/ Data Providers>, and
-- <https://aws.amazon.com/location/pricing/ Pricing plans>, see the Amazon
-- Location Service product page.
--
-- Amazon Location Service only uses @PricingPlanDataSource@ to calculate
-- billing for your geofence collection. Your data won\'t be shared with
-- the data provider, and will remain in your AWS account or Region unless
-- you move it.
--
-- Valid Values: @Esri @| @Here@
createGeofenceCollection_pricingPlanDataSource :: Lens.Lens' CreateGeofenceCollection (Prelude.Maybe Prelude.Text)
createGeofenceCollection_pricingPlanDataSource :: (Maybe Text -> f (Maybe Text))
-> CreateGeofenceCollection -> f CreateGeofenceCollection
createGeofenceCollection_pricingPlanDataSource = (CreateGeofenceCollection -> Maybe Text)
-> (CreateGeofenceCollection
    -> Maybe Text -> CreateGeofenceCollection)
-> Lens
     CreateGeofenceCollection
     CreateGeofenceCollection
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGeofenceCollection' {Maybe Text
pricingPlanDataSource :: Maybe Text
$sel:pricingPlanDataSource:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe Text
pricingPlanDataSource} -> Maybe Text
pricingPlanDataSource) (\s :: CreateGeofenceCollection
s@CreateGeofenceCollection' {} Maybe Text
a -> CreateGeofenceCollection
s {$sel:pricingPlanDataSource:CreateGeofenceCollection' :: Maybe Text
pricingPlanDataSource = Maybe Text
a} :: CreateGeofenceCollection)

-- | A key identifier for an
-- <https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html AWS KMS customer managed key>.
-- Enter a key ID, key ARN, alias name, or alias ARN.
createGeofenceCollection_kmsKeyId :: Lens.Lens' CreateGeofenceCollection (Prelude.Maybe Prelude.Text)
createGeofenceCollection_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateGeofenceCollection -> f CreateGeofenceCollection
createGeofenceCollection_kmsKeyId = (CreateGeofenceCollection -> Maybe Text)
-> (CreateGeofenceCollection
    -> Maybe Text -> CreateGeofenceCollection)
-> Lens
     CreateGeofenceCollection
     CreateGeofenceCollection
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGeofenceCollection' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateGeofenceCollection
s@CreateGeofenceCollection' {} Maybe Text
a -> CreateGeofenceCollection
s {$sel:kmsKeyId:CreateGeofenceCollection' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateGeofenceCollection)

-- | An optional description for the geofence collection.
createGeofenceCollection_description :: Lens.Lens' CreateGeofenceCollection (Prelude.Maybe Prelude.Text)
createGeofenceCollection_description :: (Maybe Text -> f (Maybe Text))
-> CreateGeofenceCollection -> f CreateGeofenceCollection
createGeofenceCollection_description = (CreateGeofenceCollection -> Maybe Text)
-> (CreateGeofenceCollection
    -> Maybe Text -> CreateGeofenceCollection)
-> Lens
     CreateGeofenceCollection
     CreateGeofenceCollection
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGeofenceCollection' {Maybe Text
description :: Maybe Text
$sel:description:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateGeofenceCollection
s@CreateGeofenceCollection' {} Maybe Text
a -> CreateGeofenceCollection
s {$sel:description:CreateGeofenceCollection' :: Maybe Text
description = Maybe Text
a} :: CreateGeofenceCollection)

-- | Applies one or more tags to the geofence collection. 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: + - = . _ : \/ \@.
createGeofenceCollection_tags :: Lens.Lens' CreateGeofenceCollection (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createGeofenceCollection_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateGeofenceCollection -> f CreateGeofenceCollection
createGeofenceCollection_tags = (CreateGeofenceCollection -> Maybe (HashMap Text Text))
-> (CreateGeofenceCollection
    -> Maybe (HashMap Text Text) -> CreateGeofenceCollection)
-> Lens
     CreateGeofenceCollection
     CreateGeofenceCollection
     (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 (\CreateGeofenceCollection' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateGeofenceCollection
s@CreateGeofenceCollection' {} Maybe (HashMap Text Text)
a -> CreateGeofenceCollection
s {$sel:tags:CreateGeofenceCollection' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateGeofenceCollection) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateGeofenceCollection -> f CreateGeofenceCollection)
-> ((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)))
-> CreateGeofenceCollection
-> f CreateGeofenceCollection
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

-- | A custom name for the geofence collection.
--
-- Requirements:
--
-- -   Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-),
--     periods (.), and underscores (_).
--
-- -   Must be a unique geofence collection name.
--
-- -   No spaces allowed. For example, @ExampleGeofenceCollection@.
createGeofenceCollection_collectionName :: Lens.Lens' CreateGeofenceCollection Prelude.Text
createGeofenceCollection_collectionName :: (Text -> f Text)
-> CreateGeofenceCollection -> f CreateGeofenceCollection
createGeofenceCollection_collectionName = (CreateGeofenceCollection -> Text)
-> (CreateGeofenceCollection -> Text -> CreateGeofenceCollection)
-> Lens CreateGeofenceCollection CreateGeofenceCollection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGeofenceCollection' {Text
collectionName :: Text
$sel:collectionName:CreateGeofenceCollection' :: CreateGeofenceCollection -> Text
collectionName} -> Text
collectionName) (\s :: CreateGeofenceCollection
s@CreateGeofenceCollection' {} Text
a -> CreateGeofenceCollection
s {$sel:collectionName:CreateGeofenceCollection' :: Text
collectionName = Text
a} :: CreateGeofenceCollection)

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

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

instance Prelude.Hashable CreateGeofenceCollection

instance Prelude.NFData CreateGeofenceCollection

instance Core.ToHeaders CreateGeofenceCollection where
  toHeaders :: CreateGeofenceCollection -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateGeofenceCollection -> 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 CreateGeofenceCollection where
  toJSON :: CreateGeofenceCollection -> Value
toJSON CreateGeofenceCollection' {Maybe Text
Maybe (HashMap Text Text)
Text
PricingPlan
pricingPlan :: PricingPlan
collectionName :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
kmsKeyId :: Maybe Text
pricingPlanDataSource :: Maybe Text
$sel:pricingPlan:CreateGeofenceCollection' :: CreateGeofenceCollection -> PricingPlan
$sel:collectionName:CreateGeofenceCollection' :: CreateGeofenceCollection -> Text
$sel:tags:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe (HashMap Text Text)
$sel:description:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe Text
$sel:kmsKeyId:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe Text
$sel:pricingPlanDataSource:CreateGeofenceCollection' :: CreateGeofenceCollection -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PricingPlanDataSource" 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
pricingPlanDataSource,
            (Text
"KmsKeyId" 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
kmsKeyId,
            (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
"CollectionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
collectionName),
            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 CreateGeofenceCollection where
  toPath :: CreateGeofenceCollection -> ByteString
toPath = ByteString -> CreateGeofenceCollection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/geofencing/v0/collections"

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

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

-- |
-- Create a value of 'CreateGeofenceCollectionResponse' 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', 'createGeofenceCollectionResponse_httpStatus' - The response's http status code.
--
-- 'collectionArn', 'createGeofenceCollectionResponse_collectionArn' - The Amazon Resource Name (ARN) for the geofence collection resource.
-- Used when you need to specify a resource across all AWS.
--
-- -   Format example:
--     @arn:aws:geo:region:account-id:geofence-collection\/ExampleGeofenceCollection@
--
-- 'collectionName', 'createGeofenceCollectionResponse_collectionName' - The name for the geofence collection.
--
-- 'createTime', 'createGeofenceCollectionResponse_createTime' - The timestamp for when the geofence collection was created in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@
newCreateGeofenceCollectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'collectionArn'
  Prelude.Text ->
  -- | 'collectionName'
  Prelude.Text ->
  -- | 'createTime'
  Prelude.UTCTime ->
  CreateGeofenceCollectionResponse
newCreateGeofenceCollectionResponse :: Int -> Text -> Text -> UTCTime -> CreateGeofenceCollectionResponse
newCreateGeofenceCollectionResponse
  Int
pHttpStatus_
  Text
pCollectionArn_
  Text
pCollectionName_
  UTCTime
pCreateTime_ =
    CreateGeofenceCollectionResponse' :: Int -> Text -> Text -> POSIX -> CreateGeofenceCollectionResponse
CreateGeofenceCollectionResponse'
      { $sel:httpStatus:CreateGeofenceCollectionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:collectionArn:CreateGeofenceCollectionResponse' :: Text
collectionArn = Text
pCollectionArn_,
        $sel:collectionName:CreateGeofenceCollectionResponse' :: Text
collectionName = Text
pCollectionName_,
        $sel:createTime:CreateGeofenceCollectionResponse' :: 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_
      }

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

-- | The Amazon Resource Name (ARN) for the geofence collection resource.
-- Used when you need to specify a resource across all AWS.
--
-- -   Format example:
--     @arn:aws:geo:region:account-id:geofence-collection\/ExampleGeofenceCollection@
createGeofenceCollectionResponse_collectionArn :: Lens.Lens' CreateGeofenceCollectionResponse Prelude.Text
createGeofenceCollectionResponse_collectionArn :: (Text -> f Text)
-> CreateGeofenceCollectionResponse
-> f CreateGeofenceCollectionResponse
createGeofenceCollectionResponse_collectionArn = (CreateGeofenceCollectionResponse -> Text)
-> (CreateGeofenceCollectionResponse
    -> Text -> CreateGeofenceCollectionResponse)
-> Lens
     CreateGeofenceCollectionResponse
     CreateGeofenceCollectionResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGeofenceCollectionResponse' {Text
collectionArn :: Text
$sel:collectionArn:CreateGeofenceCollectionResponse' :: CreateGeofenceCollectionResponse -> Text
collectionArn} -> Text
collectionArn) (\s :: CreateGeofenceCollectionResponse
s@CreateGeofenceCollectionResponse' {} Text
a -> CreateGeofenceCollectionResponse
s {$sel:collectionArn:CreateGeofenceCollectionResponse' :: Text
collectionArn = Text
a} :: CreateGeofenceCollectionResponse)

-- | The name for the geofence collection.
createGeofenceCollectionResponse_collectionName :: Lens.Lens' CreateGeofenceCollectionResponse Prelude.Text
createGeofenceCollectionResponse_collectionName :: (Text -> f Text)
-> CreateGeofenceCollectionResponse
-> f CreateGeofenceCollectionResponse
createGeofenceCollectionResponse_collectionName = (CreateGeofenceCollectionResponse -> Text)
-> (CreateGeofenceCollectionResponse
    -> Text -> CreateGeofenceCollectionResponse)
-> Lens
     CreateGeofenceCollectionResponse
     CreateGeofenceCollectionResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGeofenceCollectionResponse' {Text
collectionName :: Text
$sel:collectionName:CreateGeofenceCollectionResponse' :: CreateGeofenceCollectionResponse -> Text
collectionName} -> Text
collectionName) (\s :: CreateGeofenceCollectionResponse
s@CreateGeofenceCollectionResponse' {} Text
a -> CreateGeofenceCollectionResponse
s {$sel:collectionName:CreateGeofenceCollectionResponse' :: Text
collectionName = Text
a} :: CreateGeofenceCollectionResponse)

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