{-# 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 #-}
module Amazonka.IoT.DeprecateThingType
(
DeprecateThingType (..),
newDeprecateThingType,
deprecateThingType_undoDeprecate,
deprecateThingType_thingTypeName,
DeprecateThingTypeResponse (..),
newDeprecateThingTypeResponse,
deprecateThingTypeResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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
data DeprecateThingType = DeprecateThingType'
{
DeprecateThingType -> Maybe Bool
undoDeprecate :: Prelude.Maybe Prelude.Bool,
DeprecateThingType -> Text
thingTypeName :: Prelude.Text
}
deriving (DeprecateThingType -> DeprecateThingType -> Bool
(DeprecateThingType -> DeprecateThingType -> Bool)
-> (DeprecateThingType -> DeprecateThingType -> Bool)
-> Eq DeprecateThingType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeprecateThingType -> DeprecateThingType -> Bool
$c/= :: DeprecateThingType -> DeprecateThingType -> Bool
== :: DeprecateThingType -> DeprecateThingType -> Bool
$c== :: DeprecateThingType -> DeprecateThingType -> Bool
Prelude.Eq, ReadPrec [DeprecateThingType]
ReadPrec DeprecateThingType
Int -> ReadS DeprecateThingType
ReadS [DeprecateThingType]
(Int -> ReadS DeprecateThingType)
-> ReadS [DeprecateThingType]
-> ReadPrec DeprecateThingType
-> ReadPrec [DeprecateThingType]
-> Read DeprecateThingType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeprecateThingType]
$creadListPrec :: ReadPrec [DeprecateThingType]
readPrec :: ReadPrec DeprecateThingType
$creadPrec :: ReadPrec DeprecateThingType
readList :: ReadS [DeprecateThingType]
$creadList :: ReadS [DeprecateThingType]
readsPrec :: Int -> ReadS DeprecateThingType
$creadsPrec :: Int -> ReadS DeprecateThingType
Prelude.Read, Int -> DeprecateThingType -> ShowS
[DeprecateThingType] -> ShowS
DeprecateThingType -> String
(Int -> DeprecateThingType -> ShowS)
-> (DeprecateThingType -> String)
-> ([DeprecateThingType] -> ShowS)
-> Show DeprecateThingType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeprecateThingType] -> ShowS
$cshowList :: [DeprecateThingType] -> ShowS
show :: DeprecateThingType -> String
$cshow :: DeprecateThingType -> String
showsPrec :: Int -> DeprecateThingType -> ShowS
$cshowsPrec :: Int -> DeprecateThingType -> ShowS
Prelude.Show, (forall x. DeprecateThingType -> Rep DeprecateThingType x)
-> (forall x. Rep DeprecateThingType x -> DeprecateThingType)
-> Generic DeprecateThingType
forall x. Rep DeprecateThingType x -> DeprecateThingType
forall x. DeprecateThingType -> Rep DeprecateThingType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeprecateThingType x -> DeprecateThingType
$cfrom :: forall x. DeprecateThingType -> Rep DeprecateThingType x
Prelude.Generic)
newDeprecateThingType ::
Prelude.Text ->
DeprecateThingType
newDeprecateThingType :: Text -> DeprecateThingType
newDeprecateThingType Text
pThingTypeName_ =
DeprecateThingType' :: Maybe Bool -> Text -> DeprecateThingType
DeprecateThingType'
{ $sel:undoDeprecate:DeprecateThingType' :: Maybe Bool
undoDeprecate =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:thingTypeName:DeprecateThingType' :: Text
thingTypeName = Text
pThingTypeName_
}
deprecateThingType_undoDeprecate :: Lens.Lens' DeprecateThingType (Prelude.Maybe Prelude.Bool)
deprecateThingType_undoDeprecate :: (Maybe Bool -> f (Maybe Bool))
-> DeprecateThingType -> f DeprecateThingType
deprecateThingType_undoDeprecate = (DeprecateThingType -> Maybe Bool)
-> (DeprecateThingType -> Maybe Bool -> DeprecateThingType)
-> Lens
DeprecateThingType DeprecateThingType (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprecateThingType' {Maybe Bool
undoDeprecate :: Maybe Bool
$sel:undoDeprecate:DeprecateThingType' :: DeprecateThingType -> Maybe Bool
undoDeprecate} -> Maybe Bool
undoDeprecate) (\s :: DeprecateThingType
s@DeprecateThingType' {} Maybe Bool
a -> DeprecateThingType
s {$sel:undoDeprecate:DeprecateThingType' :: Maybe Bool
undoDeprecate = Maybe Bool
a} :: DeprecateThingType)
deprecateThingType_thingTypeName :: Lens.Lens' DeprecateThingType Prelude.Text
deprecateThingType_thingTypeName :: (Text -> f Text) -> DeprecateThingType -> f DeprecateThingType
deprecateThingType_thingTypeName = (DeprecateThingType -> Text)
-> (DeprecateThingType -> Text -> DeprecateThingType)
-> Lens DeprecateThingType DeprecateThingType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprecateThingType' {Text
thingTypeName :: Text
$sel:thingTypeName:DeprecateThingType' :: DeprecateThingType -> Text
thingTypeName} -> Text
thingTypeName) (\s :: DeprecateThingType
s@DeprecateThingType' {} Text
a -> DeprecateThingType
s {$sel:thingTypeName:DeprecateThingType' :: Text
thingTypeName = Text
a} :: DeprecateThingType)
instance Core.AWSRequest DeprecateThingType where
type
AWSResponse DeprecateThingType =
DeprecateThingTypeResponse
request :: DeprecateThingType -> Request DeprecateThingType
request = Service -> DeprecateThingType -> Request DeprecateThingType
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeprecateThingType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeprecateThingType)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeprecateThingType))
-> Logger
-> Service
-> Proxy DeprecateThingType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeprecateThingType)))
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 -> DeprecateThingTypeResponse
DeprecateThingTypeResponse'
(Int -> DeprecateThingTypeResponse)
-> Either String Int -> Either String DeprecateThingTypeResponse
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 DeprecateThingType
instance Prelude.NFData DeprecateThingType
instance Core.ToHeaders DeprecateThingType where
toHeaders :: DeprecateThingType -> ResponseHeaders
toHeaders = ResponseHeaders -> DeprecateThingType -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON DeprecateThingType where
toJSON :: DeprecateThingType -> Value
toJSON DeprecateThingType' {Maybe Bool
Text
thingTypeName :: Text
undoDeprecate :: Maybe Bool
$sel:thingTypeName:DeprecateThingType' :: DeprecateThingType -> Text
$sel:undoDeprecate:DeprecateThingType' :: DeprecateThingType -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"undoDeprecate" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
undoDeprecate
]
)
instance Core.ToPath DeprecateThingType where
toPath :: DeprecateThingType -> ByteString
toPath DeprecateThingType' {Maybe Bool
Text
thingTypeName :: Text
undoDeprecate :: Maybe Bool
$sel:thingTypeName:DeprecateThingType' :: DeprecateThingType -> Text
$sel:undoDeprecate:DeprecateThingType' :: DeprecateThingType -> Maybe Bool
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/thing-types/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
thingTypeName,
ByteString
"/deprecate"
]
instance Core.ToQuery DeprecateThingType where
toQuery :: DeprecateThingType -> QueryString
toQuery = QueryString -> DeprecateThingType -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeprecateThingTypeResponse = DeprecateThingTypeResponse'
{
DeprecateThingTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeprecateThingTypeResponse -> DeprecateThingTypeResponse -> Bool
(DeprecateThingTypeResponse -> DeprecateThingTypeResponse -> Bool)
-> (DeprecateThingTypeResponse
-> DeprecateThingTypeResponse -> Bool)
-> Eq DeprecateThingTypeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeprecateThingTypeResponse -> DeprecateThingTypeResponse -> Bool
$c/= :: DeprecateThingTypeResponse -> DeprecateThingTypeResponse -> Bool
== :: DeprecateThingTypeResponse -> DeprecateThingTypeResponse -> Bool
$c== :: DeprecateThingTypeResponse -> DeprecateThingTypeResponse -> Bool
Prelude.Eq, ReadPrec [DeprecateThingTypeResponse]
ReadPrec DeprecateThingTypeResponse
Int -> ReadS DeprecateThingTypeResponse
ReadS [DeprecateThingTypeResponse]
(Int -> ReadS DeprecateThingTypeResponse)
-> ReadS [DeprecateThingTypeResponse]
-> ReadPrec DeprecateThingTypeResponse
-> ReadPrec [DeprecateThingTypeResponse]
-> Read DeprecateThingTypeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeprecateThingTypeResponse]
$creadListPrec :: ReadPrec [DeprecateThingTypeResponse]
readPrec :: ReadPrec DeprecateThingTypeResponse
$creadPrec :: ReadPrec DeprecateThingTypeResponse
readList :: ReadS [DeprecateThingTypeResponse]
$creadList :: ReadS [DeprecateThingTypeResponse]
readsPrec :: Int -> ReadS DeprecateThingTypeResponse
$creadsPrec :: Int -> ReadS DeprecateThingTypeResponse
Prelude.Read, Int -> DeprecateThingTypeResponse -> ShowS
[DeprecateThingTypeResponse] -> ShowS
DeprecateThingTypeResponse -> String
(Int -> DeprecateThingTypeResponse -> ShowS)
-> (DeprecateThingTypeResponse -> String)
-> ([DeprecateThingTypeResponse] -> ShowS)
-> Show DeprecateThingTypeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeprecateThingTypeResponse] -> ShowS
$cshowList :: [DeprecateThingTypeResponse] -> ShowS
show :: DeprecateThingTypeResponse -> String
$cshow :: DeprecateThingTypeResponse -> String
showsPrec :: Int -> DeprecateThingTypeResponse -> ShowS
$cshowsPrec :: Int -> DeprecateThingTypeResponse -> ShowS
Prelude.Show, (forall x.
DeprecateThingTypeResponse -> Rep DeprecateThingTypeResponse x)
-> (forall x.
Rep DeprecateThingTypeResponse x -> DeprecateThingTypeResponse)
-> Generic DeprecateThingTypeResponse
forall x.
Rep DeprecateThingTypeResponse x -> DeprecateThingTypeResponse
forall x.
DeprecateThingTypeResponse -> Rep DeprecateThingTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeprecateThingTypeResponse x -> DeprecateThingTypeResponse
$cfrom :: forall x.
DeprecateThingTypeResponse -> Rep DeprecateThingTypeResponse x
Prelude.Generic)
newDeprecateThingTypeResponse ::
Prelude.Int ->
DeprecateThingTypeResponse
newDeprecateThingTypeResponse :: Int -> DeprecateThingTypeResponse
newDeprecateThingTypeResponse Int
pHttpStatus_ =
DeprecateThingTypeResponse' :: Int -> DeprecateThingTypeResponse
DeprecateThingTypeResponse'
{ $sel:httpStatus:DeprecateThingTypeResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deprecateThingTypeResponse_httpStatus :: Lens.Lens' DeprecateThingTypeResponse Prelude.Int
deprecateThingTypeResponse_httpStatus :: (Int -> f Int)
-> DeprecateThingTypeResponse -> f DeprecateThingTypeResponse
deprecateThingTypeResponse_httpStatus = (DeprecateThingTypeResponse -> Int)
-> (DeprecateThingTypeResponse
-> Int -> DeprecateThingTypeResponse)
-> Lens
DeprecateThingTypeResponse DeprecateThingTypeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprecateThingTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeprecateThingTypeResponse' :: DeprecateThingTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeprecateThingTypeResponse
s@DeprecateThingTypeResponse' {} Int
a -> DeprecateThingTypeResponse
s {$sel:httpStatus:DeprecateThingTypeResponse' :: Int
httpStatus = Int
a} :: DeprecateThingTypeResponse)
instance Prelude.NFData DeprecateThingTypeResponse