{-# 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.CloudWatch.Types.LabelOptions
-- 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.CloudWatch.Types.LabelOptions where

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

-- | This structure includes the @Timezone@ parameter, which you can use to
-- specify your time zone so that the labels that are associated with
-- returned metrics display the correct time for your time zone.
--
-- The @Timezone@ value affects a label only if you have a time-based
-- dynamic expression in the label. For more information about dynamic
-- expressions in labels, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html Using Dynamic Labels>.
--
-- /See:/ 'newLabelOptions' smart constructor.
data LabelOptions = LabelOptions'
  { -- | The time zone to use for metric data return in this operation. The
    -- format is @+@ or @-@ followed by four digits. The first two digits
    -- indicate the number of hours ahead or behind of UTC, and the final two
    -- digits are the number of minutes. For example, +0130 indicates a time
    -- zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000.
    LabelOptions -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text
  }
  deriving (LabelOptions -> LabelOptions -> Bool
(LabelOptions -> LabelOptions -> Bool)
-> (LabelOptions -> LabelOptions -> Bool) -> Eq LabelOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelOptions -> LabelOptions -> Bool
$c/= :: LabelOptions -> LabelOptions -> Bool
== :: LabelOptions -> LabelOptions -> Bool
$c== :: LabelOptions -> LabelOptions -> Bool
Prelude.Eq, ReadPrec [LabelOptions]
ReadPrec LabelOptions
Int -> ReadS LabelOptions
ReadS [LabelOptions]
(Int -> ReadS LabelOptions)
-> ReadS [LabelOptions]
-> ReadPrec LabelOptions
-> ReadPrec [LabelOptions]
-> Read LabelOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelOptions]
$creadListPrec :: ReadPrec [LabelOptions]
readPrec :: ReadPrec LabelOptions
$creadPrec :: ReadPrec LabelOptions
readList :: ReadS [LabelOptions]
$creadList :: ReadS [LabelOptions]
readsPrec :: Int -> ReadS LabelOptions
$creadsPrec :: Int -> ReadS LabelOptions
Prelude.Read, Int -> LabelOptions -> ShowS
[LabelOptions] -> ShowS
LabelOptions -> String
(Int -> LabelOptions -> ShowS)
-> (LabelOptions -> String)
-> ([LabelOptions] -> ShowS)
-> Show LabelOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelOptions] -> ShowS
$cshowList :: [LabelOptions] -> ShowS
show :: LabelOptions -> String
$cshow :: LabelOptions -> String
showsPrec :: Int -> LabelOptions -> ShowS
$cshowsPrec :: Int -> LabelOptions -> ShowS
Prelude.Show, (forall x. LabelOptions -> Rep LabelOptions x)
-> (forall x. Rep LabelOptions x -> LabelOptions)
-> Generic LabelOptions
forall x. Rep LabelOptions x -> LabelOptions
forall x. LabelOptions -> Rep LabelOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelOptions x -> LabelOptions
$cfrom :: forall x. LabelOptions -> Rep LabelOptions x
Prelude.Generic)

-- |
-- Create a value of 'LabelOptions' 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:
--
-- 'timezone', 'labelOptions_timezone' - The time zone to use for metric data return in this operation. The
-- format is @+@ or @-@ followed by four digits. The first two digits
-- indicate the number of hours ahead or behind of UTC, and the final two
-- digits are the number of minutes. For example, +0130 indicates a time
-- zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000.
newLabelOptions ::
  LabelOptions
newLabelOptions :: LabelOptions
newLabelOptions =
  LabelOptions' :: Maybe Text -> LabelOptions
LabelOptions' {$sel:timezone:LabelOptions' :: Maybe Text
timezone = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The time zone to use for metric data return in this operation. The
-- format is @+@ or @-@ followed by four digits. The first two digits
-- indicate the number of hours ahead or behind of UTC, and the final two
-- digits are the number of minutes. For example, +0130 indicates a time
-- zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000.
labelOptions_timezone :: Lens.Lens' LabelOptions (Prelude.Maybe Prelude.Text)
labelOptions_timezone :: (Maybe Text -> f (Maybe Text)) -> LabelOptions -> f LabelOptions
labelOptions_timezone = (LabelOptions -> Maybe Text)
-> (LabelOptions -> Maybe Text -> LabelOptions)
-> Lens LabelOptions LabelOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelOptions' {Maybe Text
timezone :: Maybe Text
$sel:timezone:LabelOptions' :: LabelOptions -> Maybe Text
timezone} -> Maybe Text
timezone) (\s :: LabelOptions
s@LabelOptions' {} Maybe Text
a -> LabelOptions
s {$sel:timezone:LabelOptions' :: Maybe Text
timezone = Maybe Text
a} :: LabelOptions)

instance Prelude.Hashable LabelOptions

instance Prelude.NFData LabelOptions

instance Core.ToQuery LabelOptions where
  toQuery :: LabelOptions -> QueryString
toQuery LabelOptions' {Maybe Text
timezone :: Maybe Text
$sel:timezone:LabelOptions' :: LabelOptions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Timezone" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
timezone]