{-# 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.Kendra.Types.ExperienceEndpoint
-- 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.Kendra.Types.ExperienceEndpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.EndpointType
import qualified Amazonka.Prelude as Prelude

-- | Provides the configuration information for the endpoint for your Amazon
-- Kendra experience.
--
-- /See:/ 'newExperienceEndpoint' smart constructor.
data ExperienceEndpoint = ExperienceEndpoint'
  { -- | The endpoint of your Amazon Kendra experience.
    ExperienceEndpoint -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text,
    -- | The type of endpoint for your Amazon Kendra experience. The type
    -- currently available is @HOME@, which is a unique and fully hosted URL to
    -- the home page of your Amazon Kendra experience.
    ExperienceEndpoint -> Maybe EndpointType
endpointType :: Prelude.Maybe EndpointType
  }
  deriving (ExperienceEndpoint -> ExperienceEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperienceEndpoint -> ExperienceEndpoint -> Bool
$c/= :: ExperienceEndpoint -> ExperienceEndpoint -> Bool
== :: ExperienceEndpoint -> ExperienceEndpoint -> Bool
$c== :: ExperienceEndpoint -> ExperienceEndpoint -> Bool
Prelude.Eq, ReadPrec [ExperienceEndpoint]
ReadPrec ExperienceEndpoint
Int -> ReadS ExperienceEndpoint
ReadS [ExperienceEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperienceEndpoint]
$creadListPrec :: ReadPrec [ExperienceEndpoint]
readPrec :: ReadPrec ExperienceEndpoint
$creadPrec :: ReadPrec ExperienceEndpoint
readList :: ReadS [ExperienceEndpoint]
$creadList :: ReadS [ExperienceEndpoint]
readsPrec :: Int -> ReadS ExperienceEndpoint
$creadsPrec :: Int -> ReadS ExperienceEndpoint
Prelude.Read, Int -> ExperienceEndpoint -> ShowS
[ExperienceEndpoint] -> ShowS
ExperienceEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperienceEndpoint] -> ShowS
$cshowList :: [ExperienceEndpoint] -> ShowS
show :: ExperienceEndpoint -> String
$cshow :: ExperienceEndpoint -> String
showsPrec :: Int -> ExperienceEndpoint -> ShowS
$cshowsPrec :: Int -> ExperienceEndpoint -> ShowS
Prelude.Show, forall x. Rep ExperienceEndpoint x -> ExperienceEndpoint
forall x. ExperienceEndpoint -> Rep ExperienceEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExperienceEndpoint x -> ExperienceEndpoint
$cfrom :: forall x. ExperienceEndpoint -> Rep ExperienceEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'ExperienceEndpoint' 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:
--
-- 'endpoint', 'experienceEndpoint_endpoint' - The endpoint of your Amazon Kendra experience.
--
-- 'endpointType', 'experienceEndpoint_endpointType' - The type of endpoint for your Amazon Kendra experience. The type
-- currently available is @HOME@, which is a unique and fully hosted URL to
-- the home page of your Amazon Kendra experience.
newExperienceEndpoint ::
  ExperienceEndpoint
newExperienceEndpoint :: ExperienceEndpoint
newExperienceEndpoint =
  ExperienceEndpoint'
    { $sel:endpoint:ExperienceEndpoint' :: Maybe Text
endpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:ExperienceEndpoint' :: Maybe EndpointType
endpointType = forall a. Maybe a
Prelude.Nothing
    }

-- | The endpoint of your Amazon Kendra experience.
experienceEndpoint_endpoint :: Lens.Lens' ExperienceEndpoint (Prelude.Maybe Prelude.Text)
experienceEndpoint_endpoint :: Lens' ExperienceEndpoint (Maybe Text)
experienceEndpoint_endpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperienceEndpoint' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:ExperienceEndpoint' :: ExperienceEndpoint -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: ExperienceEndpoint
s@ExperienceEndpoint' {} Maybe Text
a -> ExperienceEndpoint
s {$sel:endpoint:ExperienceEndpoint' :: Maybe Text
endpoint = Maybe Text
a} :: ExperienceEndpoint)

-- | The type of endpoint for your Amazon Kendra experience. The type
-- currently available is @HOME@, which is a unique and fully hosted URL to
-- the home page of your Amazon Kendra experience.
experienceEndpoint_endpointType :: Lens.Lens' ExperienceEndpoint (Prelude.Maybe EndpointType)
experienceEndpoint_endpointType :: Lens' ExperienceEndpoint (Maybe EndpointType)
experienceEndpoint_endpointType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperienceEndpoint' {Maybe EndpointType
endpointType :: Maybe EndpointType
$sel:endpointType:ExperienceEndpoint' :: ExperienceEndpoint -> Maybe EndpointType
endpointType} -> Maybe EndpointType
endpointType) (\s :: ExperienceEndpoint
s@ExperienceEndpoint' {} Maybe EndpointType
a -> ExperienceEndpoint
s {$sel:endpointType:ExperienceEndpoint' :: Maybe EndpointType
endpointType = Maybe EndpointType
a} :: ExperienceEndpoint)

instance Data.FromJSON ExperienceEndpoint where
  parseJSON :: Value -> Parser ExperienceEndpoint
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExperienceEndpoint"
      ( \Object
x ->
          Maybe Text -> Maybe EndpointType -> ExperienceEndpoint
ExperienceEndpoint'
            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
"Endpoint")
            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
"EndpointType")
      )

instance Prelude.Hashable ExperienceEndpoint where
  hashWithSalt :: Int -> ExperienceEndpoint -> Int
hashWithSalt Int
_salt ExperienceEndpoint' {Maybe Text
Maybe EndpointType
endpointType :: Maybe EndpointType
endpoint :: Maybe Text
$sel:endpointType:ExperienceEndpoint' :: ExperienceEndpoint -> Maybe EndpointType
$sel:endpoint:ExperienceEndpoint' :: ExperienceEndpoint -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointType
endpointType

instance Prelude.NFData ExperienceEndpoint where
  rnf :: ExperienceEndpoint -> ()
rnf ExperienceEndpoint' {Maybe Text
Maybe EndpointType
endpointType :: Maybe EndpointType
endpoint :: Maybe Text
$sel:endpointType:ExperienceEndpoint' :: ExperienceEndpoint -> Maybe EndpointType
$sel:endpoint:ExperienceEndpoint' :: ExperienceEndpoint -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointType
endpointType