{-# 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.PutVerificationStateOnViolation
(
PutVerificationStateOnViolation (..),
newPutVerificationStateOnViolation,
putVerificationStateOnViolation_verificationStateDescription,
putVerificationStateOnViolation_violationId,
putVerificationStateOnViolation_verificationState,
PutVerificationStateOnViolationResponse (..),
newPutVerificationStateOnViolationResponse,
putVerificationStateOnViolationResponse_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 PutVerificationStateOnViolation = PutVerificationStateOnViolation'
{
PutVerificationStateOnViolation -> Maybe Text
verificationStateDescription :: Prelude.Maybe Prelude.Text,
PutVerificationStateOnViolation -> Text
violationId :: Prelude.Text,
PutVerificationStateOnViolation -> VerificationState
verificationState :: VerificationState
}
deriving (PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool
(PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool)
-> (PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool)
-> Eq PutVerificationStateOnViolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool
$c/= :: PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool
== :: PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool
$c== :: PutVerificationStateOnViolation
-> PutVerificationStateOnViolation -> Bool
Prelude.Eq, ReadPrec [PutVerificationStateOnViolation]
ReadPrec PutVerificationStateOnViolation
Int -> ReadS PutVerificationStateOnViolation
ReadS [PutVerificationStateOnViolation]
(Int -> ReadS PutVerificationStateOnViolation)
-> ReadS [PutVerificationStateOnViolation]
-> ReadPrec PutVerificationStateOnViolation
-> ReadPrec [PutVerificationStateOnViolation]
-> Read PutVerificationStateOnViolation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutVerificationStateOnViolation]
$creadListPrec :: ReadPrec [PutVerificationStateOnViolation]
readPrec :: ReadPrec PutVerificationStateOnViolation
$creadPrec :: ReadPrec PutVerificationStateOnViolation
readList :: ReadS [PutVerificationStateOnViolation]
$creadList :: ReadS [PutVerificationStateOnViolation]
readsPrec :: Int -> ReadS PutVerificationStateOnViolation
$creadsPrec :: Int -> ReadS PutVerificationStateOnViolation
Prelude.Read, Int -> PutVerificationStateOnViolation -> ShowS
[PutVerificationStateOnViolation] -> ShowS
PutVerificationStateOnViolation -> String
(Int -> PutVerificationStateOnViolation -> ShowS)
-> (PutVerificationStateOnViolation -> String)
-> ([PutVerificationStateOnViolation] -> ShowS)
-> Show PutVerificationStateOnViolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutVerificationStateOnViolation] -> ShowS
$cshowList :: [PutVerificationStateOnViolation] -> ShowS
show :: PutVerificationStateOnViolation -> String
$cshow :: PutVerificationStateOnViolation -> String
showsPrec :: Int -> PutVerificationStateOnViolation -> ShowS
$cshowsPrec :: Int -> PutVerificationStateOnViolation -> ShowS
Prelude.Show, (forall x.
PutVerificationStateOnViolation
-> Rep PutVerificationStateOnViolation x)
-> (forall x.
Rep PutVerificationStateOnViolation x
-> PutVerificationStateOnViolation)
-> Generic PutVerificationStateOnViolation
forall x.
Rep PutVerificationStateOnViolation x
-> PutVerificationStateOnViolation
forall x.
PutVerificationStateOnViolation
-> Rep PutVerificationStateOnViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutVerificationStateOnViolation x
-> PutVerificationStateOnViolation
$cfrom :: forall x.
PutVerificationStateOnViolation
-> Rep PutVerificationStateOnViolation x
Prelude.Generic)
newPutVerificationStateOnViolation ::
Prelude.Text ->
VerificationState ->
PutVerificationStateOnViolation
newPutVerificationStateOnViolation :: Text -> VerificationState -> PutVerificationStateOnViolation
newPutVerificationStateOnViolation
Text
pViolationId_
VerificationState
pVerificationState_ =
PutVerificationStateOnViolation' :: Maybe Text
-> Text -> VerificationState -> PutVerificationStateOnViolation
PutVerificationStateOnViolation'
{ $sel:verificationStateDescription:PutVerificationStateOnViolation' :: Maybe Text
verificationStateDescription =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:violationId:PutVerificationStateOnViolation' :: Text
violationId = Text
pViolationId_,
$sel:verificationState:PutVerificationStateOnViolation' :: VerificationState
verificationState = VerificationState
pVerificationState_
}
putVerificationStateOnViolation_verificationStateDescription :: Lens.Lens' PutVerificationStateOnViolation (Prelude.Maybe Prelude.Text)
putVerificationStateOnViolation_verificationStateDescription :: (Maybe Text -> f (Maybe Text))
-> PutVerificationStateOnViolation
-> f PutVerificationStateOnViolation
putVerificationStateOnViolation_verificationStateDescription = (PutVerificationStateOnViolation -> Maybe Text)
-> (PutVerificationStateOnViolation
-> Maybe Text -> PutVerificationStateOnViolation)
-> Lens
PutVerificationStateOnViolation
PutVerificationStateOnViolation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVerificationStateOnViolation' {Maybe Text
verificationStateDescription :: Maybe Text
$sel:verificationStateDescription:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> Maybe Text
verificationStateDescription} -> Maybe Text
verificationStateDescription) (\s :: PutVerificationStateOnViolation
s@PutVerificationStateOnViolation' {} Maybe Text
a -> PutVerificationStateOnViolation
s {$sel:verificationStateDescription:PutVerificationStateOnViolation' :: Maybe Text
verificationStateDescription = Maybe Text
a} :: PutVerificationStateOnViolation)
putVerificationStateOnViolation_violationId :: Lens.Lens' PutVerificationStateOnViolation Prelude.Text
putVerificationStateOnViolation_violationId :: (Text -> f Text)
-> PutVerificationStateOnViolation
-> f PutVerificationStateOnViolation
putVerificationStateOnViolation_violationId = (PutVerificationStateOnViolation -> Text)
-> (PutVerificationStateOnViolation
-> Text -> PutVerificationStateOnViolation)
-> Lens
PutVerificationStateOnViolation
PutVerificationStateOnViolation
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVerificationStateOnViolation' {Text
violationId :: Text
$sel:violationId:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> Text
violationId} -> Text
violationId) (\s :: PutVerificationStateOnViolation
s@PutVerificationStateOnViolation' {} Text
a -> PutVerificationStateOnViolation
s {$sel:violationId:PutVerificationStateOnViolation' :: Text
violationId = Text
a} :: PutVerificationStateOnViolation)
putVerificationStateOnViolation_verificationState :: Lens.Lens' PutVerificationStateOnViolation VerificationState
putVerificationStateOnViolation_verificationState :: (VerificationState -> f VerificationState)
-> PutVerificationStateOnViolation
-> f PutVerificationStateOnViolation
putVerificationStateOnViolation_verificationState = (PutVerificationStateOnViolation -> VerificationState)
-> (PutVerificationStateOnViolation
-> VerificationState -> PutVerificationStateOnViolation)
-> Lens
PutVerificationStateOnViolation
PutVerificationStateOnViolation
VerificationState
VerificationState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVerificationStateOnViolation' {VerificationState
verificationState :: VerificationState
$sel:verificationState:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> VerificationState
verificationState} -> VerificationState
verificationState) (\s :: PutVerificationStateOnViolation
s@PutVerificationStateOnViolation' {} VerificationState
a -> PutVerificationStateOnViolation
s {$sel:verificationState:PutVerificationStateOnViolation' :: VerificationState
verificationState = VerificationState
a} :: PutVerificationStateOnViolation)
instance
Core.AWSRequest
PutVerificationStateOnViolation
where
type
AWSResponse PutVerificationStateOnViolation =
PutVerificationStateOnViolationResponse
request :: PutVerificationStateOnViolation
-> Request PutVerificationStateOnViolation
request = Service
-> PutVerificationStateOnViolation
-> Request PutVerificationStateOnViolation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutVerificationStateOnViolation
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutVerificationStateOnViolation)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutVerificationStateOnViolation))
-> Logger
-> Service
-> Proxy PutVerificationStateOnViolation
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutVerificationStateOnViolation)))
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 -> PutVerificationStateOnViolationResponse
PutVerificationStateOnViolationResponse'
(Int -> PutVerificationStateOnViolationResponse)
-> Either String Int
-> Either String PutVerificationStateOnViolationResponse
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
PutVerificationStateOnViolation
instance
Prelude.NFData
PutVerificationStateOnViolation
instance
Core.ToHeaders
PutVerificationStateOnViolation
where
toHeaders :: PutVerificationStateOnViolation -> ResponseHeaders
toHeaders = ResponseHeaders
-> PutVerificationStateOnViolation -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON PutVerificationStateOnViolation where
toJSON :: PutVerificationStateOnViolation -> Value
toJSON PutVerificationStateOnViolation' {Maybe Text
Text
VerificationState
verificationState :: VerificationState
violationId :: Text
verificationStateDescription :: Maybe Text
$sel:verificationState:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> VerificationState
$sel:violationId:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> Text
$sel:verificationStateDescription:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"verificationStateDescription" 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
verificationStateDescription,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"verificationState" Text -> VerificationState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VerificationState
verificationState)
]
)
instance Core.ToPath PutVerificationStateOnViolation where
toPath :: PutVerificationStateOnViolation -> ByteString
toPath PutVerificationStateOnViolation' {Maybe Text
Text
VerificationState
verificationState :: VerificationState
violationId :: Text
verificationStateDescription :: Maybe Text
$sel:verificationState:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> VerificationState
$sel:violationId:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> Text
$sel:verificationStateDescription:PutVerificationStateOnViolation' :: PutVerificationStateOnViolation -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/violations/verification-state/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
violationId
]
instance Core.ToQuery PutVerificationStateOnViolation where
toQuery :: PutVerificationStateOnViolation -> QueryString
toQuery = QueryString -> PutVerificationStateOnViolation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutVerificationStateOnViolationResponse = PutVerificationStateOnViolationResponse'
{
PutVerificationStateOnViolationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool
(PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool)
-> (PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool)
-> Eq PutVerificationStateOnViolationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool
$c/= :: PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool
== :: PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool
$c== :: PutVerificationStateOnViolationResponse
-> PutVerificationStateOnViolationResponse -> Bool
Prelude.Eq, ReadPrec [PutVerificationStateOnViolationResponse]
ReadPrec PutVerificationStateOnViolationResponse
Int -> ReadS PutVerificationStateOnViolationResponse
ReadS [PutVerificationStateOnViolationResponse]
(Int -> ReadS PutVerificationStateOnViolationResponse)
-> ReadS [PutVerificationStateOnViolationResponse]
-> ReadPrec PutVerificationStateOnViolationResponse
-> ReadPrec [PutVerificationStateOnViolationResponse]
-> Read PutVerificationStateOnViolationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutVerificationStateOnViolationResponse]
$creadListPrec :: ReadPrec [PutVerificationStateOnViolationResponse]
readPrec :: ReadPrec PutVerificationStateOnViolationResponse
$creadPrec :: ReadPrec PutVerificationStateOnViolationResponse
readList :: ReadS [PutVerificationStateOnViolationResponse]
$creadList :: ReadS [PutVerificationStateOnViolationResponse]
readsPrec :: Int -> ReadS PutVerificationStateOnViolationResponse
$creadsPrec :: Int -> ReadS PutVerificationStateOnViolationResponse
Prelude.Read, Int -> PutVerificationStateOnViolationResponse -> ShowS
[PutVerificationStateOnViolationResponse] -> ShowS
PutVerificationStateOnViolationResponse -> String
(Int -> PutVerificationStateOnViolationResponse -> ShowS)
-> (PutVerificationStateOnViolationResponse -> String)
-> ([PutVerificationStateOnViolationResponse] -> ShowS)
-> Show PutVerificationStateOnViolationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutVerificationStateOnViolationResponse] -> ShowS
$cshowList :: [PutVerificationStateOnViolationResponse] -> ShowS
show :: PutVerificationStateOnViolationResponse -> String
$cshow :: PutVerificationStateOnViolationResponse -> String
showsPrec :: Int -> PutVerificationStateOnViolationResponse -> ShowS
$cshowsPrec :: Int -> PutVerificationStateOnViolationResponse -> ShowS
Prelude.Show, (forall x.
PutVerificationStateOnViolationResponse
-> Rep PutVerificationStateOnViolationResponse x)
-> (forall x.
Rep PutVerificationStateOnViolationResponse x
-> PutVerificationStateOnViolationResponse)
-> Generic PutVerificationStateOnViolationResponse
forall x.
Rep PutVerificationStateOnViolationResponse x
-> PutVerificationStateOnViolationResponse
forall x.
PutVerificationStateOnViolationResponse
-> Rep PutVerificationStateOnViolationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutVerificationStateOnViolationResponse x
-> PutVerificationStateOnViolationResponse
$cfrom :: forall x.
PutVerificationStateOnViolationResponse
-> Rep PutVerificationStateOnViolationResponse x
Prelude.Generic)
newPutVerificationStateOnViolationResponse ::
Prelude.Int ->
PutVerificationStateOnViolationResponse
newPutVerificationStateOnViolationResponse :: Int -> PutVerificationStateOnViolationResponse
newPutVerificationStateOnViolationResponse
Int
pHttpStatus_ =
PutVerificationStateOnViolationResponse' :: Int -> PutVerificationStateOnViolationResponse
PutVerificationStateOnViolationResponse'
{ $sel:httpStatus:PutVerificationStateOnViolationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putVerificationStateOnViolationResponse_httpStatus :: Lens.Lens' PutVerificationStateOnViolationResponse Prelude.Int
putVerificationStateOnViolationResponse_httpStatus :: (Int -> f Int)
-> PutVerificationStateOnViolationResponse
-> f PutVerificationStateOnViolationResponse
putVerificationStateOnViolationResponse_httpStatus = (PutVerificationStateOnViolationResponse -> Int)
-> (PutVerificationStateOnViolationResponse
-> Int -> PutVerificationStateOnViolationResponse)
-> Lens
PutVerificationStateOnViolationResponse
PutVerificationStateOnViolationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVerificationStateOnViolationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutVerificationStateOnViolationResponse' :: PutVerificationStateOnViolationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutVerificationStateOnViolationResponse
s@PutVerificationStateOnViolationResponse' {} Int
a -> PutVerificationStateOnViolationResponse
s {$sel:httpStatus:PutVerificationStateOnViolationResponse' :: Int
httpStatus = Int
a} :: PutVerificationStateOnViolationResponse)
instance
Prelude.NFData
PutVerificationStateOnViolationResponse