{-# 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.M2.Types.VsamDetailAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.M2.Types.VsamDetailAttributes 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

-- | The attributes of a VSAM type data set.
--
-- /See:/ 'newVsamDetailAttributes' smart constructor.
data VsamDetailAttributes = VsamDetailAttributes'
  { -- | The alternate key definitions, if any. A legacy dataset might not have
    -- any alternate key defined, but if those alternate keys definitions
    -- exist, provide them as some applications will make use of them.
    VsamDetailAttributes -> Maybe [AlternateKey]
alternateKeys :: Prelude.Maybe [AlternateKey],
    -- | If set to True, enforces loading the data set into cache before it’s
    -- used by the application.
    VsamDetailAttributes -> Maybe Bool
cacheAtStartup :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether indexes for this dataset are stored as compressed
    -- values. If you have a large data set (typically > 100 Mb), consider
    -- setting this flag to True.
    VsamDetailAttributes -> Maybe Bool
compressed :: Prelude.Maybe Prelude.Bool,
    -- | The character set used by the data set. Can be ASCII, EBCDIC, or
    -- unknown.
    VsamDetailAttributes -> Maybe Text
encoding :: Prelude.Maybe Prelude.Text,
    -- | The primary key of the data set.
    VsamDetailAttributes -> Maybe PrimaryKey
primaryKey :: Prelude.Maybe PrimaryKey,
    -- | The record format of the data set.
    VsamDetailAttributes -> Maybe Text
recordFormat :: Prelude.Maybe Prelude.Text
  }
  deriving (VsamDetailAttributes -> VsamDetailAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VsamDetailAttributes -> VsamDetailAttributes -> Bool
$c/= :: VsamDetailAttributes -> VsamDetailAttributes -> Bool
== :: VsamDetailAttributes -> VsamDetailAttributes -> Bool
$c== :: VsamDetailAttributes -> VsamDetailAttributes -> Bool
Prelude.Eq, ReadPrec [VsamDetailAttributes]
ReadPrec VsamDetailAttributes
Int -> ReadS VsamDetailAttributes
ReadS [VsamDetailAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VsamDetailAttributes]
$creadListPrec :: ReadPrec [VsamDetailAttributes]
readPrec :: ReadPrec VsamDetailAttributes
$creadPrec :: ReadPrec VsamDetailAttributes
readList :: ReadS [VsamDetailAttributes]
$creadList :: ReadS [VsamDetailAttributes]
readsPrec :: Int -> ReadS VsamDetailAttributes
$creadsPrec :: Int -> ReadS VsamDetailAttributes
Prelude.Read, Int -> VsamDetailAttributes -> ShowS
[VsamDetailAttributes] -> ShowS
VsamDetailAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VsamDetailAttributes] -> ShowS
$cshowList :: [VsamDetailAttributes] -> ShowS
show :: VsamDetailAttributes -> String
$cshow :: VsamDetailAttributes -> String
showsPrec :: Int -> VsamDetailAttributes -> ShowS
$cshowsPrec :: Int -> VsamDetailAttributes -> ShowS
Prelude.Show, forall x. Rep VsamDetailAttributes x -> VsamDetailAttributes
forall x. VsamDetailAttributes -> Rep VsamDetailAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VsamDetailAttributes x -> VsamDetailAttributes
$cfrom :: forall x. VsamDetailAttributes -> Rep VsamDetailAttributes x
Prelude.Generic)

-- |
-- Create a value of 'VsamDetailAttributes' 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:
--
-- 'alternateKeys', 'vsamDetailAttributes_alternateKeys' - The alternate key definitions, if any. A legacy dataset might not have
-- any alternate key defined, but if those alternate keys definitions
-- exist, provide them as some applications will make use of them.
--
-- 'cacheAtStartup', 'vsamDetailAttributes_cacheAtStartup' - If set to True, enforces loading the data set into cache before it’s
-- used by the application.
--
-- 'compressed', 'vsamDetailAttributes_compressed' - Indicates whether indexes for this dataset are stored as compressed
-- values. If you have a large data set (typically > 100 Mb), consider
-- setting this flag to True.
--
-- 'encoding', 'vsamDetailAttributes_encoding' - The character set used by the data set. Can be ASCII, EBCDIC, or
-- unknown.
--
-- 'primaryKey', 'vsamDetailAttributes_primaryKey' - The primary key of the data set.
--
-- 'recordFormat', 'vsamDetailAttributes_recordFormat' - The record format of the data set.
newVsamDetailAttributes ::
  VsamDetailAttributes
newVsamDetailAttributes :: VsamDetailAttributes
newVsamDetailAttributes =
  VsamDetailAttributes'
    { $sel:alternateKeys:VsamDetailAttributes' :: Maybe [AlternateKey]
alternateKeys =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cacheAtStartup:VsamDetailAttributes' :: Maybe Bool
cacheAtStartup = forall a. Maybe a
Prelude.Nothing,
      $sel:compressed:VsamDetailAttributes' :: Maybe Bool
compressed = forall a. Maybe a
Prelude.Nothing,
      $sel:encoding:VsamDetailAttributes' :: Maybe Text
encoding = forall a. Maybe a
Prelude.Nothing,
      $sel:primaryKey:VsamDetailAttributes' :: Maybe PrimaryKey
primaryKey = forall a. Maybe a
Prelude.Nothing,
      $sel:recordFormat:VsamDetailAttributes' :: Maybe Text
recordFormat = forall a. Maybe a
Prelude.Nothing
    }

-- | The alternate key definitions, if any. A legacy dataset might not have
-- any alternate key defined, but if those alternate keys definitions
-- exist, provide them as some applications will make use of them.
vsamDetailAttributes_alternateKeys :: Lens.Lens' VsamDetailAttributes (Prelude.Maybe [AlternateKey])
vsamDetailAttributes_alternateKeys :: Lens' VsamDetailAttributes (Maybe [AlternateKey])
vsamDetailAttributes_alternateKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamDetailAttributes' {Maybe [AlternateKey]
alternateKeys :: Maybe [AlternateKey]
$sel:alternateKeys:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe [AlternateKey]
alternateKeys} -> Maybe [AlternateKey]
alternateKeys) (\s :: VsamDetailAttributes
s@VsamDetailAttributes' {} Maybe [AlternateKey]
a -> VsamDetailAttributes
s {$sel:alternateKeys:VsamDetailAttributes' :: Maybe [AlternateKey]
alternateKeys = Maybe [AlternateKey]
a} :: VsamDetailAttributes) 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

-- | If set to True, enforces loading the data set into cache before it’s
-- used by the application.
vsamDetailAttributes_cacheAtStartup :: Lens.Lens' VsamDetailAttributes (Prelude.Maybe Prelude.Bool)
vsamDetailAttributes_cacheAtStartup :: Lens' VsamDetailAttributes (Maybe Bool)
vsamDetailAttributes_cacheAtStartup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamDetailAttributes' {Maybe Bool
cacheAtStartup :: Maybe Bool
$sel:cacheAtStartup:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Bool
cacheAtStartup} -> Maybe Bool
cacheAtStartup) (\s :: VsamDetailAttributes
s@VsamDetailAttributes' {} Maybe Bool
a -> VsamDetailAttributes
s {$sel:cacheAtStartup:VsamDetailAttributes' :: Maybe Bool
cacheAtStartup = Maybe Bool
a} :: VsamDetailAttributes)

-- | Indicates whether indexes for this dataset are stored as compressed
-- values. If you have a large data set (typically > 100 Mb), consider
-- setting this flag to True.
vsamDetailAttributes_compressed :: Lens.Lens' VsamDetailAttributes (Prelude.Maybe Prelude.Bool)
vsamDetailAttributes_compressed :: Lens' VsamDetailAttributes (Maybe Bool)
vsamDetailAttributes_compressed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamDetailAttributes' {Maybe Bool
compressed :: Maybe Bool
$sel:compressed:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Bool
compressed} -> Maybe Bool
compressed) (\s :: VsamDetailAttributes
s@VsamDetailAttributes' {} Maybe Bool
a -> VsamDetailAttributes
s {$sel:compressed:VsamDetailAttributes' :: Maybe Bool
compressed = Maybe Bool
a} :: VsamDetailAttributes)

-- | The character set used by the data set. Can be ASCII, EBCDIC, or
-- unknown.
vsamDetailAttributes_encoding :: Lens.Lens' VsamDetailAttributes (Prelude.Maybe Prelude.Text)
vsamDetailAttributes_encoding :: Lens' VsamDetailAttributes (Maybe Text)
vsamDetailAttributes_encoding = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamDetailAttributes' {Maybe Text
encoding :: Maybe Text
$sel:encoding:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Text
encoding} -> Maybe Text
encoding) (\s :: VsamDetailAttributes
s@VsamDetailAttributes' {} Maybe Text
a -> VsamDetailAttributes
s {$sel:encoding:VsamDetailAttributes' :: Maybe Text
encoding = Maybe Text
a} :: VsamDetailAttributes)

-- | The primary key of the data set.
vsamDetailAttributes_primaryKey :: Lens.Lens' VsamDetailAttributes (Prelude.Maybe PrimaryKey)
vsamDetailAttributes_primaryKey :: Lens' VsamDetailAttributes (Maybe PrimaryKey)
vsamDetailAttributes_primaryKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamDetailAttributes' {Maybe PrimaryKey
primaryKey :: Maybe PrimaryKey
$sel:primaryKey:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe PrimaryKey
primaryKey} -> Maybe PrimaryKey
primaryKey) (\s :: VsamDetailAttributes
s@VsamDetailAttributes' {} Maybe PrimaryKey
a -> VsamDetailAttributes
s {$sel:primaryKey:VsamDetailAttributes' :: Maybe PrimaryKey
primaryKey = Maybe PrimaryKey
a} :: VsamDetailAttributes)

-- | The record format of the data set.
vsamDetailAttributes_recordFormat :: Lens.Lens' VsamDetailAttributes (Prelude.Maybe Prelude.Text)
vsamDetailAttributes_recordFormat :: Lens' VsamDetailAttributes (Maybe Text)
vsamDetailAttributes_recordFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VsamDetailAttributes' {Maybe Text
recordFormat :: Maybe Text
$sel:recordFormat:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Text
recordFormat} -> Maybe Text
recordFormat) (\s :: VsamDetailAttributes
s@VsamDetailAttributes' {} Maybe Text
a -> VsamDetailAttributes
s {$sel:recordFormat:VsamDetailAttributes' :: Maybe Text
recordFormat = Maybe Text
a} :: VsamDetailAttributes)

instance Data.FromJSON VsamDetailAttributes where
  parseJSON :: Value -> Parser VsamDetailAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VsamDetailAttributes"
      ( \Object
x ->
          Maybe [AlternateKey]
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe PrimaryKey
-> Maybe Text
-> VsamDetailAttributes
VsamDetailAttributes'
            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
"alternateKeys" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"cacheAtStartup")
            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
"compressed")
            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
"encoding")
            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
"primaryKey")
            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
"recordFormat")
      )

instance Prelude.Hashable VsamDetailAttributes where
  hashWithSalt :: Int -> VsamDetailAttributes -> Int
hashWithSalt Int
_salt VsamDetailAttributes' {Maybe Bool
Maybe [AlternateKey]
Maybe Text
Maybe PrimaryKey
recordFormat :: Maybe Text
primaryKey :: Maybe PrimaryKey
encoding :: Maybe Text
compressed :: Maybe Bool
cacheAtStartup :: Maybe Bool
alternateKeys :: Maybe [AlternateKey]
$sel:recordFormat:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Text
$sel:primaryKey:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe PrimaryKey
$sel:encoding:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Text
$sel:compressed:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Bool
$sel:cacheAtStartup:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Bool
$sel:alternateKeys:VsamDetailAttributes' :: VsamDetailAttributes -> 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
cacheAtStartup
      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` Maybe Text
recordFormat

instance Prelude.NFData VsamDetailAttributes where
  rnf :: VsamDetailAttributes -> ()
rnf VsamDetailAttributes' {Maybe Bool
Maybe [AlternateKey]
Maybe Text
Maybe PrimaryKey
recordFormat :: Maybe Text
primaryKey :: Maybe PrimaryKey
encoding :: Maybe Text
compressed :: Maybe Bool
cacheAtStartup :: Maybe Bool
alternateKeys :: Maybe [AlternateKey]
$sel:recordFormat:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Text
$sel:primaryKey:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe PrimaryKey
$sel:encoding:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Text
$sel:compressed:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Bool
$sel:cacheAtStartup:VsamDetailAttributes' :: VsamDetailAttributes -> Maybe Bool
$sel:alternateKeys:VsamDetailAttributes' :: VsamDetailAttributes -> 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
cacheAtStartup
      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 Maybe Text
recordFormat