{-# 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.M2.Types.VsamAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.M2.Types.AlternateKey
import Amazonka.M2.Types.PrimaryKey
import qualified Amazonka.Prelude as Prelude
data VsamAttributes = VsamAttributes'
{
VsamAttributes -> Maybe [AlternateKey]
alternateKeys :: Prelude.Maybe [AlternateKey],
VsamAttributes -> Maybe Bool
compressed :: Prelude.Maybe Prelude.Bool,
VsamAttributes -> Maybe Text
encoding :: Prelude.Maybe Prelude.Text,
VsamAttributes -> Maybe PrimaryKey
primaryKey :: Prelude.Maybe PrimaryKey,
VsamAttributes -> Text
format :: Prelude.Text
}
deriving (VsamAttributes -> VsamAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VsamAttributes -> VsamAttributes -> Bool
$c/= :: VsamAttributes -> VsamAttributes -> Bool
== :: VsamAttributes -> VsamAttributes -> Bool
$c== :: VsamAttributes -> VsamAttributes -> Bool
Prelude.Eq, ReadPrec [VsamAttributes]
ReadPrec VsamAttributes
Int -> ReadS VsamAttributes
ReadS [VsamAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VsamAttributes]
$creadListPrec :: ReadPrec [VsamAttributes]
readPrec :: ReadPrec VsamAttributes
$creadPrec :: ReadPrec VsamAttributes
readList :: ReadS [VsamAttributes]
$creadList :: ReadS [VsamAttributes]
readsPrec :: Int -> ReadS VsamAttributes
$creadsPrec :: Int -> ReadS VsamAttributes
Prelude.Read, Int -> VsamAttributes -> ShowS
[VsamAttributes] -> ShowS
VsamAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VsamAttributes] -> ShowS
$cshowList :: [VsamAttributes] -> ShowS
show :: VsamAttributes -> String
$cshow :: VsamAttributes -> String
showsPrec :: Int -> VsamAttributes -> ShowS
$cshowsPrec :: Int -> VsamAttributes -> ShowS
Prelude.Show, forall x. Rep VsamAttributes x -> VsamAttributes
forall x. VsamAttributes -> Rep VsamAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VsamAttributes x -> VsamAttributes
$cfrom :: forall x. VsamAttributes -> Rep VsamAttributes x
Prelude.Generic)
newVsamAttributes ::
Prelude.Text ->
VsamAttributes
newVsamAttributes :: Text -> VsamAttributes
newVsamAttributes Text
pFormat_ =
VsamAttributes'
{ $sel:alternateKeys:VsamAttributes' :: Maybe [AlternateKey]
alternateKeys = forall a. Maybe a
Prelude.Nothing,
$sel:compressed:VsamAttributes' :: Maybe Bool
compressed = forall a. Maybe a
Prelude.Nothing,
$sel:encoding:VsamAttributes' :: Maybe Text
encoding = forall a. Maybe a
Prelude.Nothing,
$sel:primaryKey:VsamAttributes' :: Maybe PrimaryKey
primaryKey = forall a. Maybe a
Prelude.Nothing,
$sel:format:VsamAttributes' :: Text
format = Text
pFormat_
}
vsamAttributes_alternateKeys :: Lens.Lens' VsamAttributes (Prelude.Maybe [AlternateKey])
vsamAttributes_alternateKeys :: Lens' VsamAttributes (Maybe [AlternateKey])
vsamAttributes_alternateKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamAttributes' {Maybe [AlternateKey]
alternateKeys :: Maybe [AlternateKey]
$sel:alternateKeys:VsamAttributes' :: VsamAttributes -> Maybe [AlternateKey]
alternateKeys} -> Maybe [AlternateKey]
alternateKeys) (\s :: VsamAttributes
s@VsamAttributes' {} Maybe [AlternateKey]
a -> VsamAttributes
s {$sel:alternateKeys:VsamAttributes' :: Maybe [AlternateKey]
alternateKeys = Maybe [AlternateKey]
a} :: VsamAttributes) 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
vsamAttributes_compressed :: Lens.Lens' VsamAttributes (Prelude.Maybe Prelude.Bool)
vsamAttributes_compressed :: Lens' VsamAttributes (Maybe Bool)
vsamAttributes_compressed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamAttributes' {Maybe Bool
compressed :: Maybe Bool
$sel:compressed:VsamAttributes' :: VsamAttributes -> Maybe Bool
compressed} -> Maybe Bool
compressed) (\s :: VsamAttributes
s@VsamAttributes' {} Maybe Bool
a -> VsamAttributes
s {$sel:compressed:VsamAttributes' :: Maybe Bool
compressed = Maybe Bool
a} :: VsamAttributes)
vsamAttributes_encoding :: Lens.Lens' VsamAttributes (Prelude.Maybe Prelude.Text)
vsamAttributes_encoding :: Lens' VsamAttributes (Maybe Text)
vsamAttributes_encoding = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamAttributes' {Maybe Text
encoding :: Maybe Text
$sel:encoding:VsamAttributes' :: VsamAttributes -> Maybe Text
encoding} -> Maybe Text
encoding) (\s :: VsamAttributes
s@VsamAttributes' {} Maybe Text
a -> VsamAttributes
s {$sel:encoding:VsamAttributes' :: Maybe Text
encoding = Maybe Text
a} :: VsamAttributes)
vsamAttributes_primaryKey :: Lens.Lens' VsamAttributes (Prelude.Maybe PrimaryKey)
vsamAttributes_primaryKey :: Lens' VsamAttributes (Maybe PrimaryKey)
vsamAttributes_primaryKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamAttributes' {Maybe PrimaryKey
primaryKey :: Maybe PrimaryKey
$sel:primaryKey:VsamAttributes' :: VsamAttributes -> Maybe PrimaryKey
primaryKey} -> Maybe PrimaryKey
primaryKey) (\s :: VsamAttributes
s@VsamAttributes' {} Maybe PrimaryKey
a -> VsamAttributes
s {$sel:primaryKey:VsamAttributes' :: Maybe PrimaryKey
primaryKey = Maybe PrimaryKey
a} :: VsamAttributes)
vsamAttributes_format :: Lens.Lens' VsamAttributes Prelude.Text
vsamAttributes_format :: Lens' VsamAttributes Text
vsamAttributes_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamAttributes' {Text
format :: Text
$sel:format:VsamAttributes' :: VsamAttributes -> Text
format} -> Text
format) (\s :: VsamAttributes
s@VsamAttributes' {} Text
a -> VsamAttributes
s {$sel:format:VsamAttributes' :: Text
format = Text
a} :: VsamAttributes)
instance Prelude.Hashable VsamAttributes where
hashWithSalt :: Int -> VsamAttributes -> Int
hashWithSalt Int
_salt VsamAttributes' {Maybe Bool
Maybe [AlternateKey]
Maybe Text
Maybe PrimaryKey
Text
format :: Text
primaryKey :: Maybe PrimaryKey
encoding :: Maybe Text
compressed :: Maybe Bool
alternateKeys :: Maybe [AlternateKey]
$sel:format:VsamAttributes' :: VsamAttributes -> Text
$sel:primaryKey:VsamAttributes' :: VsamAttributes -> Maybe PrimaryKey
$sel:encoding:VsamAttributes' :: VsamAttributes -> Maybe Text
$sel:compressed:VsamAttributes' :: VsamAttributes -> Maybe Bool
$sel:alternateKeys:VsamAttributes' :: VsamAttributes -> Maybe [AlternateKey]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AlternateKey]
alternateKeys
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
compressed
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encoding
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PrimaryKey
primaryKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
format
instance Prelude.NFData VsamAttributes where
rnf :: VsamAttributes -> ()
rnf VsamAttributes' {Maybe Bool
Maybe [AlternateKey]
Maybe Text
Maybe PrimaryKey
Text
format :: Text
primaryKey :: Maybe PrimaryKey
encoding :: Maybe Text
compressed :: Maybe Bool
alternateKeys :: Maybe [AlternateKey]
$sel:format:VsamAttributes' :: VsamAttributes -> Text
$sel:primaryKey:VsamAttributes' :: VsamAttributes -> Maybe PrimaryKey
$sel:encoding:VsamAttributes' :: VsamAttributes -> Maybe Text
$sel:compressed:VsamAttributes' :: VsamAttributes -> Maybe Bool
$sel:alternateKeys:VsamAttributes' :: VsamAttributes -> Maybe [AlternateKey]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AlternateKey]
alternateKeys
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
compressed
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encoding
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PrimaryKey
primaryKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
format
instance Data.ToJSON VsamAttributes where
toJSON :: VsamAttributes -> Value
toJSON VsamAttributes' {Maybe Bool
Maybe [AlternateKey]
Maybe Text
Maybe PrimaryKey
Text
format :: Text
primaryKey :: Maybe PrimaryKey
encoding :: Maybe Text
compressed :: Maybe Bool
alternateKeys :: Maybe [AlternateKey]
$sel:format:VsamAttributes' :: VsamAttributes -> Text
$sel:primaryKey:VsamAttributes' :: VsamAttributes -> Maybe PrimaryKey
$sel:encoding:VsamAttributes' :: VsamAttributes -> Maybe Text
$sel:compressed:VsamAttributes' :: VsamAttributes -> Maybe Bool
$sel:alternateKeys:VsamAttributes' :: VsamAttributes -> Maybe [AlternateKey]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"alternateKeys" 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 [AlternateKey]
alternateKeys,
(Key
"compressed" 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
compressed,
(Key
"encoding" 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
encoding,
(Key
"primaryKey" 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 PrimaryKey
primaryKey,
forall a. a -> Maybe a
Prelude.Just (Key
"format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
format)
]
)