{-# 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.ElastiCache.Types.SubnetOutpost
-- 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.ElastiCache.Types.SubnetOutpost where

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

-- | The ID of the outpost subnet.
--
-- /See:/ 'newSubnetOutpost' smart constructor.
data SubnetOutpost = SubnetOutpost'
  { -- | The outpost ARN of the subnet.
    SubnetOutpost -> Maybe Text
subnetOutpostArn :: Prelude.Maybe Prelude.Text
  }
  deriving (SubnetOutpost -> SubnetOutpost -> Bool
(SubnetOutpost -> SubnetOutpost -> Bool)
-> (SubnetOutpost -> SubnetOutpost -> Bool) -> Eq SubnetOutpost
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubnetOutpost -> SubnetOutpost -> Bool
$c/= :: SubnetOutpost -> SubnetOutpost -> Bool
== :: SubnetOutpost -> SubnetOutpost -> Bool
$c== :: SubnetOutpost -> SubnetOutpost -> Bool
Prelude.Eq, ReadPrec [SubnetOutpost]
ReadPrec SubnetOutpost
Int -> ReadS SubnetOutpost
ReadS [SubnetOutpost]
(Int -> ReadS SubnetOutpost)
-> ReadS [SubnetOutpost]
-> ReadPrec SubnetOutpost
-> ReadPrec [SubnetOutpost]
-> Read SubnetOutpost
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubnetOutpost]
$creadListPrec :: ReadPrec [SubnetOutpost]
readPrec :: ReadPrec SubnetOutpost
$creadPrec :: ReadPrec SubnetOutpost
readList :: ReadS [SubnetOutpost]
$creadList :: ReadS [SubnetOutpost]
readsPrec :: Int -> ReadS SubnetOutpost
$creadsPrec :: Int -> ReadS SubnetOutpost
Prelude.Read, Int -> SubnetOutpost -> ShowS
[SubnetOutpost] -> ShowS
SubnetOutpost -> String
(Int -> SubnetOutpost -> ShowS)
-> (SubnetOutpost -> String)
-> ([SubnetOutpost] -> ShowS)
-> Show SubnetOutpost
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubnetOutpost] -> ShowS
$cshowList :: [SubnetOutpost] -> ShowS
show :: SubnetOutpost -> String
$cshow :: SubnetOutpost -> String
showsPrec :: Int -> SubnetOutpost -> ShowS
$cshowsPrec :: Int -> SubnetOutpost -> ShowS
Prelude.Show, (forall x. SubnetOutpost -> Rep SubnetOutpost x)
-> (forall x. Rep SubnetOutpost x -> SubnetOutpost)
-> Generic SubnetOutpost
forall x. Rep SubnetOutpost x -> SubnetOutpost
forall x. SubnetOutpost -> Rep SubnetOutpost x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubnetOutpost x -> SubnetOutpost
$cfrom :: forall x. SubnetOutpost -> Rep SubnetOutpost x
Prelude.Generic)

-- |
-- Create a value of 'SubnetOutpost' 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:
--
-- 'subnetOutpostArn', 'subnetOutpost_subnetOutpostArn' - The outpost ARN of the subnet.
newSubnetOutpost ::
  SubnetOutpost
newSubnetOutpost :: SubnetOutpost
newSubnetOutpost =
  SubnetOutpost' :: Maybe Text -> SubnetOutpost
SubnetOutpost' {$sel:subnetOutpostArn:SubnetOutpost' :: Maybe Text
subnetOutpostArn = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The outpost ARN of the subnet.
subnetOutpost_subnetOutpostArn :: Lens.Lens' SubnetOutpost (Prelude.Maybe Prelude.Text)
subnetOutpost_subnetOutpostArn :: (Maybe Text -> f (Maybe Text)) -> SubnetOutpost -> f SubnetOutpost
subnetOutpost_subnetOutpostArn = (SubnetOutpost -> Maybe Text)
-> (SubnetOutpost -> Maybe Text -> SubnetOutpost)
-> Lens SubnetOutpost SubnetOutpost (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubnetOutpost' {Maybe Text
subnetOutpostArn :: Maybe Text
$sel:subnetOutpostArn:SubnetOutpost' :: SubnetOutpost -> Maybe Text
subnetOutpostArn} -> Maybe Text
subnetOutpostArn) (\s :: SubnetOutpost
s@SubnetOutpost' {} Maybe Text
a -> SubnetOutpost
s {$sel:subnetOutpostArn:SubnetOutpost' :: Maybe Text
subnetOutpostArn = Maybe Text
a} :: SubnetOutpost)

instance Core.FromXML SubnetOutpost where
  parseXML :: [Node] -> Either String SubnetOutpost
parseXML [Node]
x =
    Maybe Text -> SubnetOutpost
SubnetOutpost'
      (Maybe Text -> SubnetOutpost)
-> Either String (Maybe Text) -> Either String SubnetOutpost
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SubnetOutpostArn")

instance Prelude.Hashable SubnetOutpost

instance Prelude.NFData SubnetOutpost