{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.VirtualInterfaceTestHistory
-- 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)
module Amazonka.DirectConnect.Types.VirtualInterfaceTestHistory where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the virtual interface failover test.
--
-- /See:/ 'newVirtualInterfaceTestHistory' smart constructor.
data VirtualInterfaceTestHistory = VirtualInterfaceTestHistory'
  { -- | The BGP peers that were put in the DOWN state as part of the virtual
    -- interface failover test.
    VirtualInterfaceTestHistory -> Maybe [Text]
bgpPeers :: Prelude.Maybe [Prelude.Text],
    -- | The status of the virtual interface failover test.
    VirtualInterfaceTestHistory -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The time that the virtual interface failover test ran in minutes.
    VirtualInterfaceTestHistory -> Maybe Int
testDurationInMinutes :: Prelude.Maybe Prelude.Int,
    -- | The time that the virtual interface moves to the DOWN state.
    VirtualInterfaceTestHistory -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the virtual interface failover test.
    VirtualInterfaceTestHistory -> Maybe Text
testId :: Prelude.Maybe Prelude.Text,
    -- | The time that the virtual interface moves out of the DOWN state.
    VirtualInterfaceTestHistory -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The owner ID of the tested virtual interface.
    VirtualInterfaceTestHistory -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
    -- | The ID of the tested virtual interface.
    VirtualInterfaceTestHistory -> Maybe Text
virtualInterfaceId :: Prelude.Maybe Prelude.Text
  }
  deriving (VirtualInterfaceTestHistory -> VirtualInterfaceTestHistory -> Bool
(VirtualInterfaceTestHistory
 -> VirtualInterfaceTestHistory -> Bool)
-> (VirtualInterfaceTestHistory
    -> VirtualInterfaceTestHistory -> Bool)
-> Eq VirtualInterfaceTestHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualInterfaceTestHistory -> VirtualInterfaceTestHistory -> Bool
$c/= :: VirtualInterfaceTestHistory -> VirtualInterfaceTestHistory -> Bool
== :: VirtualInterfaceTestHistory -> VirtualInterfaceTestHistory -> Bool
$c== :: VirtualInterfaceTestHistory -> VirtualInterfaceTestHistory -> Bool
Prelude.Eq, ReadPrec [VirtualInterfaceTestHistory]
ReadPrec VirtualInterfaceTestHistory
Int -> ReadS VirtualInterfaceTestHistory
ReadS [VirtualInterfaceTestHistory]
(Int -> ReadS VirtualInterfaceTestHistory)
-> ReadS [VirtualInterfaceTestHistory]
-> ReadPrec VirtualInterfaceTestHistory
-> ReadPrec [VirtualInterfaceTestHistory]
-> Read VirtualInterfaceTestHistory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VirtualInterfaceTestHistory]
$creadListPrec :: ReadPrec [VirtualInterfaceTestHistory]
readPrec :: ReadPrec VirtualInterfaceTestHistory
$creadPrec :: ReadPrec VirtualInterfaceTestHistory
readList :: ReadS [VirtualInterfaceTestHistory]
$creadList :: ReadS [VirtualInterfaceTestHistory]
readsPrec :: Int -> ReadS VirtualInterfaceTestHistory
$creadsPrec :: Int -> ReadS VirtualInterfaceTestHistory
Prelude.Read, Int -> VirtualInterfaceTestHistory -> ShowS
[VirtualInterfaceTestHistory] -> ShowS
VirtualInterfaceTestHistory -> String
(Int -> VirtualInterfaceTestHistory -> ShowS)
-> (VirtualInterfaceTestHistory -> String)
-> ([VirtualInterfaceTestHistory] -> ShowS)
-> Show VirtualInterfaceTestHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualInterfaceTestHistory] -> ShowS
$cshowList :: [VirtualInterfaceTestHistory] -> ShowS
show :: VirtualInterfaceTestHistory -> String
$cshow :: VirtualInterfaceTestHistory -> String
showsPrec :: Int -> VirtualInterfaceTestHistory -> ShowS
$cshowsPrec :: Int -> VirtualInterfaceTestHistory -> ShowS
Prelude.Show, (forall x.
 VirtualInterfaceTestHistory -> Rep VirtualInterfaceTestHistory x)
-> (forall x.
    Rep VirtualInterfaceTestHistory x -> VirtualInterfaceTestHistory)
-> Generic VirtualInterfaceTestHistory
forall x.
Rep VirtualInterfaceTestHistory x -> VirtualInterfaceTestHistory
forall x.
VirtualInterfaceTestHistory -> Rep VirtualInterfaceTestHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VirtualInterfaceTestHistory x -> VirtualInterfaceTestHistory
$cfrom :: forall x.
VirtualInterfaceTestHistory -> Rep VirtualInterfaceTestHistory x
Prelude.Generic)

-- |
-- Create a value of 'VirtualInterfaceTestHistory' 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', 'virtualInterfaceTestHistory_bgpPeers' - The BGP peers that were put in the DOWN state as part of the virtual
-- interface failover test.
--
-- 'status', 'virtualInterfaceTestHistory_status' - The status of the virtual interface failover test.
--
-- 'testDurationInMinutes', 'virtualInterfaceTestHistory_testDurationInMinutes' - The time that the virtual interface failover test ran in minutes.
--
-- 'startTime', 'virtualInterfaceTestHistory_startTime' - The time that the virtual interface moves to the DOWN state.
--
-- 'testId', 'virtualInterfaceTestHistory_testId' - The ID of the virtual interface failover test.
--
-- 'endTime', 'virtualInterfaceTestHistory_endTime' - The time that the virtual interface moves out of the DOWN state.
--
-- 'ownerAccount', 'virtualInterfaceTestHistory_ownerAccount' - The owner ID of the tested virtual interface.
--
-- 'virtualInterfaceId', 'virtualInterfaceTestHistory_virtualInterfaceId' - The ID of the tested virtual interface.
newVirtualInterfaceTestHistory ::
  VirtualInterfaceTestHistory
newVirtualInterfaceTestHistory :: VirtualInterfaceTestHistory
newVirtualInterfaceTestHistory =
  VirtualInterfaceTestHistory' :: Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> VirtualInterfaceTestHistory
VirtualInterfaceTestHistory'
    { $sel:bgpPeers:VirtualInterfaceTestHistory' :: Maybe [Text]
bgpPeers =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:VirtualInterfaceTestHistory' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:testDurationInMinutes:VirtualInterfaceTestHistory' :: Maybe Int
testDurationInMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:VirtualInterfaceTestHistory' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:testId:VirtualInterfaceTestHistory' :: Maybe Text
testId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:VirtualInterfaceTestHistory' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccount:VirtualInterfaceTestHistory' :: Maybe Text
ownerAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceId:VirtualInterfaceTestHistory' :: Maybe Text
virtualInterfaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The BGP peers that were put in the DOWN state as part of the virtual
-- interface failover test.
virtualInterfaceTestHistory_bgpPeers :: Lens.Lens' VirtualInterfaceTestHistory (Prelude.Maybe [Prelude.Text])
virtualInterfaceTestHistory_bgpPeers :: (Maybe [Text] -> f (Maybe [Text]))
-> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory
virtualInterfaceTestHistory_bgpPeers = (VirtualInterfaceTestHistory -> Maybe [Text])
-> (VirtualInterfaceTestHistory
    -> Maybe [Text] -> VirtualInterfaceTestHistory)
-> Lens
     VirtualInterfaceTestHistory
     VirtualInterfaceTestHistory
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualInterfaceTestHistory' {Maybe [Text]
bgpPeers :: Maybe [Text]
$sel:bgpPeers:VirtualInterfaceTestHistory' :: VirtualInterfaceTestHistory -> Maybe [Text]
bgpPeers} -> Maybe [Text]
bgpPeers) (\s :: VirtualInterfaceTestHistory
s@VirtualInterfaceTestHistory' {} Maybe [Text]
a -> VirtualInterfaceTestHistory
s {$sel:bgpPeers:VirtualInterfaceTestHistory' :: Maybe [Text]
bgpPeers = Maybe [Text]
a} :: VirtualInterfaceTestHistory) ((Maybe [Text] -> f (Maybe [Text]))
 -> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VirtualInterfaceTestHistory
-> f VirtualInterfaceTestHistory
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.
virtualInterfaceTestHistory_status :: Lens.Lens' VirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
virtualInterfaceTestHistory_status :: (Maybe Text -> f (Maybe Text))
-> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory
virtualInterfaceTestHistory_status = (VirtualInterfaceTestHistory -> Maybe Text)
-> (VirtualInterfaceTestHistory
    -> Maybe Text -> VirtualInterfaceTestHistory)
-> Lens
     VirtualInterfaceTestHistory
     VirtualInterfaceTestHistory
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualInterfaceTestHistory' {Maybe Text
status :: Maybe Text
$sel:status:VirtualInterfaceTestHistory' :: VirtualInterfaceTestHistory -> Maybe Text
status} -> Maybe Text
status) (\s :: VirtualInterfaceTestHistory
s@VirtualInterfaceTestHistory' {} Maybe Text
a -> VirtualInterfaceTestHistory
s {$sel:status:VirtualInterfaceTestHistory' :: Maybe Text
status = Maybe Text
a} :: VirtualInterfaceTestHistory)

-- | The time that the virtual interface failover test ran in minutes.
virtualInterfaceTestHistory_testDurationInMinutes :: Lens.Lens' VirtualInterfaceTestHistory (Prelude.Maybe Prelude.Int)
virtualInterfaceTestHistory_testDurationInMinutes :: (Maybe Int -> f (Maybe Int))
-> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory
virtualInterfaceTestHistory_testDurationInMinutes = (VirtualInterfaceTestHistory -> Maybe Int)
-> (VirtualInterfaceTestHistory
    -> Maybe Int -> VirtualInterfaceTestHistory)
-> Lens
     VirtualInterfaceTestHistory
     VirtualInterfaceTestHistory
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualInterfaceTestHistory' {Maybe Int
testDurationInMinutes :: Maybe Int
$sel:testDurationInMinutes:VirtualInterfaceTestHistory' :: VirtualInterfaceTestHistory -> Maybe Int
testDurationInMinutes} -> Maybe Int
testDurationInMinutes) (\s :: VirtualInterfaceTestHistory
s@VirtualInterfaceTestHistory' {} Maybe Int
a -> VirtualInterfaceTestHistory
s {$sel:testDurationInMinutes:VirtualInterfaceTestHistory' :: Maybe Int
testDurationInMinutes = Maybe Int
a} :: VirtualInterfaceTestHistory)

-- | The time that the virtual interface moves to the DOWN state.
virtualInterfaceTestHistory_startTime :: Lens.Lens' VirtualInterfaceTestHistory (Prelude.Maybe Prelude.UTCTime)
virtualInterfaceTestHistory_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory
virtualInterfaceTestHistory_startTime = (VirtualInterfaceTestHistory -> Maybe POSIX)
-> (VirtualInterfaceTestHistory
    -> Maybe POSIX -> VirtualInterfaceTestHistory)
-> Lens
     VirtualInterfaceTestHistory
     VirtualInterfaceTestHistory
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualInterfaceTestHistory' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:VirtualInterfaceTestHistory' :: VirtualInterfaceTestHistory -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: VirtualInterfaceTestHistory
s@VirtualInterfaceTestHistory' {} Maybe POSIX
a -> VirtualInterfaceTestHistory
s {$sel:startTime:VirtualInterfaceTestHistory' :: Maybe POSIX
startTime = Maybe POSIX
a} :: VirtualInterfaceTestHistory) ((Maybe POSIX -> f (Maybe POSIX))
 -> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> VirtualInterfaceTestHistory
-> f VirtualInterfaceTestHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The time that the virtual interface moves out of the DOWN state.
virtualInterfaceTestHistory_endTime :: Lens.Lens' VirtualInterfaceTestHistory (Prelude.Maybe Prelude.UTCTime)
virtualInterfaceTestHistory_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory
virtualInterfaceTestHistory_endTime = (VirtualInterfaceTestHistory -> Maybe POSIX)
-> (VirtualInterfaceTestHistory
    -> Maybe POSIX -> VirtualInterfaceTestHistory)
-> Lens
     VirtualInterfaceTestHistory
     VirtualInterfaceTestHistory
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualInterfaceTestHistory' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:VirtualInterfaceTestHistory' :: VirtualInterfaceTestHistory -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: VirtualInterfaceTestHistory
s@VirtualInterfaceTestHistory' {} Maybe POSIX
a -> VirtualInterfaceTestHistory
s {$sel:endTime:VirtualInterfaceTestHistory' :: Maybe POSIX
endTime = Maybe POSIX
a} :: VirtualInterfaceTestHistory) ((Maybe POSIX -> f (Maybe POSIX))
 -> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> VirtualInterfaceTestHistory
-> f VirtualInterfaceTestHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The owner ID of the tested virtual interface.
virtualInterfaceTestHistory_ownerAccount :: Lens.Lens' VirtualInterfaceTestHistory (Prelude.Maybe Prelude.Text)
virtualInterfaceTestHistory_ownerAccount :: (Maybe Text -> f (Maybe Text))
-> VirtualInterfaceTestHistory -> f VirtualInterfaceTestHistory
virtualInterfaceTestHistory_ownerAccount = (VirtualInterfaceTestHistory -> Maybe Text)
-> (VirtualInterfaceTestHistory
    -> Maybe Text -> VirtualInterfaceTestHistory)
-> Lens
     VirtualInterfaceTestHistory
     VirtualInterfaceTestHistory
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualInterfaceTestHistory' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:VirtualInterfaceTestHistory' :: VirtualInterfaceTestHistory -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: VirtualInterfaceTestHistory
s@VirtualInterfaceTestHistory' {} Maybe Text
a -> VirtualInterfaceTestHistory
s {$sel:ownerAccount:VirtualInterfaceTestHistory' :: Maybe Text
ownerAccount = Maybe Text
a} :: VirtualInterfaceTestHistory)

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

instance Core.FromJSON VirtualInterfaceTestHistory where
  parseJSON :: Value -> Parser VirtualInterfaceTestHistory
parseJSON =
    String
-> (Object -> Parser VirtualInterfaceTestHistory)
-> Value
-> Parser VirtualInterfaceTestHistory
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VirtualInterfaceTestHistory"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> VirtualInterfaceTestHistory
VirtualInterfaceTestHistory'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> VirtualInterfaceTestHistory)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bgpPeers" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> VirtualInterfaceTestHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> VirtualInterfaceTestHistory)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"testDurationInMinutes")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> VirtualInterfaceTestHistory)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startTime")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> VirtualInterfaceTestHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"testId")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> VirtualInterfaceTestHistory)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"endTime")
            Parser (Maybe Text -> Maybe Text -> VirtualInterfaceTestHistory)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> VirtualInterfaceTestHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ownerAccount")
            Parser (Maybe Text -> VirtualInterfaceTestHistory)
-> Parser (Maybe Text) -> Parser VirtualInterfaceTestHistory
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"virtualInterfaceId")
      )

instance Prelude.Hashable VirtualInterfaceTestHistory

instance Prelude.NFData VirtualInterfaceTestHistory