{-# 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 #-}
module Amazonka.CognitoIdentityProvider.Types.SchemaAttributeType where
import Amazonka.CognitoIdentityProvider.Types.AttributeDataType
import Amazonka.CognitoIdentityProvider.Types.NumberAttributeConstraintsType
import Amazonka.CognitoIdentityProvider.Types.StringAttributeConstraintsType
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
data SchemaAttributeType = SchemaAttributeType'
{
SchemaAttributeType -> Maybe AttributeDataType
attributeDataType :: Prelude.Maybe AttributeDataType,
SchemaAttributeType -> Maybe Bool
developerOnlyAttribute :: Prelude.Maybe Prelude.Bool,
SchemaAttributeType -> Maybe Bool
mutable :: Prelude.Maybe Prelude.Bool,
SchemaAttributeType -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SchemaAttributeType -> Maybe NumberAttributeConstraintsType
numberAttributeConstraints :: Prelude.Maybe NumberAttributeConstraintsType,
SchemaAttributeType -> Maybe Bool
required :: Prelude.Maybe Prelude.Bool,
SchemaAttributeType -> Maybe StringAttributeConstraintsType
stringAttributeConstraints :: Prelude.Maybe StringAttributeConstraintsType
}
deriving (SchemaAttributeType -> SchemaAttributeType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaAttributeType -> SchemaAttributeType -> Bool
$c/= :: SchemaAttributeType -> SchemaAttributeType -> Bool
== :: SchemaAttributeType -> SchemaAttributeType -> Bool
$c== :: SchemaAttributeType -> SchemaAttributeType -> Bool
Prelude.Eq, ReadPrec [SchemaAttributeType]
ReadPrec SchemaAttributeType
Int -> ReadS SchemaAttributeType
ReadS [SchemaAttributeType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaAttributeType]
$creadListPrec :: ReadPrec [SchemaAttributeType]
readPrec :: ReadPrec SchemaAttributeType
$creadPrec :: ReadPrec SchemaAttributeType
readList :: ReadS [SchemaAttributeType]
$creadList :: ReadS [SchemaAttributeType]
readsPrec :: Int -> ReadS SchemaAttributeType
$creadsPrec :: Int -> ReadS SchemaAttributeType
Prelude.Read, Int -> SchemaAttributeType -> ShowS
[SchemaAttributeType] -> ShowS
SchemaAttributeType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaAttributeType] -> ShowS
$cshowList :: [SchemaAttributeType] -> ShowS
show :: SchemaAttributeType -> String
$cshow :: SchemaAttributeType -> String
showsPrec :: Int -> SchemaAttributeType -> ShowS
$cshowsPrec :: Int -> SchemaAttributeType -> ShowS
Prelude.Show, forall x. Rep SchemaAttributeType x -> SchemaAttributeType
forall x. SchemaAttributeType -> Rep SchemaAttributeType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaAttributeType x -> SchemaAttributeType
$cfrom :: forall x. SchemaAttributeType -> Rep SchemaAttributeType x
Prelude.Generic)
newSchemaAttributeType ::
SchemaAttributeType
newSchemaAttributeType :: SchemaAttributeType
newSchemaAttributeType =
SchemaAttributeType'
{ $sel:attributeDataType:SchemaAttributeType' :: Maybe AttributeDataType
attributeDataType =
forall a. Maybe a
Prelude.Nothing,
$sel:developerOnlyAttribute:SchemaAttributeType' :: Maybe Bool
developerOnlyAttribute = forall a. Maybe a
Prelude.Nothing,
$sel:mutable:SchemaAttributeType' :: Maybe Bool
mutable = forall a. Maybe a
Prelude.Nothing,
$sel:name:SchemaAttributeType' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:numberAttributeConstraints:SchemaAttributeType' :: Maybe NumberAttributeConstraintsType
numberAttributeConstraints = forall a. Maybe a
Prelude.Nothing,
$sel:required:SchemaAttributeType' :: Maybe Bool
required = forall a. Maybe a
Prelude.Nothing,
$sel:stringAttributeConstraints:SchemaAttributeType' :: Maybe StringAttributeConstraintsType
stringAttributeConstraints = forall a. Maybe a
Prelude.Nothing
}
schemaAttributeType_attributeDataType :: Lens.Lens' SchemaAttributeType (Prelude.Maybe AttributeDataType)
schemaAttributeType_attributeDataType :: Lens' SchemaAttributeType (Maybe AttributeDataType)
schemaAttributeType_attributeDataType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe AttributeDataType
attributeDataType :: Maybe AttributeDataType
$sel:attributeDataType:SchemaAttributeType' :: SchemaAttributeType -> Maybe AttributeDataType
attributeDataType} -> Maybe AttributeDataType
attributeDataType) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe AttributeDataType
a -> SchemaAttributeType
s {$sel:attributeDataType:SchemaAttributeType' :: Maybe AttributeDataType
attributeDataType = Maybe AttributeDataType
a} :: SchemaAttributeType)
schemaAttributeType_developerOnlyAttribute :: Lens.Lens' SchemaAttributeType (Prelude.Maybe Prelude.Bool)
schemaAttributeType_developerOnlyAttribute :: Lens' SchemaAttributeType (Maybe Bool)
schemaAttributeType_developerOnlyAttribute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe Bool
developerOnlyAttribute :: Maybe Bool
$sel:developerOnlyAttribute:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
developerOnlyAttribute} -> Maybe Bool
developerOnlyAttribute) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe Bool
a -> SchemaAttributeType
s {$sel:developerOnlyAttribute:SchemaAttributeType' :: Maybe Bool
developerOnlyAttribute = Maybe Bool
a} :: SchemaAttributeType)
schemaAttributeType_mutable :: Lens.Lens' SchemaAttributeType (Prelude.Maybe Prelude.Bool)
schemaAttributeType_mutable :: Lens' SchemaAttributeType (Maybe Bool)
schemaAttributeType_mutable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe Bool
mutable :: Maybe Bool
$sel:mutable:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
mutable} -> Maybe Bool
mutable) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe Bool
a -> SchemaAttributeType
s {$sel:mutable:SchemaAttributeType' :: Maybe Bool
mutable = Maybe Bool
a} :: SchemaAttributeType)
schemaAttributeType_name :: Lens.Lens' SchemaAttributeType (Prelude.Maybe Prelude.Text)
schemaAttributeType_name :: Lens' SchemaAttributeType (Maybe Text)
schemaAttributeType_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe Text
name :: Maybe Text
$sel:name:SchemaAttributeType' :: SchemaAttributeType -> Maybe Text
name} -> Maybe Text
name) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe Text
a -> SchemaAttributeType
s {$sel:name:SchemaAttributeType' :: Maybe Text
name = Maybe Text
a} :: SchemaAttributeType)
schemaAttributeType_numberAttributeConstraints :: Lens.Lens' SchemaAttributeType (Prelude.Maybe NumberAttributeConstraintsType)
schemaAttributeType_numberAttributeConstraints :: Lens' SchemaAttributeType (Maybe NumberAttributeConstraintsType)
schemaAttributeType_numberAttributeConstraints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe NumberAttributeConstraintsType
numberAttributeConstraints :: Maybe NumberAttributeConstraintsType
$sel:numberAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe NumberAttributeConstraintsType
numberAttributeConstraints} -> Maybe NumberAttributeConstraintsType
numberAttributeConstraints) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe NumberAttributeConstraintsType
a -> SchemaAttributeType
s {$sel:numberAttributeConstraints:SchemaAttributeType' :: Maybe NumberAttributeConstraintsType
numberAttributeConstraints = Maybe NumberAttributeConstraintsType
a} :: SchemaAttributeType)
schemaAttributeType_required :: Lens.Lens' SchemaAttributeType (Prelude.Maybe Prelude.Bool)
schemaAttributeType_required :: Lens' SchemaAttributeType (Maybe Bool)
schemaAttributeType_required = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe Bool
required :: Maybe Bool
$sel:required:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
required} -> Maybe Bool
required) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe Bool
a -> SchemaAttributeType
s {$sel:required:SchemaAttributeType' :: Maybe Bool
required = Maybe Bool
a} :: SchemaAttributeType)
schemaAttributeType_stringAttributeConstraints :: Lens.Lens' SchemaAttributeType (Prelude.Maybe StringAttributeConstraintsType)
schemaAttributeType_stringAttributeConstraints :: Lens' SchemaAttributeType (Maybe StringAttributeConstraintsType)
schemaAttributeType_stringAttributeConstraints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaAttributeType' {Maybe StringAttributeConstraintsType
stringAttributeConstraints :: Maybe StringAttributeConstraintsType
$sel:stringAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe StringAttributeConstraintsType
stringAttributeConstraints} -> Maybe StringAttributeConstraintsType
stringAttributeConstraints) (\s :: SchemaAttributeType
s@SchemaAttributeType' {} Maybe StringAttributeConstraintsType
a -> SchemaAttributeType
s {$sel:stringAttributeConstraints:SchemaAttributeType' :: Maybe StringAttributeConstraintsType
stringAttributeConstraints = Maybe StringAttributeConstraintsType
a} :: SchemaAttributeType)
instance Data.FromJSON SchemaAttributeType where
parseJSON :: Value -> Parser SchemaAttributeType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SchemaAttributeType"
( \Object
x ->
Maybe AttributeDataType
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe NumberAttributeConstraintsType
-> Maybe Bool
-> Maybe StringAttributeConstraintsType
-> SchemaAttributeType
SchemaAttributeType'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AttributeDataType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeveloperOnlyAttribute")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Mutable")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NumberAttributeConstraints")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Required")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StringAttributeConstraints")
)
instance Prelude.Hashable SchemaAttributeType where
hashWithSalt :: Int -> SchemaAttributeType -> Int
hashWithSalt Int
_salt SchemaAttributeType' {Maybe Bool
Maybe Text
Maybe AttributeDataType
Maybe NumberAttributeConstraintsType
Maybe StringAttributeConstraintsType
stringAttributeConstraints :: Maybe StringAttributeConstraintsType
required :: Maybe Bool
numberAttributeConstraints :: Maybe NumberAttributeConstraintsType
name :: Maybe Text
mutable :: Maybe Bool
developerOnlyAttribute :: Maybe Bool
attributeDataType :: Maybe AttributeDataType
$sel:stringAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe StringAttributeConstraintsType
$sel:required:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:numberAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe NumberAttributeConstraintsType
$sel:name:SchemaAttributeType' :: SchemaAttributeType -> Maybe Text
$sel:mutable:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:developerOnlyAttribute:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:attributeDataType:SchemaAttributeType' :: SchemaAttributeType -> Maybe AttributeDataType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttributeDataType
attributeDataType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
developerOnlyAttribute
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
mutable
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NumberAttributeConstraintsType
numberAttributeConstraints
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
required
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StringAttributeConstraintsType
stringAttributeConstraints
instance Prelude.NFData SchemaAttributeType where
rnf :: SchemaAttributeType -> ()
rnf SchemaAttributeType' {Maybe Bool
Maybe Text
Maybe AttributeDataType
Maybe NumberAttributeConstraintsType
Maybe StringAttributeConstraintsType
stringAttributeConstraints :: Maybe StringAttributeConstraintsType
required :: Maybe Bool
numberAttributeConstraints :: Maybe NumberAttributeConstraintsType
name :: Maybe Text
mutable :: Maybe Bool
developerOnlyAttribute :: Maybe Bool
attributeDataType :: Maybe AttributeDataType
$sel:stringAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe StringAttributeConstraintsType
$sel:required:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:numberAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe NumberAttributeConstraintsType
$sel:name:SchemaAttributeType' :: SchemaAttributeType -> Maybe Text
$sel:mutable:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:developerOnlyAttribute:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:attributeDataType:SchemaAttributeType' :: SchemaAttributeType -> Maybe AttributeDataType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AttributeDataType
attributeDataType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
developerOnlyAttribute
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
mutable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NumberAttributeConstraintsType
numberAttributeConstraints
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
required
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StringAttributeConstraintsType
stringAttributeConstraints
instance Data.ToJSON SchemaAttributeType where
toJSON :: SchemaAttributeType -> Value
toJSON SchemaAttributeType' {Maybe Bool
Maybe Text
Maybe AttributeDataType
Maybe NumberAttributeConstraintsType
Maybe StringAttributeConstraintsType
stringAttributeConstraints :: Maybe StringAttributeConstraintsType
required :: Maybe Bool
numberAttributeConstraints :: Maybe NumberAttributeConstraintsType
name :: Maybe Text
mutable :: Maybe Bool
developerOnlyAttribute :: Maybe Bool
attributeDataType :: Maybe AttributeDataType
$sel:stringAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe StringAttributeConstraintsType
$sel:required:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:numberAttributeConstraints:SchemaAttributeType' :: SchemaAttributeType -> Maybe NumberAttributeConstraintsType
$sel:name:SchemaAttributeType' :: SchemaAttributeType -> Maybe Text
$sel:mutable:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:developerOnlyAttribute:SchemaAttributeType' :: SchemaAttributeType -> Maybe Bool
$sel:attributeDataType:SchemaAttributeType' :: SchemaAttributeType -> Maybe AttributeDataType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AttributeDataType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AttributeDataType
attributeDataType,
(Key
"DeveloperOnlyAttribute" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
developerOnlyAttribute,
(Key
"Mutable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
mutable,
(Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Key
"NumberAttributeConstraints" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NumberAttributeConstraintsType
numberAttributeConstraints,
(Key
"Required" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
required,
(Key
"StringAttributeConstraints" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StringAttributeConstraintsType
stringAttributeConstraints
]
)