{-# 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.XRay.PutTraceSegments
(
PutTraceSegments (..),
newPutTraceSegments,
putTraceSegments_traceSegmentDocuments,
PutTraceSegmentsResponse (..),
newPutTraceSegmentsResponse,
putTraceSegmentsResponse_unprocessedTraceSegments,
putTraceSegmentsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.XRay.Types
data PutTraceSegments = PutTraceSegments'
{
PutTraceSegments -> [Text]
traceSegmentDocuments :: [Prelude.Text]
}
deriving (PutTraceSegments -> PutTraceSegments -> Bool
(PutTraceSegments -> PutTraceSegments -> Bool)
-> (PutTraceSegments -> PutTraceSegments -> Bool)
-> Eq PutTraceSegments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutTraceSegments -> PutTraceSegments -> Bool
$c/= :: PutTraceSegments -> PutTraceSegments -> Bool
== :: PutTraceSegments -> PutTraceSegments -> Bool
$c== :: PutTraceSegments -> PutTraceSegments -> Bool
Prelude.Eq, ReadPrec [PutTraceSegments]
ReadPrec PutTraceSegments
Int -> ReadS PutTraceSegments
ReadS [PutTraceSegments]
(Int -> ReadS PutTraceSegments)
-> ReadS [PutTraceSegments]
-> ReadPrec PutTraceSegments
-> ReadPrec [PutTraceSegments]
-> Read PutTraceSegments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutTraceSegments]
$creadListPrec :: ReadPrec [PutTraceSegments]
readPrec :: ReadPrec PutTraceSegments
$creadPrec :: ReadPrec PutTraceSegments
readList :: ReadS [PutTraceSegments]
$creadList :: ReadS [PutTraceSegments]
readsPrec :: Int -> ReadS PutTraceSegments
$creadsPrec :: Int -> ReadS PutTraceSegments
Prelude.Read, Int -> PutTraceSegments -> ShowS
[PutTraceSegments] -> ShowS
PutTraceSegments -> String
(Int -> PutTraceSegments -> ShowS)
-> (PutTraceSegments -> String)
-> ([PutTraceSegments] -> ShowS)
-> Show PutTraceSegments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutTraceSegments] -> ShowS
$cshowList :: [PutTraceSegments] -> ShowS
show :: PutTraceSegments -> String
$cshow :: PutTraceSegments -> String
showsPrec :: Int -> PutTraceSegments -> ShowS
$cshowsPrec :: Int -> PutTraceSegments -> ShowS
Prelude.Show, (forall x. PutTraceSegments -> Rep PutTraceSegments x)
-> (forall x. Rep PutTraceSegments x -> PutTraceSegments)
-> Generic PutTraceSegments
forall x. Rep PutTraceSegments x -> PutTraceSegments
forall x. PutTraceSegments -> Rep PutTraceSegments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutTraceSegments x -> PutTraceSegments
$cfrom :: forall x. PutTraceSegments -> Rep PutTraceSegments x
Prelude.Generic)
newPutTraceSegments ::
PutTraceSegments
newPutTraceSegments :: PutTraceSegments
newPutTraceSegments =
PutTraceSegments' :: [Text] -> PutTraceSegments
PutTraceSegments'
{ $sel:traceSegmentDocuments:PutTraceSegments' :: [Text]
traceSegmentDocuments =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
putTraceSegments_traceSegmentDocuments :: Lens.Lens' PutTraceSegments [Prelude.Text]
putTraceSegments_traceSegmentDocuments :: ([Text] -> f [Text]) -> PutTraceSegments -> f PutTraceSegments
putTraceSegments_traceSegmentDocuments = (PutTraceSegments -> [Text])
-> (PutTraceSegments -> [Text] -> PutTraceSegments)
-> Lens PutTraceSegments PutTraceSegments [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutTraceSegments' {[Text]
traceSegmentDocuments :: [Text]
$sel:traceSegmentDocuments:PutTraceSegments' :: PutTraceSegments -> [Text]
traceSegmentDocuments} -> [Text]
traceSegmentDocuments) (\s :: PutTraceSegments
s@PutTraceSegments' {} [Text]
a -> PutTraceSegments
s {$sel:traceSegmentDocuments:PutTraceSegments' :: [Text]
traceSegmentDocuments = [Text]
a} :: PutTraceSegments) (([Text] -> f [Text]) -> PutTraceSegments -> f PutTraceSegments)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> PutTraceSegments
-> f PutTraceSegments
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest PutTraceSegments where
type
AWSResponse PutTraceSegments =
PutTraceSegmentsResponse
request :: PutTraceSegments -> Request PutTraceSegments
request = Service -> PutTraceSegments -> Request PutTraceSegments
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutTraceSegments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutTraceSegments)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutTraceSegments))
-> Logger
-> Service
-> Proxy PutTraceSegments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutTraceSegments)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [UnprocessedTraceSegment] -> Int -> PutTraceSegmentsResponse
PutTraceSegmentsResponse'
(Maybe [UnprocessedTraceSegment]
-> Int -> PutTraceSegmentsResponse)
-> Either String (Maybe [UnprocessedTraceSegment])
-> Either String (Int -> PutTraceSegmentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [UnprocessedTraceSegment]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UnprocessedTraceSegments"
Either String (Maybe (Maybe [UnprocessedTraceSegment]))
-> Maybe [UnprocessedTraceSegment]
-> Either String (Maybe [UnprocessedTraceSegment])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UnprocessedTraceSegment]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> PutTraceSegmentsResponse)
-> Either String Int -> Either String PutTraceSegmentsResponse
forall (f :: * -> *) a b. Applicative f => 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 PutTraceSegments
instance Prelude.NFData PutTraceSegments
instance Core.ToHeaders PutTraceSegments where
toHeaders :: PutTraceSegments -> ResponseHeaders
toHeaders = ResponseHeaders -> PutTraceSegments -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON PutTraceSegments where
toJSON :: PutTraceSegments -> Value
toJSON PutTraceSegments' {[Text]
traceSegmentDocuments :: [Text]
$sel:traceSegmentDocuments:PutTraceSegments' :: PutTraceSegments -> [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
"TraceSegmentDocuments"
Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
traceSegmentDocuments
)
]
)
instance Core.ToPath PutTraceSegments where
toPath :: PutTraceSegments -> ByteString
toPath = ByteString -> PutTraceSegments -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/TraceSegments"
instance Core.ToQuery PutTraceSegments where
toQuery :: PutTraceSegments -> QueryString
toQuery = QueryString -> PutTraceSegments -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutTraceSegmentsResponse = PutTraceSegmentsResponse'
{
PutTraceSegmentsResponse -> Maybe [UnprocessedTraceSegment]
unprocessedTraceSegments :: Prelude.Maybe [UnprocessedTraceSegment],
PutTraceSegmentsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool
(PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool)
-> (PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool)
-> Eq PutTraceSegmentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool
$c/= :: PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool
== :: PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool
$c== :: PutTraceSegmentsResponse -> PutTraceSegmentsResponse -> Bool
Prelude.Eq, ReadPrec [PutTraceSegmentsResponse]
ReadPrec PutTraceSegmentsResponse
Int -> ReadS PutTraceSegmentsResponse
ReadS [PutTraceSegmentsResponse]
(Int -> ReadS PutTraceSegmentsResponse)
-> ReadS [PutTraceSegmentsResponse]
-> ReadPrec PutTraceSegmentsResponse
-> ReadPrec [PutTraceSegmentsResponse]
-> Read PutTraceSegmentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutTraceSegmentsResponse]
$creadListPrec :: ReadPrec [PutTraceSegmentsResponse]
readPrec :: ReadPrec PutTraceSegmentsResponse
$creadPrec :: ReadPrec PutTraceSegmentsResponse
readList :: ReadS [PutTraceSegmentsResponse]
$creadList :: ReadS [PutTraceSegmentsResponse]
readsPrec :: Int -> ReadS PutTraceSegmentsResponse
$creadsPrec :: Int -> ReadS PutTraceSegmentsResponse
Prelude.Read, Int -> PutTraceSegmentsResponse -> ShowS
[PutTraceSegmentsResponse] -> ShowS
PutTraceSegmentsResponse -> String
(Int -> PutTraceSegmentsResponse -> ShowS)
-> (PutTraceSegmentsResponse -> String)
-> ([PutTraceSegmentsResponse] -> ShowS)
-> Show PutTraceSegmentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutTraceSegmentsResponse] -> ShowS
$cshowList :: [PutTraceSegmentsResponse] -> ShowS
show :: PutTraceSegmentsResponse -> String
$cshow :: PutTraceSegmentsResponse -> String
showsPrec :: Int -> PutTraceSegmentsResponse -> ShowS
$cshowsPrec :: Int -> PutTraceSegmentsResponse -> ShowS
Prelude.Show, (forall x.
PutTraceSegmentsResponse -> Rep PutTraceSegmentsResponse x)
-> (forall x.
Rep PutTraceSegmentsResponse x -> PutTraceSegmentsResponse)
-> Generic PutTraceSegmentsResponse
forall x.
Rep PutTraceSegmentsResponse x -> PutTraceSegmentsResponse
forall x.
PutTraceSegmentsResponse -> Rep PutTraceSegmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutTraceSegmentsResponse x -> PutTraceSegmentsResponse
$cfrom :: forall x.
PutTraceSegmentsResponse -> Rep PutTraceSegmentsResponse x
Prelude.Generic)
newPutTraceSegmentsResponse ::
Prelude.Int ->
PutTraceSegmentsResponse
newPutTraceSegmentsResponse :: Int -> PutTraceSegmentsResponse
newPutTraceSegmentsResponse Int
pHttpStatus_ =
PutTraceSegmentsResponse' :: Maybe [UnprocessedTraceSegment] -> Int -> PutTraceSegmentsResponse
PutTraceSegmentsResponse'
{ $sel:unprocessedTraceSegments:PutTraceSegmentsResponse' :: Maybe [UnprocessedTraceSegment]
unprocessedTraceSegments =
Maybe [UnprocessedTraceSegment]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutTraceSegmentsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putTraceSegmentsResponse_unprocessedTraceSegments :: Lens.Lens' PutTraceSegmentsResponse (Prelude.Maybe [UnprocessedTraceSegment])
putTraceSegmentsResponse_unprocessedTraceSegments :: (Maybe [UnprocessedTraceSegment]
-> f (Maybe [UnprocessedTraceSegment]))
-> PutTraceSegmentsResponse -> f PutTraceSegmentsResponse
putTraceSegmentsResponse_unprocessedTraceSegments = (PutTraceSegmentsResponse -> Maybe [UnprocessedTraceSegment])
-> (PutTraceSegmentsResponse
-> Maybe [UnprocessedTraceSegment] -> PutTraceSegmentsResponse)
-> Lens
PutTraceSegmentsResponse
PutTraceSegmentsResponse
(Maybe [UnprocessedTraceSegment])
(Maybe [UnprocessedTraceSegment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutTraceSegmentsResponse' {Maybe [UnprocessedTraceSegment]
unprocessedTraceSegments :: Maybe [UnprocessedTraceSegment]
$sel:unprocessedTraceSegments:PutTraceSegmentsResponse' :: PutTraceSegmentsResponse -> Maybe [UnprocessedTraceSegment]
unprocessedTraceSegments} -> Maybe [UnprocessedTraceSegment]
unprocessedTraceSegments) (\s :: PutTraceSegmentsResponse
s@PutTraceSegmentsResponse' {} Maybe [UnprocessedTraceSegment]
a -> PutTraceSegmentsResponse
s {$sel:unprocessedTraceSegments:PutTraceSegmentsResponse' :: Maybe [UnprocessedTraceSegment]
unprocessedTraceSegments = Maybe [UnprocessedTraceSegment]
a} :: PutTraceSegmentsResponse) ((Maybe [UnprocessedTraceSegment]
-> f (Maybe [UnprocessedTraceSegment]))
-> PutTraceSegmentsResponse -> f PutTraceSegmentsResponse)
-> ((Maybe [UnprocessedTraceSegment]
-> f (Maybe [UnprocessedTraceSegment]))
-> Maybe [UnprocessedTraceSegment]
-> f (Maybe [UnprocessedTraceSegment]))
-> (Maybe [UnprocessedTraceSegment]
-> f (Maybe [UnprocessedTraceSegment]))
-> PutTraceSegmentsResponse
-> f PutTraceSegmentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[UnprocessedTraceSegment]
[UnprocessedTraceSegment]
[UnprocessedTraceSegment]
[UnprocessedTraceSegment]
-> Iso
(Maybe [UnprocessedTraceSegment])
(Maybe [UnprocessedTraceSegment])
(Maybe [UnprocessedTraceSegment])
(Maybe [UnprocessedTraceSegment])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[UnprocessedTraceSegment]
[UnprocessedTraceSegment]
[UnprocessedTraceSegment]
[UnprocessedTraceSegment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putTraceSegmentsResponse_httpStatus :: Lens.Lens' PutTraceSegmentsResponse Prelude.Int
putTraceSegmentsResponse_httpStatus :: (Int -> f Int)
-> PutTraceSegmentsResponse -> f PutTraceSegmentsResponse
putTraceSegmentsResponse_httpStatus = (PutTraceSegmentsResponse -> Int)
-> (PutTraceSegmentsResponse -> Int -> PutTraceSegmentsResponse)
-> Lens PutTraceSegmentsResponse PutTraceSegmentsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutTraceSegmentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutTraceSegmentsResponse' :: PutTraceSegmentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutTraceSegmentsResponse
s@PutTraceSegmentsResponse' {} Int
a -> PutTraceSegmentsResponse
s {$sel:httpStatus:PutTraceSegmentsResponse' :: Int
httpStatus = Int
a} :: PutTraceSegmentsResponse)
instance Prelude.NFData PutTraceSegmentsResponse