{-# 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.XRay.Types.AvailabilityZoneDetail
-- 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.XRay.Types.AvailabilityZoneDetail where

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

-- | A list of Availability Zones corresponding to the segments in a trace.
--
-- /See:/ 'newAvailabilityZoneDetail' smart constructor.
data AvailabilityZoneDetail = AvailabilityZoneDetail'
  { -- | The name of a corresponding Availability Zone.
    AvailabilityZoneDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool
(AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool)
-> (AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool)
-> Eq AvailabilityZoneDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool
$c/= :: AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool
== :: AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool
$c== :: AvailabilityZoneDetail -> AvailabilityZoneDetail -> Bool
Prelude.Eq, ReadPrec [AvailabilityZoneDetail]
ReadPrec AvailabilityZoneDetail
Int -> ReadS AvailabilityZoneDetail
ReadS [AvailabilityZoneDetail]
(Int -> ReadS AvailabilityZoneDetail)
-> ReadS [AvailabilityZoneDetail]
-> ReadPrec AvailabilityZoneDetail
-> ReadPrec [AvailabilityZoneDetail]
-> Read AvailabilityZoneDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AvailabilityZoneDetail]
$creadListPrec :: ReadPrec [AvailabilityZoneDetail]
readPrec :: ReadPrec AvailabilityZoneDetail
$creadPrec :: ReadPrec AvailabilityZoneDetail
readList :: ReadS [AvailabilityZoneDetail]
$creadList :: ReadS [AvailabilityZoneDetail]
readsPrec :: Int -> ReadS AvailabilityZoneDetail
$creadsPrec :: Int -> ReadS AvailabilityZoneDetail
Prelude.Read, Int -> AvailabilityZoneDetail -> ShowS
[AvailabilityZoneDetail] -> ShowS
AvailabilityZoneDetail -> String
(Int -> AvailabilityZoneDetail -> ShowS)
-> (AvailabilityZoneDetail -> String)
-> ([AvailabilityZoneDetail] -> ShowS)
-> Show AvailabilityZoneDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AvailabilityZoneDetail] -> ShowS
$cshowList :: [AvailabilityZoneDetail] -> ShowS
show :: AvailabilityZoneDetail -> String
$cshow :: AvailabilityZoneDetail -> String
showsPrec :: Int -> AvailabilityZoneDetail -> ShowS
$cshowsPrec :: Int -> AvailabilityZoneDetail -> ShowS
Prelude.Show, (forall x. AvailabilityZoneDetail -> Rep AvailabilityZoneDetail x)
-> (forall x.
    Rep AvailabilityZoneDetail x -> AvailabilityZoneDetail)
-> Generic AvailabilityZoneDetail
forall x. Rep AvailabilityZoneDetail x -> AvailabilityZoneDetail
forall x. AvailabilityZoneDetail -> Rep AvailabilityZoneDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AvailabilityZoneDetail x -> AvailabilityZoneDetail
$cfrom :: forall x. AvailabilityZoneDetail -> Rep AvailabilityZoneDetail x
Prelude.Generic)

-- |
-- Create a value of 'AvailabilityZoneDetail' 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:
--
-- 'name', 'availabilityZoneDetail_name' - The name of a corresponding Availability Zone.
newAvailabilityZoneDetail ::
  AvailabilityZoneDetail
newAvailabilityZoneDetail :: AvailabilityZoneDetail
newAvailabilityZoneDetail =
  AvailabilityZoneDetail' :: Maybe Text -> AvailabilityZoneDetail
AvailabilityZoneDetail' {$sel:name:AvailabilityZoneDetail' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of a corresponding Availability Zone.
availabilityZoneDetail_name :: Lens.Lens' AvailabilityZoneDetail (Prelude.Maybe Prelude.Text)
availabilityZoneDetail_name :: (Maybe Text -> f (Maybe Text))
-> AvailabilityZoneDetail -> f AvailabilityZoneDetail
availabilityZoneDetail_name = (AvailabilityZoneDetail -> Maybe Text)
-> (AvailabilityZoneDetail -> Maybe Text -> AvailabilityZoneDetail)
-> Lens
     AvailabilityZoneDetail
     AvailabilityZoneDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailabilityZoneDetail' {Maybe Text
name :: Maybe Text
$sel:name:AvailabilityZoneDetail' :: AvailabilityZoneDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: AvailabilityZoneDetail
s@AvailabilityZoneDetail' {} Maybe Text
a -> AvailabilityZoneDetail
s {$sel:name:AvailabilityZoneDetail' :: Maybe Text
name = Maybe Text
a} :: AvailabilityZoneDetail)

instance Core.FromJSON AvailabilityZoneDetail where
  parseJSON :: Value -> Parser AvailabilityZoneDetail
parseJSON =
    String
-> (Object -> Parser AvailabilityZoneDetail)
-> Value
-> Parser AvailabilityZoneDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AvailabilityZoneDetail"
      ( \Object
x ->
          Maybe Text -> AvailabilityZoneDetail
AvailabilityZoneDetail'
            (Maybe Text -> AvailabilityZoneDetail)
-> Parser (Maybe Text) -> Parser AvailabilityZoneDetail
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
"Name")
      )

instance Prelude.Hashable AvailabilityZoneDetail

instance Prelude.NFData AvailabilityZoneDetail