{-# 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.IoTDeviceAdvisor.DeleteSuiteDefinition
-- 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 Device Advisor test suite.
module Amazonka.IoTDeviceAdvisor.DeleteSuiteDefinition
  ( -- * Creating a Request
    DeleteSuiteDefinition (..),
    newDeleteSuiteDefinition,

    -- * Request Lenses
    deleteSuiteDefinition_suiteDefinitionId,

    -- * Destructuring the Response
    DeleteSuiteDefinitionResponse (..),
    newDeleteSuiteDefinitionResponse,

    -- * Response Lenses
    deleteSuiteDefinitionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTDeviceAdvisor.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:/ 'newDeleteSuiteDefinition' smart constructor.
data DeleteSuiteDefinition = DeleteSuiteDefinition'
  { -- | Suite definition Id of the test suite to be deleted.
    DeleteSuiteDefinition -> Text
suiteDefinitionId :: Prelude.Text
  }
  deriving (DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool
(DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool)
-> (DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool)
-> Eq DeleteSuiteDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool
$c/= :: DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool
== :: DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool
$c== :: DeleteSuiteDefinition -> DeleteSuiteDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteSuiteDefinition]
ReadPrec DeleteSuiteDefinition
Int -> ReadS DeleteSuiteDefinition
ReadS [DeleteSuiteDefinition]
(Int -> ReadS DeleteSuiteDefinition)
-> ReadS [DeleteSuiteDefinition]
-> ReadPrec DeleteSuiteDefinition
-> ReadPrec [DeleteSuiteDefinition]
-> Read DeleteSuiteDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSuiteDefinition]
$creadListPrec :: ReadPrec [DeleteSuiteDefinition]
readPrec :: ReadPrec DeleteSuiteDefinition
$creadPrec :: ReadPrec DeleteSuiteDefinition
readList :: ReadS [DeleteSuiteDefinition]
$creadList :: ReadS [DeleteSuiteDefinition]
readsPrec :: Int -> ReadS DeleteSuiteDefinition
$creadsPrec :: Int -> ReadS DeleteSuiteDefinition
Prelude.Read, Int -> DeleteSuiteDefinition -> ShowS
[DeleteSuiteDefinition] -> ShowS
DeleteSuiteDefinition -> String
(Int -> DeleteSuiteDefinition -> ShowS)
-> (DeleteSuiteDefinition -> String)
-> ([DeleteSuiteDefinition] -> ShowS)
-> Show DeleteSuiteDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSuiteDefinition] -> ShowS
$cshowList :: [DeleteSuiteDefinition] -> ShowS
show :: DeleteSuiteDefinition -> String
$cshow :: DeleteSuiteDefinition -> String
showsPrec :: Int -> DeleteSuiteDefinition -> ShowS
$cshowsPrec :: Int -> DeleteSuiteDefinition -> ShowS
Prelude.Show, (forall x. DeleteSuiteDefinition -> Rep DeleteSuiteDefinition x)
-> (forall x. Rep DeleteSuiteDefinition x -> DeleteSuiteDefinition)
-> Generic DeleteSuiteDefinition
forall x. Rep DeleteSuiteDefinition x -> DeleteSuiteDefinition
forall x. DeleteSuiteDefinition -> Rep DeleteSuiteDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSuiteDefinition x -> DeleteSuiteDefinition
$cfrom :: forall x. DeleteSuiteDefinition -> Rep DeleteSuiteDefinition x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSuiteDefinition' 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:
--
-- 'suiteDefinitionId', 'deleteSuiteDefinition_suiteDefinitionId' - Suite definition Id of the test suite to be deleted.
newDeleteSuiteDefinition ::
  -- | 'suiteDefinitionId'
  Prelude.Text ->
  DeleteSuiteDefinition
newDeleteSuiteDefinition :: Text -> DeleteSuiteDefinition
newDeleteSuiteDefinition Text
pSuiteDefinitionId_ =
  DeleteSuiteDefinition' :: Text -> DeleteSuiteDefinition
DeleteSuiteDefinition'
    { $sel:suiteDefinitionId:DeleteSuiteDefinition' :: Text
suiteDefinitionId =
        Text
pSuiteDefinitionId_
    }

-- | Suite definition Id of the test suite to be deleted.
deleteSuiteDefinition_suiteDefinitionId :: Lens.Lens' DeleteSuiteDefinition Prelude.Text
deleteSuiteDefinition_suiteDefinitionId :: (Text -> f Text)
-> DeleteSuiteDefinition -> f DeleteSuiteDefinition
deleteSuiteDefinition_suiteDefinitionId = (DeleteSuiteDefinition -> Text)
-> (DeleteSuiteDefinition -> Text -> DeleteSuiteDefinition)
-> Lens DeleteSuiteDefinition DeleteSuiteDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSuiteDefinition' {Text
suiteDefinitionId :: Text
$sel:suiteDefinitionId:DeleteSuiteDefinition' :: DeleteSuiteDefinition -> Text
suiteDefinitionId} -> Text
suiteDefinitionId) (\s :: DeleteSuiteDefinition
s@DeleteSuiteDefinition' {} Text
a -> DeleteSuiteDefinition
s {$sel:suiteDefinitionId:DeleteSuiteDefinition' :: Text
suiteDefinitionId = Text
a} :: DeleteSuiteDefinition)

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

instance Prelude.NFData DeleteSuiteDefinition

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

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

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

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

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

instance Prelude.NFData DeleteSuiteDefinitionResponse