{-# 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.GdgDetailAttributes
-- 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.GdgDetailAttributes where

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

-- | The required attributes for a generation data group data set. A
-- generation data set is one of a collection of successive, historically
-- related, catalogued data sets that together are known as a generation
-- data group (GDG). Use this structure when you want to import a GDG. For
-- more information on GDG, see
-- <https://www.ibm.com/docs/en/zos/2.3.0?topic=guide-generation-data-sets Generation data sets>.
--
-- /See:/ 'newGdgDetailAttributes' smart constructor.
data GdgDetailAttributes = GdgDetailAttributes'
  { -- | The maximum number of generation data sets, up to 255, in a GDG.
    GdgDetailAttributes -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The disposition of the data set in the catalog.
    GdgDetailAttributes -> Maybe Text
rollDisposition :: Prelude.Maybe Prelude.Text
  }
  deriving (GdgDetailAttributes -> GdgDetailAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GdgDetailAttributes -> GdgDetailAttributes -> Bool
$c/= :: GdgDetailAttributes -> GdgDetailAttributes -> Bool
== :: GdgDetailAttributes -> GdgDetailAttributes -> Bool
$c== :: GdgDetailAttributes -> GdgDetailAttributes -> Bool
Prelude.Eq, ReadPrec [GdgDetailAttributes]
ReadPrec GdgDetailAttributes
Int -> ReadS GdgDetailAttributes
ReadS [GdgDetailAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GdgDetailAttributes]
$creadListPrec :: ReadPrec [GdgDetailAttributes]
readPrec :: ReadPrec GdgDetailAttributes
$creadPrec :: ReadPrec GdgDetailAttributes
readList :: ReadS [GdgDetailAttributes]
$creadList :: ReadS [GdgDetailAttributes]
readsPrec :: Int -> ReadS GdgDetailAttributes
$creadsPrec :: Int -> ReadS GdgDetailAttributes
Prelude.Read, Int -> GdgDetailAttributes -> ShowS
[GdgDetailAttributes] -> ShowS
GdgDetailAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GdgDetailAttributes] -> ShowS
$cshowList :: [GdgDetailAttributes] -> ShowS
show :: GdgDetailAttributes -> String
$cshow :: GdgDetailAttributes -> String
showsPrec :: Int -> GdgDetailAttributes -> ShowS
$cshowsPrec :: Int -> GdgDetailAttributes -> ShowS
Prelude.Show, forall x. Rep GdgDetailAttributes x -> GdgDetailAttributes
forall x. GdgDetailAttributes -> Rep GdgDetailAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GdgDetailAttributes x -> GdgDetailAttributes
$cfrom :: forall x. GdgDetailAttributes -> Rep GdgDetailAttributes x
Prelude.Generic)

-- |
-- Create a value of 'GdgDetailAttributes' 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:
--
-- 'limit', 'gdgDetailAttributes_limit' - The maximum number of generation data sets, up to 255, in a GDG.
--
-- 'rollDisposition', 'gdgDetailAttributes_rollDisposition' - The disposition of the data set in the catalog.
newGdgDetailAttributes ::
  GdgDetailAttributes
newGdgDetailAttributes :: GdgDetailAttributes
newGdgDetailAttributes =
  GdgDetailAttributes'
    { $sel:limit:GdgDetailAttributes' :: Maybe Int
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:rollDisposition:GdgDetailAttributes' :: Maybe Text
rollDisposition = forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum number of generation data sets, up to 255, in a GDG.
gdgDetailAttributes_limit :: Lens.Lens' GdgDetailAttributes (Prelude.Maybe Prelude.Int)
gdgDetailAttributes_limit :: Lens' GdgDetailAttributes (Maybe Int)
gdgDetailAttributes_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GdgDetailAttributes' {Maybe Int
limit :: Maybe Int
$sel:limit:GdgDetailAttributes' :: GdgDetailAttributes -> Maybe Int
limit} -> Maybe Int
limit) (\s :: GdgDetailAttributes
s@GdgDetailAttributes' {} Maybe Int
a -> GdgDetailAttributes
s {$sel:limit:GdgDetailAttributes' :: Maybe Int
limit = Maybe Int
a} :: GdgDetailAttributes)

-- | The disposition of the data set in the catalog.
gdgDetailAttributes_rollDisposition :: Lens.Lens' GdgDetailAttributes (Prelude.Maybe Prelude.Text)
gdgDetailAttributes_rollDisposition :: Lens' GdgDetailAttributes (Maybe Text)
gdgDetailAttributes_rollDisposition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GdgDetailAttributes' {Maybe Text
rollDisposition :: Maybe Text
$sel:rollDisposition:GdgDetailAttributes' :: GdgDetailAttributes -> Maybe Text
rollDisposition} -> Maybe Text
rollDisposition) (\s :: GdgDetailAttributes
s@GdgDetailAttributes' {} Maybe Text
a -> GdgDetailAttributes
s {$sel:rollDisposition:GdgDetailAttributes' :: Maybe Text
rollDisposition = Maybe Text
a} :: GdgDetailAttributes)

instance Data.FromJSON GdgDetailAttributes where
  parseJSON :: Value -> Parser GdgDetailAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GdgDetailAttributes"
      ( \Object
x ->
          Maybe Int -> Maybe Text -> GdgDetailAttributes
GdgDetailAttributes'
            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
"limit")
            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
"rollDisposition")
      )

instance Prelude.Hashable GdgDetailAttributes where
  hashWithSalt :: Int -> GdgDetailAttributes -> Int
hashWithSalt Int
_salt GdgDetailAttributes' {Maybe Int
Maybe Text
rollDisposition :: Maybe Text
limit :: Maybe Int
$sel:rollDisposition:GdgDetailAttributes' :: GdgDetailAttributes -> Maybe Text
$sel:limit:GdgDetailAttributes' :: GdgDetailAttributes -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rollDisposition

instance Prelude.NFData GdgDetailAttributes where
  rnf :: GdgDetailAttributes -> ()
rnf GdgDetailAttributes' {Maybe Int
Maybe Text
rollDisposition :: Maybe Text
limit :: Maybe Int
$sel:rollDisposition:GdgDetailAttributes' :: GdgDetailAttributes -> Maybe Text
$sel:limit:GdgDetailAttributes' :: GdgDetailAttributes -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rollDisposition