amazonka-mwaa-2.0: gen/Amazonka/MwAA/Types/Dimension.hs
{-# 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.MwAA.Types.Dimension
-- 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.MwAA.Types.Dimension 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
-- | __Internal only__. Represents the dimensions of a metric. To learn more
-- about the metrics published to Amazon CloudWatch, see
-- <https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html Amazon MWAA performance metrics in Amazon CloudWatch>.
--
-- /See:/ 'newDimension' smart constructor.
data Dimension = Dimension'
{ -- | __Internal only__. The name of the dimension.
name :: Prelude.Text,
-- | __Internal only__. The value of the dimension.
value :: Prelude.Text
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'Dimension' 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', 'dimension_name' - __Internal only__. The name of the dimension.
--
-- 'value', 'dimension_value' - __Internal only__. The value of the dimension.
newDimension ::
-- | 'name'
Prelude.Text ->
-- | 'value'
Prelude.Text ->
Dimension
newDimension pName_ pValue_ =
Dimension' {name = pName_, value = pValue_}
-- | __Internal only__. The name of the dimension.
dimension_name :: Lens.Lens' Dimension Prelude.Text
dimension_name = Lens.lens (\Dimension' {name} -> name) (\s@Dimension' {} a -> s {name = a} :: Dimension)
-- | __Internal only__. The value of the dimension.
dimension_value :: Lens.Lens' Dimension Prelude.Text
dimension_value = Lens.lens (\Dimension' {value} -> value) (\s@Dimension' {} a -> s {value = a} :: Dimension)
instance Prelude.Hashable Dimension where
hashWithSalt _salt Dimension' {..} =
_salt
`Prelude.hashWithSalt` name
`Prelude.hashWithSalt` value
instance Prelude.NFData Dimension where
rnf Dimension' {..} =
Prelude.rnf name `Prelude.seq` Prelude.rnf value
instance Data.ToJSON Dimension where
toJSON Dimension' {..} =
Data.object
( Prelude.catMaybes
[ Prelude.Just ("Name" Data..= name),
Prelude.Just ("Value" Data..= value)
]
)