{-# 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.DirectConnect.ListVirtualInterfaceTestHistory
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the virtual interface failover test history.
module Amazonka.DirectConnect.ListVirtualInterfaceTestHistory
  ( -- * Creating a Request
    ListVirtualInterfaceTestHistory (..),
    newListVirtualInterfaceTestHistory,

    -- * Request Lenses
    listVirtualInterfaceTestHistory_bgpPeers,
    listVirtualInterfaceTestHistory_maxResults,
    listVirtualInterfaceTestHistory_nextToken,
    listVirtualInterfaceTestHistory_status,
    listVirtualInterfaceTestHistory_testId,
    listVirtualInterfaceTestHistory_virtualInterfaceId,

    -- * Destructuring the Response
    ListVirtualInterfaceTestHistoryResponse (..),
    newListVirtualInterfaceTestHistoryResponse,

    -- * Response Lenses
    listVirtualInterfaceTestHistoryResponse_nextToken,
    listVirtualInterfaceTestHistoryResponse_virtualInterfaceTestHistory,
    listVirtualInterfaceTestHistoryResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListVirtualInterfaceTestHistory' smart constructor.
data ListVirtualInterfaceTestHistory = ListVirtualInterfaceTestHistory'
  { -- | The BGP peers that were placed in the DOWN state during the virtual
    -- interface failover test.
    ListVirtualInterfaceTestHistory -> Maybe [Text]
bgpPeers :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    --
    -- If @MaxResults@ is given a value larger than 100, only 100 results are
    -- returned.
    ListVirtualInterfaceTestHistory -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token for the next page of results.
    ListVirtualInterfaceTestHistory -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The status of the virtual interface failover test.
    ListVirtualInterfaceTestHistory -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The ID of the virtual interface failover test.
    ListVirtualInterfaceTestHistory -> Maybe Text
testId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the virtual interface that was tested.
    ListVirtualInterfaceTestHistory -> Maybe Text
virtualInterfaceId :: Prelude.Maybe Prelude.Text
  }
  deriving (ListVirtualInterfaceTestHistory
-> ListVirtualInterfaceTestHistory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualInterfaceTestHistory
-> ListVirtualInterfaceTestHistory -> Bool
$c/= :: ListVirtualInterfaceTestHistory
-> ListVirtualInterfaceTestHistory -> Bool
== :: ListVirtualInterfaceTestHistory
-> ListVirtualInterfaceTestHistory -> Bool
$c== :: ListVirtualInterfaceTestHistory
-> ListVirtualInterfaceTestHistory -> Bool
Prelude.Eq, ReadPrec [ListVirtualInterfaceTestHistory]
ReadPrec ListVirtualInterfaceTestHistory
Int -> ReadS ListVirtualInterfaceTestHistory
ReadS [ListVirtualInterfaceTestHistory]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualInterfaceTestHistory]
$creadListPrec :: ReadPrec [ListVirtualInterfaceTestHistory]
readPrec :: ReadPrec ListVirtualInterfaceTestHistory
$creadPrec :: ReadPrec ListVirtualInterfaceTestHistory
readList :: ReadS [ListVirtualInterfaceTestHistory]
$creadList :: ReadS [ListVirtualInterfaceTestHistory]
readsPrec :: Int -> ReadS ListVirtualInterfaceTestHistory
$creadsPrec :: Int -> ReadS ListVirtualInterfaceTestHistory
Prelude.Read, Int -> ListVirtualInterfaceTestHistory -> ShowS
[ListVirtualInterfaceTestHistory] -> ShowS
ListVirtualInterfaceTestHistory -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualInterfaceTestHistory] -> ShowS
$cshowList :: [ListVirtualInterfaceTestHistory] -> ShowS
show :: ListVirtualInterfaceTestHistory -> String
$cshow :: ListVirtualInterfaceTestHistory -> String
showsPrec :: Int -> ListVirtualInterfaceTestHistory -> ShowS
$cshowsPrec :: Int -> ListVirtualInterfaceTestHistory -> ShowS
Prelude.Show, forall x.
Rep ListVirtualInterfaceTestHistory x
-> ListVirtualInterfaceTestHistory
forall x.
ListVirtualInterfaceTestHistory
-> Rep ListVirtualInterfaceTestHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVirtualInterfaceTestHistory x
-> ListVirtualInterfaceTestHistory
$cfrom :: forall x.
ListVirtualInterfaceTestHistory
-> Rep ListVirtualInterfaceTestHistory x
Prelude.Generic)

-- |
-- Create a value of 'ListVirtualInterfaceTestHistory' 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:
--
-- 'bgpPeers', 'listVirtualInterfaceTestHistory_bgpPeers' - The BGP peers that were placed in the DOWN state during the virtual
-- interface failover test.
--
-- 'maxResults', 'listVirtualInterfaceTestHistory_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- If @MaxResults@ is given a value larger than 100, only 100 results are
-- returned.
--
-- 'nextToken', 'listVirtualInterfaceTestHistory_nextToken' - The token for the next page of results.
--
-- 'status', 'listVirtualInterfaceTestHistory_status' - The status of the virtual interface failover test.
--
-- 'testId', 'listVirtualInterfaceTestHistory_testId' - The ID of the virtual interface failover test.
--
-- 'virtualInterfaceId', 'listVirtualInterfaceTestHistory_virtualInterfaceId' - The ID of the virtual interface that was tested.
newListVirtualInterfaceTestHistory ::
  ListVirtualInterfaceTestHistory
newListVirtualInterfaceTestHistory :: ListVirtualInterfaceTestHistory
newListVirtualInterfaceTestHistory =
  ListVirtualInterfaceTestHistory'
    { $sel:bgpPeers:ListVirtualInterfaceTestHistory' :: Maybe [Text]
bgpPeers =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListVirtualInterfaceTestHistory' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVirtualInterfaceTestHistory' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListVirtualInterfaceTestHistory' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
      $sel:testId:ListVirtualInterfaceTestHistory' :: Maybe Text
testId = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: Maybe Text
virtualInterfaceId = forall a. Maybe a
Prelude.Nothing
    }

-- | The BGP peers that were placed in the DOWN state during the virtual
-- interface failover test.
listVirtualInterfaceTestHistory_bgpPeers :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe [Prelude.Text])
listVirtualInterfaceTestHistory_bgpPeers :: Lens' ListVirtualInterfaceTestHistory (Maybe [Text])
listVirtualInterfaceTestHistory_bgpPeers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistory' {Maybe [Text]
bgpPeers :: Maybe [Text]
$sel:bgpPeers:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe [Text]
bgpPeers} -> Maybe [Text]
bgpPeers) (\s :: ListVirtualInterfaceTestHistory
s@ListVirtualInterfaceTestHistory' {} Maybe [Text]
a -> ListVirtualInterfaceTestHistory
s {$sel:bgpPeers:ListVirtualInterfaceTestHistory' :: Maybe [Text]
bgpPeers = Maybe [Text]
a} :: ListVirtualInterfaceTestHistory) 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 maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- If @MaxResults@ is given a value larger than 100, only 100 results are
-- returned.
listVirtualInterfaceTestHistory_maxResults :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Int)
listVirtualInterfaceTestHistory_maxResults :: Lens' ListVirtualInterfaceTestHistory (Maybe Int)
listVirtualInterfaceTestHistory_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistory' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListVirtualInterfaceTestHistory
s@ListVirtualInterfaceTestHistory' {} Maybe Int
a -> ListVirtualInterfaceTestHistory
s {$sel:maxResults:ListVirtualInterfaceTestHistory' :: Maybe Int
maxResults = Maybe Int
a} :: ListVirtualInterfaceTestHistory)

-- | The token for the next page of results.
listVirtualInterfaceTestHistory_nextToken :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_nextToken :: Lens' ListVirtualInterfaceTestHistory (Maybe Text)
listVirtualInterfaceTestHistory_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistory' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVirtualInterfaceTestHistory
s@ListVirtualInterfaceTestHistory' {} Maybe Text
a -> ListVirtualInterfaceTestHistory
s {$sel:nextToken:ListVirtualInterfaceTestHistory' :: Maybe Text
nextToken = Maybe Text
a} :: ListVirtualInterfaceTestHistory)

-- | The status of the virtual interface failover test.
listVirtualInterfaceTestHistory_status :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_status :: Lens' ListVirtualInterfaceTestHistory (Maybe Text)
listVirtualInterfaceTestHistory_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistory' {Maybe Text
status :: Maybe Text
$sel:status:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
status} -> Maybe Text
status) (\s :: ListVirtualInterfaceTestHistory
s@ListVirtualInterfaceTestHistory' {} Maybe Text
a -> ListVirtualInterfaceTestHistory
s {$sel:status:ListVirtualInterfaceTestHistory' :: Maybe Text
status = Maybe Text
a} :: ListVirtualInterfaceTestHistory)

-- | The ID of the virtual interface failover test.
listVirtualInterfaceTestHistory_testId :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_testId :: Lens' ListVirtualInterfaceTestHistory (Maybe Text)
listVirtualInterfaceTestHistory_testId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistory' {Maybe Text
testId :: Maybe Text
$sel:testId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
testId} -> Maybe Text
testId) (\s :: ListVirtualInterfaceTestHistory
s@ListVirtualInterfaceTestHistory' {} Maybe Text
a -> ListVirtualInterfaceTestHistory
s {$sel:testId:ListVirtualInterfaceTestHistory' :: Maybe Text
testId = Maybe Text
a} :: ListVirtualInterfaceTestHistory)

-- | The ID of the virtual interface that was tested.
listVirtualInterfaceTestHistory_virtualInterfaceId :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_virtualInterfaceId :: Lens' ListVirtualInterfaceTestHistory (Maybe Text)
listVirtualInterfaceTestHistory_virtualInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistory' {Maybe Text
virtualInterfaceId :: Maybe Text
$sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
virtualInterfaceId} -> Maybe Text
virtualInterfaceId) (\s :: ListVirtualInterfaceTestHistory
s@ListVirtualInterfaceTestHistory' {} Maybe Text
a -> ListVirtualInterfaceTestHistory
s {$sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: Maybe Text
virtualInterfaceId = Maybe Text
a} :: ListVirtualInterfaceTestHistory)

instance
  Core.AWSRequest
    ListVirtualInterfaceTestHistory
  where
  type
    AWSResponse ListVirtualInterfaceTestHistory =
      ListVirtualInterfaceTestHistoryResponse
  request :: (Service -> Service)
-> ListVirtualInterfaceTestHistory
-> Request ListVirtualInterfaceTestHistory
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 ListVirtualInterfaceTestHistory
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListVirtualInterfaceTestHistory)))
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 Text
-> Maybe [VirtualInterfaceTestHistory]
-> Int
-> ListVirtualInterfaceTestHistoryResponse
ListVirtualInterfaceTestHistoryResponse'
            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
"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
"virtualInterfaceTestHistory"
                            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListVirtualInterfaceTestHistory
  where
  hashWithSalt :: Int -> ListVirtualInterfaceTestHistory -> Int
hashWithSalt
    Int
_salt
    ListVirtualInterfaceTestHistory' {Maybe Int
Maybe [Text]
Maybe Text
virtualInterfaceId :: Maybe Text
testId :: Maybe Text
status :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
bgpPeers :: Maybe [Text]
$sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:testId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:status:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:nextToken:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:maxResults:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Int
$sel:bgpPeers:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
bgpPeers
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
testId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualInterfaceId

instance
  Prelude.NFData
    ListVirtualInterfaceTestHistory
  where
  rnf :: ListVirtualInterfaceTestHistory -> ()
rnf ListVirtualInterfaceTestHistory' {Maybe Int
Maybe [Text]
Maybe Text
virtualInterfaceId :: Maybe Text
testId :: Maybe Text
status :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
bgpPeers :: Maybe [Text]
$sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:testId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:status:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:nextToken:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:maxResults:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Int
$sel:bgpPeers:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
bgpPeers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      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 Text
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
testId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualInterfaceId

instance
  Data.ToHeaders
    ListVirtualInterfaceTestHistory
  where
  toHeaders :: ListVirtualInterfaceTestHistory -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OvertureService.ListVirtualInterfaceTestHistory" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListVirtualInterfaceTestHistory where
  toJSON :: ListVirtualInterfaceTestHistory -> Value
toJSON ListVirtualInterfaceTestHistory' {Maybe Int
Maybe [Text]
Maybe Text
virtualInterfaceId :: Maybe Text
testId :: Maybe Text
status :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
bgpPeers :: Maybe [Text]
$sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:testId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:status:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:nextToken:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:maxResults:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Int
$sel:bgpPeers:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"bgpPeers" 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]
bgpPeers,
            (Key
"maxResults" 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 Int
maxResults,
            (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,
            (Key
"status" 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
status,
            (Key
"testId" 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
testId,
            (Key
"virtualInterfaceId" 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
virtualInterfaceId
          ]
      )

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

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

-- | /See:/ 'newListVirtualInterfaceTestHistoryResponse' smart constructor.
data ListVirtualInterfaceTestHistoryResponse = ListVirtualInterfaceTestHistoryResponse'
  { -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    ListVirtualInterfaceTestHistoryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the tested virtual interface.
    ListVirtualInterfaceTestHistoryResponse
-> Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory :: Prelude.Maybe [VirtualInterfaceTestHistory],
    -- | The response's http status code.
    ListVirtualInterfaceTestHistoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListVirtualInterfaceTestHistoryResponse
-> ListVirtualInterfaceTestHistoryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualInterfaceTestHistoryResponse
-> ListVirtualInterfaceTestHistoryResponse -> Bool
$c/= :: ListVirtualInterfaceTestHistoryResponse
-> ListVirtualInterfaceTestHistoryResponse -> Bool
== :: ListVirtualInterfaceTestHistoryResponse
-> ListVirtualInterfaceTestHistoryResponse -> Bool
$c== :: ListVirtualInterfaceTestHistoryResponse
-> ListVirtualInterfaceTestHistoryResponse -> Bool
Prelude.Eq, ReadPrec [ListVirtualInterfaceTestHistoryResponse]
ReadPrec ListVirtualInterfaceTestHistoryResponse
Int -> ReadS ListVirtualInterfaceTestHistoryResponse
ReadS [ListVirtualInterfaceTestHistoryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualInterfaceTestHistoryResponse]
$creadListPrec :: ReadPrec [ListVirtualInterfaceTestHistoryResponse]
readPrec :: ReadPrec ListVirtualInterfaceTestHistoryResponse
$creadPrec :: ReadPrec ListVirtualInterfaceTestHistoryResponse
readList :: ReadS [ListVirtualInterfaceTestHistoryResponse]
$creadList :: ReadS [ListVirtualInterfaceTestHistoryResponse]
readsPrec :: Int -> ReadS ListVirtualInterfaceTestHistoryResponse
$creadsPrec :: Int -> ReadS ListVirtualInterfaceTestHistoryResponse
Prelude.Read, Int -> ListVirtualInterfaceTestHistoryResponse -> ShowS
[ListVirtualInterfaceTestHistoryResponse] -> ShowS
ListVirtualInterfaceTestHistoryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualInterfaceTestHistoryResponse] -> ShowS
$cshowList :: [ListVirtualInterfaceTestHistoryResponse] -> ShowS
show :: ListVirtualInterfaceTestHistoryResponse -> String
$cshow :: ListVirtualInterfaceTestHistoryResponse -> String
showsPrec :: Int -> ListVirtualInterfaceTestHistoryResponse -> ShowS
$cshowsPrec :: Int -> ListVirtualInterfaceTestHistoryResponse -> ShowS
Prelude.Show, forall x.
Rep ListVirtualInterfaceTestHistoryResponse x
-> ListVirtualInterfaceTestHistoryResponse
forall x.
ListVirtualInterfaceTestHistoryResponse
-> Rep ListVirtualInterfaceTestHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVirtualInterfaceTestHistoryResponse x
-> ListVirtualInterfaceTestHistoryResponse
$cfrom :: forall x.
ListVirtualInterfaceTestHistoryResponse
-> Rep ListVirtualInterfaceTestHistoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVirtualInterfaceTestHistoryResponse' 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:
--
-- 'nextToken', 'listVirtualInterfaceTestHistoryResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'virtualInterfaceTestHistory', 'listVirtualInterfaceTestHistoryResponse_virtualInterfaceTestHistory' - The ID of the tested virtual interface.
--
-- 'httpStatus', 'listVirtualInterfaceTestHistoryResponse_httpStatus' - The response's http status code.
newListVirtualInterfaceTestHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVirtualInterfaceTestHistoryResponse
newListVirtualInterfaceTestHistoryResponse :: Int -> ListVirtualInterfaceTestHistoryResponse
newListVirtualInterfaceTestHistoryResponse
  Int
pHttpStatus_ =
    ListVirtualInterfaceTestHistoryResponse'
      { $sel:nextToken:ListVirtualInterfaceTestHistoryResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:virtualInterfaceTestHistory:ListVirtualInterfaceTestHistoryResponse' :: Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListVirtualInterfaceTestHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
listVirtualInterfaceTestHistoryResponse_nextToken :: Lens.Lens' ListVirtualInterfaceTestHistoryResponse (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistoryResponse_nextToken :: Lens' ListVirtualInterfaceTestHistoryResponse (Maybe Text)
listVirtualInterfaceTestHistoryResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistoryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVirtualInterfaceTestHistoryResponse' :: ListVirtualInterfaceTestHistoryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVirtualInterfaceTestHistoryResponse
s@ListVirtualInterfaceTestHistoryResponse' {} Maybe Text
a -> ListVirtualInterfaceTestHistoryResponse
s {$sel:nextToken:ListVirtualInterfaceTestHistoryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVirtualInterfaceTestHistoryResponse)

-- | The ID of the tested virtual interface.
listVirtualInterfaceTestHistoryResponse_virtualInterfaceTestHistory :: Lens.Lens' ListVirtualInterfaceTestHistoryResponse (Prelude.Maybe [VirtualInterfaceTestHistory])
listVirtualInterfaceTestHistoryResponse_virtualInterfaceTestHistory :: Lens'
  ListVirtualInterfaceTestHistoryResponse
  (Maybe [VirtualInterfaceTestHistory])
listVirtualInterfaceTestHistoryResponse_virtualInterfaceTestHistory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistoryResponse' {Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory :: Maybe [VirtualInterfaceTestHistory]
$sel:virtualInterfaceTestHistory:ListVirtualInterfaceTestHistoryResponse' :: ListVirtualInterfaceTestHistoryResponse
-> Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory} -> Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory) (\s :: ListVirtualInterfaceTestHistoryResponse
s@ListVirtualInterfaceTestHistoryResponse' {} Maybe [VirtualInterfaceTestHistory]
a -> ListVirtualInterfaceTestHistoryResponse
s {$sel:virtualInterfaceTestHistory:ListVirtualInterfaceTestHistoryResponse' :: Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory = Maybe [VirtualInterfaceTestHistory]
a} :: ListVirtualInterfaceTestHistoryResponse) 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 response's http status code.
listVirtualInterfaceTestHistoryResponse_httpStatus :: Lens.Lens' ListVirtualInterfaceTestHistoryResponse Prelude.Int
listVirtualInterfaceTestHistoryResponse_httpStatus :: Lens' ListVirtualInterfaceTestHistoryResponse Int
listVirtualInterfaceTestHistoryResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualInterfaceTestHistoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVirtualInterfaceTestHistoryResponse' :: ListVirtualInterfaceTestHistoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVirtualInterfaceTestHistoryResponse
s@ListVirtualInterfaceTestHistoryResponse' {} Int
a -> ListVirtualInterfaceTestHistoryResponse
s {$sel:httpStatus:ListVirtualInterfaceTestHistoryResponse' :: Int
httpStatus = Int
a} :: ListVirtualInterfaceTestHistoryResponse)

instance
  Prelude.NFData
    ListVirtualInterfaceTestHistoryResponse
  where
  rnf :: ListVirtualInterfaceTestHistoryResponse -> ()
rnf ListVirtualInterfaceTestHistoryResponse' {Int
Maybe [VirtualInterfaceTestHistory]
Maybe Text
httpStatus :: Int
virtualInterfaceTestHistory :: Maybe [VirtualInterfaceTestHistory]
nextToken :: Maybe Text
$sel:httpStatus:ListVirtualInterfaceTestHistoryResponse' :: ListVirtualInterfaceTestHistoryResponse -> Int
$sel:virtualInterfaceTestHistory:ListVirtualInterfaceTestHistoryResponse' :: ListVirtualInterfaceTestHistoryResponse
-> Maybe [VirtualInterfaceTestHistory]
$sel:nextToken:ListVirtualInterfaceTestHistoryResponse' :: ListVirtualInterfaceTestHistoryResponse -> Maybe Text
..} =
    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 [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus