{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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_status,
    listVirtualInterfaceTestHistory_testId,
    listVirtualInterfaceTestHistory_nextToken,
    listVirtualInterfaceTestHistory_maxResults,
    listVirtualInterfaceTestHistory_virtualInterfaceId,

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

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

import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types
import qualified Amazonka.Lens as Lens
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 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 token for the next page of results.
    ListVirtualInterfaceTestHistory -> Maybe Text
nextToken :: 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 ID of the virtual interface that was tested.
    ListVirtualInterfaceTestHistory -> Maybe Text
virtualInterfaceId :: Prelude.Maybe Prelude.Text
  }
  deriving (ListVirtualInterfaceTestHistory
-> ListVirtualInterfaceTestHistory -> Bool
(ListVirtualInterfaceTestHistory
 -> ListVirtualInterfaceTestHistory -> Bool)
-> (ListVirtualInterfaceTestHistory
    -> ListVirtualInterfaceTestHistory -> Bool)
-> Eq ListVirtualInterfaceTestHistory
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]
(Int -> ReadS ListVirtualInterfaceTestHistory)
-> ReadS [ListVirtualInterfaceTestHistory]
-> ReadPrec ListVirtualInterfaceTestHistory
-> ReadPrec [ListVirtualInterfaceTestHistory]
-> Read 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
(Int -> ListVirtualInterfaceTestHistory -> ShowS)
-> (ListVirtualInterfaceTestHistory -> String)
-> ([ListVirtualInterfaceTestHistory] -> ShowS)
-> Show ListVirtualInterfaceTestHistory
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.
 ListVirtualInterfaceTestHistory
 -> Rep ListVirtualInterfaceTestHistory x)
-> (forall x.
    Rep ListVirtualInterfaceTestHistory x
    -> ListVirtualInterfaceTestHistory)
-> Generic ListVirtualInterfaceTestHistory
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.
--
-- 'status', 'listVirtualInterfaceTestHistory_status' - The status of the virtual interface failover test.
--
-- 'testId', 'listVirtualInterfaceTestHistory_testId' - The ID of the virtual interface failover test.
--
-- 'nextToken', 'listVirtualInterfaceTestHistory_nextToken' - The token for the next page of results.
--
-- '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.
--
-- 'virtualInterfaceId', 'listVirtualInterfaceTestHistory_virtualInterfaceId' - The ID of the virtual interface that was tested.
newListVirtualInterfaceTestHistory ::
  ListVirtualInterfaceTestHistory
newListVirtualInterfaceTestHistory :: ListVirtualInterfaceTestHistory
newListVirtualInterfaceTestHistory =
  ListVirtualInterfaceTestHistory' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ListVirtualInterfaceTestHistory
ListVirtualInterfaceTestHistory'
    { $sel:bgpPeers:ListVirtualInterfaceTestHistory' :: Maybe [Text]
bgpPeers =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListVirtualInterfaceTestHistory' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:testId:ListVirtualInterfaceTestHistory' :: Maybe Text
testId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVirtualInterfaceTestHistory' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListVirtualInterfaceTestHistory' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: Maybe Text
virtualInterfaceId = Maybe Text
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
listVirtualInterfaceTestHistory_bgpPeers = (ListVirtualInterfaceTestHistory -> Maybe [Text])
-> (ListVirtualInterfaceTestHistory
    -> Maybe [Text] -> ListVirtualInterfaceTestHistory)
-> Lens
     ListVirtualInterfaceTestHistory
     ListVirtualInterfaceTestHistory
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListVirtualInterfaceTestHistory
 -> f ListVirtualInterfaceTestHistory)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status of the virtual interface failover test.
listVirtualInterfaceTestHistory_status :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_status :: (Maybe Text -> f (Maybe Text))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
listVirtualInterfaceTestHistory_status = (ListVirtualInterfaceTestHistory -> Maybe Text)
-> (ListVirtualInterfaceTestHistory
    -> Maybe Text -> ListVirtualInterfaceTestHistory)
-> Lens
     ListVirtualInterfaceTestHistory
     ListVirtualInterfaceTestHistory
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
listVirtualInterfaceTestHistory_testId = (ListVirtualInterfaceTestHistory -> Maybe Text)
-> (ListVirtualInterfaceTestHistory
    -> Maybe Text -> ListVirtualInterfaceTestHistory)
-> Lens
     ListVirtualInterfaceTestHistory
     ListVirtualInterfaceTestHistory
     (Maybe Text)
     (Maybe Text)
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 token for the next page of results.
listVirtualInterfaceTestHistory_nextToken :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
listVirtualInterfaceTestHistory_nextToken = (ListVirtualInterfaceTestHistory -> Maybe Text)
-> (ListVirtualInterfaceTestHistory
    -> Maybe Text -> ListVirtualInterfaceTestHistory)
-> Lens
     ListVirtualInterfaceTestHistory
     ListVirtualInterfaceTestHistory
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Int -> f (Maybe Int))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
listVirtualInterfaceTestHistory_maxResults = (ListVirtualInterfaceTestHistory -> Maybe Int)
-> (ListVirtualInterfaceTestHistory
    -> Maybe Int -> ListVirtualInterfaceTestHistory)
-> Lens
     ListVirtualInterfaceTestHistory
     ListVirtualInterfaceTestHistory
     (Maybe Int)
     (Maybe Int)
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 ID of the virtual interface that was tested.
listVirtualInterfaceTestHistory_virtualInterfaceId :: Lens.Lens' ListVirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
listVirtualInterfaceTestHistory_virtualInterfaceId :: (Maybe Text -> f (Maybe Text))
-> ListVirtualInterfaceTestHistory
-> f ListVirtualInterfaceTestHistory
listVirtualInterfaceTestHistory_virtualInterfaceId = (ListVirtualInterfaceTestHistory -> Maybe Text)
-> (ListVirtualInterfaceTestHistory
    -> Maybe Text -> ListVirtualInterfaceTestHistory)
-> Lens
     ListVirtualInterfaceTestHistory
     ListVirtualInterfaceTestHistory
     (Maybe Text)
     (Maybe Text)
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 :: ListVirtualInterfaceTestHistory
-> Request ListVirtualInterfaceTestHistory
request = Service
-> ListVirtualInterfaceTestHistory
-> Request ListVirtualInterfaceTestHistory
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListVirtualInterfaceTestHistory
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListVirtualInterfaceTestHistory)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListVirtualInterfaceTestHistory))
-> Logger
-> Service
-> Proxy ListVirtualInterfaceTestHistory
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListVirtualInterfaceTestHistory)))
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 Text
-> Maybe [VirtualInterfaceTestHistory]
-> Int
-> ListVirtualInterfaceTestHistoryResponse
ListVirtualInterfaceTestHistoryResponse'
            (Maybe Text
 -> Maybe [VirtualInterfaceTestHistory]
 -> Int
 -> ListVirtualInterfaceTestHistoryResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [VirtualInterfaceTestHistory]
      -> Int -> ListVirtualInterfaceTestHistoryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String
  (Maybe [VirtualInterfaceTestHistory]
   -> Int -> ListVirtualInterfaceTestHistoryResponse)
-> Either String (Maybe [VirtualInterfaceTestHistory])
-> Either String (Int -> ListVirtualInterfaceTestHistoryResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [VirtualInterfaceTestHistory]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualInterfaceTestHistory"
                            Either String (Maybe (Maybe [VirtualInterfaceTestHistory]))
-> Maybe [VirtualInterfaceTestHistory]
-> Either String (Maybe [VirtualInterfaceTestHistory])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VirtualInterfaceTestHistory]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListVirtualInterfaceTestHistoryResponse)
-> Either String Int
-> Either String ListVirtualInterfaceTestHistoryResponse
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
    ListVirtualInterfaceTestHistory

instance
  Prelude.NFData
    ListVirtualInterfaceTestHistory

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

instance Core.ToJSON ListVirtualInterfaceTestHistory where
  toJSON :: ListVirtualInterfaceTestHistory -> Value
toJSON ListVirtualInterfaceTestHistory' {Maybe Int
Maybe [Text]
Maybe Text
virtualInterfaceId :: Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
testId :: Maybe Text
status :: Maybe Text
bgpPeers :: Maybe [Text]
$sel:virtualInterfaceId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:maxResults:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Int
$sel:nextToken:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:testId:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:status:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe Text
$sel:bgpPeers:ListVirtualInterfaceTestHistory' :: ListVirtualInterfaceTestHistory -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"bgpPeers" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
bgpPeers,
            (Text
"status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
            (Text
"testId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
testId,
            (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            (Text
"virtualInterfaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
virtualInterfaceId
          ]
      )

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

instance Core.ToQuery ListVirtualInterfaceTestHistory where
  toQuery :: ListVirtualInterfaceTestHistory -> QueryString
toQuery = QueryString -> ListVirtualInterfaceTestHistory -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(ListVirtualInterfaceTestHistoryResponse
 -> ListVirtualInterfaceTestHistoryResponse -> Bool)
-> (ListVirtualInterfaceTestHistoryResponse
    -> ListVirtualInterfaceTestHistoryResponse -> Bool)
-> Eq ListVirtualInterfaceTestHistoryResponse
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]
(Int -> ReadS ListVirtualInterfaceTestHistoryResponse)
-> ReadS [ListVirtualInterfaceTestHistoryResponse]
-> ReadPrec ListVirtualInterfaceTestHistoryResponse
-> ReadPrec [ListVirtualInterfaceTestHistoryResponse]
-> Read 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
(Int -> ListVirtualInterfaceTestHistoryResponse -> ShowS)
-> (ListVirtualInterfaceTestHistoryResponse -> String)
-> ([ListVirtualInterfaceTestHistoryResponse] -> ShowS)
-> Show ListVirtualInterfaceTestHistoryResponse
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.
 ListVirtualInterfaceTestHistoryResponse
 -> Rep ListVirtualInterfaceTestHistoryResponse x)
-> (forall x.
    Rep ListVirtualInterfaceTestHistoryResponse x
    -> ListVirtualInterfaceTestHistoryResponse)
-> Generic ListVirtualInterfaceTestHistoryResponse
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' :: Maybe Text
-> Maybe [VirtualInterfaceTestHistory]
-> Int
-> ListVirtualInterfaceTestHistoryResponse
ListVirtualInterfaceTestHistoryResponse'
      { $sel:nextToken:ListVirtualInterfaceTestHistoryResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:virtualInterfaceTestHistory:ListVirtualInterfaceTestHistoryResponse' :: Maybe [VirtualInterfaceTestHistory]
virtualInterfaceTestHistory =
          Maybe [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 :: (Maybe Text -> f (Maybe Text))
-> ListVirtualInterfaceTestHistoryResponse
-> f ListVirtualInterfaceTestHistoryResponse
listVirtualInterfaceTestHistoryResponse_nextToken = (ListVirtualInterfaceTestHistoryResponse -> Maybe Text)
-> (ListVirtualInterfaceTestHistoryResponse
    -> Maybe Text -> ListVirtualInterfaceTestHistoryResponse)
-> Lens
     ListVirtualInterfaceTestHistoryResponse
     ListVirtualInterfaceTestHistoryResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe [VirtualInterfaceTestHistory]
 -> f (Maybe [VirtualInterfaceTestHistory]))
-> ListVirtualInterfaceTestHistoryResponse
-> f ListVirtualInterfaceTestHistoryResponse
listVirtualInterfaceTestHistoryResponse_virtualInterfaceTestHistory = (ListVirtualInterfaceTestHistoryResponse
 -> Maybe [VirtualInterfaceTestHistory])
-> (ListVirtualInterfaceTestHistoryResponse
    -> Maybe [VirtualInterfaceTestHistory]
    -> ListVirtualInterfaceTestHistoryResponse)
-> Lens
     ListVirtualInterfaceTestHistoryResponse
     ListVirtualInterfaceTestHistoryResponse
     (Maybe [VirtualInterfaceTestHistory])
     (Maybe [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) ((Maybe [VirtualInterfaceTestHistory]
  -> f (Maybe [VirtualInterfaceTestHistory]))
 -> ListVirtualInterfaceTestHistoryResponse
 -> f ListVirtualInterfaceTestHistoryResponse)
-> ((Maybe [VirtualInterfaceTestHistory]
     -> f (Maybe [VirtualInterfaceTestHistory]))
    -> Maybe [VirtualInterfaceTestHistory]
    -> f (Maybe [VirtualInterfaceTestHistory]))
-> (Maybe [VirtualInterfaceTestHistory]
    -> f (Maybe [VirtualInterfaceTestHistory]))
-> ListVirtualInterfaceTestHistoryResponse
-> f ListVirtualInterfaceTestHistoryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VirtualInterfaceTestHistory]
  [VirtualInterfaceTestHistory]
  [VirtualInterfaceTestHistory]
  [VirtualInterfaceTestHistory]
-> Iso
     (Maybe [VirtualInterfaceTestHistory])
     (Maybe [VirtualInterfaceTestHistory])
     (Maybe [VirtualInterfaceTestHistory])
     (Maybe [VirtualInterfaceTestHistory])
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
  [VirtualInterfaceTestHistory]
  [VirtualInterfaceTestHistory]
  [VirtualInterfaceTestHistory]
  [VirtualInterfaceTestHistory]
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 :: (Int -> f Int)
-> ListVirtualInterfaceTestHistoryResponse
-> f ListVirtualInterfaceTestHistoryResponse
listVirtualInterfaceTestHistoryResponse_httpStatus = (ListVirtualInterfaceTestHistoryResponse -> Int)
-> (ListVirtualInterfaceTestHistoryResponse
    -> Int -> ListVirtualInterfaceTestHistoryResponse)
-> Lens
     ListVirtualInterfaceTestHistoryResponse
     ListVirtualInterfaceTestHistoryResponse
     Int
     Int
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