{-# 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.RouterType
-- 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.RouterType where

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

-- | Information about the virtual router.
--
-- /See:/ 'newRouterType' smart constructor.
data RouterType = RouterType'
  { -- | The vendor for the virtual interface\'s router.
    RouterType -> Maybe Text
vendor :: Prelude.Maybe Prelude.Text,
    -- | The virtual interface router platform.
    RouterType -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
    -- | The template for the virtual interface\'s router.
    RouterType -> Maybe Text
xsltTemplateName :: Prelude.Maybe Prelude.Text,
    -- | The router software.
    RouterType -> Maybe Text
software :: Prelude.Maybe Prelude.Text,
    -- | The MAC Security (MACsec) template for the virtual interface\'s router.
    RouterType -> Maybe Text
xsltTemplateNameForMacSec :: Prelude.Maybe Prelude.Text,
    -- | Identifies the router by a combination of vendor, platform, and software
    -- version. For example, @CiscoSystemsInc-2900SeriesRouters-IOS124@.
    RouterType -> Maybe Text
routerTypeIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (RouterType -> RouterType -> Bool
(RouterType -> RouterType -> Bool)
-> (RouterType -> RouterType -> Bool) -> Eq RouterType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RouterType -> RouterType -> Bool
$c/= :: RouterType -> RouterType -> Bool
== :: RouterType -> RouterType -> Bool
$c== :: RouterType -> RouterType -> Bool
Prelude.Eq, ReadPrec [RouterType]
ReadPrec RouterType
Int -> ReadS RouterType
ReadS [RouterType]
(Int -> ReadS RouterType)
-> ReadS [RouterType]
-> ReadPrec RouterType
-> ReadPrec [RouterType]
-> Read RouterType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RouterType]
$creadListPrec :: ReadPrec [RouterType]
readPrec :: ReadPrec RouterType
$creadPrec :: ReadPrec RouterType
readList :: ReadS [RouterType]
$creadList :: ReadS [RouterType]
readsPrec :: Int -> ReadS RouterType
$creadsPrec :: Int -> ReadS RouterType
Prelude.Read, Int -> RouterType -> ShowS
[RouterType] -> ShowS
RouterType -> String
(Int -> RouterType -> ShowS)
-> (RouterType -> String)
-> ([RouterType] -> ShowS)
-> Show RouterType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RouterType] -> ShowS
$cshowList :: [RouterType] -> ShowS
show :: RouterType -> String
$cshow :: RouterType -> String
showsPrec :: Int -> RouterType -> ShowS
$cshowsPrec :: Int -> RouterType -> ShowS
Prelude.Show, (forall x. RouterType -> Rep RouterType x)
-> (forall x. Rep RouterType x -> RouterType) -> Generic RouterType
forall x. Rep RouterType x -> RouterType
forall x. RouterType -> Rep RouterType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RouterType x -> RouterType
$cfrom :: forall x. RouterType -> Rep RouterType x
Prelude.Generic)

-- |
-- Create a value of 'RouterType' 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:
--
-- 'vendor', 'routerType_vendor' - The vendor for the virtual interface\'s router.
--
-- 'platform', 'routerType_platform' - The virtual interface router platform.
--
-- 'xsltTemplateName', 'routerType_xsltTemplateName' - The template for the virtual interface\'s router.
--
-- 'software', 'routerType_software' - The router software.
--
-- 'xsltTemplateNameForMacSec', 'routerType_xsltTemplateNameForMacSec' - The MAC Security (MACsec) template for the virtual interface\'s router.
--
-- 'routerTypeIdentifier', 'routerType_routerTypeIdentifier' - Identifies the router by a combination of vendor, platform, and software
-- version. For example, @CiscoSystemsInc-2900SeriesRouters-IOS124@.
newRouterType ::
  RouterType
newRouterType :: RouterType
newRouterType =
  RouterType' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RouterType
RouterType'
    { $sel:vendor:RouterType' :: Maybe Text
vendor = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:RouterType' :: Maybe Text
platform = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:xsltTemplateName:RouterType' :: Maybe Text
xsltTemplateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:software:RouterType' :: Maybe Text
software = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:xsltTemplateNameForMacSec:RouterType' :: Maybe Text
xsltTemplateNameForMacSec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routerTypeIdentifier:RouterType' :: Maybe Text
routerTypeIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The vendor for the virtual interface\'s router.
routerType_vendor :: Lens.Lens' RouterType (Prelude.Maybe Prelude.Text)
routerType_vendor :: (Maybe Text -> f (Maybe Text)) -> RouterType -> f RouterType
routerType_vendor = (RouterType -> Maybe Text)
-> (RouterType -> Maybe Text -> RouterType)
-> Lens RouterType RouterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouterType' {Maybe Text
vendor :: Maybe Text
$sel:vendor:RouterType' :: RouterType -> Maybe Text
vendor} -> Maybe Text
vendor) (\s :: RouterType
s@RouterType' {} Maybe Text
a -> RouterType
s {$sel:vendor:RouterType' :: Maybe Text
vendor = Maybe Text
a} :: RouterType)

-- | The virtual interface router platform.
routerType_platform :: Lens.Lens' RouterType (Prelude.Maybe Prelude.Text)
routerType_platform :: (Maybe Text -> f (Maybe Text)) -> RouterType -> f RouterType
routerType_platform = (RouterType -> Maybe Text)
-> (RouterType -> Maybe Text -> RouterType)
-> Lens RouterType RouterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouterType' {Maybe Text
platform :: Maybe Text
$sel:platform:RouterType' :: RouterType -> Maybe Text
platform} -> Maybe Text
platform) (\s :: RouterType
s@RouterType' {} Maybe Text
a -> RouterType
s {$sel:platform:RouterType' :: Maybe Text
platform = Maybe Text
a} :: RouterType)

-- | The template for the virtual interface\'s router.
routerType_xsltTemplateName :: Lens.Lens' RouterType (Prelude.Maybe Prelude.Text)
routerType_xsltTemplateName :: (Maybe Text -> f (Maybe Text)) -> RouterType -> f RouterType
routerType_xsltTemplateName = (RouterType -> Maybe Text)
-> (RouterType -> Maybe Text -> RouterType)
-> Lens RouterType RouterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouterType' {Maybe Text
xsltTemplateName :: Maybe Text
$sel:xsltTemplateName:RouterType' :: RouterType -> Maybe Text
xsltTemplateName} -> Maybe Text
xsltTemplateName) (\s :: RouterType
s@RouterType' {} Maybe Text
a -> RouterType
s {$sel:xsltTemplateName:RouterType' :: Maybe Text
xsltTemplateName = Maybe Text
a} :: RouterType)

-- | The router software.
routerType_software :: Lens.Lens' RouterType (Prelude.Maybe Prelude.Text)
routerType_software :: (Maybe Text -> f (Maybe Text)) -> RouterType -> f RouterType
routerType_software = (RouterType -> Maybe Text)
-> (RouterType -> Maybe Text -> RouterType)
-> Lens RouterType RouterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouterType' {Maybe Text
software :: Maybe Text
$sel:software:RouterType' :: RouterType -> Maybe Text
software} -> Maybe Text
software) (\s :: RouterType
s@RouterType' {} Maybe Text
a -> RouterType
s {$sel:software:RouterType' :: Maybe Text
software = Maybe Text
a} :: RouterType)

-- | The MAC Security (MACsec) template for the virtual interface\'s router.
routerType_xsltTemplateNameForMacSec :: Lens.Lens' RouterType (Prelude.Maybe Prelude.Text)
routerType_xsltTemplateNameForMacSec :: (Maybe Text -> f (Maybe Text)) -> RouterType -> f RouterType
routerType_xsltTemplateNameForMacSec = (RouterType -> Maybe Text)
-> (RouterType -> Maybe Text -> RouterType)
-> Lens RouterType RouterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouterType' {Maybe Text
xsltTemplateNameForMacSec :: Maybe Text
$sel:xsltTemplateNameForMacSec:RouterType' :: RouterType -> Maybe Text
xsltTemplateNameForMacSec} -> Maybe Text
xsltTemplateNameForMacSec) (\s :: RouterType
s@RouterType' {} Maybe Text
a -> RouterType
s {$sel:xsltTemplateNameForMacSec:RouterType' :: Maybe Text
xsltTemplateNameForMacSec = Maybe Text
a} :: RouterType)

-- | Identifies the router by a combination of vendor, platform, and software
-- version. For example, @CiscoSystemsInc-2900SeriesRouters-IOS124@.
routerType_routerTypeIdentifier :: Lens.Lens' RouterType (Prelude.Maybe Prelude.Text)
routerType_routerTypeIdentifier :: (Maybe Text -> f (Maybe Text)) -> RouterType -> f RouterType
routerType_routerTypeIdentifier = (RouterType -> Maybe Text)
-> (RouterType -> Maybe Text -> RouterType)
-> Lens RouterType RouterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouterType' {Maybe Text
routerTypeIdentifier :: Maybe Text
$sel:routerTypeIdentifier:RouterType' :: RouterType -> Maybe Text
routerTypeIdentifier} -> Maybe Text
routerTypeIdentifier) (\s :: RouterType
s@RouterType' {} Maybe Text
a -> RouterType
s {$sel:routerTypeIdentifier:RouterType' :: Maybe Text
routerTypeIdentifier = Maybe Text
a} :: RouterType)

instance Core.FromJSON RouterType where
  parseJSON :: Value -> Parser RouterType
parseJSON =
    String
-> (Object -> Parser RouterType) -> Value -> Parser RouterType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RouterType"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RouterType
RouterType'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> RouterType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> RouterType)
forall (f :: * -> *) a b. Functor 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
"vendor")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> RouterType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> RouterType)
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
"platform")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> RouterType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> RouterType)
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
"xsltTemplateName")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> RouterType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> RouterType)
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
"software")
            Parser (Maybe Text -> Maybe Text -> RouterType)
-> Parser (Maybe Text) -> Parser (Maybe Text -> RouterType)
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
"xsltTemplateNameForMacSec")
            Parser (Maybe Text -> RouterType)
-> Parser (Maybe Text) -> Parser RouterType
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
"routerTypeIdentifier")
      )

instance Prelude.Hashable RouterType

instance Prelude.NFData RouterType