{-# 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.Route53.Types.LocationSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53.Types.LocationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal

-- | A complex type that contains information about the CIDR location.
--
-- /See:/ 'newLocationSummary' smart constructor.
data LocationSummary = LocationSummary'
  { -- | A string that specifies a location name.
    LocationSummary -> Maybe Text
locationName :: Prelude.Maybe Prelude.Text
  }
  deriving (LocationSummary -> LocationSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocationSummary -> LocationSummary -> Bool
$c/= :: LocationSummary -> LocationSummary -> Bool
== :: LocationSummary -> LocationSummary -> Bool
$c== :: LocationSummary -> LocationSummary -> Bool
Prelude.Eq, ReadPrec [LocationSummary]
ReadPrec LocationSummary
Int -> ReadS LocationSummary
ReadS [LocationSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocationSummary]
$creadListPrec :: ReadPrec [LocationSummary]
readPrec :: ReadPrec LocationSummary
$creadPrec :: ReadPrec LocationSummary
readList :: ReadS [LocationSummary]
$creadList :: ReadS [LocationSummary]
readsPrec :: Int -> ReadS LocationSummary
$creadsPrec :: Int -> ReadS LocationSummary
Prelude.Read, Int -> LocationSummary -> ShowS
[LocationSummary] -> ShowS
LocationSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocationSummary] -> ShowS
$cshowList :: [LocationSummary] -> ShowS
show :: LocationSummary -> String
$cshow :: LocationSummary -> String
showsPrec :: Int -> LocationSummary -> ShowS
$cshowsPrec :: Int -> LocationSummary -> ShowS
Prelude.Show, forall x. Rep LocationSummary x -> LocationSummary
forall x. LocationSummary -> Rep LocationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocationSummary x -> LocationSummary
$cfrom :: forall x. LocationSummary -> Rep LocationSummary x
Prelude.Generic)

-- |
-- Create a value of 'LocationSummary' 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:
--
-- 'locationName', 'locationSummary_locationName' - A string that specifies a location name.
newLocationSummary ::
  LocationSummary
newLocationSummary :: LocationSummary
newLocationSummary =
  LocationSummary' {$sel:locationName:LocationSummary' :: Maybe Text
locationName = forall a. Maybe a
Prelude.Nothing}

-- | A string that specifies a location name.
locationSummary_locationName :: Lens.Lens' LocationSummary (Prelude.Maybe Prelude.Text)
locationSummary_locationName :: Lens' LocationSummary (Maybe Text)
locationSummary_locationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationSummary' {Maybe Text
locationName :: Maybe Text
$sel:locationName:LocationSummary' :: LocationSummary -> Maybe Text
locationName} -> Maybe Text
locationName) (\s :: LocationSummary
s@LocationSummary' {} Maybe Text
a -> LocationSummary
s {$sel:locationName:LocationSummary' :: Maybe Text
locationName = Maybe Text
a} :: LocationSummary)

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

instance Prelude.Hashable LocationSummary where
  hashWithSalt :: Int -> LocationSummary -> Int
hashWithSalt Int
_salt LocationSummary' {Maybe Text
locationName :: Maybe Text
$sel:locationName:LocationSummary' :: LocationSummary -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
locationName

instance Prelude.NFData LocationSummary where
  rnf :: LocationSummary -> ()
rnf LocationSummary' {Maybe Text
locationName :: Maybe Text
$sel:locationName:LocationSummary' :: LocationSummary -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locationName