{-# 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.CloudFront.Types.TagKeys
-- 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.CloudFront.Types.TagKeys 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

-- | A complex type that contains zero or more @Tag@ elements.
--
-- /See:/ 'newTagKeys' smart constructor.
data TagKeys = TagKeys'
  { -- | A complex type that contains @Tag@ key elements.
    TagKeys -> Maybe [Text]
items :: Prelude.Maybe [Prelude.Text]
  }
  deriving (TagKeys -> TagKeys -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagKeys -> TagKeys -> Bool
$c/= :: TagKeys -> TagKeys -> Bool
== :: TagKeys -> TagKeys -> Bool
$c== :: TagKeys -> TagKeys -> Bool
Prelude.Eq, ReadPrec [TagKeys]
ReadPrec TagKeys
Int -> ReadS TagKeys
ReadS [TagKeys]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagKeys]
$creadListPrec :: ReadPrec [TagKeys]
readPrec :: ReadPrec TagKeys
$creadPrec :: ReadPrec TagKeys
readList :: ReadS [TagKeys]
$creadList :: ReadS [TagKeys]
readsPrec :: Int -> ReadS TagKeys
$creadsPrec :: Int -> ReadS TagKeys
Prelude.Read, Int -> TagKeys -> ShowS
[TagKeys] -> ShowS
TagKeys -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagKeys] -> ShowS
$cshowList :: [TagKeys] -> ShowS
show :: TagKeys -> String
$cshow :: TagKeys -> String
showsPrec :: Int -> TagKeys -> ShowS
$cshowsPrec :: Int -> TagKeys -> ShowS
Prelude.Show, forall x. Rep TagKeys x -> TagKeys
forall x. TagKeys -> Rep TagKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagKeys x -> TagKeys
$cfrom :: forall x. TagKeys -> Rep TagKeys x
Prelude.Generic)

-- |
-- Create a value of 'TagKeys' 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:
--
-- 'items', 'tagKeys_items' - A complex type that contains @Tag@ key elements.
newTagKeys ::
  TagKeys
newTagKeys :: TagKeys
newTagKeys = TagKeys' {$sel:items:TagKeys' :: Maybe [Text]
items = forall a. Maybe a
Prelude.Nothing}

-- | A complex type that contains @Tag@ key elements.
tagKeys_items :: Lens.Lens' TagKeys (Prelude.Maybe [Prelude.Text])
tagKeys_items :: Lens' TagKeys (Maybe [Text])
tagKeys_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagKeys' {Maybe [Text]
items :: Maybe [Text]
$sel:items:TagKeys' :: TagKeys -> Maybe [Text]
items} -> Maybe [Text]
items) (\s :: TagKeys
s@TagKeys' {} Maybe [Text]
a -> TagKeys
s {$sel:items:TagKeys' :: Maybe [Text]
items = Maybe [Text]
a} :: TagKeys) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable TagKeys where
  hashWithSalt :: Int -> TagKeys -> Int
hashWithSalt Int
_salt TagKeys' {Maybe [Text]
items :: Maybe [Text]
$sel:items:TagKeys' :: TagKeys -> Maybe [Text]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
items

instance Prelude.NFData TagKeys where
  rnf :: TagKeys -> ()
rnf TagKeys' {Maybe [Text]
items :: Maybe [Text]
$sel:items:TagKeys' :: TagKeys -> Maybe [Text]
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
items

instance Data.ToXML TagKeys where
  toXML :: TagKeys -> XML
toXML TagKeys' {Maybe [Text]
items :: Maybe [Text]
$sel:items:TagKeys' :: TagKeys -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"Items"
          forall a. ToXML a => Name -> a -> XML
Data.@= forall a. ToXML a => a -> XML
Data.toXML (forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Data.toXMLList Name
"Key" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
items)
      ]