{-# 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.GroundStation.DeleteMissionProfile
-- 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 mission profile.
module Amazonka.GroundStation.DeleteMissionProfile
  ( -- * Creating a Request
    DeleteMissionProfile (..),
    newDeleteMissionProfile,

    -- * Request Lenses
    deleteMissionProfile_missionProfileId,

    -- * Destructuring the Response
    MissionProfileIdResponse (..),
    newMissionProfileIdResponse,

    -- * Response Lenses
    missionProfileIdResponse_missionProfileId,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GroundStation.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDeleteMissionProfile' smart constructor.
data DeleteMissionProfile = DeleteMissionProfile'
  { -- | UUID of a mission profile.
    DeleteMissionProfile -> Text
missionProfileId :: Prelude.Text
  }
  deriving (DeleteMissionProfile -> DeleteMissionProfile -> Bool
(DeleteMissionProfile -> DeleteMissionProfile -> Bool)
-> (DeleteMissionProfile -> DeleteMissionProfile -> Bool)
-> Eq DeleteMissionProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMissionProfile -> DeleteMissionProfile -> Bool
$c/= :: DeleteMissionProfile -> DeleteMissionProfile -> Bool
== :: DeleteMissionProfile -> DeleteMissionProfile -> Bool
$c== :: DeleteMissionProfile -> DeleteMissionProfile -> Bool
Prelude.Eq, ReadPrec [DeleteMissionProfile]
ReadPrec DeleteMissionProfile
Int -> ReadS DeleteMissionProfile
ReadS [DeleteMissionProfile]
(Int -> ReadS DeleteMissionProfile)
-> ReadS [DeleteMissionProfile]
-> ReadPrec DeleteMissionProfile
-> ReadPrec [DeleteMissionProfile]
-> Read DeleteMissionProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMissionProfile]
$creadListPrec :: ReadPrec [DeleteMissionProfile]
readPrec :: ReadPrec DeleteMissionProfile
$creadPrec :: ReadPrec DeleteMissionProfile
readList :: ReadS [DeleteMissionProfile]
$creadList :: ReadS [DeleteMissionProfile]
readsPrec :: Int -> ReadS DeleteMissionProfile
$creadsPrec :: Int -> ReadS DeleteMissionProfile
Prelude.Read, Int -> DeleteMissionProfile -> ShowS
[DeleteMissionProfile] -> ShowS
DeleteMissionProfile -> String
(Int -> DeleteMissionProfile -> ShowS)
-> (DeleteMissionProfile -> String)
-> ([DeleteMissionProfile] -> ShowS)
-> Show DeleteMissionProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMissionProfile] -> ShowS
$cshowList :: [DeleteMissionProfile] -> ShowS
show :: DeleteMissionProfile -> String
$cshow :: DeleteMissionProfile -> String
showsPrec :: Int -> DeleteMissionProfile -> ShowS
$cshowsPrec :: Int -> DeleteMissionProfile -> ShowS
Prelude.Show, (forall x. DeleteMissionProfile -> Rep DeleteMissionProfile x)
-> (forall x. Rep DeleteMissionProfile x -> DeleteMissionProfile)
-> Generic DeleteMissionProfile
forall x. Rep DeleteMissionProfile x -> DeleteMissionProfile
forall x. DeleteMissionProfile -> Rep DeleteMissionProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMissionProfile x -> DeleteMissionProfile
$cfrom :: forall x. DeleteMissionProfile -> Rep DeleteMissionProfile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteMissionProfile' 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:
--
-- 'missionProfileId', 'deleteMissionProfile_missionProfileId' - UUID of a mission profile.
newDeleteMissionProfile ::
  -- | 'missionProfileId'
  Prelude.Text ->
  DeleteMissionProfile
newDeleteMissionProfile :: Text -> DeleteMissionProfile
newDeleteMissionProfile Text
pMissionProfileId_ =
  DeleteMissionProfile' :: Text -> DeleteMissionProfile
DeleteMissionProfile'
    { $sel:missionProfileId:DeleteMissionProfile' :: Text
missionProfileId =
        Text
pMissionProfileId_
    }

-- | UUID of a mission profile.
deleteMissionProfile_missionProfileId :: Lens.Lens' DeleteMissionProfile Prelude.Text
deleteMissionProfile_missionProfileId :: (Text -> f Text) -> DeleteMissionProfile -> f DeleteMissionProfile
deleteMissionProfile_missionProfileId = (DeleteMissionProfile -> Text)
-> (DeleteMissionProfile -> Text -> DeleteMissionProfile)
-> Lens DeleteMissionProfile DeleteMissionProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMissionProfile' {Text
missionProfileId :: Text
$sel:missionProfileId:DeleteMissionProfile' :: DeleteMissionProfile -> Text
missionProfileId} -> Text
missionProfileId) (\s :: DeleteMissionProfile
s@DeleteMissionProfile' {} Text
a -> DeleteMissionProfile
s {$sel:missionProfileId:DeleteMissionProfile' :: Text
missionProfileId = Text
a} :: DeleteMissionProfile)

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

instance Prelude.Hashable DeleteMissionProfile

instance Prelude.NFData DeleteMissionProfile

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

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