{-# 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.Wisdom.Types.ContentReference
-- 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.Wisdom.Types.ContentReference 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

-- | Reference information about the content.
--
-- /See:/ 'newContentReference' smart constructor.
data ContentReference = ContentReference'
  { -- | The Amazon Resource Name (ARN) of the content.
    ContentReference -> Maybe Text
contentArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the content.
    ContentReference -> Maybe Text
contentId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the knowledge base.
    ContentReference -> Maybe Text
knowledgeBaseArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the knowledge base.
    ContentReference -> Maybe Text
knowledgeBaseId :: Prelude.Maybe Prelude.Text
  }
  deriving (ContentReference -> ContentReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContentReference -> ContentReference -> Bool
$c/= :: ContentReference -> ContentReference -> Bool
== :: ContentReference -> ContentReference -> Bool
$c== :: ContentReference -> ContentReference -> Bool
Prelude.Eq, ReadPrec [ContentReference]
ReadPrec ContentReference
Int -> ReadS ContentReference
ReadS [ContentReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContentReference]
$creadListPrec :: ReadPrec [ContentReference]
readPrec :: ReadPrec ContentReference
$creadPrec :: ReadPrec ContentReference
readList :: ReadS [ContentReference]
$creadList :: ReadS [ContentReference]
readsPrec :: Int -> ReadS ContentReference
$creadsPrec :: Int -> ReadS ContentReference
Prelude.Read, Int -> ContentReference -> ShowS
[ContentReference] -> ShowS
ContentReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContentReference] -> ShowS
$cshowList :: [ContentReference] -> ShowS
show :: ContentReference -> String
$cshow :: ContentReference -> String
showsPrec :: Int -> ContentReference -> ShowS
$cshowsPrec :: Int -> ContentReference -> ShowS
Prelude.Show, forall x. Rep ContentReference x -> ContentReference
forall x. ContentReference -> Rep ContentReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContentReference x -> ContentReference
$cfrom :: forall x. ContentReference -> Rep ContentReference x
Prelude.Generic)

-- |
-- Create a value of 'ContentReference' 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:
--
-- 'contentArn', 'contentReference_contentArn' - The Amazon Resource Name (ARN) of the content.
--
-- 'contentId', 'contentReference_contentId' - The identifier of the content.
--
-- 'knowledgeBaseArn', 'contentReference_knowledgeBaseArn' - The Amazon Resource Name (ARN) of the knowledge base.
--
-- 'knowledgeBaseId', 'contentReference_knowledgeBaseId' - The identifier of the knowledge base.
newContentReference ::
  ContentReference
newContentReference :: ContentReference
newContentReference =
  ContentReference'
    { $sel:contentArn:ContentReference' :: Maybe Text
contentArn = forall a. Maybe a
Prelude.Nothing,
      $sel:contentId:ContentReference' :: Maybe Text
contentId = forall a. Maybe a
Prelude.Nothing,
      $sel:knowledgeBaseArn:ContentReference' :: Maybe Text
knowledgeBaseArn = forall a. Maybe a
Prelude.Nothing,
      $sel:knowledgeBaseId:ContentReference' :: Maybe Text
knowledgeBaseId = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the content.
contentReference_contentArn :: Lens.Lens' ContentReference (Prelude.Maybe Prelude.Text)
contentReference_contentArn :: Lens' ContentReference (Maybe Text)
contentReference_contentArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentReference' {Maybe Text
contentArn :: Maybe Text
$sel:contentArn:ContentReference' :: ContentReference -> Maybe Text
contentArn} -> Maybe Text
contentArn) (\s :: ContentReference
s@ContentReference' {} Maybe Text
a -> ContentReference
s {$sel:contentArn:ContentReference' :: Maybe Text
contentArn = Maybe Text
a} :: ContentReference)

-- | The identifier of the content.
contentReference_contentId :: Lens.Lens' ContentReference (Prelude.Maybe Prelude.Text)
contentReference_contentId :: Lens' ContentReference (Maybe Text)
contentReference_contentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentReference' {Maybe Text
contentId :: Maybe Text
$sel:contentId:ContentReference' :: ContentReference -> Maybe Text
contentId} -> Maybe Text
contentId) (\s :: ContentReference
s@ContentReference' {} Maybe Text
a -> ContentReference
s {$sel:contentId:ContentReference' :: Maybe Text
contentId = Maybe Text
a} :: ContentReference)

-- | The Amazon Resource Name (ARN) of the knowledge base.
contentReference_knowledgeBaseArn :: Lens.Lens' ContentReference (Prelude.Maybe Prelude.Text)
contentReference_knowledgeBaseArn :: Lens' ContentReference (Maybe Text)
contentReference_knowledgeBaseArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentReference' {Maybe Text
knowledgeBaseArn :: Maybe Text
$sel:knowledgeBaseArn:ContentReference' :: ContentReference -> Maybe Text
knowledgeBaseArn} -> Maybe Text
knowledgeBaseArn) (\s :: ContentReference
s@ContentReference' {} Maybe Text
a -> ContentReference
s {$sel:knowledgeBaseArn:ContentReference' :: Maybe Text
knowledgeBaseArn = Maybe Text
a} :: ContentReference)

-- | The identifier of the knowledge base.
contentReference_knowledgeBaseId :: Lens.Lens' ContentReference (Prelude.Maybe Prelude.Text)
contentReference_knowledgeBaseId :: Lens' ContentReference (Maybe Text)
contentReference_knowledgeBaseId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentReference' {Maybe Text
knowledgeBaseId :: Maybe Text
$sel:knowledgeBaseId:ContentReference' :: ContentReference -> Maybe Text
knowledgeBaseId} -> Maybe Text
knowledgeBaseId) (\s :: ContentReference
s@ContentReference' {} Maybe Text
a -> ContentReference
s {$sel:knowledgeBaseId:ContentReference' :: Maybe Text
knowledgeBaseId = Maybe Text
a} :: ContentReference)

instance Data.FromJSON ContentReference where
  parseJSON :: Value -> Parser ContentReference
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContentReference"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ContentReference
ContentReference'
            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
"contentArn")
            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
"contentId")
            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
"knowledgeBaseArn")
            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
"knowledgeBaseId")
      )

instance Prelude.Hashable ContentReference where
  hashWithSalt :: Int -> ContentReference -> Int
hashWithSalt Int
_salt ContentReference' {Maybe Text
knowledgeBaseId :: Maybe Text
knowledgeBaseArn :: Maybe Text
contentId :: Maybe Text
contentArn :: Maybe Text
$sel:knowledgeBaseId:ContentReference' :: ContentReference -> Maybe Text
$sel:knowledgeBaseArn:ContentReference' :: ContentReference -> Maybe Text
$sel:contentId:ContentReference' :: ContentReference -> Maybe Text
$sel:contentArn:ContentReference' :: ContentReference -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
knowledgeBaseArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
knowledgeBaseId

instance Prelude.NFData ContentReference where
  rnf :: ContentReference -> ()
rnf ContentReference' {Maybe Text
knowledgeBaseId :: Maybe Text
knowledgeBaseArn :: Maybe Text
contentId :: Maybe Text
contentArn :: Maybe Text
$sel:knowledgeBaseId:ContentReference' :: ContentReference -> Maybe Text
$sel:knowledgeBaseArn:ContentReference' :: ContentReference -> Maybe Text
$sel:contentId:ContentReference' :: ContentReference -> Maybe Text
$sel:contentArn:ContentReference' :: ContentReference -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
knowledgeBaseArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
knowledgeBaseId