{-# 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.RDS.Types.Timezone
-- 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.RDS.Types.Timezone where

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

-- | A time zone associated with a @DBInstance@ or a @DBSnapshot@. This data
-- type is an element in the response to the @DescribeDBInstances@, the
-- @DescribeDBSnapshots@, and the @DescribeDBEngineVersions@ actions.
--
-- /See:/ 'newTimezone' smart constructor.
data Timezone = Timezone'
  { -- | The name of the time zone.
    Timezone -> Maybe Text
timezoneName :: Prelude.Maybe Prelude.Text
  }
  deriving (Timezone -> Timezone -> Bool
(Timezone -> Timezone -> Bool)
-> (Timezone -> Timezone -> Bool) -> Eq Timezone
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Timezone -> Timezone -> Bool
$c/= :: Timezone -> Timezone -> Bool
== :: Timezone -> Timezone -> Bool
$c== :: Timezone -> Timezone -> Bool
Prelude.Eq, ReadPrec [Timezone]
ReadPrec Timezone
Int -> ReadS Timezone
ReadS [Timezone]
(Int -> ReadS Timezone)
-> ReadS [Timezone]
-> ReadPrec Timezone
-> ReadPrec [Timezone]
-> Read Timezone
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Timezone]
$creadListPrec :: ReadPrec [Timezone]
readPrec :: ReadPrec Timezone
$creadPrec :: ReadPrec Timezone
readList :: ReadS [Timezone]
$creadList :: ReadS [Timezone]
readsPrec :: Int -> ReadS Timezone
$creadsPrec :: Int -> ReadS Timezone
Prelude.Read, Int -> Timezone -> ShowS
[Timezone] -> ShowS
Timezone -> String
(Int -> Timezone -> ShowS)
-> (Timezone -> String) -> ([Timezone] -> ShowS) -> Show Timezone
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Timezone] -> ShowS
$cshowList :: [Timezone] -> ShowS
show :: Timezone -> String
$cshow :: Timezone -> String
showsPrec :: Int -> Timezone -> ShowS
$cshowsPrec :: Int -> Timezone -> ShowS
Prelude.Show, (forall x. Timezone -> Rep Timezone x)
-> (forall x. Rep Timezone x -> Timezone) -> Generic Timezone
forall x. Rep Timezone x -> Timezone
forall x. Timezone -> Rep Timezone x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Timezone x -> Timezone
$cfrom :: forall x. Timezone -> Rep Timezone x
Prelude.Generic)

-- |
-- Create a value of 'Timezone' 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:
--
-- 'timezoneName', 'timezone_timezoneName' - The name of the time zone.
newTimezone ::
  Timezone
newTimezone :: Timezone
newTimezone =
  Timezone' :: Maybe Text -> Timezone
Timezone' {$sel:timezoneName:Timezone' :: Maybe Text
timezoneName = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of the time zone.
timezone_timezoneName :: Lens.Lens' Timezone (Prelude.Maybe Prelude.Text)
timezone_timezoneName :: (Maybe Text -> f (Maybe Text)) -> Timezone -> f Timezone
timezone_timezoneName = (Timezone -> Maybe Text)
-> (Timezone -> Maybe Text -> Timezone)
-> Lens Timezone Timezone (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Timezone' {Maybe Text
timezoneName :: Maybe Text
$sel:timezoneName:Timezone' :: Timezone -> Maybe Text
timezoneName} -> Maybe Text
timezoneName) (\s :: Timezone
s@Timezone' {} Maybe Text
a -> Timezone
s {$sel:timezoneName:Timezone' :: Maybe Text
timezoneName = Maybe Text
a} :: Timezone)

instance Core.FromXML Timezone where
  parseXML :: [Node] -> Either String Timezone
parseXML [Node]
x =
    Maybe Text -> Timezone
Timezone' (Maybe Text -> Timezone)
-> Either String (Maybe Text) -> Either String Timezone
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
"TimezoneName")

instance Prelude.Hashable Timezone

instance Prelude.NFData Timezone