{-# 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.GdgAttributes
-- 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.GdgAttributes 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:/ 'newGdgAttributes' smart constructor.
data GdgAttributes = GdgAttributes'
  { -- | The maximum number of generation data sets, up to 255, in a GDG.
    GdgAttributes -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The disposition of the data set in the catalog.
    GdgAttributes -> Maybe Text
rollDisposition :: Prelude.Maybe Prelude.Text
  }
  deriving (GdgAttributes -> GdgAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GdgAttributes -> GdgAttributes -> Bool
$c/= :: GdgAttributes -> GdgAttributes -> Bool
== :: GdgAttributes -> GdgAttributes -> Bool
$c== :: GdgAttributes -> GdgAttributes -> Bool
Prelude.Eq, ReadPrec [GdgAttributes]
ReadPrec GdgAttributes
Int -> ReadS GdgAttributes
ReadS [GdgAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GdgAttributes]
$creadListPrec :: ReadPrec [GdgAttributes]
readPrec :: ReadPrec GdgAttributes
$creadPrec :: ReadPrec GdgAttributes
readList :: ReadS [GdgAttributes]
$creadList :: ReadS [GdgAttributes]
readsPrec :: Int -> ReadS GdgAttributes
$creadsPrec :: Int -> ReadS GdgAttributes
Prelude.Read, Int -> GdgAttributes -> ShowS
[GdgAttributes] -> ShowS
GdgAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GdgAttributes] -> ShowS
$cshowList :: [GdgAttributes] -> ShowS
show :: GdgAttributes -> String
$cshow :: GdgAttributes -> String
showsPrec :: Int -> GdgAttributes -> ShowS
$cshowsPrec :: Int -> GdgAttributes -> ShowS
Prelude.Show, forall x. Rep GdgAttributes x -> GdgAttributes
forall x. GdgAttributes -> Rep GdgAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GdgAttributes x -> GdgAttributes
$cfrom :: forall x. GdgAttributes -> Rep GdgAttributes x
Prelude.Generic)

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

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

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

instance Prelude.Hashable GdgAttributes where
  hashWithSalt :: Int -> GdgAttributes -> Int
hashWithSalt Int
_salt GdgAttributes' {Maybe Int
Maybe Text
rollDisposition :: Maybe Text
limit :: Maybe Int
$sel:rollDisposition:GdgAttributes' :: GdgAttributes -> Maybe Text
$sel:limit:GdgAttributes' :: GdgAttributes -> 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 GdgAttributes where
  rnf :: GdgAttributes -> ()
rnf GdgAttributes' {Maybe Int
Maybe Text
rollDisposition :: Maybe Text
limit :: Maybe Int
$sel:rollDisposition:GdgAttributes' :: GdgAttributes -> Maybe Text
$sel:limit:GdgAttributes' :: GdgAttributes -> 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

instance Data.ToJSON GdgAttributes where
  toJSON :: GdgAttributes -> Value
toJSON GdgAttributes' {Maybe Int
Maybe Text
rollDisposition :: Maybe Text
limit :: Maybe Int
$sel:rollDisposition:GdgAttributes' :: GdgAttributes -> Maybe Text
$sel:limit:GdgAttributes' :: GdgAttributes -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"limit" 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 Int
limit,
            (Key
"rollDisposition" 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
rollDisposition
          ]
      )