{-# 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.IVS.Types.PlaybackKeyPairSummary
-- 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.IVS.Types.PlaybackKeyPairSummary where

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

-- | Summary information about a playback key pair.
--
-- /See:/ 'newPlaybackKeyPairSummary' smart constructor.
data PlaybackKeyPairSummary = PlaybackKeyPairSummary'
  { -- | Key-pair ARN.
    PlaybackKeyPairSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Playback-key-pair name. The value does not need to be unique.
    PlaybackKeyPairSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Array of 1-50 maps, each of the form @string:string (key:value)@.
    PlaybackKeyPairSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool
(PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool)
-> (PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool)
-> Eq PlaybackKeyPairSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool
$c/= :: PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool
== :: PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool
$c== :: PlaybackKeyPairSummary -> PlaybackKeyPairSummary -> Bool
Prelude.Eq, ReadPrec [PlaybackKeyPairSummary]
ReadPrec PlaybackKeyPairSummary
Int -> ReadS PlaybackKeyPairSummary
ReadS [PlaybackKeyPairSummary]
(Int -> ReadS PlaybackKeyPairSummary)
-> ReadS [PlaybackKeyPairSummary]
-> ReadPrec PlaybackKeyPairSummary
-> ReadPrec [PlaybackKeyPairSummary]
-> Read PlaybackKeyPairSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlaybackKeyPairSummary]
$creadListPrec :: ReadPrec [PlaybackKeyPairSummary]
readPrec :: ReadPrec PlaybackKeyPairSummary
$creadPrec :: ReadPrec PlaybackKeyPairSummary
readList :: ReadS [PlaybackKeyPairSummary]
$creadList :: ReadS [PlaybackKeyPairSummary]
readsPrec :: Int -> ReadS PlaybackKeyPairSummary
$creadsPrec :: Int -> ReadS PlaybackKeyPairSummary
Prelude.Read, Int -> PlaybackKeyPairSummary -> ShowS
[PlaybackKeyPairSummary] -> ShowS
PlaybackKeyPairSummary -> String
(Int -> PlaybackKeyPairSummary -> ShowS)
-> (PlaybackKeyPairSummary -> String)
-> ([PlaybackKeyPairSummary] -> ShowS)
-> Show PlaybackKeyPairSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlaybackKeyPairSummary] -> ShowS
$cshowList :: [PlaybackKeyPairSummary] -> ShowS
show :: PlaybackKeyPairSummary -> String
$cshow :: PlaybackKeyPairSummary -> String
showsPrec :: Int -> PlaybackKeyPairSummary -> ShowS
$cshowsPrec :: Int -> PlaybackKeyPairSummary -> ShowS
Prelude.Show, (forall x. PlaybackKeyPairSummary -> Rep PlaybackKeyPairSummary x)
-> (forall x.
    Rep PlaybackKeyPairSummary x -> PlaybackKeyPairSummary)
-> Generic PlaybackKeyPairSummary
forall x. Rep PlaybackKeyPairSummary x -> PlaybackKeyPairSummary
forall x. PlaybackKeyPairSummary -> Rep PlaybackKeyPairSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlaybackKeyPairSummary x -> PlaybackKeyPairSummary
$cfrom :: forall x. PlaybackKeyPairSummary -> Rep PlaybackKeyPairSummary x
Prelude.Generic)

-- |
-- Create a value of 'PlaybackKeyPairSummary' 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:
--
-- 'arn', 'playbackKeyPairSummary_arn' - Key-pair ARN.
--
-- 'name', 'playbackKeyPairSummary_name' - Playback-key-pair name. The value does not need to be unique.
--
-- 'tags', 'playbackKeyPairSummary_tags' - Array of 1-50 maps, each of the form @string:string (key:value)@.
newPlaybackKeyPairSummary ::
  PlaybackKeyPairSummary
newPlaybackKeyPairSummary :: PlaybackKeyPairSummary
newPlaybackKeyPairSummary =
  PlaybackKeyPairSummary' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> PlaybackKeyPairSummary
PlaybackKeyPairSummary'
    { $sel:arn:PlaybackKeyPairSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:PlaybackKeyPairSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PlaybackKeyPairSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Key-pair ARN.
playbackKeyPairSummary_arn :: Lens.Lens' PlaybackKeyPairSummary (Prelude.Maybe Prelude.Text)
playbackKeyPairSummary_arn :: (Maybe Text -> f (Maybe Text))
-> PlaybackKeyPairSummary -> f PlaybackKeyPairSummary
playbackKeyPairSummary_arn = (PlaybackKeyPairSummary -> Maybe Text)
-> (PlaybackKeyPairSummary -> Maybe Text -> PlaybackKeyPairSummary)
-> Lens
     PlaybackKeyPairSummary
     PlaybackKeyPairSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlaybackKeyPairSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:PlaybackKeyPairSummary' :: PlaybackKeyPairSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PlaybackKeyPairSummary
s@PlaybackKeyPairSummary' {} Maybe Text
a -> PlaybackKeyPairSummary
s {$sel:arn:PlaybackKeyPairSummary' :: Maybe Text
arn = Maybe Text
a} :: PlaybackKeyPairSummary)

-- | Playback-key-pair name. The value does not need to be unique.
playbackKeyPairSummary_name :: Lens.Lens' PlaybackKeyPairSummary (Prelude.Maybe Prelude.Text)
playbackKeyPairSummary_name :: (Maybe Text -> f (Maybe Text))
-> PlaybackKeyPairSummary -> f PlaybackKeyPairSummary
playbackKeyPairSummary_name = (PlaybackKeyPairSummary -> Maybe Text)
-> (PlaybackKeyPairSummary -> Maybe Text -> PlaybackKeyPairSummary)
-> Lens
     PlaybackKeyPairSummary
     PlaybackKeyPairSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlaybackKeyPairSummary' {Maybe Text
name :: Maybe Text
$sel:name:PlaybackKeyPairSummary' :: PlaybackKeyPairSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: PlaybackKeyPairSummary
s@PlaybackKeyPairSummary' {} Maybe Text
a -> PlaybackKeyPairSummary
s {$sel:name:PlaybackKeyPairSummary' :: Maybe Text
name = Maybe Text
a} :: PlaybackKeyPairSummary)

-- | Array of 1-50 maps, each of the form @string:string (key:value)@.
playbackKeyPairSummary_tags :: Lens.Lens' PlaybackKeyPairSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
playbackKeyPairSummary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PlaybackKeyPairSummary -> f PlaybackKeyPairSummary
playbackKeyPairSummary_tags = (PlaybackKeyPairSummary -> Maybe (HashMap Text Text))
-> (PlaybackKeyPairSummary
    -> Maybe (HashMap Text Text) -> PlaybackKeyPairSummary)
-> Lens
     PlaybackKeyPairSummary
     PlaybackKeyPairSummary
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlaybackKeyPairSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PlaybackKeyPairSummary' :: PlaybackKeyPairSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PlaybackKeyPairSummary
s@PlaybackKeyPairSummary' {} Maybe (HashMap Text Text)
a -> PlaybackKeyPairSummary
s {$sel:tags:PlaybackKeyPairSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PlaybackKeyPairSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PlaybackKeyPairSummary -> f PlaybackKeyPairSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PlaybackKeyPairSummary
-> f PlaybackKeyPairSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON PlaybackKeyPairSummary where
  parseJSON :: Value -> Parser PlaybackKeyPairSummary
parseJSON =
    String
-> (Object -> Parser PlaybackKeyPairSummary)
-> Value
-> Parser PlaybackKeyPairSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PlaybackKeyPairSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> PlaybackKeyPairSummary
PlaybackKeyPairSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> PlaybackKeyPairSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> PlaybackKeyPairSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe Text -> Maybe (HashMap Text Text) -> PlaybackKeyPairSummary)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> PlaybackKeyPairSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser (Maybe (HashMap Text Text) -> PlaybackKeyPairSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser PlaybackKeyPairSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable PlaybackKeyPairSummary

instance Prelude.NFData PlaybackKeyPairSummary