{-# 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.ELB.Types.PolicyAttributeTypeDescription
-- 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.ELB.Types.PolicyAttributeTypeDescription where

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

-- | Information about a policy attribute type.
--
-- /See:/ 'newPolicyAttributeTypeDescription' smart constructor.
data PolicyAttributeTypeDescription = PolicyAttributeTypeDescription'
  { -- | The name of the attribute.
    PolicyAttributeTypeDescription -> Maybe Text
attributeName :: Prelude.Maybe Prelude.Text,
    -- | The type of the attribute. For example, @Boolean@ or @Integer@.
    PolicyAttributeTypeDescription -> Maybe Text
attributeType :: Prelude.Maybe Prelude.Text,
    -- | The cardinality of the attribute.
    --
    -- Valid values:
    --
    -- -   ONE(1) : Single value required
    --
    -- -   ZERO_OR_ONE(0..1) : Up to one value is allowed
    --
    -- -   ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed
    --
    -- -   ONE_OR_MORE(1..*0) : Required. Multiple values are allowed
    PolicyAttributeTypeDescription -> Maybe Text
cardinality :: Prelude.Maybe Prelude.Text,
    -- | The default value of the attribute, if applicable.
    PolicyAttributeTypeDescription -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | A description of the attribute.
    PolicyAttributeTypeDescription -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (PolicyAttributeTypeDescription
-> PolicyAttributeTypeDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyAttributeTypeDescription
-> PolicyAttributeTypeDescription -> Bool
$c/= :: PolicyAttributeTypeDescription
-> PolicyAttributeTypeDescription -> Bool
== :: PolicyAttributeTypeDescription
-> PolicyAttributeTypeDescription -> Bool
$c== :: PolicyAttributeTypeDescription
-> PolicyAttributeTypeDescription -> Bool
Prelude.Eq, ReadPrec [PolicyAttributeTypeDescription]
ReadPrec PolicyAttributeTypeDescription
Int -> ReadS PolicyAttributeTypeDescription
ReadS [PolicyAttributeTypeDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyAttributeTypeDescription]
$creadListPrec :: ReadPrec [PolicyAttributeTypeDescription]
readPrec :: ReadPrec PolicyAttributeTypeDescription
$creadPrec :: ReadPrec PolicyAttributeTypeDescription
readList :: ReadS [PolicyAttributeTypeDescription]
$creadList :: ReadS [PolicyAttributeTypeDescription]
readsPrec :: Int -> ReadS PolicyAttributeTypeDescription
$creadsPrec :: Int -> ReadS PolicyAttributeTypeDescription
Prelude.Read, Int -> PolicyAttributeTypeDescription -> ShowS
[PolicyAttributeTypeDescription] -> ShowS
PolicyAttributeTypeDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyAttributeTypeDescription] -> ShowS
$cshowList :: [PolicyAttributeTypeDescription] -> ShowS
show :: PolicyAttributeTypeDescription -> String
$cshow :: PolicyAttributeTypeDescription -> String
showsPrec :: Int -> PolicyAttributeTypeDescription -> ShowS
$cshowsPrec :: Int -> PolicyAttributeTypeDescription -> ShowS
Prelude.Show, forall x.
Rep PolicyAttributeTypeDescription x
-> PolicyAttributeTypeDescription
forall x.
PolicyAttributeTypeDescription
-> Rep PolicyAttributeTypeDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PolicyAttributeTypeDescription x
-> PolicyAttributeTypeDescription
$cfrom :: forall x.
PolicyAttributeTypeDescription
-> Rep PolicyAttributeTypeDescription x
Prelude.Generic)

-- |
-- Create a value of 'PolicyAttributeTypeDescription' 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:
--
-- 'attributeName', 'policyAttributeTypeDescription_attributeName' - The name of the attribute.
--
-- 'attributeType', 'policyAttributeTypeDescription_attributeType' - The type of the attribute. For example, @Boolean@ or @Integer@.
--
-- 'cardinality', 'policyAttributeTypeDescription_cardinality' - The cardinality of the attribute.
--
-- Valid values:
--
-- -   ONE(1) : Single value required
--
-- -   ZERO_OR_ONE(0..1) : Up to one value is allowed
--
-- -   ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed
--
-- -   ONE_OR_MORE(1..*0) : Required. Multiple values are allowed
--
-- 'defaultValue', 'policyAttributeTypeDescription_defaultValue' - The default value of the attribute, if applicable.
--
-- 'description', 'policyAttributeTypeDescription_description' - A description of the attribute.
newPolicyAttributeTypeDescription ::
  PolicyAttributeTypeDescription
newPolicyAttributeTypeDescription :: PolicyAttributeTypeDescription
newPolicyAttributeTypeDescription =
  PolicyAttributeTypeDescription'
    { $sel:attributeName:PolicyAttributeTypeDescription' :: Maybe Text
attributeName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:attributeType:PolicyAttributeTypeDescription' :: Maybe Text
attributeType = forall a. Maybe a
Prelude.Nothing,
      $sel:cardinality:PolicyAttributeTypeDescription' :: Maybe Text
cardinality = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:PolicyAttributeTypeDescription' :: Maybe Text
defaultValue = forall a. Maybe a
Prelude.Nothing,
      $sel:description:PolicyAttributeTypeDescription' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the attribute.
policyAttributeTypeDescription_attributeName :: Lens.Lens' PolicyAttributeTypeDescription (Prelude.Maybe Prelude.Text)
policyAttributeTypeDescription_attributeName :: Lens' PolicyAttributeTypeDescription (Maybe Text)
policyAttributeTypeDescription_attributeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttributeTypeDescription' {Maybe Text
attributeName :: Maybe Text
$sel:attributeName:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
attributeName} -> Maybe Text
attributeName) (\s :: PolicyAttributeTypeDescription
s@PolicyAttributeTypeDescription' {} Maybe Text
a -> PolicyAttributeTypeDescription
s {$sel:attributeName:PolicyAttributeTypeDescription' :: Maybe Text
attributeName = Maybe Text
a} :: PolicyAttributeTypeDescription)

-- | The type of the attribute. For example, @Boolean@ or @Integer@.
policyAttributeTypeDescription_attributeType :: Lens.Lens' PolicyAttributeTypeDescription (Prelude.Maybe Prelude.Text)
policyAttributeTypeDescription_attributeType :: Lens' PolicyAttributeTypeDescription (Maybe Text)
policyAttributeTypeDescription_attributeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttributeTypeDescription' {Maybe Text
attributeType :: Maybe Text
$sel:attributeType:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
attributeType} -> Maybe Text
attributeType) (\s :: PolicyAttributeTypeDescription
s@PolicyAttributeTypeDescription' {} Maybe Text
a -> PolicyAttributeTypeDescription
s {$sel:attributeType:PolicyAttributeTypeDescription' :: Maybe Text
attributeType = Maybe Text
a} :: PolicyAttributeTypeDescription)

-- | The cardinality of the attribute.
--
-- Valid values:
--
-- -   ONE(1) : Single value required
--
-- -   ZERO_OR_ONE(0..1) : Up to one value is allowed
--
-- -   ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed
--
-- -   ONE_OR_MORE(1..*0) : Required. Multiple values are allowed
policyAttributeTypeDescription_cardinality :: Lens.Lens' PolicyAttributeTypeDescription (Prelude.Maybe Prelude.Text)
policyAttributeTypeDescription_cardinality :: Lens' PolicyAttributeTypeDescription (Maybe Text)
policyAttributeTypeDescription_cardinality = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttributeTypeDescription' {Maybe Text
cardinality :: Maybe Text
$sel:cardinality:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
cardinality} -> Maybe Text
cardinality) (\s :: PolicyAttributeTypeDescription
s@PolicyAttributeTypeDescription' {} Maybe Text
a -> PolicyAttributeTypeDescription
s {$sel:cardinality:PolicyAttributeTypeDescription' :: Maybe Text
cardinality = Maybe Text
a} :: PolicyAttributeTypeDescription)

-- | The default value of the attribute, if applicable.
policyAttributeTypeDescription_defaultValue :: Lens.Lens' PolicyAttributeTypeDescription (Prelude.Maybe Prelude.Text)
policyAttributeTypeDescription_defaultValue :: Lens' PolicyAttributeTypeDescription (Maybe Text)
policyAttributeTypeDescription_defaultValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttributeTypeDescription' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: PolicyAttributeTypeDescription
s@PolicyAttributeTypeDescription' {} Maybe Text
a -> PolicyAttributeTypeDescription
s {$sel:defaultValue:PolicyAttributeTypeDescription' :: Maybe Text
defaultValue = Maybe Text
a} :: PolicyAttributeTypeDescription)

-- | A description of the attribute.
policyAttributeTypeDescription_description :: Lens.Lens' PolicyAttributeTypeDescription (Prelude.Maybe Prelude.Text)
policyAttributeTypeDescription_description :: Lens' PolicyAttributeTypeDescription (Maybe Text)
policyAttributeTypeDescription_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttributeTypeDescription' {Maybe Text
description :: Maybe Text
$sel:description:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
description} -> Maybe Text
description) (\s :: PolicyAttributeTypeDescription
s@PolicyAttributeTypeDescription' {} Maybe Text
a -> PolicyAttributeTypeDescription
s {$sel:description:PolicyAttributeTypeDescription' :: Maybe Text
description = Maybe Text
a} :: PolicyAttributeTypeDescription)

instance Data.FromXML PolicyAttributeTypeDescription where
  parseXML :: [Node] -> Either String PolicyAttributeTypeDescription
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PolicyAttributeTypeDescription
PolicyAttributeTypeDescription'
      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
"AttributeName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AttributeType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Cardinality")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DefaultValue")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Description")

instance
  Prelude.Hashable
    PolicyAttributeTypeDescription
  where
  hashWithSalt :: Int -> PolicyAttributeTypeDescription -> Int
hashWithSalt
    Int
_salt
    PolicyAttributeTypeDescription' {Maybe Text
description :: Maybe Text
defaultValue :: Maybe Text
cardinality :: Maybe Text
attributeType :: Maybe Text
attributeName :: Maybe Text
$sel:description:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:defaultValue:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:cardinality:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:attributeType:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:attributeName:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cardinality
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultValue
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description

instance
  Prelude.NFData
    PolicyAttributeTypeDescription
  where
  rnf :: PolicyAttributeTypeDescription -> ()
rnf PolicyAttributeTypeDescription' {Maybe Text
description :: Maybe Text
defaultValue :: Maybe Text
cardinality :: Maybe Text
attributeType :: Maybe Text
attributeName :: Maybe Text
$sel:description:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:defaultValue:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:cardinality:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:attributeType:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
$sel:attributeName:PolicyAttributeTypeDescription' :: PolicyAttributeTypeDescription -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cardinality
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description