{-# 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.Evidently.TestSegmentPattern
(
TestSegmentPattern (..),
newTestSegmentPattern,
testSegmentPattern_pattern,
testSegmentPattern_payload,
TestSegmentPatternResponse (..),
newTestSegmentPatternResponse,
testSegmentPatternResponse_httpStatus,
testSegmentPatternResponse_match,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Evidently.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data TestSegmentPattern = TestSegmentPattern'
{
TestSegmentPattern -> Text
pattern' :: Prelude.Text,
TestSegmentPattern -> Text
payload :: Prelude.Text
}
deriving (TestSegmentPattern -> TestSegmentPattern -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestSegmentPattern -> TestSegmentPattern -> Bool
$c/= :: TestSegmentPattern -> TestSegmentPattern -> Bool
== :: TestSegmentPattern -> TestSegmentPattern -> Bool
$c== :: TestSegmentPattern -> TestSegmentPattern -> Bool
Prelude.Eq, ReadPrec [TestSegmentPattern]
ReadPrec TestSegmentPattern
Int -> ReadS TestSegmentPattern
ReadS [TestSegmentPattern]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestSegmentPattern]
$creadListPrec :: ReadPrec [TestSegmentPattern]
readPrec :: ReadPrec TestSegmentPattern
$creadPrec :: ReadPrec TestSegmentPattern
readList :: ReadS [TestSegmentPattern]
$creadList :: ReadS [TestSegmentPattern]
readsPrec :: Int -> ReadS TestSegmentPattern
$creadsPrec :: Int -> ReadS TestSegmentPattern
Prelude.Read, Int -> TestSegmentPattern -> ShowS
[TestSegmentPattern] -> ShowS
TestSegmentPattern -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestSegmentPattern] -> ShowS
$cshowList :: [TestSegmentPattern] -> ShowS
show :: TestSegmentPattern -> String
$cshow :: TestSegmentPattern -> String
showsPrec :: Int -> TestSegmentPattern -> ShowS
$cshowsPrec :: Int -> TestSegmentPattern -> ShowS
Prelude.Show, forall x. Rep TestSegmentPattern x -> TestSegmentPattern
forall x. TestSegmentPattern -> Rep TestSegmentPattern x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestSegmentPattern x -> TestSegmentPattern
$cfrom :: forall x. TestSegmentPattern -> Rep TestSegmentPattern x
Prelude.Generic)
newTestSegmentPattern ::
Prelude.Text ->
Prelude.Text ->
TestSegmentPattern
newTestSegmentPattern :: Text -> Text -> TestSegmentPattern
newTestSegmentPattern Text
pPattern_ Text
pPayload_ =
TestSegmentPattern'
{ $sel:pattern':TestSegmentPattern' :: Text
pattern' = Text
pPattern_,
$sel:payload:TestSegmentPattern' :: Text
payload = Text
pPayload_
}
testSegmentPattern_pattern :: Lens.Lens' TestSegmentPattern Prelude.Text
testSegmentPattern_pattern :: Lens' TestSegmentPattern Text
testSegmentPattern_pattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestSegmentPattern' {Text
pattern' :: Text
$sel:pattern':TestSegmentPattern' :: TestSegmentPattern -> Text
pattern'} -> Text
pattern') (\s :: TestSegmentPattern
s@TestSegmentPattern' {} Text
a -> TestSegmentPattern
s {$sel:pattern':TestSegmentPattern' :: Text
pattern' = Text
a} :: TestSegmentPattern)
testSegmentPattern_payload :: Lens.Lens' TestSegmentPattern Prelude.Text
testSegmentPattern_payload :: Lens' TestSegmentPattern Text
testSegmentPattern_payload = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestSegmentPattern' {Text
payload :: Text
$sel:payload:TestSegmentPattern' :: TestSegmentPattern -> Text
payload} -> Text
payload) (\s :: TestSegmentPattern
s@TestSegmentPattern' {} Text
a -> TestSegmentPattern
s {$sel:payload:TestSegmentPattern' :: Text
payload = Text
a} :: TestSegmentPattern)
instance Core.AWSRequest TestSegmentPattern where
type
AWSResponse TestSegmentPattern =
TestSegmentPatternResponse
request :: (Service -> Service)
-> TestSegmentPattern -> Request TestSegmentPattern
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy TestSegmentPattern
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TestSegmentPattern)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Bool -> TestSegmentPatternResponse
TestSegmentPatternResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"match")
)
instance Prelude.Hashable TestSegmentPattern where
hashWithSalt :: Int -> TestSegmentPattern -> Int
hashWithSalt Int
_salt TestSegmentPattern' {Text
payload :: Text
pattern' :: Text
$sel:payload:TestSegmentPattern' :: TestSegmentPattern -> Text
$sel:pattern':TestSegmentPattern' :: TestSegmentPattern -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pattern'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
payload
instance Prelude.NFData TestSegmentPattern where
rnf :: TestSegmentPattern -> ()
rnf TestSegmentPattern' {Text
payload :: Text
pattern' :: Text
$sel:payload:TestSegmentPattern' :: TestSegmentPattern -> Text
$sel:pattern':TestSegmentPattern' :: TestSegmentPattern -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
pattern'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
payload
instance Data.ToHeaders TestSegmentPattern where
toHeaders :: TestSegmentPattern -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON TestSegmentPattern where
toJSON :: TestSegmentPattern -> Value
toJSON TestSegmentPattern' {Text
payload :: Text
pattern' :: Text
$sel:payload:TestSegmentPattern' :: TestSegmentPattern -> Text
$sel:pattern':TestSegmentPattern' :: TestSegmentPattern -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"pattern" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
pattern'),
forall a. a -> Maybe a
Prelude.Just (Key
"payload" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
payload)
]
)
instance Data.ToPath TestSegmentPattern where
toPath :: TestSegmentPattern -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/test-segment-pattern"
instance Data.ToQuery TestSegmentPattern where
toQuery :: TestSegmentPattern -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data TestSegmentPatternResponse = TestSegmentPatternResponse'
{
TestSegmentPatternResponse -> Int
httpStatus :: Prelude.Int,
TestSegmentPatternResponse -> Bool
match :: Prelude.Bool
}
deriving (TestSegmentPatternResponse -> TestSegmentPatternResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestSegmentPatternResponse -> TestSegmentPatternResponse -> Bool
$c/= :: TestSegmentPatternResponse -> TestSegmentPatternResponse -> Bool
== :: TestSegmentPatternResponse -> TestSegmentPatternResponse -> Bool
$c== :: TestSegmentPatternResponse -> TestSegmentPatternResponse -> Bool
Prelude.Eq, ReadPrec [TestSegmentPatternResponse]
ReadPrec TestSegmentPatternResponse
Int -> ReadS TestSegmentPatternResponse
ReadS [TestSegmentPatternResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestSegmentPatternResponse]
$creadListPrec :: ReadPrec [TestSegmentPatternResponse]
readPrec :: ReadPrec TestSegmentPatternResponse
$creadPrec :: ReadPrec TestSegmentPatternResponse
readList :: ReadS [TestSegmentPatternResponse]
$creadList :: ReadS [TestSegmentPatternResponse]
readsPrec :: Int -> ReadS TestSegmentPatternResponse
$creadsPrec :: Int -> ReadS TestSegmentPatternResponse
Prelude.Read, Int -> TestSegmentPatternResponse -> ShowS
[TestSegmentPatternResponse] -> ShowS
TestSegmentPatternResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestSegmentPatternResponse] -> ShowS
$cshowList :: [TestSegmentPatternResponse] -> ShowS
show :: TestSegmentPatternResponse -> String
$cshow :: TestSegmentPatternResponse -> String
showsPrec :: Int -> TestSegmentPatternResponse -> ShowS
$cshowsPrec :: Int -> TestSegmentPatternResponse -> ShowS
Prelude.Show, forall x.
Rep TestSegmentPatternResponse x -> TestSegmentPatternResponse
forall x.
TestSegmentPatternResponse -> Rep TestSegmentPatternResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestSegmentPatternResponse x -> TestSegmentPatternResponse
$cfrom :: forall x.
TestSegmentPatternResponse -> Rep TestSegmentPatternResponse x
Prelude.Generic)
newTestSegmentPatternResponse ::
Prelude.Int ->
Prelude.Bool ->
TestSegmentPatternResponse
newTestSegmentPatternResponse :: Int -> Bool -> TestSegmentPatternResponse
newTestSegmentPatternResponse Int
pHttpStatus_ Bool
pMatch_ =
TestSegmentPatternResponse'
{ $sel:httpStatus:TestSegmentPatternResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:match:TestSegmentPatternResponse' :: Bool
match = Bool
pMatch_
}
testSegmentPatternResponse_httpStatus :: Lens.Lens' TestSegmentPatternResponse Prelude.Int
testSegmentPatternResponse_httpStatus :: Lens' TestSegmentPatternResponse Int
testSegmentPatternResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestSegmentPatternResponse' {Int
httpStatus :: Int
$sel:httpStatus:TestSegmentPatternResponse' :: TestSegmentPatternResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TestSegmentPatternResponse
s@TestSegmentPatternResponse' {} Int
a -> TestSegmentPatternResponse
s {$sel:httpStatus:TestSegmentPatternResponse' :: Int
httpStatus = Int
a} :: TestSegmentPatternResponse)
testSegmentPatternResponse_match :: Lens.Lens' TestSegmentPatternResponse Prelude.Bool
testSegmentPatternResponse_match :: Lens' TestSegmentPatternResponse Bool
testSegmentPatternResponse_match = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestSegmentPatternResponse' {Bool
match :: Bool
$sel:match:TestSegmentPatternResponse' :: TestSegmentPatternResponse -> Bool
match} -> Bool
match) (\s :: TestSegmentPatternResponse
s@TestSegmentPatternResponse' {} Bool
a -> TestSegmentPatternResponse
s {$sel:match:TestSegmentPatternResponse' :: Bool
match = Bool
a} :: TestSegmentPatternResponse)
instance Prelude.NFData TestSegmentPatternResponse where
rnf :: TestSegmentPatternResponse -> ()
rnf TestSegmentPatternResponse' {Bool
Int
match :: Bool
httpStatus :: Int
$sel:match:TestSegmentPatternResponse' :: TestSegmentPatternResponse -> Bool
$sel:httpStatus:TestSegmentPatternResponse' :: TestSegmentPatternResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
match