{-# 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.CognitoIdentity.Types.IdentityPoolShortDescription
-- 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.CognitoIdentity.Types.IdentityPoolShortDescription where

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

-- | A description of the identity pool.
--
-- /See:/ 'newIdentityPoolShortDescription' smart constructor.
data IdentityPoolShortDescription = IdentityPoolShortDescription'
  { -- | An identity pool ID in the format REGION:GUID.
    IdentityPoolShortDescription -> Maybe Text
identityPoolId :: Prelude.Maybe Prelude.Text,
    -- | A string that you provide.
    IdentityPoolShortDescription -> Maybe Text
identityPoolName :: Prelude.Maybe Prelude.Text
  }
  deriving (IdentityPoolShortDescription
-> IdentityPoolShortDescription -> Bool
(IdentityPoolShortDescription
 -> IdentityPoolShortDescription -> Bool)
-> (IdentityPoolShortDescription
    -> IdentityPoolShortDescription -> Bool)
-> Eq IdentityPoolShortDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityPoolShortDescription
-> IdentityPoolShortDescription -> Bool
$c/= :: IdentityPoolShortDescription
-> IdentityPoolShortDescription -> Bool
== :: IdentityPoolShortDescription
-> IdentityPoolShortDescription -> Bool
$c== :: IdentityPoolShortDescription
-> IdentityPoolShortDescription -> Bool
Prelude.Eq, ReadPrec [IdentityPoolShortDescription]
ReadPrec IdentityPoolShortDescription
Int -> ReadS IdentityPoolShortDescription
ReadS [IdentityPoolShortDescription]
(Int -> ReadS IdentityPoolShortDescription)
-> ReadS [IdentityPoolShortDescription]
-> ReadPrec IdentityPoolShortDescription
-> ReadPrec [IdentityPoolShortDescription]
-> Read IdentityPoolShortDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityPoolShortDescription]
$creadListPrec :: ReadPrec [IdentityPoolShortDescription]
readPrec :: ReadPrec IdentityPoolShortDescription
$creadPrec :: ReadPrec IdentityPoolShortDescription
readList :: ReadS [IdentityPoolShortDescription]
$creadList :: ReadS [IdentityPoolShortDescription]
readsPrec :: Int -> ReadS IdentityPoolShortDescription
$creadsPrec :: Int -> ReadS IdentityPoolShortDescription
Prelude.Read, Int -> IdentityPoolShortDescription -> ShowS
[IdentityPoolShortDescription] -> ShowS
IdentityPoolShortDescription -> String
(Int -> IdentityPoolShortDescription -> ShowS)
-> (IdentityPoolShortDescription -> String)
-> ([IdentityPoolShortDescription] -> ShowS)
-> Show IdentityPoolShortDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityPoolShortDescription] -> ShowS
$cshowList :: [IdentityPoolShortDescription] -> ShowS
show :: IdentityPoolShortDescription -> String
$cshow :: IdentityPoolShortDescription -> String
showsPrec :: Int -> IdentityPoolShortDescription -> ShowS
$cshowsPrec :: Int -> IdentityPoolShortDescription -> ShowS
Prelude.Show, (forall x.
 IdentityPoolShortDescription -> Rep IdentityPoolShortDescription x)
-> (forall x.
    Rep IdentityPoolShortDescription x -> IdentityPoolShortDescription)
-> Generic IdentityPoolShortDescription
forall x.
Rep IdentityPoolShortDescription x -> IdentityPoolShortDescription
forall x.
IdentityPoolShortDescription -> Rep IdentityPoolShortDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IdentityPoolShortDescription x -> IdentityPoolShortDescription
$cfrom :: forall x.
IdentityPoolShortDescription -> Rep IdentityPoolShortDescription x
Prelude.Generic)

-- |
-- Create a value of 'IdentityPoolShortDescription' 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:
--
-- 'identityPoolId', 'identityPoolShortDescription_identityPoolId' - An identity pool ID in the format REGION:GUID.
--
-- 'identityPoolName', 'identityPoolShortDescription_identityPoolName' - A string that you provide.
newIdentityPoolShortDescription ::
  IdentityPoolShortDescription
newIdentityPoolShortDescription :: IdentityPoolShortDescription
newIdentityPoolShortDescription =
  IdentityPoolShortDescription' :: Maybe Text -> Maybe Text -> IdentityPoolShortDescription
IdentityPoolShortDescription'
    { $sel:identityPoolId:IdentityPoolShortDescription' :: Maybe Text
identityPoolId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityPoolName:IdentityPoolShortDescription' :: Maybe Text
identityPoolName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | An identity pool ID in the format REGION:GUID.
identityPoolShortDescription_identityPoolId :: Lens.Lens' IdentityPoolShortDescription (Prelude.Maybe Prelude.Text)
identityPoolShortDescription_identityPoolId :: (Maybe Text -> f (Maybe Text))
-> IdentityPoolShortDescription -> f IdentityPoolShortDescription
identityPoolShortDescription_identityPoolId = (IdentityPoolShortDescription -> Maybe Text)
-> (IdentityPoolShortDescription
    -> Maybe Text -> IdentityPoolShortDescription)
-> Lens
     IdentityPoolShortDescription
     IdentityPoolShortDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPoolShortDescription' {Maybe Text
identityPoolId :: Maybe Text
$sel:identityPoolId:IdentityPoolShortDescription' :: IdentityPoolShortDescription -> Maybe Text
identityPoolId} -> Maybe Text
identityPoolId) (\s :: IdentityPoolShortDescription
s@IdentityPoolShortDescription' {} Maybe Text
a -> IdentityPoolShortDescription
s {$sel:identityPoolId:IdentityPoolShortDescription' :: Maybe Text
identityPoolId = Maybe Text
a} :: IdentityPoolShortDescription)

-- | A string that you provide.
identityPoolShortDescription_identityPoolName :: Lens.Lens' IdentityPoolShortDescription (Prelude.Maybe Prelude.Text)
identityPoolShortDescription_identityPoolName :: (Maybe Text -> f (Maybe Text))
-> IdentityPoolShortDescription -> f IdentityPoolShortDescription
identityPoolShortDescription_identityPoolName = (IdentityPoolShortDescription -> Maybe Text)
-> (IdentityPoolShortDescription
    -> Maybe Text -> IdentityPoolShortDescription)
-> Lens
     IdentityPoolShortDescription
     IdentityPoolShortDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPoolShortDescription' {Maybe Text
identityPoolName :: Maybe Text
$sel:identityPoolName:IdentityPoolShortDescription' :: IdentityPoolShortDescription -> Maybe Text
identityPoolName} -> Maybe Text
identityPoolName) (\s :: IdentityPoolShortDescription
s@IdentityPoolShortDescription' {} Maybe Text
a -> IdentityPoolShortDescription
s {$sel:identityPoolName:IdentityPoolShortDescription' :: Maybe Text
identityPoolName = Maybe Text
a} :: IdentityPoolShortDescription)

instance Core.FromJSON IdentityPoolShortDescription where
  parseJSON :: Value -> Parser IdentityPoolShortDescription
parseJSON =
    String
-> (Object -> Parser IdentityPoolShortDescription)
-> Value
-> Parser IdentityPoolShortDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IdentityPoolShortDescription"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> IdentityPoolShortDescription
IdentityPoolShortDescription'
            (Maybe Text -> Maybe Text -> IdentityPoolShortDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> IdentityPoolShortDescription)
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
"IdentityPoolId")
            Parser (Maybe Text -> IdentityPoolShortDescription)
-> Parser (Maybe Text) -> Parser IdentityPoolShortDescription
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
"IdentityPoolName")
      )

instance
  Prelude.Hashable
    IdentityPoolShortDescription

instance Prelude.NFData IdentityPoolShortDescription