{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.XRay.GetServiceGraph
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves a document that describes services that process incoming
-- requests, and downstream services that they call as a result. Root
-- services process incoming requests and make calls to downstream
-- services. Root services are applications that use the
-- <https://docs.aws.amazon.com/xray/index.html Amazon Web Services X-Ray SDK>.
-- Downstream services can be other applications, Amazon Web Services
-- resources, HTTP web APIs, or SQL databases.
--
-- This operation returns paginated results.
module Amazonka.XRay.GetServiceGraph
  ( -- * Creating a Request
    GetServiceGraph (..),
    newGetServiceGraph,

    -- * Request Lenses
    getServiceGraph_groupARN,
    getServiceGraph_groupName,
    getServiceGraph_nextToken,
    getServiceGraph_startTime,
    getServiceGraph_endTime,

    -- * Destructuring the Response
    GetServiceGraphResponse (..),
    newGetServiceGraphResponse,

    -- * Response Lenses
    getServiceGraphResponse_containsOldGroupVersions,
    getServiceGraphResponse_endTime,
    getServiceGraphResponse_nextToken,
    getServiceGraphResponse_services,
    getServiceGraphResponse_startTime,
    getServiceGraphResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.XRay.Types

-- | /See:/ 'newGetServiceGraph' smart constructor.
data GetServiceGraph = GetServiceGraph'
  { -- | The Amazon Resource Name (ARN) of a group based on which you want to
    -- generate a graph.
    GetServiceGraph -> Maybe Text
groupARN :: Prelude.Maybe Prelude.Text,
    -- | The name of a group based on which you want to generate a graph.
    GetServiceGraph -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | Pagination token.
    GetServiceGraph -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The start of the time frame for which to generate a graph.
    GetServiceGraph -> POSIX
startTime :: Data.POSIX,
    -- | The end of the timeframe for which to generate a graph.
    GetServiceGraph -> POSIX
endTime :: Data.POSIX
  }
  deriving (GetServiceGraph -> GetServiceGraph -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetServiceGraph -> GetServiceGraph -> Bool
$c/= :: GetServiceGraph -> GetServiceGraph -> Bool
== :: GetServiceGraph -> GetServiceGraph -> Bool
$c== :: GetServiceGraph -> GetServiceGraph -> Bool
Prelude.Eq, ReadPrec [GetServiceGraph]
ReadPrec GetServiceGraph
Int -> ReadS GetServiceGraph
ReadS [GetServiceGraph]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetServiceGraph]
$creadListPrec :: ReadPrec [GetServiceGraph]
readPrec :: ReadPrec GetServiceGraph
$creadPrec :: ReadPrec GetServiceGraph
readList :: ReadS [GetServiceGraph]
$creadList :: ReadS [GetServiceGraph]
readsPrec :: Int -> ReadS GetServiceGraph
$creadsPrec :: Int -> ReadS GetServiceGraph
Prelude.Read, Int -> GetServiceGraph -> ShowS
[GetServiceGraph] -> ShowS
GetServiceGraph -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetServiceGraph] -> ShowS
$cshowList :: [GetServiceGraph] -> ShowS
show :: GetServiceGraph -> String
$cshow :: GetServiceGraph -> String
showsPrec :: Int -> GetServiceGraph -> ShowS
$cshowsPrec :: Int -> GetServiceGraph -> ShowS
Prelude.Show, forall x. Rep GetServiceGraph x -> GetServiceGraph
forall x. GetServiceGraph -> Rep GetServiceGraph x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetServiceGraph x -> GetServiceGraph
$cfrom :: forall x. GetServiceGraph -> Rep GetServiceGraph x
Prelude.Generic)

-- |
-- Create a value of 'GetServiceGraph' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'groupARN', 'getServiceGraph_groupARN' - The Amazon Resource Name (ARN) of a group based on which you want to
-- generate a graph.
--
-- 'groupName', 'getServiceGraph_groupName' - The name of a group based on which you want to generate a graph.
--
-- 'nextToken', 'getServiceGraph_nextToken' - Pagination token.
--
-- 'startTime', 'getServiceGraph_startTime' - The start of the time frame for which to generate a graph.
--
-- 'endTime', 'getServiceGraph_endTime' - The end of the timeframe for which to generate a graph.
newGetServiceGraph ::
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  GetServiceGraph
newGetServiceGraph :: UTCTime -> UTCTime -> GetServiceGraph
newGetServiceGraph UTCTime
pStartTime_ UTCTime
pEndTime_ =
  GetServiceGraph'
    { $sel:groupARN:GetServiceGraph' :: Maybe Text
groupARN = forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:GetServiceGraph' :: Maybe Text
groupName = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetServiceGraph' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:GetServiceGraph' :: POSIX
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
      $sel:endTime:GetServiceGraph' :: POSIX
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_
    }

-- | The Amazon Resource Name (ARN) of a group based on which you want to
-- generate a graph.
getServiceGraph_groupARN :: Lens.Lens' GetServiceGraph (Prelude.Maybe Prelude.Text)
getServiceGraph_groupARN :: Lens' GetServiceGraph (Maybe Text)
getServiceGraph_groupARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraph' {Maybe Text
groupARN :: Maybe Text
$sel:groupARN:GetServiceGraph' :: GetServiceGraph -> Maybe Text
groupARN} -> Maybe Text
groupARN) (\s :: GetServiceGraph
s@GetServiceGraph' {} Maybe Text
a -> GetServiceGraph
s {$sel:groupARN:GetServiceGraph' :: Maybe Text
groupARN = Maybe Text
a} :: GetServiceGraph)

-- | The name of a group based on which you want to generate a graph.
getServiceGraph_groupName :: Lens.Lens' GetServiceGraph (Prelude.Maybe Prelude.Text)
getServiceGraph_groupName :: Lens' GetServiceGraph (Maybe Text)
getServiceGraph_groupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraph' {Maybe Text
groupName :: Maybe Text
$sel:groupName:GetServiceGraph' :: GetServiceGraph -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: GetServiceGraph
s@GetServiceGraph' {} Maybe Text
a -> GetServiceGraph
s {$sel:groupName:GetServiceGraph' :: Maybe Text
groupName = Maybe Text
a} :: GetServiceGraph)

-- | Pagination token.
getServiceGraph_nextToken :: Lens.Lens' GetServiceGraph (Prelude.Maybe Prelude.Text)
getServiceGraph_nextToken :: Lens' GetServiceGraph (Maybe Text)
getServiceGraph_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraph' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetServiceGraph' :: GetServiceGraph -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetServiceGraph
s@GetServiceGraph' {} Maybe Text
a -> GetServiceGraph
s {$sel:nextToken:GetServiceGraph' :: Maybe Text
nextToken = Maybe Text
a} :: GetServiceGraph)

-- | The start of the time frame for which to generate a graph.
getServiceGraph_startTime :: Lens.Lens' GetServiceGraph Prelude.UTCTime
getServiceGraph_startTime :: Lens' GetServiceGraph UTCTime
getServiceGraph_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraph' {POSIX
startTime :: POSIX
$sel:startTime:GetServiceGraph' :: GetServiceGraph -> POSIX
startTime} -> POSIX
startTime) (\s :: GetServiceGraph
s@GetServiceGraph' {} POSIX
a -> GetServiceGraph
s {$sel:startTime:GetServiceGraph' :: POSIX
startTime = POSIX
a} :: GetServiceGraph) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The end of the timeframe for which to generate a graph.
getServiceGraph_endTime :: Lens.Lens' GetServiceGraph Prelude.UTCTime
getServiceGraph_endTime :: Lens' GetServiceGraph UTCTime
getServiceGraph_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraph' {POSIX
endTime :: POSIX
$sel:endTime:GetServiceGraph' :: GetServiceGraph -> POSIX
endTime} -> POSIX
endTime) (\s :: GetServiceGraph
s@GetServiceGraph' {} POSIX
a -> GetServiceGraph
s {$sel:endTime:GetServiceGraph' :: POSIX
endTime = POSIX
a} :: GetServiceGraph) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Core.AWSPager GetServiceGraph where
  page :: GetServiceGraph
-> AWSResponse GetServiceGraph -> Maybe GetServiceGraph
page GetServiceGraph
rq AWSResponse GetServiceGraph
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetServiceGraph
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetServiceGraphResponse (Maybe Text)
getServiceGraphResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetServiceGraph
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetServiceGraphResponse (Maybe [ServiceInfo])
getServiceGraphResponse_services
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetServiceGraph
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetServiceGraph (Maybe Text)
getServiceGraph_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetServiceGraph
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetServiceGraphResponse (Maybe Text)
getServiceGraphResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetServiceGraph where
  type
    AWSResponse GetServiceGraph =
      GetServiceGraphResponse
  request :: (Service -> Service) -> GetServiceGraph -> Request GetServiceGraph
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 GetServiceGraph
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetServiceGraph)))
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 ->
          Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> Maybe [ServiceInfo]
-> Maybe POSIX
-> Int
-> GetServiceGraphResponse
GetServiceGraphResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ContainsOldGroupVersions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EndTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Services" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StartTime")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable GetServiceGraph where
  hashWithSalt :: Int -> GetServiceGraph -> Int
hashWithSalt Int
_salt GetServiceGraph' {Maybe Text
POSIX
endTime :: POSIX
startTime :: POSIX
nextToken :: Maybe Text
groupName :: Maybe Text
groupARN :: Maybe Text
$sel:endTime:GetServiceGraph' :: GetServiceGraph -> POSIX
$sel:startTime:GetServiceGraph' :: GetServiceGraph -> POSIX
$sel:nextToken:GetServiceGraph' :: GetServiceGraph -> Maybe Text
$sel:groupName:GetServiceGraph' :: GetServiceGraph -> Maybe Text
$sel:groupARN:GetServiceGraph' :: GetServiceGraph -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
endTime

instance Prelude.NFData GetServiceGraph where
  rnf :: GetServiceGraph -> ()
rnf GetServiceGraph' {Maybe Text
POSIX
endTime :: POSIX
startTime :: POSIX
nextToken :: Maybe Text
groupName :: Maybe Text
groupARN :: Maybe Text
$sel:endTime:GetServiceGraph' :: GetServiceGraph -> POSIX
$sel:startTime:GetServiceGraph' :: GetServiceGraph -> POSIX
$sel:nextToken:GetServiceGraph' :: GetServiceGraph -> Maybe Text
$sel:groupName:GetServiceGraph' :: GetServiceGraph -> Maybe Text
$sel:groupARN:GetServiceGraph' :: GetServiceGraph -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
endTime

instance Data.ToHeaders GetServiceGraph where
  toHeaders :: GetServiceGraph -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON GetServiceGraph where
  toJSON :: GetServiceGraph -> Value
toJSON GetServiceGraph' {Maybe Text
POSIX
endTime :: POSIX
startTime :: POSIX
nextToken :: Maybe Text
groupName :: Maybe Text
groupARN :: Maybe Text
$sel:endTime:GetServiceGraph' :: GetServiceGraph -> POSIX
$sel:startTime:GetServiceGraph' :: GetServiceGraph -> POSIX
$sel:nextToken:GetServiceGraph' :: GetServiceGraph -> Maybe Text
$sel:groupName:GetServiceGraph' :: GetServiceGraph -> Maybe Text
$sel:groupARN:GetServiceGraph' :: GetServiceGraph -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"GroupARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupARN,
            (Key
"GroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"StartTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
startTime),
            forall a. a -> Maybe a
Prelude.Just (Key
"EndTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
endTime)
          ]
      )

instance Data.ToPath GetServiceGraph where
  toPath :: GetServiceGraph -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/ServiceGraph"

instance Data.ToQuery GetServiceGraph where
  toQuery :: GetServiceGraph -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetServiceGraphResponse' smart constructor.
data GetServiceGraphResponse = GetServiceGraphResponse'
  { -- | A flag indicating whether the group\'s filter expression has been
    -- consistent, or if the returned service graph may show traces from an
    -- older version of the group\'s filter expression.
    GetServiceGraphResponse -> Maybe Bool
containsOldGroupVersions :: Prelude.Maybe Prelude.Bool,
    -- | The end of the time frame for which the graph was generated.
    GetServiceGraphResponse -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
    -- | Pagination token.
    GetServiceGraphResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The services that have processed a traced request during the specified
    -- time frame.
    GetServiceGraphResponse -> Maybe [ServiceInfo]
services :: Prelude.Maybe [ServiceInfo],
    -- | The start of the time frame for which the graph was generated.
    GetServiceGraphResponse -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | The response's http status code.
    GetServiceGraphResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetServiceGraphResponse -> GetServiceGraphResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetServiceGraphResponse -> GetServiceGraphResponse -> Bool
$c/= :: GetServiceGraphResponse -> GetServiceGraphResponse -> Bool
== :: GetServiceGraphResponse -> GetServiceGraphResponse -> Bool
$c== :: GetServiceGraphResponse -> GetServiceGraphResponse -> Bool
Prelude.Eq, ReadPrec [GetServiceGraphResponse]
ReadPrec GetServiceGraphResponse
Int -> ReadS GetServiceGraphResponse
ReadS [GetServiceGraphResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetServiceGraphResponse]
$creadListPrec :: ReadPrec [GetServiceGraphResponse]
readPrec :: ReadPrec GetServiceGraphResponse
$creadPrec :: ReadPrec GetServiceGraphResponse
readList :: ReadS [GetServiceGraphResponse]
$creadList :: ReadS [GetServiceGraphResponse]
readsPrec :: Int -> ReadS GetServiceGraphResponse
$creadsPrec :: Int -> ReadS GetServiceGraphResponse
Prelude.Read, Int -> GetServiceGraphResponse -> ShowS
[GetServiceGraphResponse] -> ShowS
GetServiceGraphResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetServiceGraphResponse] -> ShowS
$cshowList :: [GetServiceGraphResponse] -> ShowS
show :: GetServiceGraphResponse -> String
$cshow :: GetServiceGraphResponse -> String
showsPrec :: Int -> GetServiceGraphResponse -> ShowS
$cshowsPrec :: Int -> GetServiceGraphResponse -> ShowS
Prelude.Show, forall x. Rep GetServiceGraphResponse x -> GetServiceGraphResponse
forall x. GetServiceGraphResponse -> Rep GetServiceGraphResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetServiceGraphResponse x -> GetServiceGraphResponse
$cfrom :: forall x. GetServiceGraphResponse -> Rep GetServiceGraphResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetServiceGraphResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'containsOldGroupVersions', 'getServiceGraphResponse_containsOldGroupVersions' - A flag indicating whether the group\'s filter expression has been
-- consistent, or if the returned service graph may show traces from an
-- older version of the group\'s filter expression.
--
-- 'endTime', 'getServiceGraphResponse_endTime' - The end of the time frame for which the graph was generated.
--
-- 'nextToken', 'getServiceGraphResponse_nextToken' - Pagination token.
--
-- 'services', 'getServiceGraphResponse_services' - The services that have processed a traced request during the specified
-- time frame.
--
-- 'startTime', 'getServiceGraphResponse_startTime' - The start of the time frame for which the graph was generated.
--
-- 'httpStatus', 'getServiceGraphResponse_httpStatus' - The response's http status code.
newGetServiceGraphResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetServiceGraphResponse
newGetServiceGraphResponse :: Int -> GetServiceGraphResponse
newGetServiceGraphResponse Int
pHttpStatus_ =
  GetServiceGraphResponse'
    { $sel:containsOldGroupVersions:GetServiceGraphResponse' :: Maybe Bool
containsOldGroupVersions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:GetServiceGraphResponse' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetServiceGraphResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:services:GetServiceGraphResponse' :: Maybe [ServiceInfo]
services = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:GetServiceGraphResponse' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetServiceGraphResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A flag indicating whether the group\'s filter expression has been
-- consistent, or if the returned service graph may show traces from an
-- older version of the group\'s filter expression.
getServiceGraphResponse_containsOldGroupVersions :: Lens.Lens' GetServiceGraphResponse (Prelude.Maybe Prelude.Bool)
getServiceGraphResponse_containsOldGroupVersions :: Lens' GetServiceGraphResponse (Maybe Bool)
getServiceGraphResponse_containsOldGroupVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraphResponse' {Maybe Bool
containsOldGroupVersions :: Maybe Bool
$sel:containsOldGroupVersions:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe Bool
containsOldGroupVersions} -> Maybe Bool
containsOldGroupVersions) (\s :: GetServiceGraphResponse
s@GetServiceGraphResponse' {} Maybe Bool
a -> GetServiceGraphResponse
s {$sel:containsOldGroupVersions:GetServiceGraphResponse' :: Maybe Bool
containsOldGroupVersions = Maybe Bool
a} :: GetServiceGraphResponse)

-- | The end of the time frame for which the graph was generated.
getServiceGraphResponse_endTime :: Lens.Lens' GetServiceGraphResponse (Prelude.Maybe Prelude.UTCTime)
getServiceGraphResponse_endTime :: Lens' GetServiceGraphResponse (Maybe UTCTime)
getServiceGraphResponse_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraphResponse' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: GetServiceGraphResponse
s@GetServiceGraphResponse' {} Maybe POSIX
a -> GetServiceGraphResponse
s {$sel:endTime:GetServiceGraphResponse' :: Maybe POSIX
endTime = Maybe POSIX
a} :: GetServiceGraphResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Pagination token.
getServiceGraphResponse_nextToken :: Lens.Lens' GetServiceGraphResponse (Prelude.Maybe Prelude.Text)
getServiceGraphResponse_nextToken :: Lens' GetServiceGraphResponse (Maybe Text)
getServiceGraphResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraphResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetServiceGraphResponse
s@GetServiceGraphResponse' {} Maybe Text
a -> GetServiceGraphResponse
s {$sel:nextToken:GetServiceGraphResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetServiceGraphResponse)

-- | The services that have processed a traced request during the specified
-- time frame.
getServiceGraphResponse_services :: Lens.Lens' GetServiceGraphResponse (Prelude.Maybe [ServiceInfo])
getServiceGraphResponse_services :: Lens' GetServiceGraphResponse (Maybe [ServiceInfo])
getServiceGraphResponse_services = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraphResponse' {Maybe [ServiceInfo]
services :: Maybe [ServiceInfo]
$sel:services:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe [ServiceInfo]
services} -> Maybe [ServiceInfo]
services) (\s :: GetServiceGraphResponse
s@GetServiceGraphResponse' {} Maybe [ServiceInfo]
a -> GetServiceGraphResponse
s {$sel:services:GetServiceGraphResponse' :: Maybe [ServiceInfo]
services = Maybe [ServiceInfo]
a} :: GetServiceGraphResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The start of the time frame for which the graph was generated.
getServiceGraphResponse_startTime :: Lens.Lens' GetServiceGraphResponse (Prelude.Maybe Prelude.UTCTime)
getServiceGraphResponse_startTime :: Lens' GetServiceGraphResponse (Maybe UTCTime)
getServiceGraphResponse_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraphResponse' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: GetServiceGraphResponse
s@GetServiceGraphResponse' {} Maybe POSIX
a -> GetServiceGraphResponse
s {$sel:startTime:GetServiceGraphResponse' :: Maybe POSIX
startTime = Maybe POSIX
a} :: GetServiceGraphResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The response's http status code.
getServiceGraphResponse_httpStatus :: Lens.Lens' GetServiceGraphResponse Prelude.Int
getServiceGraphResponse_httpStatus :: Lens' GetServiceGraphResponse Int
getServiceGraphResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceGraphResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetServiceGraphResponse' :: GetServiceGraphResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetServiceGraphResponse
s@GetServiceGraphResponse' {} Int
a -> GetServiceGraphResponse
s {$sel:httpStatus:GetServiceGraphResponse' :: Int
httpStatus = Int
a} :: GetServiceGraphResponse)

instance Prelude.NFData GetServiceGraphResponse where
  rnf :: GetServiceGraphResponse -> ()
rnf GetServiceGraphResponse' {Int
Maybe Bool
Maybe [ServiceInfo]
Maybe Text
Maybe POSIX
httpStatus :: Int
startTime :: Maybe POSIX
services :: Maybe [ServiceInfo]
nextToken :: Maybe Text
endTime :: Maybe POSIX
containsOldGroupVersions :: Maybe Bool
$sel:httpStatus:GetServiceGraphResponse' :: GetServiceGraphResponse -> Int
$sel:startTime:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe POSIX
$sel:services:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe [ServiceInfo]
$sel:nextToken:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe Text
$sel:endTime:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe POSIX
$sel:containsOldGroupVersions:GetServiceGraphResponse' :: GetServiceGraphResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
containsOldGroupVersions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceInfo]
services
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus