{-# 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.DatasetDetailOrgAttributes
-- 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.DatasetDetailOrgAttributes 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.GdgDetailAttributes
import Amazonka.M2.Types.VsamDetailAttributes
import qualified Amazonka.Prelude as Prelude

-- | Additional details about the data set. Different attributes correspond
-- to different data set organizations. The values are populated based on
-- datasetOrg, storageType and backend (Blu Age or Micro Focus).
--
-- /See:/ 'newDatasetDetailOrgAttributes' smart constructor.
data DatasetDetailOrgAttributes = DatasetDetailOrgAttributes'
  { -- | The generation data group of the data set.
    DatasetDetailOrgAttributes -> Maybe GdgDetailAttributes
gdg :: Prelude.Maybe GdgDetailAttributes,
    -- | The details of a VSAM data set.
    DatasetDetailOrgAttributes -> Maybe VsamDetailAttributes
vsam :: Prelude.Maybe VsamDetailAttributes
  }
  deriving (DatasetDetailOrgAttributes -> DatasetDetailOrgAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetDetailOrgAttributes -> DatasetDetailOrgAttributes -> Bool
$c/= :: DatasetDetailOrgAttributes -> DatasetDetailOrgAttributes -> Bool
== :: DatasetDetailOrgAttributes -> DatasetDetailOrgAttributes -> Bool
$c== :: DatasetDetailOrgAttributes -> DatasetDetailOrgAttributes -> Bool
Prelude.Eq, ReadPrec [DatasetDetailOrgAttributes]
ReadPrec DatasetDetailOrgAttributes
Int -> ReadS DatasetDetailOrgAttributes
ReadS [DatasetDetailOrgAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetDetailOrgAttributes]
$creadListPrec :: ReadPrec [DatasetDetailOrgAttributes]
readPrec :: ReadPrec DatasetDetailOrgAttributes
$creadPrec :: ReadPrec DatasetDetailOrgAttributes
readList :: ReadS [DatasetDetailOrgAttributes]
$creadList :: ReadS [DatasetDetailOrgAttributes]
readsPrec :: Int -> ReadS DatasetDetailOrgAttributes
$creadsPrec :: Int -> ReadS DatasetDetailOrgAttributes
Prelude.Read, Int -> DatasetDetailOrgAttributes -> ShowS
[DatasetDetailOrgAttributes] -> ShowS
DatasetDetailOrgAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetDetailOrgAttributes] -> ShowS
$cshowList :: [DatasetDetailOrgAttributes] -> ShowS
show :: DatasetDetailOrgAttributes -> String
$cshow :: DatasetDetailOrgAttributes -> String
showsPrec :: Int -> DatasetDetailOrgAttributes -> ShowS
$cshowsPrec :: Int -> DatasetDetailOrgAttributes -> ShowS
Prelude.Show, forall x.
Rep DatasetDetailOrgAttributes x -> DatasetDetailOrgAttributes
forall x.
DatasetDetailOrgAttributes -> Rep DatasetDetailOrgAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DatasetDetailOrgAttributes x -> DatasetDetailOrgAttributes
$cfrom :: forall x.
DatasetDetailOrgAttributes -> Rep DatasetDetailOrgAttributes x
Prelude.Generic)

-- |
-- Create a value of 'DatasetDetailOrgAttributes' 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:
--
-- 'gdg', 'datasetDetailOrgAttributes_gdg' - The generation data group of the data set.
--
-- 'vsam', 'datasetDetailOrgAttributes_vsam' - The details of a VSAM data set.
newDatasetDetailOrgAttributes ::
  DatasetDetailOrgAttributes
newDatasetDetailOrgAttributes :: DatasetDetailOrgAttributes
newDatasetDetailOrgAttributes =
  DatasetDetailOrgAttributes'
    { $sel:gdg:DatasetDetailOrgAttributes' :: Maybe GdgDetailAttributes
gdg = forall a. Maybe a
Prelude.Nothing,
      $sel:vsam:DatasetDetailOrgAttributes' :: Maybe VsamDetailAttributes
vsam = forall a. Maybe a
Prelude.Nothing
    }

-- | The generation data group of the data set.
datasetDetailOrgAttributes_gdg :: Lens.Lens' DatasetDetailOrgAttributes (Prelude.Maybe GdgDetailAttributes)
datasetDetailOrgAttributes_gdg :: Lens' DatasetDetailOrgAttributes (Maybe GdgDetailAttributes)
datasetDetailOrgAttributes_gdg = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetDetailOrgAttributes' {Maybe GdgDetailAttributes
gdg :: Maybe GdgDetailAttributes
$sel:gdg:DatasetDetailOrgAttributes' :: DatasetDetailOrgAttributes -> Maybe GdgDetailAttributes
gdg} -> Maybe GdgDetailAttributes
gdg) (\s :: DatasetDetailOrgAttributes
s@DatasetDetailOrgAttributes' {} Maybe GdgDetailAttributes
a -> DatasetDetailOrgAttributes
s {$sel:gdg:DatasetDetailOrgAttributes' :: Maybe GdgDetailAttributes
gdg = Maybe GdgDetailAttributes
a} :: DatasetDetailOrgAttributes)

-- | The details of a VSAM data set.
datasetDetailOrgAttributes_vsam :: Lens.Lens' DatasetDetailOrgAttributes (Prelude.Maybe VsamDetailAttributes)
datasetDetailOrgAttributes_vsam :: Lens' DatasetDetailOrgAttributes (Maybe VsamDetailAttributes)
datasetDetailOrgAttributes_vsam = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetDetailOrgAttributes' {Maybe VsamDetailAttributes
vsam :: Maybe VsamDetailAttributes
$sel:vsam:DatasetDetailOrgAttributes' :: DatasetDetailOrgAttributes -> Maybe VsamDetailAttributes
vsam} -> Maybe VsamDetailAttributes
vsam) (\s :: DatasetDetailOrgAttributes
s@DatasetDetailOrgAttributes' {} Maybe VsamDetailAttributes
a -> DatasetDetailOrgAttributes
s {$sel:vsam:DatasetDetailOrgAttributes' :: Maybe VsamDetailAttributes
vsam = Maybe VsamDetailAttributes
a} :: DatasetDetailOrgAttributes)

instance Data.FromJSON DatasetDetailOrgAttributes where
  parseJSON :: Value -> Parser DatasetDetailOrgAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DatasetDetailOrgAttributes"
      ( \Object
x ->
          Maybe GdgDetailAttributes
-> Maybe VsamDetailAttributes -> DatasetDetailOrgAttributes
DatasetDetailOrgAttributes'
            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
"gdg")
            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
"vsam")
      )

instance Prelude.Hashable DatasetDetailOrgAttributes where
  hashWithSalt :: Int -> DatasetDetailOrgAttributes -> Int
hashWithSalt Int
_salt DatasetDetailOrgAttributes' {Maybe GdgDetailAttributes
Maybe VsamDetailAttributes
vsam :: Maybe VsamDetailAttributes
gdg :: Maybe GdgDetailAttributes
$sel:vsam:DatasetDetailOrgAttributes' :: DatasetDetailOrgAttributes -> Maybe VsamDetailAttributes
$sel:gdg:DatasetDetailOrgAttributes' :: DatasetDetailOrgAttributes -> Maybe GdgDetailAttributes
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GdgDetailAttributes
gdg
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VsamDetailAttributes
vsam

instance Prelude.NFData DatasetDetailOrgAttributes where
  rnf :: DatasetDetailOrgAttributes -> ()
rnf DatasetDetailOrgAttributes' {Maybe GdgDetailAttributes
Maybe VsamDetailAttributes
vsam :: Maybe VsamDetailAttributes
gdg :: Maybe GdgDetailAttributes
$sel:vsam:DatasetDetailOrgAttributes' :: DatasetDetailOrgAttributes -> Maybe VsamDetailAttributes
$sel:gdg:DatasetDetailOrgAttributes' :: DatasetDetailOrgAttributes -> Maybe GdgDetailAttributes
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe GdgDetailAttributes
gdg seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VsamDetailAttributes
vsam