{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatchEvents.DescribeEndpoint
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Get the information about an existing global endpoint. For more
-- information about global endpoints, see
-- <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html Making applications Regional-fault tolerant with global endpoints and event replication>
-- in the Amazon EventBridge User Guide..
module Amazonka.CloudWatchEvents.DescribeEndpoint
  ( -- * Creating a Request
    DescribeEndpoint (..),
    newDescribeEndpoint,

    -- * Request Lenses
    describeEndpoint_homeRegion,
    describeEndpoint_name,

    -- * Destructuring the Response
    DescribeEndpointResponse (..),
    newDescribeEndpointResponse,

    -- * Response Lenses
    describeEndpointResponse_arn,
    describeEndpointResponse_creationTime,
    describeEndpointResponse_description,
    describeEndpointResponse_endpointId,
    describeEndpointResponse_endpointUrl,
    describeEndpointResponse_eventBuses,
    describeEndpointResponse_lastModifiedTime,
    describeEndpointResponse_name,
    describeEndpointResponse_replicationConfig,
    describeEndpointResponse_roleArn,
    describeEndpointResponse_routingConfig,
    describeEndpointResponse_state,
    describeEndpointResponse_stateReason,
    describeEndpointResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeEndpoint' smart constructor.
data DescribeEndpoint = DescribeEndpoint'
  { -- | The primary Region of the endpoint you want to get information about.
    -- For example @\"HomeRegion\": \"us-east-1\"@.
    DescribeEndpoint -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
    -- | The name of the endpoint you want to get information about. For example,
    -- @\"Name\":\"us-east-2-custom_bus_A-endpoint\"@.
    DescribeEndpoint -> Text
name :: Prelude.Text
  }
  deriving (DescribeEndpoint -> DescribeEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEndpoint -> DescribeEndpoint -> Bool
$c/= :: DescribeEndpoint -> DescribeEndpoint -> Bool
== :: DescribeEndpoint -> DescribeEndpoint -> Bool
$c== :: DescribeEndpoint -> DescribeEndpoint -> Bool
Prelude.Eq, ReadPrec [DescribeEndpoint]
ReadPrec DescribeEndpoint
Int -> ReadS DescribeEndpoint
ReadS [DescribeEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEndpoint]
$creadListPrec :: ReadPrec [DescribeEndpoint]
readPrec :: ReadPrec DescribeEndpoint
$creadPrec :: ReadPrec DescribeEndpoint
readList :: ReadS [DescribeEndpoint]
$creadList :: ReadS [DescribeEndpoint]
readsPrec :: Int -> ReadS DescribeEndpoint
$creadsPrec :: Int -> ReadS DescribeEndpoint
Prelude.Read, Int -> DescribeEndpoint -> ShowS
[DescribeEndpoint] -> ShowS
DescribeEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEndpoint] -> ShowS
$cshowList :: [DescribeEndpoint] -> ShowS
show :: DescribeEndpoint -> String
$cshow :: DescribeEndpoint -> String
showsPrec :: Int -> DescribeEndpoint -> ShowS
$cshowsPrec :: Int -> DescribeEndpoint -> ShowS
Prelude.Show, forall x. Rep DescribeEndpoint x -> DescribeEndpoint
forall x. DescribeEndpoint -> Rep DescribeEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeEndpoint x -> DescribeEndpoint
$cfrom :: forall x. DescribeEndpoint -> Rep DescribeEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEndpoint' 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:
--
-- 'homeRegion', 'describeEndpoint_homeRegion' - The primary Region of the endpoint you want to get information about.
-- For example @\"HomeRegion\": \"us-east-1\"@.
--
-- 'name', 'describeEndpoint_name' - The name of the endpoint you want to get information about. For example,
-- @\"Name\":\"us-east-2-custom_bus_A-endpoint\"@.
newDescribeEndpoint ::
  -- | 'name'
  Prelude.Text ->
  DescribeEndpoint
newDescribeEndpoint :: Text -> DescribeEndpoint
newDescribeEndpoint Text
pName_ =
  DescribeEndpoint'
    { $sel:homeRegion:DescribeEndpoint' :: Maybe Text
homeRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeEndpoint' :: Text
name = Text
pName_
    }

-- | The primary Region of the endpoint you want to get information about.
-- For example @\"HomeRegion\": \"us-east-1\"@.
describeEndpoint_homeRegion :: Lens.Lens' DescribeEndpoint (Prelude.Maybe Prelude.Text)
describeEndpoint_homeRegion :: Lens' DescribeEndpoint (Maybe Text)
describeEndpoint_homeRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpoint' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:DescribeEndpoint' :: DescribeEndpoint -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: DescribeEndpoint
s@DescribeEndpoint' {} Maybe Text
a -> DescribeEndpoint
s {$sel:homeRegion:DescribeEndpoint' :: Maybe Text
homeRegion = Maybe Text
a} :: DescribeEndpoint)

-- | The name of the endpoint you want to get information about. For example,
-- @\"Name\":\"us-east-2-custom_bus_A-endpoint\"@.
describeEndpoint_name :: Lens.Lens' DescribeEndpoint Prelude.Text
describeEndpoint_name :: Lens' DescribeEndpoint Text
describeEndpoint_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpoint' {Text
name :: Text
$sel:name:DescribeEndpoint' :: DescribeEndpoint -> Text
name} -> Text
name) (\s :: DescribeEndpoint
s@DescribeEndpoint' {} Text
a -> DescribeEndpoint
s {$sel:name:DescribeEndpoint' :: Text
name = Text
a} :: DescribeEndpoint)

instance Core.AWSRequest DescribeEndpoint where
  type
    AWSResponse DescribeEndpoint =
      DescribeEndpointResponse
  request :: (Service -> Service)
-> DescribeEndpoint -> Request DescribeEndpoint
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeEndpoint)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty EndpointEventBus)
-> Maybe POSIX
-> Maybe Text
-> Maybe ReplicationConfig
-> Maybe Text
-> Maybe RoutingConfig
-> Maybe EndpointState
-> Maybe Text
-> Int
-> DescribeEndpointResponse
DescribeEndpointResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EndpointId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EndpointUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventBuses")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplicationConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RoutingConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"State")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StateReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeEndpoint where
  hashWithSalt :: Int -> DescribeEndpoint -> Int
hashWithSalt Int
_salt DescribeEndpoint' {Maybe Text
Text
name :: Text
homeRegion :: Maybe Text
$sel:name:DescribeEndpoint' :: DescribeEndpoint -> Text
$sel:homeRegion:DescribeEndpoint' :: DescribeEndpoint -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
homeRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData DescribeEndpoint where
  rnf :: DescribeEndpoint -> ()
rnf DescribeEndpoint' {Maybe Text
Text
name :: Text
homeRegion :: Maybe Text
$sel:name:DescribeEndpoint' :: DescribeEndpoint -> Text
$sel:homeRegion:DescribeEndpoint' :: DescribeEndpoint -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
homeRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders DescribeEndpoint where
  toHeaders :: DescribeEndpoint -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AWSEvents.DescribeEndpoint" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeEndpoint where
  toJSON :: DescribeEndpoint -> Value
toJSON DescribeEndpoint' {Maybe Text
Text
name :: Text
homeRegion :: Maybe Text
$sel:name:DescribeEndpoint' :: DescribeEndpoint -> Text
$sel:homeRegion:DescribeEndpoint' :: DescribeEndpoint -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"HomeRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
homeRegion,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath DescribeEndpoint where
  toPath :: DescribeEndpoint -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeEndpoint where
  toQuery :: DescribeEndpoint -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeEndpointResponse' smart constructor.
data DescribeEndpointResponse = DescribeEndpointResponse'
  { -- | The ARN of the endpoint you asked for information about.
    DescribeEndpointResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time the endpoint you asked for information about was created.
    DescribeEndpointResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The description of the endpoint you asked for information about.
    DescribeEndpointResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the endpoint you asked for information about.
    DescribeEndpointResponse -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text,
    -- | The URL of the endpoint you asked for information about.
    DescribeEndpointResponse -> Maybe Text
endpointUrl :: Prelude.Maybe Prelude.Text,
    -- | The event buses being used by the endpoint you asked for information
    -- about.
    DescribeEndpointResponse -> Maybe (NonEmpty EndpointEventBus)
eventBuses :: Prelude.Maybe (Prelude.NonEmpty EndpointEventBus),
    -- | The last time the endpoint you asked for information about was modified.
    DescribeEndpointResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the endpoint you asked for information about.
    DescribeEndpointResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Whether replication is enabled or disabled for the endpoint you asked
    -- for information about.
    DescribeEndpointResponse -> Maybe ReplicationConfig
replicationConfig :: Prelude.Maybe ReplicationConfig,
    -- | The ARN of the role used by the endpoint you asked for information
    -- about.
    DescribeEndpointResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The routing configuration of the endpoint you asked for information
    -- about.
    DescribeEndpointResponse -> Maybe RoutingConfig
routingConfig :: Prelude.Maybe RoutingConfig,
    -- | The current state of the endpoint you asked for information about.
    DescribeEndpointResponse -> Maybe EndpointState
state :: Prelude.Maybe EndpointState,
    -- | The reason the endpoint you asked for information about is in its
    -- current state.
    DescribeEndpointResponse -> Maybe Text
stateReason :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeEndpointResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEndpointResponse -> DescribeEndpointResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEndpointResponse -> DescribeEndpointResponse -> Bool
$c/= :: DescribeEndpointResponse -> DescribeEndpointResponse -> Bool
== :: DescribeEndpointResponse -> DescribeEndpointResponse -> Bool
$c== :: DescribeEndpointResponse -> DescribeEndpointResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEndpointResponse]
ReadPrec DescribeEndpointResponse
Int -> ReadS DescribeEndpointResponse
ReadS [DescribeEndpointResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEndpointResponse]
$creadListPrec :: ReadPrec [DescribeEndpointResponse]
readPrec :: ReadPrec DescribeEndpointResponse
$creadPrec :: ReadPrec DescribeEndpointResponse
readList :: ReadS [DescribeEndpointResponse]
$creadList :: ReadS [DescribeEndpointResponse]
readsPrec :: Int -> ReadS DescribeEndpointResponse
$creadsPrec :: Int -> ReadS DescribeEndpointResponse
Prelude.Read, Int -> DescribeEndpointResponse -> ShowS
[DescribeEndpointResponse] -> ShowS
DescribeEndpointResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEndpointResponse] -> ShowS
$cshowList :: [DescribeEndpointResponse] -> ShowS
show :: DescribeEndpointResponse -> String
$cshow :: DescribeEndpointResponse -> String
showsPrec :: Int -> DescribeEndpointResponse -> ShowS
$cshowsPrec :: Int -> DescribeEndpointResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeEndpointResponse x -> DescribeEndpointResponse
forall x.
DescribeEndpointResponse -> Rep DescribeEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEndpointResponse x -> DescribeEndpointResponse
$cfrom :: forall x.
DescribeEndpointResponse -> Rep DescribeEndpointResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEndpointResponse' 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:
--
-- 'arn', 'describeEndpointResponse_arn' - The ARN of the endpoint you asked for information about.
--
-- 'creationTime', 'describeEndpointResponse_creationTime' - The time the endpoint you asked for information about was created.
--
-- 'description', 'describeEndpointResponse_description' - The description of the endpoint you asked for information about.
--
-- 'endpointId', 'describeEndpointResponse_endpointId' - The ID of the endpoint you asked for information about.
--
-- 'endpointUrl', 'describeEndpointResponse_endpointUrl' - The URL of the endpoint you asked for information about.
--
-- 'eventBuses', 'describeEndpointResponse_eventBuses' - The event buses being used by the endpoint you asked for information
-- about.
--
-- 'lastModifiedTime', 'describeEndpointResponse_lastModifiedTime' - The last time the endpoint you asked for information about was modified.
--
-- 'name', 'describeEndpointResponse_name' - The name of the endpoint you asked for information about.
--
-- 'replicationConfig', 'describeEndpointResponse_replicationConfig' - Whether replication is enabled or disabled for the endpoint you asked
-- for information about.
--
-- 'roleArn', 'describeEndpointResponse_roleArn' - The ARN of the role used by the endpoint you asked for information
-- about.
--
-- 'routingConfig', 'describeEndpointResponse_routingConfig' - The routing configuration of the endpoint you asked for information
-- about.
--
-- 'state', 'describeEndpointResponse_state' - The current state of the endpoint you asked for information about.
--
-- 'stateReason', 'describeEndpointResponse_stateReason' - The reason the endpoint you asked for information about is in its
-- current state.
--
-- 'httpStatus', 'describeEndpointResponse_httpStatus' - The response's http status code.
newDescribeEndpointResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEndpointResponse
newDescribeEndpointResponse :: Int -> DescribeEndpointResponse
newDescribeEndpointResponse Int
pHttpStatus_ =
  DescribeEndpointResponse'
    { $sel:arn:DescribeEndpointResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:DescribeEndpointResponse' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribeEndpointResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointId:DescribeEndpointResponse' :: Maybe Text
endpointId = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointUrl:DescribeEndpointResponse' :: Maybe Text
endpointUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:eventBuses:DescribeEndpointResponse' :: Maybe (NonEmpty EndpointEventBus)
eventBuses = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:DescribeEndpointResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeEndpointResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:replicationConfig:DescribeEndpointResponse' :: Maybe ReplicationConfig
replicationConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:DescribeEndpointResponse' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:routingConfig:DescribeEndpointResponse' :: Maybe RoutingConfig
routingConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeEndpointResponse' :: Maybe EndpointState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:stateReason:DescribeEndpointResponse' :: Maybe Text
stateReason = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the endpoint you asked for information about.
describeEndpointResponse_arn :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_arn :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:arn:DescribeEndpointResponse' :: Maybe Text
arn = Maybe Text
a} :: DescribeEndpointResponse)

-- | The time the endpoint you asked for information about was created.
describeEndpointResponse_creationTime :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.UTCTime)
describeEndpointResponse_creationTime :: Lens' DescribeEndpointResponse (Maybe UTCTime)
describeEndpointResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe POSIX
a -> DescribeEndpointResponse
s {$sel:creationTime:DescribeEndpointResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeEndpointResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The description of the endpoint you asked for information about.
describeEndpointResponse_description :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_description :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:description:DescribeEndpointResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeEndpointResponse)

-- | The ID of the endpoint you asked for information about.
describeEndpointResponse_endpointId :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_endpointId :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_endpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
endpointId} -> Maybe Text
endpointId) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:endpointId:DescribeEndpointResponse' :: Maybe Text
endpointId = Maybe Text
a} :: DescribeEndpointResponse)

-- | The URL of the endpoint you asked for information about.
describeEndpointResponse_endpointUrl :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_endpointUrl :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_endpointUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
endpointUrl :: Maybe Text
$sel:endpointUrl:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
endpointUrl} -> Maybe Text
endpointUrl) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:endpointUrl:DescribeEndpointResponse' :: Maybe Text
endpointUrl = Maybe Text
a} :: DescribeEndpointResponse)

-- | The event buses being used by the endpoint you asked for information
-- about.
describeEndpointResponse_eventBuses :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe (Prelude.NonEmpty EndpointEventBus))
describeEndpointResponse_eventBuses :: Lens' DescribeEndpointResponse (Maybe (NonEmpty EndpointEventBus))
describeEndpointResponse_eventBuses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe (NonEmpty EndpointEventBus)
eventBuses :: Maybe (NonEmpty EndpointEventBus)
$sel:eventBuses:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe (NonEmpty EndpointEventBus)
eventBuses} -> Maybe (NonEmpty EndpointEventBus)
eventBuses) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe (NonEmpty EndpointEventBus)
a -> DescribeEndpointResponse
s {$sel:eventBuses:DescribeEndpointResponse' :: Maybe (NonEmpty EndpointEventBus)
eventBuses = Maybe (NonEmpty EndpointEventBus)
a} :: DescribeEndpointResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The last time the endpoint you asked for information about was modified.
describeEndpointResponse_lastModifiedTime :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.UTCTime)
describeEndpointResponse_lastModifiedTime :: Lens' DescribeEndpointResponse (Maybe UTCTime)
describeEndpointResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe POSIX
a -> DescribeEndpointResponse
s {$sel:lastModifiedTime:DescribeEndpointResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DescribeEndpointResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the endpoint you asked for information about.
describeEndpointResponse_name :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_name :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:name:DescribeEndpointResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeEndpointResponse)

-- | Whether replication is enabled or disabled for the endpoint you asked
-- for information about.
describeEndpointResponse_replicationConfig :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe ReplicationConfig)
describeEndpointResponse_replicationConfig :: Lens' DescribeEndpointResponse (Maybe ReplicationConfig)
describeEndpointResponse_replicationConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe ReplicationConfig
replicationConfig :: Maybe ReplicationConfig
$sel:replicationConfig:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe ReplicationConfig
replicationConfig} -> Maybe ReplicationConfig
replicationConfig) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe ReplicationConfig
a -> DescribeEndpointResponse
s {$sel:replicationConfig:DescribeEndpointResponse' :: Maybe ReplicationConfig
replicationConfig = Maybe ReplicationConfig
a} :: DescribeEndpointResponse)

-- | The ARN of the role used by the endpoint you asked for information
-- about.
describeEndpointResponse_roleArn :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_roleArn :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:roleArn:DescribeEndpointResponse' :: Maybe Text
roleArn = Maybe Text
a} :: DescribeEndpointResponse)

-- | The routing configuration of the endpoint you asked for information
-- about.
describeEndpointResponse_routingConfig :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe RoutingConfig)
describeEndpointResponse_routingConfig :: Lens' DescribeEndpointResponse (Maybe RoutingConfig)
describeEndpointResponse_routingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe RoutingConfig
routingConfig :: Maybe RoutingConfig
$sel:routingConfig:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe RoutingConfig
routingConfig} -> Maybe RoutingConfig
routingConfig) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe RoutingConfig
a -> DescribeEndpointResponse
s {$sel:routingConfig:DescribeEndpointResponse' :: Maybe RoutingConfig
routingConfig = Maybe RoutingConfig
a} :: DescribeEndpointResponse)

-- | The current state of the endpoint you asked for information about.
describeEndpointResponse_state :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe EndpointState)
describeEndpointResponse_state :: Lens' DescribeEndpointResponse (Maybe EndpointState)
describeEndpointResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe EndpointState
state :: Maybe EndpointState
$sel:state:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe EndpointState
state} -> Maybe EndpointState
state) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe EndpointState
a -> DescribeEndpointResponse
s {$sel:state:DescribeEndpointResponse' :: Maybe EndpointState
state = Maybe EndpointState
a} :: DescribeEndpointResponse)

-- | The reason the endpoint you asked for information about is in its
-- current state.
describeEndpointResponse_stateReason :: Lens.Lens' DescribeEndpointResponse (Prelude.Maybe Prelude.Text)
describeEndpointResponse_stateReason :: Lens' DescribeEndpointResponse (Maybe Text)
describeEndpointResponse_stateReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Maybe Text
stateReason :: Maybe Text
$sel:stateReason:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
stateReason} -> Maybe Text
stateReason) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Maybe Text
a -> DescribeEndpointResponse
s {$sel:stateReason:DescribeEndpointResponse' :: Maybe Text
stateReason = Maybe Text
a} :: DescribeEndpointResponse)

-- | The response's http status code.
describeEndpointResponse_httpStatus :: Lens.Lens' DescribeEndpointResponse Prelude.Int
describeEndpointResponse_httpStatus :: Lens' DescribeEndpointResponse Int
describeEndpointResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeEndpointResponse' :: DescribeEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeEndpointResponse
s@DescribeEndpointResponse' {} Int
a -> DescribeEndpointResponse
s {$sel:httpStatus:DescribeEndpointResponse' :: Int
httpStatus = Int
a} :: DescribeEndpointResponse)

instance Prelude.NFData DescribeEndpointResponse where
  rnf :: DescribeEndpointResponse -> ()
rnf DescribeEndpointResponse' {Int
Maybe (NonEmpty EndpointEventBus)
Maybe Text
Maybe POSIX
Maybe EndpointState
Maybe ReplicationConfig
Maybe RoutingConfig
httpStatus :: Int
stateReason :: Maybe Text
state :: Maybe EndpointState
routingConfig :: Maybe RoutingConfig
roleArn :: Maybe Text
replicationConfig :: Maybe ReplicationConfig
name :: Maybe Text
lastModifiedTime :: Maybe POSIX
eventBuses :: Maybe (NonEmpty EndpointEventBus)
endpointUrl :: Maybe Text
endpointId :: Maybe Text
description :: Maybe Text
creationTime :: Maybe POSIX
arn :: Maybe Text
$sel:httpStatus:DescribeEndpointResponse' :: DescribeEndpointResponse -> Int
$sel:stateReason:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
$sel:state:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe EndpointState
$sel:routingConfig:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe RoutingConfig
$sel:roleArn:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
$sel:replicationConfig:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe ReplicationConfig
$sel:name:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
$sel:lastModifiedTime:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe POSIX
$sel:eventBuses:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe (NonEmpty EndpointEventBus)
$sel:endpointUrl:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
$sel:endpointId:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
$sel:description:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
$sel:creationTime:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe POSIX
$sel:arn:DescribeEndpointResponse' :: DescribeEndpointResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty EndpointEventBus)
eventBuses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplicationConfig
replicationConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RoutingConfig
routingConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stateReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus