{-# 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.NetworkManager.StartRouteAnalysis
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts analyzing the routing path between the specified source and
-- destination. For more information, see
-- <https://docs.aws.amazon.com/vpc/latest/tgw/route-analyzer.html Route Analyzer>.
module Amazonka.NetworkManager.StartRouteAnalysis
  ( -- * Creating a Request
    StartRouteAnalysis (..),
    newStartRouteAnalysis,

    -- * Request Lenses
    startRouteAnalysis_includeReturnPath,
    startRouteAnalysis_useMiddleboxes,
    startRouteAnalysis_globalNetworkId,
    startRouteAnalysis_source,
    startRouteAnalysis_destination,

    -- * Destructuring the Response
    StartRouteAnalysisResponse (..),
    newStartRouteAnalysisResponse,

    -- * Response Lenses
    startRouteAnalysisResponse_routeAnalysis,
    startRouteAnalysisResponse_httpStatus,
  )
where

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

-- | /See:/ 'newStartRouteAnalysis' smart constructor.
data StartRouteAnalysis = StartRouteAnalysis'
  { -- | Indicates whether to analyze the return path. The default is @false@.
    StartRouteAnalysis -> Maybe Bool
includeReturnPath :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether to include the location of middlebox appliances in the
    -- route analysis. The default is @false@.
    StartRouteAnalysis -> Maybe Bool
useMiddleboxes :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the global network.
    StartRouteAnalysis -> Text
globalNetworkId :: Prelude.Text,
    -- | The source from which traffic originates.
    StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
source :: RouteAnalysisEndpointOptionsSpecification,
    -- | The destination.
    StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
destination :: RouteAnalysisEndpointOptionsSpecification
  }
  deriving (StartRouteAnalysis -> StartRouteAnalysis -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRouteAnalysis -> StartRouteAnalysis -> Bool
$c/= :: StartRouteAnalysis -> StartRouteAnalysis -> Bool
== :: StartRouteAnalysis -> StartRouteAnalysis -> Bool
$c== :: StartRouteAnalysis -> StartRouteAnalysis -> Bool
Prelude.Eq, ReadPrec [StartRouteAnalysis]
ReadPrec StartRouteAnalysis
Int -> ReadS StartRouteAnalysis
ReadS [StartRouteAnalysis]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRouteAnalysis]
$creadListPrec :: ReadPrec [StartRouteAnalysis]
readPrec :: ReadPrec StartRouteAnalysis
$creadPrec :: ReadPrec StartRouteAnalysis
readList :: ReadS [StartRouteAnalysis]
$creadList :: ReadS [StartRouteAnalysis]
readsPrec :: Int -> ReadS StartRouteAnalysis
$creadsPrec :: Int -> ReadS StartRouteAnalysis
Prelude.Read, Int -> StartRouteAnalysis -> ShowS
[StartRouteAnalysis] -> ShowS
StartRouteAnalysis -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRouteAnalysis] -> ShowS
$cshowList :: [StartRouteAnalysis] -> ShowS
show :: StartRouteAnalysis -> String
$cshow :: StartRouteAnalysis -> String
showsPrec :: Int -> StartRouteAnalysis -> ShowS
$cshowsPrec :: Int -> StartRouteAnalysis -> ShowS
Prelude.Show, forall x. Rep StartRouteAnalysis x -> StartRouteAnalysis
forall x. StartRouteAnalysis -> Rep StartRouteAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartRouteAnalysis x -> StartRouteAnalysis
$cfrom :: forall x. StartRouteAnalysis -> Rep StartRouteAnalysis x
Prelude.Generic)

-- |
-- Create a value of 'StartRouteAnalysis' 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:
--
-- 'includeReturnPath', 'startRouteAnalysis_includeReturnPath' - Indicates whether to analyze the return path. The default is @false@.
--
-- 'useMiddleboxes', 'startRouteAnalysis_useMiddleboxes' - Indicates whether to include the location of middlebox appliances in the
-- route analysis. The default is @false@.
--
-- 'globalNetworkId', 'startRouteAnalysis_globalNetworkId' - The ID of the global network.
--
-- 'source', 'startRouteAnalysis_source' - The source from which traffic originates.
--
-- 'destination', 'startRouteAnalysis_destination' - The destination.
newStartRouteAnalysis ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  -- | 'source'
  RouteAnalysisEndpointOptionsSpecification ->
  -- | 'destination'
  RouteAnalysisEndpointOptionsSpecification ->
  StartRouteAnalysis
newStartRouteAnalysis :: Text
-> RouteAnalysisEndpointOptionsSpecification
-> RouteAnalysisEndpointOptionsSpecification
-> StartRouteAnalysis
newStartRouteAnalysis
  Text
pGlobalNetworkId_
  RouteAnalysisEndpointOptionsSpecification
pSource_
  RouteAnalysisEndpointOptionsSpecification
pDestination_ =
    StartRouteAnalysis'
      { $sel:includeReturnPath:StartRouteAnalysis' :: Maybe Bool
includeReturnPath =
          forall a. Maybe a
Prelude.Nothing,
        $sel:useMiddleboxes:StartRouteAnalysis' :: Maybe Bool
useMiddleboxes = forall a. Maybe a
Prelude.Nothing,
        $sel:globalNetworkId:StartRouteAnalysis' :: Text
globalNetworkId = Text
pGlobalNetworkId_,
        $sel:source:StartRouteAnalysis' :: RouteAnalysisEndpointOptionsSpecification
source = RouteAnalysisEndpointOptionsSpecification
pSource_,
        $sel:destination:StartRouteAnalysis' :: RouteAnalysisEndpointOptionsSpecification
destination = RouteAnalysisEndpointOptionsSpecification
pDestination_
      }

-- | Indicates whether to analyze the return path. The default is @false@.
startRouteAnalysis_includeReturnPath :: Lens.Lens' StartRouteAnalysis (Prelude.Maybe Prelude.Bool)
startRouteAnalysis_includeReturnPath :: Lens' StartRouteAnalysis (Maybe Bool)
startRouteAnalysis_includeReturnPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRouteAnalysis' {Maybe Bool
includeReturnPath :: Maybe Bool
$sel:includeReturnPath:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
includeReturnPath} -> Maybe Bool
includeReturnPath) (\s :: StartRouteAnalysis
s@StartRouteAnalysis' {} Maybe Bool
a -> StartRouteAnalysis
s {$sel:includeReturnPath:StartRouteAnalysis' :: Maybe Bool
includeReturnPath = Maybe Bool
a} :: StartRouteAnalysis)

-- | Indicates whether to include the location of middlebox appliances in the
-- route analysis. The default is @false@.
startRouteAnalysis_useMiddleboxes :: Lens.Lens' StartRouteAnalysis (Prelude.Maybe Prelude.Bool)
startRouteAnalysis_useMiddleboxes :: Lens' StartRouteAnalysis (Maybe Bool)
startRouteAnalysis_useMiddleboxes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRouteAnalysis' {Maybe Bool
useMiddleboxes :: Maybe Bool
$sel:useMiddleboxes:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
useMiddleboxes} -> Maybe Bool
useMiddleboxes) (\s :: StartRouteAnalysis
s@StartRouteAnalysis' {} Maybe Bool
a -> StartRouteAnalysis
s {$sel:useMiddleboxes:StartRouteAnalysis' :: Maybe Bool
useMiddleboxes = Maybe Bool
a} :: StartRouteAnalysis)

-- | The ID of the global network.
startRouteAnalysis_globalNetworkId :: Lens.Lens' StartRouteAnalysis Prelude.Text
startRouteAnalysis_globalNetworkId :: Lens' StartRouteAnalysis Text
startRouteAnalysis_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRouteAnalysis' {Text
globalNetworkId :: Text
$sel:globalNetworkId:StartRouteAnalysis' :: StartRouteAnalysis -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: StartRouteAnalysis
s@StartRouteAnalysis' {} Text
a -> StartRouteAnalysis
s {$sel:globalNetworkId:StartRouteAnalysis' :: Text
globalNetworkId = Text
a} :: StartRouteAnalysis)

-- | The source from which traffic originates.
startRouteAnalysis_source :: Lens.Lens' StartRouteAnalysis RouteAnalysisEndpointOptionsSpecification
startRouteAnalysis_source :: Lens' StartRouteAnalysis RouteAnalysisEndpointOptionsSpecification
startRouteAnalysis_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRouteAnalysis' {RouteAnalysisEndpointOptionsSpecification
source :: RouteAnalysisEndpointOptionsSpecification
$sel:source:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
source} -> RouteAnalysisEndpointOptionsSpecification
source) (\s :: StartRouteAnalysis
s@StartRouteAnalysis' {} RouteAnalysisEndpointOptionsSpecification
a -> StartRouteAnalysis
s {$sel:source:StartRouteAnalysis' :: RouteAnalysisEndpointOptionsSpecification
source = RouteAnalysisEndpointOptionsSpecification
a} :: StartRouteAnalysis)

-- | The destination.
startRouteAnalysis_destination :: Lens.Lens' StartRouteAnalysis RouteAnalysisEndpointOptionsSpecification
startRouteAnalysis_destination :: Lens' StartRouteAnalysis RouteAnalysisEndpointOptionsSpecification
startRouteAnalysis_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRouteAnalysis' {RouteAnalysisEndpointOptionsSpecification
destination :: RouteAnalysisEndpointOptionsSpecification
$sel:destination:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
destination} -> RouteAnalysisEndpointOptionsSpecification
destination) (\s :: StartRouteAnalysis
s@StartRouteAnalysis' {} RouteAnalysisEndpointOptionsSpecification
a -> StartRouteAnalysis
s {$sel:destination:StartRouteAnalysis' :: RouteAnalysisEndpointOptionsSpecification
destination = RouteAnalysisEndpointOptionsSpecification
a} :: StartRouteAnalysis)

instance Core.AWSRequest StartRouteAnalysis where
  type
    AWSResponse StartRouteAnalysis =
      StartRouteAnalysisResponse
  request :: (Service -> Service)
-> StartRouteAnalysis -> Request StartRouteAnalysis
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 StartRouteAnalysis
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartRouteAnalysis)))
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 RouteAnalysis -> Int -> StartRouteAnalysisResponse
StartRouteAnalysisResponse'
            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
"RouteAnalysis")
            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 StartRouteAnalysis where
  hashWithSalt :: Int -> StartRouteAnalysis -> Int
hashWithSalt Int
_salt StartRouteAnalysis' {Maybe Bool
Text
RouteAnalysisEndpointOptionsSpecification
destination :: RouteAnalysisEndpointOptionsSpecification
source :: RouteAnalysisEndpointOptionsSpecification
globalNetworkId :: Text
useMiddleboxes :: Maybe Bool
includeReturnPath :: Maybe Bool
$sel:destination:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:source:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:globalNetworkId:StartRouteAnalysis' :: StartRouteAnalysis -> Text
$sel:useMiddleboxes:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
$sel:includeReturnPath:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeReturnPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useMiddleboxes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RouteAnalysisEndpointOptionsSpecification
source
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RouteAnalysisEndpointOptionsSpecification
destination

instance Prelude.NFData StartRouteAnalysis where
  rnf :: StartRouteAnalysis -> ()
rnf StartRouteAnalysis' {Maybe Bool
Text
RouteAnalysisEndpointOptionsSpecification
destination :: RouteAnalysisEndpointOptionsSpecification
source :: RouteAnalysisEndpointOptionsSpecification
globalNetworkId :: Text
useMiddleboxes :: Maybe Bool
includeReturnPath :: Maybe Bool
$sel:destination:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:source:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:globalNetworkId:StartRouteAnalysis' :: StartRouteAnalysis -> Text
$sel:useMiddleboxes:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
$sel:includeReturnPath:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeReturnPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useMiddleboxes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RouteAnalysisEndpointOptionsSpecification
source
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RouteAnalysisEndpointOptionsSpecification
destination

instance Data.ToHeaders StartRouteAnalysis where
  toHeaders :: StartRouteAnalysis -> 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 StartRouteAnalysis where
  toJSON :: StartRouteAnalysis -> Value
toJSON StartRouteAnalysis' {Maybe Bool
Text
RouteAnalysisEndpointOptionsSpecification
destination :: RouteAnalysisEndpointOptionsSpecification
source :: RouteAnalysisEndpointOptionsSpecification
globalNetworkId :: Text
useMiddleboxes :: Maybe Bool
includeReturnPath :: Maybe Bool
$sel:destination:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:source:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:globalNetworkId:StartRouteAnalysis' :: StartRouteAnalysis -> Text
$sel:useMiddleboxes:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
$sel:includeReturnPath:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"IncludeReturnPath" 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 Bool
includeReturnPath,
            (Key
"UseMiddleboxes" 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 Bool
useMiddleboxes,
            forall a. a -> Maybe a
Prelude.Just (Key
"Source" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RouteAnalysisEndpointOptionsSpecification
source),
            forall a. a -> Maybe a
Prelude.Just (Key
"Destination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RouteAnalysisEndpointOptionsSpecification
destination)
          ]
      )

instance Data.ToPath StartRouteAnalysis where
  toPath :: StartRouteAnalysis -> ByteString
toPath StartRouteAnalysis' {Maybe Bool
Text
RouteAnalysisEndpointOptionsSpecification
destination :: RouteAnalysisEndpointOptionsSpecification
source :: RouteAnalysisEndpointOptionsSpecification
globalNetworkId :: Text
useMiddleboxes :: Maybe Bool
includeReturnPath :: Maybe Bool
$sel:destination:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:source:StartRouteAnalysis' :: StartRouteAnalysis -> RouteAnalysisEndpointOptionsSpecification
$sel:globalNetworkId:StartRouteAnalysis' :: StartRouteAnalysis -> Text
$sel:useMiddleboxes:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
$sel:includeReturnPath:StartRouteAnalysis' :: StartRouteAnalysis -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId,
        ByteString
"/route-analyses"
      ]

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

-- | /See:/ 'newStartRouteAnalysisResponse' smart constructor.
data StartRouteAnalysisResponse = StartRouteAnalysisResponse'
  { -- | The route analysis.
    StartRouteAnalysisResponse -> Maybe RouteAnalysis
routeAnalysis :: Prelude.Maybe RouteAnalysis,
    -- | The response's http status code.
    StartRouteAnalysisResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartRouteAnalysisResponse -> StartRouteAnalysisResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRouteAnalysisResponse -> StartRouteAnalysisResponse -> Bool
$c/= :: StartRouteAnalysisResponse -> StartRouteAnalysisResponse -> Bool
== :: StartRouteAnalysisResponse -> StartRouteAnalysisResponse -> Bool
$c== :: StartRouteAnalysisResponse -> StartRouteAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [StartRouteAnalysisResponse]
ReadPrec StartRouteAnalysisResponse
Int -> ReadS StartRouteAnalysisResponse
ReadS [StartRouteAnalysisResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRouteAnalysisResponse]
$creadListPrec :: ReadPrec [StartRouteAnalysisResponse]
readPrec :: ReadPrec StartRouteAnalysisResponse
$creadPrec :: ReadPrec StartRouteAnalysisResponse
readList :: ReadS [StartRouteAnalysisResponse]
$creadList :: ReadS [StartRouteAnalysisResponse]
readsPrec :: Int -> ReadS StartRouteAnalysisResponse
$creadsPrec :: Int -> ReadS StartRouteAnalysisResponse
Prelude.Read, Int -> StartRouteAnalysisResponse -> ShowS
[StartRouteAnalysisResponse] -> ShowS
StartRouteAnalysisResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRouteAnalysisResponse] -> ShowS
$cshowList :: [StartRouteAnalysisResponse] -> ShowS
show :: StartRouteAnalysisResponse -> String
$cshow :: StartRouteAnalysisResponse -> String
showsPrec :: Int -> StartRouteAnalysisResponse -> ShowS
$cshowsPrec :: Int -> StartRouteAnalysisResponse -> ShowS
Prelude.Show, forall x.
Rep StartRouteAnalysisResponse x -> StartRouteAnalysisResponse
forall x.
StartRouteAnalysisResponse -> Rep StartRouteAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartRouteAnalysisResponse x -> StartRouteAnalysisResponse
$cfrom :: forall x.
StartRouteAnalysisResponse -> Rep StartRouteAnalysisResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartRouteAnalysisResponse' 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:
--
-- 'routeAnalysis', 'startRouteAnalysisResponse_routeAnalysis' - The route analysis.
--
-- 'httpStatus', 'startRouteAnalysisResponse_httpStatus' - The response's http status code.
newStartRouteAnalysisResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartRouteAnalysisResponse
newStartRouteAnalysisResponse :: Int -> StartRouteAnalysisResponse
newStartRouteAnalysisResponse Int
pHttpStatus_ =
  StartRouteAnalysisResponse'
    { $sel:routeAnalysis:StartRouteAnalysisResponse' :: Maybe RouteAnalysis
routeAnalysis =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartRouteAnalysisResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The route analysis.
startRouteAnalysisResponse_routeAnalysis :: Lens.Lens' StartRouteAnalysisResponse (Prelude.Maybe RouteAnalysis)
startRouteAnalysisResponse_routeAnalysis :: Lens' StartRouteAnalysisResponse (Maybe RouteAnalysis)
startRouteAnalysisResponse_routeAnalysis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRouteAnalysisResponse' {Maybe RouteAnalysis
routeAnalysis :: Maybe RouteAnalysis
$sel:routeAnalysis:StartRouteAnalysisResponse' :: StartRouteAnalysisResponse -> Maybe RouteAnalysis
routeAnalysis} -> Maybe RouteAnalysis
routeAnalysis) (\s :: StartRouteAnalysisResponse
s@StartRouteAnalysisResponse' {} Maybe RouteAnalysis
a -> StartRouteAnalysisResponse
s {$sel:routeAnalysis:StartRouteAnalysisResponse' :: Maybe RouteAnalysis
routeAnalysis = Maybe RouteAnalysis
a} :: StartRouteAnalysisResponse)

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

instance Prelude.NFData StartRouteAnalysisResponse where
  rnf :: StartRouteAnalysisResponse -> ()
rnf StartRouteAnalysisResponse' {Int
Maybe RouteAnalysis
httpStatus :: Int
routeAnalysis :: Maybe RouteAnalysis
$sel:httpStatus:StartRouteAnalysisResponse' :: StartRouteAnalysisResponse -> Int
$sel:routeAnalysis:StartRouteAnalysisResponse' :: StartRouteAnalysisResponse -> Maybe RouteAnalysis
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RouteAnalysis
routeAnalysis
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus