{-# 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.DataExchange.Types.OriginDetails
-- 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.DataExchange.Types.OriginDetails 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

-- | Details about the origin of the data set.
--
-- /See:/ 'newOriginDetails' smart constructor.
data OriginDetails = OriginDetails'
  { -- | The product ID of the origin of the data set.
    OriginDetails -> Text
productId :: Prelude.Text
  }
  deriving (OriginDetails -> OriginDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OriginDetails -> OriginDetails -> Bool
$c/= :: OriginDetails -> OriginDetails -> Bool
== :: OriginDetails -> OriginDetails -> Bool
$c== :: OriginDetails -> OriginDetails -> Bool
Prelude.Eq, ReadPrec [OriginDetails]
ReadPrec OriginDetails
Int -> ReadS OriginDetails
ReadS [OriginDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OriginDetails]
$creadListPrec :: ReadPrec [OriginDetails]
readPrec :: ReadPrec OriginDetails
$creadPrec :: ReadPrec OriginDetails
readList :: ReadS [OriginDetails]
$creadList :: ReadS [OriginDetails]
readsPrec :: Int -> ReadS OriginDetails
$creadsPrec :: Int -> ReadS OriginDetails
Prelude.Read, Int -> OriginDetails -> ShowS
[OriginDetails] -> ShowS
OriginDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OriginDetails] -> ShowS
$cshowList :: [OriginDetails] -> ShowS
show :: OriginDetails -> String
$cshow :: OriginDetails -> String
showsPrec :: Int -> OriginDetails -> ShowS
$cshowsPrec :: Int -> OriginDetails -> ShowS
Prelude.Show, forall x. Rep OriginDetails x -> OriginDetails
forall x. OriginDetails -> Rep OriginDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OriginDetails x -> OriginDetails
$cfrom :: forall x. OriginDetails -> Rep OriginDetails x
Prelude.Generic)

-- |
-- Create a value of 'OriginDetails' 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:
--
-- 'productId', 'originDetails_productId' - The product ID of the origin of the data set.
newOriginDetails ::
  -- | 'productId'
  Prelude.Text ->
  OriginDetails
newOriginDetails :: Text -> OriginDetails
newOriginDetails Text
pProductId_ =
  OriginDetails' {$sel:productId:OriginDetails' :: Text
productId = Text
pProductId_}

-- | The product ID of the origin of the data set.
originDetails_productId :: Lens.Lens' OriginDetails Prelude.Text
originDetails_productId :: Lens' OriginDetails Text
originDetails_productId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OriginDetails' {Text
productId :: Text
$sel:productId:OriginDetails' :: OriginDetails -> Text
productId} -> Text
productId) (\s :: OriginDetails
s@OriginDetails' {} Text
a -> OriginDetails
s {$sel:productId:OriginDetails' :: Text
productId = Text
a} :: OriginDetails)

instance Data.FromJSON OriginDetails where
  parseJSON :: Value -> Parser OriginDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OriginDetails"
      ( \Object
x ->
          Text -> OriginDetails
OriginDetails' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ProductId")
      )

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

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