{-# 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.CloudSearch.Types.ServiceEndpoint
-- 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.CloudSearch.Types.ServiceEndpoint where

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

-- | The endpoint to which service requests can be submitted.
--
-- /See:/ 'newServiceEndpoint' smart constructor.
data ServiceEndpoint = ServiceEndpoint'
  { ServiceEndpoint -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceEndpoint -> ServiceEndpoint -> Bool
(ServiceEndpoint -> ServiceEndpoint -> Bool)
-> (ServiceEndpoint -> ServiceEndpoint -> Bool)
-> Eq ServiceEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceEndpoint -> ServiceEndpoint -> Bool
$c/= :: ServiceEndpoint -> ServiceEndpoint -> Bool
== :: ServiceEndpoint -> ServiceEndpoint -> Bool
$c== :: ServiceEndpoint -> ServiceEndpoint -> Bool
Prelude.Eq, ReadPrec [ServiceEndpoint]
ReadPrec ServiceEndpoint
Int -> ReadS ServiceEndpoint
ReadS [ServiceEndpoint]
(Int -> ReadS ServiceEndpoint)
-> ReadS [ServiceEndpoint]
-> ReadPrec ServiceEndpoint
-> ReadPrec [ServiceEndpoint]
-> Read ServiceEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceEndpoint]
$creadListPrec :: ReadPrec [ServiceEndpoint]
readPrec :: ReadPrec ServiceEndpoint
$creadPrec :: ReadPrec ServiceEndpoint
readList :: ReadS [ServiceEndpoint]
$creadList :: ReadS [ServiceEndpoint]
readsPrec :: Int -> ReadS ServiceEndpoint
$creadsPrec :: Int -> ReadS ServiceEndpoint
Prelude.Read, Int -> ServiceEndpoint -> ShowS
[ServiceEndpoint] -> ShowS
ServiceEndpoint -> String
(Int -> ServiceEndpoint -> ShowS)
-> (ServiceEndpoint -> String)
-> ([ServiceEndpoint] -> ShowS)
-> Show ServiceEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceEndpoint] -> ShowS
$cshowList :: [ServiceEndpoint] -> ShowS
show :: ServiceEndpoint -> String
$cshow :: ServiceEndpoint -> String
showsPrec :: Int -> ServiceEndpoint -> ShowS
$cshowsPrec :: Int -> ServiceEndpoint -> ShowS
Prelude.Show, (forall x. ServiceEndpoint -> Rep ServiceEndpoint x)
-> (forall x. Rep ServiceEndpoint x -> ServiceEndpoint)
-> Generic ServiceEndpoint
forall x. Rep ServiceEndpoint x -> ServiceEndpoint
forall x. ServiceEndpoint -> Rep ServiceEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceEndpoint x -> ServiceEndpoint
$cfrom :: forall x. ServiceEndpoint -> Rep ServiceEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'ServiceEndpoint' 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', 'serviceEndpoint_endpoint' - Undocumented member.
newServiceEndpoint ::
  ServiceEndpoint
newServiceEndpoint :: ServiceEndpoint
newServiceEndpoint =
  ServiceEndpoint' :: Maybe Text -> ServiceEndpoint
ServiceEndpoint' {$sel:endpoint:ServiceEndpoint' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | Undocumented member.
serviceEndpoint_endpoint :: Lens.Lens' ServiceEndpoint (Prelude.Maybe Prelude.Text)
serviceEndpoint_endpoint :: (Maybe Text -> f (Maybe Text))
-> ServiceEndpoint -> f ServiceEndpoint
serviceEndpoint_endpoint = (ServiceEndpoint -> Maybe Text)
-> (ServiceEndpoint -> Maybe Text -> ServiceEndpoint)
-> Lens ServiceEndpoint ServiceEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceEndpoint' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:ServiceEndpoint' :: ServiceEndpoint -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: ServiceEndpoint
s@ServiceEndpoint' {} Maybe Text
a -> ServiceEndpoint
s {$sel:endpoint:ServiceEndpoint' :: Maybe Text
endpoint = Maybe Text
a} :: ServiceEndpoint)

instance Core.FromXML ServiceEndpoint where
  parseXML :: [Node] -> Either String ServiceEndpoint
parseXML [Node]
x =
    Maybe Text -> ServiceEndpoint
ServiceEndpoint'
      (Maybe Text -> ServiceEndpoint)
-> Either String (Maybe Text) -> Either String ServiceEndpoint
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Endpoint")

instance Prelude.Hashable ServiceEndpoint

instance Prelude.NFData ServiceEndpoint