{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CognitoIdentityProvider.Types.UsernameAttributeType
-- 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.CognitoIdentityProvider.Types.UsernameAttributeType
  ( UsernameAttributeType
      ( ..,
        UsernameAttributeType_Email,
        UsernameAttributeType_Phone_number
      ),
  )
where

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

newtype UsernameAttributeType = UsernameAttributeType'
  { UsernameAttributeType -> Text
fromUsernameAttributeType ::
      Core.Text
  }
  deriving stock
    ( Int -> UsernameAttributeType -> ShowS
[UsernameAttributeType] -> ShowS
UsernameAttributeType -> String
(Int -> UsernameAttributeType -> ShowS)
-> (UsernameAttributeType -> String)
-> ([UsernameAttributeType] -> ShowS)
-> Show UsernameAttributeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsernameAttributeType] -> ShowS
$cshowList :: [UsernameAttributeType] -> ShowS
show :: UsernameAttributeType -> String
$cshow :: UsernameAttributeType -> String
showsPrec :: Int -> UsernameAttributeType -> ShowS
$cshowsPrec :: Int -> UsernameAttributeType -> ShowS
Prelude.Show,
      ReadPrec [UsernameAttributeType]
ReadPrec UsernameAttributeType
Int -> ReadS UsernameAttributeType
ReadS [UsernameAttributeType]
(Int -> ReadS UsernameAttributeType)
-> ReadS [UsernameAttributeType]
-> ReadPrec UsernameAttributeType
-> ReadPrec [UsernameAttributeType]
-> Read UsernameAttributeType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsernameAttributeType]
$creadListPrec :: ReadPrec [UsernameAttributeType]
readPrec :: ReadPrec UsernameAttributeType
$creadPrec :: ReadPrec UsernameAttributeType
readList :: ReadS [UsernameAttributeType]
$creadList :: ReadS [UsernameAttributeType]
readsPrec :: Int -> ReadS UsernameAttributeType
$creadsPrec :: Int -> ReadS UsernameAttributeType
Prelude.Read,
      UsernameAttributeType -> UsernameAttributeType -> Bool
(UsernameAttributeType -> UsernameAttributeType -> Bool)
-> (UsernameAttributeType -> UsernameAttributeType -> Bool)
-> Eq UsernameAttributeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsernameAttributeType -> UsernameAttributeType -> Bool
$c/= :: UsernameAttributeType -> UsernameAttributeType -> Bool
== :: UsernameAttributeType -> UsernameAttributeType -> Bool
$c== :: UsernameAttributeType -> UsernameAttributeType -> Bool
Prelude.Eq,
      Eq UsernameAttributeType
Eq UsernameAttributeType
-> (UsernameAttributeType -> UsernameAttributeType -> Ordering)
-> (UsernameAttributeType -> UsernameAttributeType -> Bool)
-> (UsernameAttributeType -> UsernameAttributeType -> Bool)
-> (UsernameAttributeType -> UsernameAttributeType -> Bool)
-> (UsernameAttributeType -> UsernameAttributeType -> Bool)
-> (UsernameAttributeType
    -> UsernameAttributeType -> UsernameAttributeType)
-> (UsernameAttributeType
    -> UsernameAttributeType -> UsernameAttributeType)
-> Ord UsernameAttributeType
UsernameAttributeType -> UsernameAttributeType -> Bool
UsernameAttributeType -> UsernameAttributeType -> Ordering
UsernameAttributeType
-> UsernameAttributeType -> UsernameAttributeType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: UsernameAttributeType
-> UsernameAttributeType -> UsernameAttributeType
$cmin :: UsernameAttributeType
-> UsernameAttributeType -> UsernameAttributeType
max :: UsernameAttributeType
-> UsernameAttributeType -> UsernameAttributeType
$cmax :: UsernameAttributeType
-> UsernameAttributeType -> UsernameAttributeType
>= :: UsernameAttributeType -> UsernameAttributeType -> Bool
$c>= :: UsernameAttributeType -> UsernameAttributeType -> Bool
> :: UsernameAttributeType -> UsernameAttributeType -> Bool
$c> :: UsernameAttributeType -> UsernameAttributeType -> Bool
<= :: UsernameAttributeType -> UsernameAttributeType -> Bool
$c<= :: UsernameAttributeType -> UsernameAttributeType -> Bool
< :: UsernameAttributeType -> UsernameAttributeType -> Bool
$c< :: UsernameAttributeType -> UsernameAttributeType -> Bool
compare :: UsernameAttributeType -> UsernameAttributeType -> Ordering
$ccompare :: UsernameAttributeType -> UsernameAttributeType -> Ordering
$cp1Ord :: Eq UsernameAttributeType
Prelude.Ord,
      (forall x. UsernameAttributeType -> Rep UsernameAttributeType x)
-> (forall x. Rep UsernameAttributeType x -> UsernameAttributeType)
-> Generic UsernameAttributeType
forall x. Rep UsernameAttributeType x -> UsernameAttributeType
forall x. UsernameAttributeType -> Rep UsernameAttributeType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UsernameAttributeType x -> UsernameAttributeType
$cfrom :: forall x. UsernameAttributeType -> Rep UsernameAttributeType x
Prelude.Generic
    )
  deriving newtype
    ( Int -> UsernameAttributeType -> Int
UsernameAttributeType -> Int
(Int -> UsernameAttributeType -> Int)
-> (UsernameAttributeType -> Int) -> Hashable UsernameAttributeType
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: UsernameAttributeType -> Int
$chash :: UsernameAttributeType -> Int
hashWithSalt :: Int -> UsernameAttributeType -> Int
$chashWithSalt :: Int -> UsernameAttributeType -> Int
Prelude.Hashable,
      UsernameAttributeType -> ()
(UsernameAttributeType -> ()) -> NFData UsernameAttributeType
forall a. (a -> ()) -> NFData a
rnf :: UsernameAttributeType -> ()
$crnf :: UsernameAttributeType -> ()
Prelude.NFData,
      Text -> Either String UsernameAttributeType
(Text -> Either String UsernameAttributeType)
-> FromText UsernameAttributeType
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String UsernameAttributeType
$cfromText :: Text -> Either String UsernameAttributeType
Core.FromText,
      UsernameAttributeType -> Text
(UsernameAttributeType -> Text) -> ToText UsernameAttributeType
forall a. (a -> Text) -> ToText a
toText :: UsernameAttributeType -> Text
$ctoText :: UsernameAttributeType -> Text
Core.ToText,
      UsernameAttributeType -> ByteString
(UsernameAttributeType -> ByteString)
-> ToByteString UsernameAttributeType
forall a. (a -> ByteString) -> ToByteString a
toBS :: UsernameAttributeType -> ByteString
$ctoBS :: UsernameAttributeType -> ByteString
Core.ToByteString,
      UsernameAttributeType -> ByteStringBuilder
(UsernameAttributeType -> ByteStringBuilder)
-> ToLog UsernameAttributeType
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: UsernameAttributeType -> ByteStringBuilder
$cbuild :: UsernameAttributeType -> ByteStringBuilder
Core.ToLog,
      HeaderName -> UsernameAttributeType -> [Header]
(HeaderName -> UsernameAttributeType -> [Header])
-> ToHeader UsernameAttributeType
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> UsernameAttributeType -> [Header]
$ctoHeader :: HeaderName -> UsernameAttributeType -> [Header]
Core.ToHeader,
      UsernameAttributeType -> QueryString
(UsernameAttributeType -> QueryString)
-> ToQuery UsernameAttributeType
forall a. (a -> QueryString) -> ToQuery a
toQuery :: UsernameAttributeType -> QueryString
$ctoQuery :: UsernameAttributeType -> QueryString
Core.ToQuery,
      Value -> Parser [UsernameAttributeType]
Value -> Parser UsernameAttributeType
(Value -> Parser UsernameAttributeType)
-> (Value -> Parser [UsernameAttributeType])
-> FromJSON UsernameAttributeType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [UsernameAttributeType]
$cparseJSONList :: Value -> Parser [UsernameAttributeType]
parseJSON :: Value -> Parser UsernameAttributeType
$cparseJSON :: Value -> Parser UsernameAttributeType
Core.FromJSON,
      FromJSONKeyFunction [UsernameAttributeType]
FromJSONKeyFunction UsernameAttributeType
FromJSONKeyFunction UsernameAttributeType
-> FromJSONKeyFunction [UsernameAttributeType]
-> FromJSONKey UsernameAttributeType
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [UsernameAttributeType]
$cfromJSONKeyList :: FromJSONKeyFunction [UsernameAttributeType]
fromJSONKey :: FromJSONKeyFunction UsernameAttributeType
$cfromJSONKey :: FromJSONKeyFunction UsernameAttributeType
Core.FromJSONKey,
      [UsernameAttributeType] -> Encoding
[UsernameAttributeType] -> Value
UsernameAttributeType -> Encoding
UsernameAttributeType -> Value
(UsernameAttributeType -> Value)
-> (UsernameAttributeType -> Encoding)
-> ([UsernameAttributeType] -> Value)
-> ([UsernameAttributeType] -> Encoding)
-> ToJSON UsernameAttributeType
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [UsernameAttributeType] -> Encoding
$ctoEncodingList :: [UsernameAttributeType] -> Encoding
toJSONList :: [UsernameAttributeType] -> Value
$ctoJSONList :: [UsernameAttributeType] -> Value
toEncoding :: UsernameAttributeType -> Encoding
$ctoEncoding :: UsernameAttributeType -> Encoding
toJSON :: UsernameAttributeType -> Value
$ctoJSON :: UsernameAttributeType -> Value
Core.ToJSON,
      ToJSONKeyFunction [UsernameAttributeType]
ToJSONKeyFunction UsernameAttributeType
ToJSONKeyFunction UsernameAttributeType
-> ToJSONKeyFunction [UsernameAttributeType]
-> ToJSONKey UsernameAttributeType
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [UsernameAttributeType]
$ctoJSONKeyList :: ToJSONKeyFunction [UsernameAttributeType]
toJSONKey :: ToJSONKeyFunction UsernameAttributeType
$ctoJSONKey :: ToJSONKeyFunction UsernameAttributeType
Core.ToJSONKey,
      [Node] -> Either String UsernameAttributeType
([Node] -> Either String UsernameAttributeType)
-> FromXML UsernameAttributeType
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String UsernameAttributeType
$cparseXML :: [Node] -> Either String UsernameAttributeType
Core.FromXML,
      UsernameAttributeType -> XML
(UsernameAttributeType -> XML) -> ToXML UsernameAttributeType
forall a. (a -> XML) -> ToXML a
toXML :: UsernameAttributeType -> XML
$ctoXML :: UsernameAttributeType -> XML
Core.ToXML
    )

pattern UsernameAttributeType_Email :: UsernameAttributeType
pattern $bUsernameAttributeType_Email :: UsernameAttributeType
$mUsernameAttributeType_Email :: forall r.
UsernameAttributeType -> (Void# -> r) -> (Void# -> r) -> r
UsernameAttributeType_Email = UsernameAttributeType' "email"

pattern UsernameAttributeType_Phone_number :: UsernameAttributeType
pattern $bUsernameAttributeType_Phone_number :: UsernameAttributeType
$mUsernameAttributeType_Phone_number :: forall r.
UsernameAttributeType -> (Void# -> r) -> (Void# -> r) -> r
UsernameAttributeType_Phone_number = UsernameAttributeType' "phone_number"

{-# COMPLETE
  UsernameAttributeType_Email,
  UsernameAttributeType_Phone_number,
  UsernameAttributeType'
  #-}