{-# 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.DescribeEventSource
-- 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)
--
-- This operation lists details about a partner event source that is shared
-- with your account.
module Amazonka.CloudWatchEvents.DescribeEventSource
  ( -- * Creating a Request
    DescribeEventSource (..),
    newDescribeEventSource,

    -- * Request Lenses
    describeEventSource_name,

    -- * Destructuring the Response
    DescribeEventSourceResponse (..),
    newDescribeEventSourceResponse,

    -- * Response Lenses
    describeEventSourceResponse_creationTime,
    describeEventSourceResponse_state,
    describeEventSourceResponse_arn,
    describeEventSourceResponse_createdBy,
    describeEventSourceResponse_name,
    describeEventSourceResponse_expirationTime,
    describeEventSourceResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeEventSource' smart constructor.
data DescribeEventSource = DescribeEventSource'
  { -- | The name of the partner event source to display the details of.
    DescribeEventSource -> Text
name :: Prelude.Text
  }
  deriving (DescribeEventSource -> DescribeEventSource -> Bool
(DescribeEventSource -> DescribeEventSource -> Bool)
-> (DescribeEventSource -> DescribeEventSource -> Bool)
-> Eq DescribeEventSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventSource -> DescribeEventSource -> Bool
$c/= :: DescribeEventSource -> DescribeEventSource -> Bool
== :: DescribeEventSource -> DescribeEventSource -> Bool
$c== :: DescribeEventSource -> DescribeEventSource -> Bool
Prelude.Eq, ReadPrec [DescribeEventSource]
ReadPrec DescribeEventSource
Int -> ReadS DescribeEventSource
ReadS [DescribeEventSource]
(Int -> ReadS DescribeEventSource)
-> ReadS [DescribeEventSource]
-> ReadPrec DescribeEventSource
-> ReadPrec [DescribeEventSource]
-> Read DescribeEventSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventSource]
$creadListPrec :: ReadPrec [DescribeEventSource]
readPrec :: ReadPrec DescribeEventSource
$creadPrec :: ReadPrec DescribeEventSource
readList :: ReadS [DescribeEventSource]
$creadList :: ReadS [DescribeEventSource]
readsPrec :: Int -> ReadS DescribeEventSource
$creadsPrec :: Int -> ReadS DescribeEventSource
Prelude.Read, Int -> DescribeEventSource -> ShowS
[DescribeEventSource] -> ShowS
DescribeEventSource -> String
(Int -> DescribeEventSource -> ShowS)
-> (DescribeEventSource -> String)
-> ([DescribeEventSource] -> ShowS)
-> Show DescribeEventSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventSource] -> ShowS
$cshowList :: [DescribeEventSource] -> ShowS
show :: DescribeEventSource -> String
$cshow :: DescribeEventSource -> String
showsPrec :: Int -> DescribeEventSource -> ShowS
$cshowsPrec :: Int -> DescribeEventSource -> ShowS
Prelude.Show, (forall x. DescribeEventSource -> Rep DescribeEventSource x)
-> (forall x. Rep DescribeEventSource x -> DescribeEventSource)
-> Generic DescribeEventSource
forall x. Rep DescribeEventSource x -> DescribeEventSource
forall x. DescribeEventSource -> Rep DescribeEventSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeEventSource x -> DescribeEventSource
$cfrom :: forall x. DescribeEventSource -> Rep DescribeEventSource x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventSource' 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:
--
-- 'name', 'describeEventSource_name' - The name of the partner event source to display the details of.
newDescribeEventSource ::
  -- | 'name'
  Prelude.Text ->
  DescribeEventSource
newDescribeEventSource :: Text -> DescribeEventSource
newDescribeEventSource Text
pName_ =
  DescribeEventSource' :: Text -> DescribeEventSource
DescribeEventSource' {$sel:name:DescribeEventSource' :: Text
name = Text
pName_}

-- | The name of the partner event source to display the details of.
describeEventSource_name :: Lens.Lens' DescribeEventSource Prelude.Text
describeEventSource_name :: (Text -> f Text) -> DescribeEventSource -> f DescribeEventSource
describeEventSource_name = (DescribeEventSource -> Text)
-> (DescribeEventSource -> Text -> DescribeEventSource)
-> Lens DescribeEventSource DescribeEventSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSource' {Text
name :: Text
$sel:name:DescribeEventSource' :: DescribeEventSource -> Text
name} -> Text
name) (\s :: DescribeEventSource
s@DescribeEventSource' {} Text
a -> DescribeEventSource
s {$sel:name:DescribeEventSource' :: Text
name = Text
a} :: DescribeEventSource)

instance Core.AWSRequest DescribeEventSource where
  type
    AWSResponse DescribeEventSource =
      DescribeEventSourceResponse
  request :: DescribeEventSource -> Request DescribeEventSource
request = Service -> DescribeEventSource -> Request DescribeEventSource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeEventSource
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeEventSource)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeEventSource))
-> Logger
-> Service
-> Proxy DescribeEventSource
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeEventSource)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe EventSourceState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DescribeEventSourceResponse
DescribeEventSourceResponse'
            (Maybe POSIX
 -> Maybe EventSourceState
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> DescribeEventSourceResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe EventSourceState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeEventSourceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe EventSourceState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeEventSourceResponse)
-> Either String (Maybe EventSourceState)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeEventSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EventSourceState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"State")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeEventSourceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Int -> DescribeEventSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Int -> DescribeEventSourceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe POSIX -> Int -> DescribeEventSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedBy")
            Either
  String
  (Maybe Text -> Maybe POSIX -> Int -> DescribeEventSourceResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe POSIX -> Int -> DescribeEventSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either String (Maybe POSIX -> Int -> DescribeEventSourceResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DescribeEventSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ExpirationTime")
            Either String (Int -> DescribeEventSourceResponse)
-> Either String Int -> Either String DescribeEventSourceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeEventSource

instance Prelude.NFData DescribeEventSource

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

instance Core.ToJSON DescribeEventSource where
  toJSON :: DescribeEventSource -> Value
toJSON DescribeEventSource' {Text
name :: Text
$sel:name:DescribeEventSource' :: DescribeEventSource -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
      )

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

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

-- | /See:/ 'newDescribeEventSourceResponse' smart constructor.
data DescribeEventSourceResponse = DescribeEventSourceResponse'
  { -- | The date and time that the event source was created.
    DescribeEventSourceResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The state of the event source. If it is ACTIVE, you have already created
    -- a matching event bus for this event source, and that event bus is
    -- active. If it is PENDING, either you haven\'t yet created a matching
    -- event bus, or that event bus is deactivated. If it is DELETED, you have
    -- created a matching event bus, but the event source has since been
    -- deleted.
    DescribeEventSourceResponse -> Maybe EventSourceState
state :: Prelude.Maybe EventSourceState,
    -- | The ARN of the partner event source.
    DescribeEventSourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the SaaS partner that created the event source.
    DescribeEventSourceResponse -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The name of the partner event source.
    DescribeEventSourceResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the event source will expire if you do not create
    -- a matching event bus.
    DescribeEventSourceResponse -> Maybe POSIX
expirationTime :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    DescribeEventSourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEventSourceResponse -> DescribeEventSourceResponse -> Bool
(DescribeEventSourceResponse
 -> DescribeEventSourceResponse -> Bool)
-> (DescribeEventSourceResponse
    -> DescribeEventSourceResponse -> Bool)
-> Eq DescribeEventSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventSourceResponse -> DescribeEventSourceResponse -> Bool
$c/= :: DescribeEventSourceResponse -> DescribeEventSourceResponse -> Bool
== :: DescribeEventSourceResponse -> DescribeEventSourceResponse -> Bool
$c== :: DescribeEventSourceResponse -> DescribeEventSourceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEventSourceResponse]
ReadPrec DescribeEventSourceResponse
Int -> ReadS DescribeEventSourceResponse
ReadS [DescribeEventSourceResponse]
(Int -> ReadS DescribeEventSourceResponse)
-> ReadS [DescribeEventSourceResponse]
-> ReadPrec DescribeEventSourceResponse
-> ReadPrec [DescribeEventSourceResponse]
-> Read DescribeEventSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventSourceResponse]
$creadListPrec :: ReadPrec [DescribeEventSourceResponse]
readPrec :: ReadPrec DescribeEventSourceResponse
$creadPrec :: ReadPrec DescribeEventSourceResponse
readList :: ReadS [DescribeEventSourceResponse]
$creadList :: ReadS [DescribeEventSourceResponse]
readsPrec :: Int -> ReadS DescribeEventSourceResponse
$creadsPrec :: Int -> ReadS DescribeEventSourceResponse
Prelude.Read, Int -> DescribeEventSourceResponse -> ShowS
[DescribeEventSourceResponse] -> ShowS
DescribeEventSourceResponse -> String
(Int -> DescribeEventSourceResponse -> ShowS)
-> (DescribeEventSourceResponse -> String)
-> ([DescribeEventSourceResponse] -> ShowS)
-> Show DescribeEventSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventSourceResponse] -> ShowS
$cshowList :: [DescribeEventSourceResponse] -> ShowS
show :: DescribeEventSourceResponse -> String
$cshow :: DescribeEventSourceResponse -> String
showsPrec :: Int -> DescribeEventSourceResponse -> ShowS
$cshowsPrec :: Int -> DescribeEventSourceResponse -> ShowS
Prelude.Show, (forall x.
 DescribeEventSourceResponse -> Rep DescribeEventSourceResponse x)
-> (forall x.
    Rep DescribeEventSourceResponse x -> DescribeEventSourceResponse)
-> Generic DescribeEventSourceResponse
forall x.
Rep DescribeEventSourceResponse x -> DescribeEventSourceResponse
forall x.
DescribeEventSourceResponse -> Rep DescribeEventSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventSourceResponse x -> DescribeEventSourceResponse
$cfrom :: forall x.
DescribeEventSourceResponse -> Rep DescribeEventSourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventSourceResponse' 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:
--
-- 'creationTime', 'describeEventSourceResponse_creationTime' - The date and time that the event source was created.
--
-- 'state', 'describeEventSourceResponse_state' - The state of the event source. If it is ACTIVE, you have already created
-- a matching event bus for this event source, and that event bus is
-- active. If it is PENDING, either you haven\'t yet created a matching
-- event bus, or that event bus is deactivated. If it is DELETED, you have
-- created a matching event bus, but the event source has since been
-- deleted.
--
-- 'arn', 'describeEventSourceResponse_arn' - The ARN of the partner event source.
--
-- 'createdBy', 'describeEventSourceResponse_createdBy' - The name of the SaaS partner that created the event source.
--
-- 'name', 'describeEventSourceResponse_name' - The name of the partner event source.
--
-- 'expirationTime', 'describeEventSourceResponse_expirationTime' - The date and time that the event source will expire if you do not create
-- a matching event bus.
--
-- 'httpStatus', 'describeEventSourceResponse_httpStatus' - The response's http status code.
newDescribeEventSourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEventSourceResponse
newDescribeEventSourceResponse :: Int -> DescribeEventSourceResponse
newDescribeEventSourceResponse Int
pHttpStatus_ =
  DescribeEventSourceResponse' :: Maybe POSIX
-> Maybe EventSourceState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DescribeEventSourceResponse
DescribeEventSourceResponse'
    { $sel:creationTime:DescribeEventSourceResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeEventSourceResponse' :: Maybe EventSourceState
state = Maybe EventSourceState
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DescribeEventSourceResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:DescribeEventSourceResponse' :: Maybe Text
createdBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeEventSourceResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expirationTime:DescribeEventSourceResponse' :: Maybe POSIX
expirationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeEventSourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date and time that the event source was created.
describeEventSourceResponse_creationTime :: Lens.Lens' DescribeEventSourceResponse (Prelude.Maybe Prelude.UTCTime)
describeEventSourceResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEventSourceResponse -> f DescribeEventSourceResponse
describeEventSourceResponse_creationTime = (DescribeEventSourceResponse -> Maybe POSIX)
-> (DescribeEventSourceResponse
    -> Maybe POSIX -> DescribeEventSourceResponse)
-> Lens
     DescribeEventSourceResponse
     DescribeEventSourceResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSourceResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeEventSourceResponse' :: DescribeEventSourceResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeEventSourceResponse
s@DescribeEventSourceResponse' {} Maybe POSIX
a -> DescribeEventSourceResponse
s {$sel:creationTime:DescribeEventSourceResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeEventSourceResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeEventSourceResponse -> f DescribeEventSourceResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEventSourceResponse
-> f DescribeEventSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The state of the event source. If it is ACTIVE, you have already created
-- a matching event bus for this event source, and that event bus is
-- active. If it is PENDING, either you haven\'t yet created a matching
-- event bus, or that event bus is deactivated. If it is DELETED, you have
-- created a matching event bus, but the event source has since been
-- deleted.
describeEventSourceResponse_state :: Lens.Lens' DescribeEventSourceResponse (Prelude.Maybe EventSourceState)
describeEventSourceResponse_state :: (Maybe EventSourceState -> f (Maybe EventSourceState))
-> DescribeEventSourceResponse -> f DescribeEventSourceResponse
describeEventSourceResponse_state = (DescribeEventSourceResponse -> Maybe EventSourceState)
-> (DescribeEventSourceResponse
    -> Maybe EventSourceState -> DescribeEventSourceResponse)
-> Lens
     DescribeEventSourceResponse
     DescribeEventSourceResponse
     (Maybe EventSourceState)
     (Maybe EventSourceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSourceResponse' {Maybe EventSourceState
state :: Maybe EventSourceState
$sel:state:DescribeEventSourceResponse' :: DescribeEventSourceResponse -> Maybe EventSourceState
state} -> Maybe EventSourceState
state) (\s :: DescribeEventSourceResponse
s@DescribeEventSourceResponse' {} Maybe EventSourceState
a -> DescribeEventSourceResponse
s {$sel:state:DescribeEventSourceResponse' :: Maybe EventSourceState
state = Maybe EventSourceState
a} :: DescribeEventSourceResponse)

-- | The ARN of the partner event source.
describeEventSourceResponse_arn :: Lens.Lens' DescribeEventSourceResponse (Prelude.Maybe Prelude.Text)
describeEventSourceResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DescribeEventSourceResponse -> f DescribeEventSourceResponse
describeEventSourceResponse_arn = (DescribeEventSourceResponse -> Maybe Text)
-> (DescribeEventSourceResponse
    -> Maybe Text -> DescribeEventSourceResponse)
-> Lens
     DescribeEventSourceResponse
     DescribeEventSourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSourceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DescribeEventSourceResponse' :: DescribeEventSourceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DescribeEventSourceResponse
s@DescribeEventSourceResponse' {} Maybe Text
a -> DescribeEventSourceResponse
s {$sel:arn:DescribeEventSourceResponse' :: Maybe Text
arn = Maybe Text
a} :: DescribeEventSourceResponse)

-- | The name of the SaaS partner that created the event source.
describeEventSourceResponse_createdBy :: Lens.Lens' DescribeEventSourceResponse (Prelude.Maybe Prelude.Text)
describeEventSourceResponse_createdBy :: (Maybe Text -> f (Maybe Text))
-> DescribeEventSourceResponse -> f DescribeEventSourceResponse
describeEventSourceResponse_createdBy = (DescribeEventSourceResponse -> Maybe Text)
-> (DescribeEventSourceResponse
    -> Maybe Text -> DescribeEventSourceResponse)
-> Lens
     DescribeEventSourceResponse
     DescribeEventSourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSourceResponse' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:DescribeEventSourceResponse' :: DescribeEventSourceResponse -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: DescribeEventSourceResponse
s@DescribeEventSourceResponse' {} Maybe Text
a -> DescribeEventSourceResponse
s {$sel:createdBy:DescribeEventSourceResponse' :: Maybe Text
createdBy = Maybe Text
a} :: DescribeEventSourceResponse)

-- | The name of the partner event source.
describeEventSourceResponse_name :: Lens.Lens' DescribeEventSourceResponse (Prelude.Maybe Prelude.Text)
describeEventSourceResponse_name :: (Maybe Text -> f (Maybe Text))
-> DescribeEventSourceResponse -> f DescribeEventSourceResponse
describeEventSourceResponse_name = (DescribeEventSourceResponse -> Maybe Text)
-> (DescribeEventSourceResponse
    -> Maybe Text -> DescribeEventSourceResponse)
-> Lens
     DescribeEventSourceResponse
     DescribeEventSourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSourceResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeEventSourceResponse' :: DescribeEventSourceResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeEventSourceResponse
s@DescribeEventSourceResponse' {} Maybe Text
a -> DescribeEventSourceResponse
s {$sel:name:DescribeEventSourceResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeEventSourceResponse)

-- | The date and time that the event source will expire if you do not create
-- a matching event bus.
describeEventSourceResponse_expirationTime :: Lens.Lens' DescribeEventSourceResponse (Prelude.Maybe Prelude.UTCTime)
describeEventSourceResponse_expirationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEventSourceResponse -> f DescribeEventSourceResponse
describeEventSourceResponse_expirationTime = (DescribeEventSourceResponse -> Maybe POSIX)
-> (DescribeEventSourceResponse
    -> Maybe POSIX -> DescribeEventSourceResponse)
-> Lens
     DescribeEventSourceResponse
     DescribeEventSourceResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSourceResponse' {Maybe POSIX
expirationTime :: Maybe POSIX
$sel:expirationTime:DescribeEventSourceResponse' :: DescribeEventSourceResponse -> Maybe POSIX
expirationTime} -> Maybe POSIX
expirationTime) (\s :: DescribeEventSourceResponse
s@DescribeEventSourceResponse' {} Maybe POSIX
a -> DescribeEventSourceResponse
s {$sel:expirationTime:DescribeEventSourceResponse' :: Maybe POSIX
expirationTime = Maybe POSIX
a} :: DescribeEventSourceResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeEventSourceResponse -> f DescribeEventSourceResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEventSourceResponse
-> f DescribeEventSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Prelude.NFData DescribeEventSourceResponse