{-# 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.Rekognition.Types.DistributeDataset
-- 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.Rekognition.Types.DistributeDataset 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

-- | A training dataset or a test dataset used in a dataset distribution
-- operation. For more information, see DistributeDatasetEntries.
--
-- /See:/ 'newDistributeDataset' smart constructor.
data DistributeDataset = DistributeDataset'
  { -- | The Amazon Resource Name (ARN) of the dataset that you want to use.
    DistributeDataset -> Text
arn :: Prelude.Text
  }
  deriving (DistributeDataset -> DistributeDataset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DistributeDataset -> DistributeDataset -> Bool
$c/= :: DistributeDataset -> DistributeDataset -> Bool
== :: DistributeDataset -> DistributeDataset -> Bool
$c== :: DistributeDataset -> DistributeDataset -> Bool
Prelude.Eq, ReadPrec [DistributeDataset]
ReadPrec DistributeDataset
Int -> ReadS DistributeDataset
ReadS [DistributeDataset]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DistributeDataset]
$creadListPrec :: ReadPrec [DistributeDataset]
readPrec :: ReadPrec DistributeDataset
$creadPrec :: ReadPrec DistributeDataset
readList :: ReadS [DistributeDataset]
$creadList :: ReadS [DistributeDataset]
readsPrec :: Int -> ReadS DistributeDataset
$creadsPrec :: Int -> ReadS DistributeDataset
Prelude.Read, Int -> DistributeDataset -> ShowS
[DistributeDataset] -> ShowS
DistributeDataset -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DistributeDataset] -> ShowS
$cshowList :: [DistributeDataset] -> ShowS
show :: DistributeDataset -> String
$cshow :: DistributeDataset -> String
showsPrec :: Int -> DistributeDataset -> ShowS
$cshowsPrec :: Int -> DistributeDataset -> ShowS
Prelude.Show, forall x. Rep DistributeDataset x -> DistributeDataset
forall x. DistributeDataset -> Rep DistributeDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DistributeDataset x -> DistributeDataset
$cfrom :: forall x. DistributeDataset -> Rep DistributeDataset x
Prelude.Generic)

-- |
-- Create a value of 'DistributeDataset' 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:
--
-- 'arn', 'distributeDataset_arn' - The Amazon Resource Name (ARN) of the dataset that you want to use.
newDistributeDataset ::
  -- | 'arn'
  Prelude.Text ->
  DistributeDataset
newDistributeDataset :: Text -> DistributeDataset
newDistributeDataset Text
pArn_ =
  DistributeDataset' {$sel:arn:DistributeDataset' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the dataset that you want to use.
distributeDataset_arn :: Lens.Lens' DistributeDataset Prelude.Text
distributeDataset_arn :: Lens' DistributeDataset Text
distributeDataset_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributeDataset' {Text
arn :: Text
$sel:arn:DistributeDataset' :: DistributeDataset -> Text
arn} -> Text
arn) (\s :: DistributeDataset
s@DistributeDataset' {} Text
a -> DistributeDataset
s {$sel:arn:DistributeDataset' :: Text
arn = Text
a} :: DistributeDataset)

instance Prelude.Hashable DistributeDataset where
  hashWithSalt :: Int -> DistributeDataset -> Int
hashWithSalt Int
_salt DistributeDataset' {Text
arn :: Text
$sel:arn:DistributeDataset' :: DistributeDataset -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData DistributeDataset where
  rnf :: DistributeDataset -> ()
rnf DistributeDataset' {Text
arn :: Text
$sel:arn:DistributeDataset' :: DistributeDataset -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn

instance Data.ToJSON DistributeDataset where
  toJSON :: DistributeDataset -> Value
toJSON DistributeDataset' {Text
arn :: Text
$sel:arn:DistributeDataset' :: DistributeDataset -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"Arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)]
      )