{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DataExchange.Types.OriginDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information 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
(OriginDetails -> OriginDetails -> Bool)
-> (OriginDetails -> OriginDetails -> Bool) -> Eq OriginDetails
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]
(Int -> ReadS OriginDetails)
-> ReadS [OriginDetails]
-> ReadPrec OriginDetails
-> ReadPrec [OriginDetails]
-> Read 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
(Int -> OriginDetails -> ShowS)
-> (OriginDetails -> String)
-> ([OriginDetails] -> ShowS)
-> Show OriginDetails
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. OriginDetails -> Rep OriginDetails x)
-> (forall x. Rep OriginDetails x -> OriginDetails)
-> Generic OriginDetails
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' :: Text -> OriginDetails
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 :: (Text -> f Text) -> OriginDetails -> f OriginDetails
originDetails_productId = (OriginDetails -> Text)
-> (OriginDetails -> Text -> OriginDetails)
-> Lens OriginDetails OriginDetails Text Text
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 Core.FromJSON OriginDetails where
  parseJSON :: Value -> Parser OriginDetails
parseJSON =
    String
-> (Object -> Parser OriginDetails)
-> Value
-> Parser OriginDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OriginDetails"
      ( \Object
x ->
          Text -> OriginDetails
OriginDetails' (Text -> OriginDetails) -> Parser Text -> Parser OriginDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ProductId")
      )

instance Prelude.Hashable OriginDetails

instance Prelude.NFData OriginDetails