{-# 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.RemoveThingFromThingGroup
(
RemoveThingFromThingGroup (..),
newRemoveThingFromThingGroup,
removeThingFromThingGroup_thingGroupArn,
removeThingFromThingGroup_thingArn,
removeThingFromThingGroup_thingGroupName,
removeThingFromThingGroup_thingName,
RemoveThingFromThingGroupResponse (..),
newRemoveThingFromThingGroupResponse,
removeThingFromThingGroupResponse_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 RemoveThingFromThingGroup = RemoveThingFromThingGroup'
{
RemoveThingFromThingGroup -> Maybe Text
thingGroupArn :: Prelude.Maybe Prelude.Text,
RemoveThingFromThingGroup -> Maybe Text
thingArn :: Prelude.Maybe Prelude.Text,
RemoveThingFromThingGroup -> Maybe Text
thingGroupName :: Prelude.Maybe Prelude.Text,
RemoveThingFromThingGroup -> Maybe Text
thingName :: Prelude.Maybe Prelude.Text
}
deriving (RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool
(RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool)
-> (RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool)
-> Eq RemoveThingFromThingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool
$c/= :: RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool
== :: RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool
$c== :: RemoveThingFromThingGroup -> RemoveThingFromThingGroup -> Bool
Prelude.Eq, ReadPrec [RemoveThingFromThingGroup]
ReadPrec RemoveThingFromThingGroup
Int -> ReadS RemoveThingFromThingGroup
ReadS [RemoveThingFromThingGroup]
(Int -> ReadS RemoveThingFromThingGroup)
-> ReadS [RemoveThingFromThingGroup]
-> ReadPrec RemoveThingFromThingGroup
-> ReadPrec [RemoveThingFromThingGroup]
-> Read RemoveThingFromThingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveThingFromThingGroup]
$creadListPrec :: ReadPrec [RemoveThingFromThingGroup]
readPrec :: ReadPrec RemoveThingFromThingGroup
$creadPrec :: ReadPrec RemoveThingFromThingGroup
readList :: ReadS [RemoveThingFromThingGroup]
$creadList :: ReadS [RemoveThingFromThingGroup]
readsPrec :: Int -> ReadS RemoveThingFromThingGroup
$creadsPrec :: Int -> ReadS RemoveThingFromThingGroup
Prelude.Read, Int -> RemoveThingFromThingGroup -> ShowS
[RemoveThingFromThingGroup] -> ShowS
RemoveThingFromThingGroup -> String
(Int -> RemoveThingFromThingGroup -> ShowS)
-> (RemoveThingFromThingGroup -> String)
-> ([RemoveThingFromThingGroup] -> ShowS)
-> Show RemoveThingFromThingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveThingFromThingGroup] -> ShowS
$cshowList :: [RemoveThingFromThingGroup] -> ShowS
show :: RemoveThingFromThingGroup -> String
$cshow :: RemoveThingFromThingGroup -> String
showsPrec :: Int -> RemoveThingFromThingGroup -> ShowS
$cshowsPrec :: Int -> RemoveThingFromThingGroup -> ShowS
Prelude.Show, (forall x.
RemoveThingFromThingGroup -> Rep RemoveThingFromThingGroup x)
-> (forall x.
Rep RemoveThingFromThingGroup x -> RemoveThingFromThingGroup)
-> Generic RemoveThingFromThingGroup
forall x.
Rep RemoveThingFromThingGroup x -> RemoveThingFromThingGroup
forall x.
RemoveThingFromThingGroup -> Rep RemoveThingFromThingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveThingFromThingGroup x -> RemoveThingFromThingGroup
$cfrom :: forall x.
RemoveThingFromThingGroup -> Rep RemoveThingFromThingGroup x
Prelude.Generic)
newRemoveThingFromThingGroup ::
RemoveThingFromThingGroup
newRemoveThingFromThingGroup :: RemoveThingFromThingGroup
newRemoveThingFromThingGroup =
RemoveThingFromThingGroup' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RemoveThingFromThingGroup
RemoveThingFromThingGroup'
{ $sel:thingGroupArn:RemoveThingFromThingGroup' :: Maybe Text
thingGroupArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingArn:RemoveThingFromThingGroup' :: Maybe Text
thingArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingGroupName:RemoveThingFromThingGroup' :: Maybe Text
thingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingName:RemoveThingFromThingGroup' :: Maybe Text
thingName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
removeThingFromThingGroup_thingGroupArn :: Lens.Lens' RemoveThingFromThingGroup (Prelude.Maybe Prelude.Text)
removeThingFromThingGroup_thingGroupArn :: (Maybe Text -> f (Maybe Text))
-> RemoveThingFromThingGroup -> f RemoveThingFromThingGroup
removeThingFromThingGroup_thingGroupArn = (RemoveThingFromThingGroup -> Maybe Text)
-> (RemoveThingFromThingGroup
-> Maybe Text -> RemoveThingFromThingGroup)
-> Lens
RemoveThingFromThingGroup
RemoveThingFromThingGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveThingFromThingGroup' {Maybe Text
thingGroupArn :: Maybe Text
$sel:thingGroupArn:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
thingGroupArn} -> Maybe Text
thingGroupArn) (\s :: RemoveThingFromThingGroup
s@RemoveThingFromThingGroup' {} Maybe Text
a -> RemoveThingFromThingGroup
s {$sel:thingGroupArn:RemoveThingFromThingGroup' :: Maybe Text
thingGroupArn = Maybe Text
a} :: RemoveThingFromThingGroup)
removeThingFromThingGroup_thingArn :: Lens.Lens' RemoveThingFromThingGroup (Prelude.Maybe Prelude.Text)
removeThingFromThingGroup_thingArn :: (Maybe Text -> f (Maybe Text))
-> RemoveThingFromThingGroup -> f RemoveThingFromThingGroup
removeThingFromThingGroup_thingArn = (RemoveThingFromThingGroup -> Maybe Text)
-> (RemoveThingFromThingGroup
-> Maybe Text -> RemoveThingFromThingGroup)
-> Lens
RemoveThingFromThingGroup
RemoveThingFromThingGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveThingFromThingGroup' {Maybe Text
thingArn :: Maybe Text
$sel:thingArn:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
thingArn} -> Maybe Text
thingArn) (\s :: RemoveThingFromThingGroup
s@RemoveThingFromThingGroup' {} Maybe Text
a -> RemoveThingFromThingGroup
s {$sel:thingArn:RemoveThingFromThingGroup' :: Maybe Text
thingArn = Maybe Text
a} :: RemoveThingFromThingGroup)
removeThingFromThingGroup_thingGroupName :: Lens.Lens' RemoveThingFromThingGroup (Prelude.Maybe Prelude.Text)
removeThingFromThingGroup_thingGroupName :: (Maybe Text -> f (Maybe Text))
-> RemoveThingFromThingGroup -> f RemoveThingFromThingGroup
removeThingFromThingGroup_thingGroupName = (RemoveThingFromThingGroup -> Maybe Text)
-> (RemoveThingFromThingGroup
-> Maybe Text -> RemoveThingFromThingGroup)
-> Lens
RemoveThingFromThingGroup
RemoveThingFromThingGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveThingFromThingGroup' {Maybe Text
thingGroupName :: Maybe Text
$sel:thingGroupName:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
thingGroupName} -> Maybe Text
thingGroupName) (\s :: RemoveThingFromThingGroup
s@RemoveThingFromThingGroup' {} Maybe Text
a -> RemoveThingFromThingGroup
s {$sel:thingGroupName:RemoveThingFromThingGroup' :: Maybe Text
thingGroupName = Maybe Text
a} :: RemoveThingFromThingGroup)
removeThingFromThingGroup_thingName :: Lens.Lens' RemoveThingFromThingGroup (Prelude.Maybe Prelude.Text)
removeThingFromThingGroup_thingName :: (Maybe Text -> f (Maybe Text))
-> RemoveThingFromThingGroup -> f RemoveThingFromThingGroup
removeThingFromThingGroup_thingName = (RemoveThingFromThingGroup -> Maybe Text)
-> (RemoveThingFromThingGroup
-> Maybe Text -> RemoveThingFromThingGroup)
-> Lens
RemoveThingFromThingGroup
RemoveThingFromThingGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveThingFromThingGroup' {Maybe Text
thingName :: Maybe Text
$sel:thingName:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
thingName} -> Maybe Text
thingName) (\s :: RemoveThingFromThingGroup
s@RemoveThingFromThingGroup' {} Maybe Text
a -> RemoveThingFromThingGroup
s {$sel:thingName:RemoveThingFromThingGroup' :: Maybe Text
thingName = Maybe Text
a} :: RemoveThingFromThingGroup)
instance Core.AWSRequest RemoveThingFromThingGroup where
type
AWSResponse RemoveThingFromThingGroup =
RemoveThingFromThingGroupResponse
request :: RemoveThingFromThingGroup -> Request RemoveThingFromThingGroup
request = Service
-> RemoveThingFromThingGroup -> Request RemoveThingFromThingGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RemoveThingFromThingGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveThingFromThingGroup)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse RemoveThingFromThingGroup))
-> Logger
-> Service
-> Proxy RemoveThingFromThingGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveThingFromThingGroup)))
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 -> RemoveThingFromThingGroupResponse
RemoveThingFromThingGroupResponse'
(Int -> RemoveThingFromThingGroupResponse)
-> Either String Int
-> Either String RemoveThingFromThingGroupResponse
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 RemoveThingFromThingGroup
instance Prelude.NFData RemoveThingFromThingGroup
instance Core.ToHeaders RemoveThingFromThingGroup where
toHeaders :: RemoveThingFromThingGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> RemoveThingFromThingGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON RemoveThingFromThingGroup where
toJSON :: RemoveThingFromThingGroup -> Value
toJSON RemoveThingFromThingGroup' {Maybe Text
thingName :: Maybe Text
thingGroupName :: Maybe Text
thingArn :: Maybe Text
thingGroupArn :: Maybe Text
$sel:thingName:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
$sel:thingGroupName:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
$sel:thingArn:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
$sel:thingGroupArn:RemoveThingFromThingGroup' :: RemoveThingFromThingGroup -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"thingGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
thingGroupArn,
(Text
"thingArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
thingArn,
(Text
"thingGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
thingGroupName,
(Text
"thingName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
thingName
]
)
instance Core.ToPath RemoveThingFromThingGroup where
toPath :: RemoveThingFromThingGroup -> ByteString
toPath =
ByteString -> RemoveThingFromThingGroup -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/thing-groups/removeThingFromThingGroup"
instance Core.ToQuery RemoveThingFromThingGroup where
toQuery :: RemoveThingFromThingGroup -> QueryString
toQuery = QueryString -> RemoveThingFromThingGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RemoveThingFromThingGroupResponse = RemoveThingFromThingGroupResponse'
{
RemoveThingFromThingGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool
(RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool)
-> (RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool)
-> Eq RemoveThingFromThingGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool
$c/= :: RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool
== :: RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool
$c== :: RemoveThingFromThingGroupResponse
-> RemoveThingFromThingGroupResponse -> Bool
Prelude.Eq, ReadPrec [RemoveThingFromThingGroupResponse]
ReadPrec RemoveThingFromThingGroupResponse
Int -> ReadS RemoveThingFromThingGroupResponse
ReadS [RemoveThingFromThingGroupResponse]
(Int -> ReadS RemoveThingFromThingGroupResponse)
-> ReadS [RemoveThingFromThingGroupResponse]
-> ReadPrec RemoveThingFromThingGroupResponse
-> ReadPrec [RemoveThingFromThingGroupResponse]
-> Read RemoveThingFromThingGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveThingFromThingGroupResponse]
$creadListPrec :: ReadPrec [RemoveThingFromThingGroupResponse]
readPrec :: ReadPrec RemoveThingFromThingGroupResponse
$creadPrec :: ReadPrec RemoveThingFromThingGroupResponse
readList :: ReadS [RemoveThingFromThingGroupResponse]
$creadList :: ReadS [RemoveThingFromThingGroupResponse]
readsPrec :: Int -> ReadS RemoveThingFromThingGroupResponse
$creadsPrec :: Int -> ReadS RemoveThingFromThingGroupResponse
Prelude.Read, Int -> RemoveThingFromThingGroupResponse -> ShowS
[RemoveThingFromThingGroupResponse] -> ShowS
RemoveThingFromThingGroupResponse -> String
(Int -> RemoveThingFromThingGroupResponse -> ShowS)
-> (RemoveThingFromThingGroupResponse -> String)
-> ([RemoveThingFromThingGroupResponse] -> ShowS)
-> Show RemoveThingFromThingGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveThingFromThingGroupResponse] -> ShowS
$cshowList :: [RemoveThingFromThingGroupResponse] -> ShowS
show :: RemoveThingFromThingGroupResponse -> String
$cshow :: RemoveThingFromThingGroupResponse -> String
showsPrec :: Int -> RemoveThingFromThingGroupResponse -> ShowS
$cshowsPrec :: Int -> RemoveThingFromThingGroupResponse -> ShowS
Prelude.Show, (forall x.
RemoveThingFromThingGroupResponse
-> Rep RemoveThingFromThingGroupResponse x)
-> (forall x.
Rep RemoveThingFromThingGroupResponse x
-> RemoveThingFromThingGroupResponse)
-> Generic RemoveThingFromThingGroupResponse
forall x.
Rep RemoveThingFromThingGroupResponse x
-> RemoveThingFromThingGroupResponse
forall x.
RemoveThingFromThingGroupResponse
-> Rep RemoveThingFromThingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveThingFromThingGroupResponse x
-> RemoveThingFromThingGroupResponse
$cfrom :: forall x.
RemoveThingFromThingGroupResponse
-> Rep RemoveThingFromThingGroupResponse x
Prelude.Generic)
newRemoveThingFromThingGroupResponse ::
Prelude.Int ->
RemoveThingFromThingGroupResponse
newRemoveThingFromThingGroupResponse :: Int -> RemoveThingFromThingGroupResponse
newRemoveThingFromThingGroupResponse Int
pHttpStatus_ =
RemoveThingFromThingGroupResponse' :: Int -> RemoveThingFromThingGroupResponse
RemoveThingFromThingGroupResponse'
{ $sel:httpStatus:RemoveThingFromThingGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
removeThingFromThingGroupResponse_httpStatus :: Lens.Lens' RemoveThingFromThingGroupResponse Prelude.Int
removeThingFromThingGroupResponse_httpStatus :: (Int -> f Int)
-> RemoveThingFromThingGroupResponse
-> f RemoveThingFromThingGroupResponse
removeThingFromThingGroupResponse_httpStatus = (RemoveThingFromThingGroupResponse -> Int)
-> (RemoveThingFromThingGroupResponse
-> Int -> RemoveThingFromThingGroupResponse)
-> Lens
RemoveThingFromThingGroupResponse
RemoveThingFromThingGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveThingFromThingGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveThingFromThingGroupResponse' :: RemoveThingFromThingGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveThingFromThingGroupResponse
s@RemoveThingFromThingGroupResponse' {} Int
a -> RemoveThingFromThingGroupResponse
s {$sel:httpStatus:RemoveThingFromThingGroupResponse' :: Int
httpStatus = Int
a} :: RemoveThingFromThingGroupResponse)
instance
Prelude.NFData
RemoveThingFromThingGroupResponse