{-# 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.IoTThingsGraph.DeprecateSystemTemplate
-- 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)
--
-- Deprecates the specified system.
module Amazonka.IoTThingsGraph.DeprecateSystemTemplate
  ( -- * Creating a Request
    DeprecateSystemTemplate (..),
    newDeprecateSystemTemplate,

    -- * Request Lenses
    deprecateSystemTemplate_id,

    -- * Destructuring the Response
    DeprecateSystemTemplateResponse (..),
    newDeprecateSystemTemplateResponse,

    -- * Response Lenses
    deprecateSystemTemplateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTThingsGraph.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:/ 'newDeprecateSystemTemplate' smart constructor.
data DeprecateSystemTemplate = DeprecateSystemTemplate'
  { -- | The ID of the system to delete.
    --
    -- The ID should be in the following format.
    --
    -- @urn:tdm:REGION\/ACCOUNT ID\/default:system:SYSTEMNAME@
    DeprecateSystemTemplate -> Text
id :: Prelude.Text
  }
  deriving (DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool
(DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool)
-> (DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool)
-> Eq DeprecateSystemTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool
$c/= :: DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool
== :: DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool
$c== :: DeprecateSystemTemplate -> DeprecateSystemTemplate -> Bool
Prelude.Eq, ReadPrec [DeprecateSystemTemplate]
ReadPrec DeprecateSystemTemplate
Int -> ReadS DeprecateSystemTemplate
ReadS [DeprecateSystemTemplate]
(Int -> ReadS DeprecateSystemTemplate)
-> ReadS [DeprecateSystemTemplate]
-> ReadPrec DeprecateSystemTemplate
-> ReadPrec [DeprecateSystemTemplate]
-> Read DeprecateSystemTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeprecateSystemTemplate]
$creadListPrec :: ReadPrec [DeprecateSystemTemplate]
readPrec :: ReadPrec DeprecateSystemTemplate
$creadPrec :: ReadPrec DeprecateSystemTemplate
readList :: ReadS [DeprecateSystemTemplate]
$creadList :: ReadS [DeprecateSystemTemplate]
readsPrec :: Int -> ReadS DeprecateSystemTemplate
$creadsPrec :: Int -> ReadS DeprecateSystemTemplate
Prelude.Read, Int -> DeprecateSystemTemplate -> ShowS
[DeprecateSystemTemplate] -> ShowS
DeprecateSystemTemplate -> String
(Int -> DeprecateSystemTemplate -> ShowS)
-> (DeprecateSystemTemplate -> String)
-> ([DeprecateSystemTemplate] -> ShowS)
-> Show DeprecateSystemTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeprecateSystemTemplate] -> ShowS
$cshowList :: [DeprecateSystemTemplate] -> ShowS
show :: DeprecateSystemTemplate -> String
$cshow :: DeprecateSystemTemplate -> String
showsPrec :: Int -> DeprecateSystemTemplate -> ShowS
$cshowsPrec :: Int -> DeprecateSystemTemplate -> ShowS
Prelude.Show, (forall x.
 DeprecateSystemTemplate -> Rep DeprecateSystemTemplate x)
-> (forall x.
    Rep DeprecateSystemTemplate x -> DeprecateSystemTemplate)
-> Generic DeprecateSystemTemplate
forall x. Rep DeprecateSystemTemplate x -> DeprecateSystemTemplate
forall x. DeprecateSystemTemplate -> Rep DeprecateSystemTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeprecateSystemTemplate x -> DeprecateSystemTemplate
$cfrom :: forall x. DeprecateSystemTemplate -> Rep DeprecateSystemTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeprecateSystemTemplate' 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:
--
-- 'id', 'deprecateSystemTemplate_id' - The ID of the system to delete.
--
-- The ID should be in the following format.
--
-- @urn:tdm:REGION\/ACCOUNT ID\/default:system:SYSTEMNAME@
newDeprecateSystemTemplate ::
  -- | 'id'
  Prelude.Text ->
  DeprecateSystemTemplate
newDeprecateSystemTemplate :: Text -> DeprecateSystemTemplate
newDeprecateSystemTemplate Text
pId_ =
  DeprecateSystemTemplate' :: Text -> DeprecateSystemTemplate
DeprecateSystemTemplate' {$sel:id:DeprecateSystemTemplate' :: Text
id = Text
pId_}

-- | The ID of the system to delete.
--
-- The ID should be in the following format.
--
-- @urn:tdm:REGION\/ACCOUNT ID\/default:system:SYSTEMNAME@
deprecateSystemTemplate_id :: Lens.Lens' DeprecateSystemTemplate Prelude.Text
deprecateSystemTemplate_id :: (Text -> f Text)
-> DeprecateSystemTemplate -> f DeprecateSystemTemplate
deprecateSystemTemplate_id = (DeprecateSystemTemplate -> Text)
-> (DeprecateSystemTemplate -> Text -> DeprecateSystemTemplate)
-> Lens DeprecateSystemTemplate DeprecateSystemTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprecateSystemTemplate' {Text
id :: Text
$sel:id:DeprecateSystemTemplate' :: DeprecateSystemTemplate -> Text
id} -> Text
id) (\s :: DeprecateSystemTemplate
s@DeprecateSystemTemplate' {} Text
a -> DeprecateSystemTemplate
s {$sel:id:DeprecateSystemTemplate' :: Text
id = Text
a} :: DeprecateSystemTemplate)

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

instance Prelude.NFData DeprecateSystemTemplate

instance Core.ToHeaders DeprecateSystemTemplate where
  toHeaders :: DeprecateSystemTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeprecateSystemTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"IotThingsGraphFrontEndService.DeprecateSystemTemplate" ::
                          Prelude.ByteString
                      ),
            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 DeprecateSystemTemplate where
  toJSON :: DeprecateSystemTemplate -> Value
toJSON DeprecateSystemTemplate' {Text
id :: Text
$sel:id:DeprecateSystemTemplate' :: DeprecateSystemTemplate -> Text
..} =
    [Pair] -> Value
Core.object
      ([Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)])

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

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

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

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

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

instance
  Prelude.NFData
    DeprecateSystemTemplateResponse