{-# 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.DeleteGeofenceCollection
-- 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)
--
-- Deletes a geofence collection from your AWS account.
--
-- This operation deletes the resource permanently. If the geofence
-- collection is the target of a tracker resource, the devices will no
-- longer be monitored.
module Amazonka.Location.DeleteGeofenceCollection
  ( -- * Creating a Request
    DeleteGeofenceCollection (..),
    newDeleteGeofenceCollection,

    -- * Request Lenses
    deleteGeofenceCollection_collectionName,

    -- * Destructuring the Response
    DeleteGeofenceCollectionResponse (..),
    newDeleteGeofenceCollectionResponse,

    -- * Response Lenses
    deleteGeofenceCollectionResponse_httpStatus,
  )
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:/ 'newDeleteGeofenceCollection' smart constructor.
data DeleteGeofenceCollection = DeleteGeofenceCollection'
  { -- | The name of the geofence collection to be deleted.
    DeleteGeofenceCollection -> Text
collectionName :: Prelude.Text
  }
  deriving (DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool
(DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool)
-> (DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool)
-> Eq DeleteGeofenceCollection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool
$c/= :: DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool
== :: DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool
$c== :: DeleteGeofenceCollection -> DeleteGeofenceCollection -> Bool
Prelude.Eq, ReadPrec [DeleteGeofenceCollection]
ReadPrec DeleteGeofenceCollection
Int -> ReadS DeleteGeofenceCollection
ReadS [DeleteGeofenceCollection]
(Int -> ReadS DeleteGeofenceCollection)
-> ReadS [DeleteGeofenceCollection]
-> ReadPrec DeleteGeofenceCollection
-> ReadPrec [DeleteGeofenceCollection]
-> Read DeleteGeofenceCollection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGeofenceCollection]
$creadListPrec :: ReadPrec [DeleteGeofenceCollection]
readPrec :: ReadPrec DeleteGeofenceCollection
$creadPrec :: ReadPrec DeleteGeofenceCollection
readList :: ReadS [DeleteGeofenceCollection]
$creadList :: ReadS [DeleteGeofenceCollection]
readsPrec :: Int -> ReadS DeleteGeofenceCollection
$creadsPrec :: Int -> ReadS DeleteGeofenceCollection
Prelude.Read, Int -> DeleteGeofenceCollection -> ShowS
[DeleteGeofenceCollection] -> ShowS
DeleteGeofenceCollection -> String
(Int -> DeleteGeofenceCollection -> ShowS)
-> (DeleteGeofenceCollection -> String)
-> ([DeleteGeofenceCollection] -> ShowS)
-> Show DeleteGeofenceCollection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGeofenceCollection] -> ShowS
$cshowList :: [DeleteGeofenceCollection] -> ShowS
show :: DeleteGeofenceCollection -> String
$cshow :: DeleteGeofenceCollection -> String
showsPrec :: Int -> DeleteGeofenceCollection -> ShowS
$cshowsPrec :: Int -> DeleteGeofenceCollection -> ShowS
Prelude.Show, (forall x.
 DeleteGeofenceCollection -> Rep DeleteGeofenceCollection x)
-> (forall x.
    Rep DeleteGeofenceCollection x -> DeleteGeofenceCollection)
-> Generic DeleteGeofenceCollection
forall x.
Rep DeleteGeofenceCollection x -> DeleteGeofenceCollection
forall x.
DeleteGeofenceCollection -> Rep DeleteGeofenceCollection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteGeofenceCollection x -> DeleteGeofenceCollection
$cfrom :: forall x.
DeleteGeofenceCollection -> Rep DeleteGeofenceCollection x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGeofenceCollection' 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:
--
-- 'collectionName', 'deleteGeofenceCollection_collectionName' - The name of the geofence collection to be deleted.
newDeleteGeofenceCollection ::
  -- | 'collectionName'
  Prelude.Text ->
  DeleteGeofenceCollection
newDeleteGeofenceCollection :: Text -> DeleteGeofenceCollection
newDeleteGeofenceCollection Text
pCollectionName_ =
  DeleteGeofenceCollection' :: Text -> DeleteGeofenceCollection
DeleteGeofenceCollection'
    { $sel:collectionName:DeleteGeofenceCollection' :: Text
collectionName =
        Text
pCollectionName_
    }

-- | The name of the geofence collection to be deleted.
deleteGeofenceCollection_collectionName :: Lens.Lens' DeleteGeofenceCollection Prelude.Text
deleteGeofenceCollection_collectionName :: (Text -> f Text)
-> DeleteGeofenceCollection -> f DeleteGeofenceCollection
deleteGeofenceCollection_collectionName = (DeleteGeofenceCollection -> Text)
-> (DeleteGeofenceCollection -> Text -> DeleteGeofenceCollection)
-> Lens DeleteGeofenceCollection DeleteGeofenceCollection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGeofenceCollection' {Text
collectionName :: Text
$sel:collectionName:DeleteGeofenceCollection' :: DeleteGeofenceCollection -> Text
collectionName} -> Text
collectionName) (\s :: DeleteGeofenceCollection
s@DeleteGeofenceCollection' {} Text
a -> DeleteGeofenceCollection
s {$sel:collectionName:DeleteGeofenceCollection' :: Text
collectionName = Text
a} :: DeleteGeofenceCollection)

instance Core.AWSRequest DeleteGeofenceCollection where
  type
    AWSResponse DeleteGeofenceCollection =
      DeleteGeofenceCollectionResponse
  request :: DeleteGeofenceCollection -> Request DeleteGeofenceCollection
request = Service
-> DeleteGeofenceCollection -> Request DeleteGeofenceCollection
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteGeofenceCollection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGeofenceCollection)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteGeofenceCollection))
-> Logger
-> Service
-> Proxy DeleteGeofenceCollection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGeofenceCollection)))
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 -> DeleteGeofenceCollectionResponse
DeleteGeofenceCollectionResponse'
            (Int -> DeleteGeofenceCollectionResponse)
-> Either String Int
-> Either String DeleteGeofenceCollectionResponse
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 DeleteGeofenceCollection

instance Prelude.NFData DeleteGeofenceCollection

instance Core.ToHeaders DeleteGeofenceCollection where
  toHeaders :: DeleteGeofenceCollection -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteGeofenceCollection -> 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.ToPath DeleteGeofenceCollection where
  toPath :: DeleteGeofenceCollection -> ByteString
toPath DeleteGeofenceCollection' {Text
collectionName :: Text
$sel:collectionName:DeleteGeofenceCollection' :: DeleteGeofenceCollection -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/geofencing/v0/collections/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
collectionName
      ]

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

-- | /See:/ 'newDeleteGeofenceCollectionResponse' smart constructor.
data DeleteGeofenceCollectionResponse = DeleteGeofenceCollectionResponse'
  { -- | The response's http status code.
    DeleteGeofenceCollectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteGeofenceCollectionResponse
-> DeleteGeofenceCollectionResponse -> Bool
(DeleteGeofenceCollectionResponse
 -> DeleteGeofenceCollectionResponse -> Bool)
-> (DeleteGeofenceCollectionResponse
    -> DeleteGeofenceCollectionResponse -> Bool)
-> Eq DeleteGeofenceCollectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGeofenceCollectionResponse
-> DeleteGeofenceCollectionResponse -> Bool
$c/= :: DeleteGeofenceCollectionResponse
-> DeleteGeofenceCollectionResponse -> Bool
== :: DeleteGeofenceCollectionResponse
-> DeleteGeofenceCollectionResponse -> Bool
$c== :: DeleteGeofenceCollectionResponse
-> DeleteGeofenceCollectionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteGeofenceCollectionResponse]
ReadPrec DeleteGeofenceCollectionResponse
Int -> ReadS DeleteGeofenceCollectionResponse
ReadS [DeleteGeofenceCollectionResponse]
(Int -> ReadS DeleteGeofenceCollectionResponse)
-> ReadS [DeleteGeofenceCollectionResponse]
-> ReadPrec DeleteGeofenceCollectionResponse
-> ReadPrec [DeleteGeofenceCollectionResponse]
-> Read DeleteGeofenceCollectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGeofenceCollectionResponse]
$creadListPrec :: ReadPrec [DeleteGeofenceCollectionResponse]
readPrec :: ReadPrec DeleteGeofenceCollectionResponse
$creadPrec :: ReadPrec DeleteGeofenceCollectionResponse
readList :: ReadS [DeleteGeofenceCollectionResponse]
$creadList :: ReadS [DeleteGeofenceCollectionResponse]
readsPrec :: Int -> ReadS DeleteGeofenceCollectionResponse
$creadsPrec :: Int -> ReadS DeleteGeofenceCollectionResponse
Prelude.Read, Int -> DeleteGeofenceCollectionResponse -> ShowS
[DeleteGeofenceCollectionResponse] -> ShowS
DeleteGeofenceCollectionResponse -> String
(Int -> DeleteGeofenceCollectionResponse -> ShowS)
-> (DeleteGeofenceCollectionResponse -> String)
-> ([DeleteGeofenceCollectionResponse] -> ShowS)
-> Show DeleteGeofenceCollectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGeofenceCollectionResponse] -> ShowS
$cshowList :: [DeleteGeofenceCollectionResponse] -> ShowS
show :: DeleteGeofenceCollectionResponse -> String
$cshow :: DeleteGeofenceCollectionResponse -> String
showsPrec :: Int -> DeleteGeofenceCollectionResponse -> ShowS
$cshowsPrec :: Int -> DeleteGeofenceCollectionResponse -> ShowS
Prelude.Show, (forall x.
 DeleteGeofenceCollectionResponse
 -> Rep DeleteGeofenceCollectionResponse x)
-> (forall x.
    Rep DeleteGeofenceCollectionResponse x
    -> DeleteGeofenceCollectionResponse)
-> Generic DeleteGeofenceCollectionResponse
forall x.
Rep DeleteGeofenceCollectionResponse x
-> DeleteGeofenceCollectionResponse
forall x.
DeleteGeofenceCollectionResponse
-> Rep DeleteGeofenceCollectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteGeofenceCollectionResponse x
-> DeleteGeofenceCollectionResponse
$cfrom :: forall x.
DeleteGeofenceCollectionResponse
-> Rep DeleteGeofenceCollectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGeofenceCollectionResponse' 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', 'deleteGeofenceCollectionResponse_httpStatus' - The response's http status code.
newDeleteGeofenceCollectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteGeofenceCollectionResponse
newDeleteGeofenceCollectionResponse :: Int -> DeleteGeofenceCollectionResponse
newDeleteGeofenceCollectionResponse Int
pHttpStatus_ =
  DeleteGeofenceCollectionResponse' :: Int -> DeleteGeofenceCollectionResponse
DeleteGeofenceCollectionResponse'
    { $sel:httpStatus:DeleteGeofenceCollectionResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DeleteGeofenceCollectionResponse