{-# 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.KafkaConnect.Types.CustomPluginSummary
-- 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.KafkaConnect.Types.CustomPluginSummary where

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.CustomPluginRevisionSummary
import Amazonka.KafkaConnect.Types.CustomPluginState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A summary of the custom plugin.
--
-- /See:/ 'newCustomPluginSummary' smart constructor.
data CustomPluginSummary = CustomPluginSummary'
  { -- | The time that the custom plugin was created.
    CustomPluginSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The latest revision of the custom plugin.
    CustomPluginSummary -> Maybe CustomPluginRevisionSummary
latestRevision :: Prelude.Maybe CustomPluginRevisionSummary,
    -- | The name of the custom plugin.
    CustomPluginSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the custom plugin.
    CustomPluginSummary -> Maybe Text
customPluginArn :: Prelude.Maybe Prelude.Text,
    -- | The state of the custom plugin.
    CustomPluginSummary -> Maybe CustomPluginState
customPluginState :: Prelude.Maybe CustomPluginState,
    -- | A description of the custom plugin.
    CustomPluginSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomPluginSummary -> CustomPluginSummary -> Bool
(CustomPluginSummary -> CustomPluginSummary -> Bool)
-> (CustomPluginSummary -> CustomPluginSummary -> Bool)
-> Eq CustomPluginSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomPluginSummary -> CustomPluginSummary -> Bool
$c/= :: CustomPluginSummary -> CustomPluginSummary -> Bool
== :: CustomPluginSummary -> CustomPluginSummary -> Bool
$c== :: CustomPluginSummary -> CustomPluginSummary -> Bool
Prelude.Eq, ReadPrec [CustomPluginSummary]
ReadPrec CustomPluginSummary
Int -> ReadS CustomPluginSummary
ReadS [CustomPluginSummary]
(Int -> ReadS CustomPluginSummary)
-> ReadS [CustomPluginSummary]
-> ReadPrec CustomPluginSummary
-> ReadPrec [CustomPluginSummary]
-> Read CustomPluginSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomPluginSummary]
$creadListPrec :: ReadPrec [CustomPluginSummary]
readPrec :: ReadPrec CustomPluginSummary
$creadPrec :: ReadPrec CustomPluginSummary
readList :: ReadS [CustomPluginSummary]
$creadList :: ReadS [CustomPluginSummary]
readsPrec :: Int -> ReadS CustomPluginSummary
$creadsPrec :: Int -> ReadS CustomPluginSummary
Prelude.Read, Int -> CustomPluginSummary -> ShowS
[CustomPluginSummary] -> ShowS
CustomPluginSummary -> String
(Int -> CustomPluginSummary -> ShowS)
-> (CustomPluginSummary -> String)
-> ([CustomPluginSummary] -> ShowS)
-> Show CustomPluginSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomPluginSummary] -> ShowS
$cshowList :: [CustomPluginSummary] -> ShowS
show :: CustomPluginSummary -> String
$cshow :: CustomPluginSummary -> String
showsPrec :: Int -> CustomPluginSummary -> ShowS
$cshowsPrec :: Int -> CustomPluginSummary -> ShowS
Prelude.Show, (forall x. CustomPluginSummary -> Rep CustomPluginSummary x)
-> (forall x. Rep CustomPluginSummary x -> CustomPluginSummary)
-> Generic CustomPluginSummary
forall x. Rep CustomPluginSummary x -> CustomPluginSummary
forall x. CustomPluginSummary -> Rep CustomPluginSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomPluginSummary x -> CustomPluginSummary
$cfrom :: forall x. CustomPluginSummary -> Rep CustomPluginSummary x
Prelude.Generic)

-- |
-- Create a value of 'CustomPluginSummary' 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', 'customPluginSummary_creationTime' - The time that the custom plugin was created.
--
-- 'latestRevision', 'customPluginSummary_latestRevision' - The latest revision of the custom plugin.
--
-- 'name', 'customPluginSummary_name' - The name of the custom plugin.
--
-- 'customPluginArn', 'customPluginSummary_customPluginArn' - The Amazon Resource Name (ARN) of the custom plugin.
--
-- 'customPluginState', 'customPluginSummary_customPluginState' - The state of the custom plugin.
--
-- 'description', 'customPluginSummary_description' - A description of the custom plugin.
newCustomPluginSummary ::
  CustomPluginSummary
newCustomPluginSummary :: CustomPluginSummary
newCustomPluginSummary =
  CustomPluginSummary' :: Maybe POSIX
-> Maybe CustomPluginRevisionSummary
-> Maybe Text
-> Maybe Text
-> Maybe CustomPluginState
-> Maybe Text
-> CustomPluginSummary
CustomPluginSummary'
    { $sel:creationTime:CustomPluginSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:CustomPluginSummary' :: Maybe CustomPluginRevisionSummary
latestRevision = Maybe CustomPluginRevisionSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CustomPluginSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customPluginArn:CustomPluginSummary' :: Maybe Text
customPluginArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customPluginState:CustomPluginSummary' :: Maybe CustomPluginState
customPluginState = Maybe CustomPluginState
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CustomPluginSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time that the custom plugin was created.
customPluginSummary_creationTime :: Lens.Lens' CustomPluginSummary (Prelude.Maybe Prelude.UTCTime)
customPluginSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CustomPluginSummary -> f CustomPluginSummary
customPluginSummary_creationTime = (CustomPluginSummary -> Maybe POSIX)
-> (CustomPluginSummary -> Maybe POSIX -> CustomPluginSummary)
-> Lens
     CustomPluginSummary CustomPluginSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:CustomPluginSummary' :: CustomPluginSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe POSIX
a -> CustomPluginSummary
s {$sel:creationTime:CustomPluginSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: CustomPluginSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> CustomPluginSummary -> f CustomPluginSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CustomPluginSummary
-> f CustomPluginSummary
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 latest revision of the custom plugin.
customPluginSummary_latestRevision :: Lens.Lens' CustomPluginSummary (Prelude.Maybe CustomPluginRevisionSummary)
customPluginSummary_latestRevision :: (Maybe CustomPluginRevisionSummary
 -> f (Maybe CustomPluginRevisionSummary))
-> CustomPluginSummary -> f CustomPluginSummary
customPluginSummary_latestRevision = (CustomPluginSummary -> Maybe CustomPluginRevisionSummary)
-> (CustomPluginSummary
    -> Maybe CustomPluginRevisionSummary -> CustomPluginSummary)
-> Lens
     CustomPluginSummary
     CustomPluginSummary
     (Maybe CustomPluginRevisionSummary)
     (Maybe CustomPluginRevisionSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe CustomPluginRevisionSummary
latestRevision :: Maybe CustomPluginRevisionSummary
$sel:latestRevision:CustomPluginSummary' :: CustomPluginSummary -> Maybe CustomPluginRevisionSummary
latestRevision} -> Maybe CustomPluginRevisionSummary
latestRevision) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe CustomPluginRevisionSummary
a -> CustomPluginSummary
s {$sel:latestRevision:CustomPluginSummary' :: Maybe CustomPluginRevisionSummary
latestRevision = Maybe CustomPluginRevisionSummary
a} :: CustomPluginSummary)

-- | The name of the custom plugin.
customPluginSummary_name :: Lens.Lens' CustomPluginSummary (Prelude.Maybe Prelude.Text)
customPluginSummary_name :: (Maybe Text -> f (Maybe Text))
-> CustomPluginSummary -> f CustomPluginSummary
customPluginSummary_name = (CustomPluginSummary -> Maybe Text)
-> (CustomPluginSummary -> Maybe Text -> CustomPluginSummary)
-> Lens
     CustomPluginSummary CustomPluginSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe Text
name :: Maybe Text
$sel:name:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe Text
a -> CustomPluginSummary
s {$sel:name:CustomPluginSummary' :: Maybe Text
name = Maybe Text
a} :: CustomPluginSummary)

-- | The Amazon Resource Name (ARN) of the custom plugin.
customPluginSummary_customPluginArn :: Lens.Lens' CustomPluginSummary (Prelude.Maybe Prelude.Text)
customPluginSummary_customPluginArn :: (Maybe Text -> f (Maybe Text))
-> CustomPluginSummary -> f CustomPluginSummary
customPluginSummary_customPluginArn = (CustomPluginSummary -> Maybe Text)
-> (CustomPluginSummary -> Maybe Text -> CustomPluginSummary)
-> Lens
     CustomPluginSummary CustomPluginSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe Text
customPluginArn :: Maybe Text
$sel:customPluginArn:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
customPluginArn} -> Maybe Text
customPluginArn) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe Text
a -> CustomPluginSummary
s {$sel:customPluginArn:CustomPluginSummary' :: Maybe Text
customPluginArn = Maybe Text
a} :: CustomPluginSummary)

-- | The state of the custom plugin.
customPluginSummary_customPluginState :: Lens.Lens' CustomPluginSummary (Prelude.Maybe CustomPluginState)
customPluginSummary_customPluginState :: (Maybe CustomPluginState -> f (Maybe CustomPluginState))
-> CustomPluginSummary -> f CustomPluginSummary
customPluginSummary_customPluginState = (CustomPluginSummary -> Maybe CustomPluginState)
-> (CustomPluginSummary
    -> Maybe CustomPluginState -> CustomPluginSummary)
-> Lens
     CustomPluginSummary
     CustomPluginSummary
     (Maybe CustomPluginState)
     (Maybe CustomPluginState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe CustomPluginState
customPluginState :: Maybe CustomPluginState
$sel:customPluginState:CustomPluginSummary' :: CustomPluginSummary -> Maybe CustomPluginState
customPluginState} -> Maybe CustomPluginState
customPluginState) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe CustomPluginState
a -> CustomPluginSummary
s {$sel:customPluginState:CustomPluginSummary' :: Maybe CustomPluginState
customPluginState = Maybe CustomPluginState
a} :: CustomPluginSummary)

-- | A description of the custom plugin.
customPluginSummary_description :: Lens.Lens' CustomPluginSummary (Prelude.Maybe Prelude.Text)
customPluginSummary_description :: (Maybe Text -> f (Maybe Text))
-> CustomPluginSummary -> f CustomPluginSummary
customPluginSummary_description = (CustomPluginSummary -> Maybe Text)
-> (CustomPluginSummary -> Maybe Text -> CustomPluginSummary)
-> Lens
     CustomPluginSummary CustomPluginSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe Text
description :: Maybe Text
$sel:description:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe Text
a -> CustomPluginSummary
s {$sel:description:CustomPluginSummary' :: Maybe Text
description = Maybe Text
a} :: CustomPluginSummary)

instance Core.FromJSON CustomPluginSummary where
  parseJSON :: Value -> Parser CustomPluginSummary
parseJSON =
    String
-> (Object -> Parser CustomPluginSummary)
-> Value
-> Parser CustomPluginSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomPluginSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe CustomPluginRevisionSummary
-> Maybe Text
-> Maybe Text
-> Maybe CustomPluginState
-> Maybe Text
-> CustomPluginSummary
CustomPluginSummary'
            (Maybe POSIX
 -> Maybe CustomPluginRevisionSummary
 -> Maybe Text
 -> Maybe Text
 -> Maybe CustomPluginState
 -> Maybe Text
 -> CustomPluginSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe CustomPluginRevisionSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe CustomPluginState
      -> Maybe Text
      -> CustomPluginSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe CustomPluginRevisionSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe CustomPluginState
   -> Maybe Text
   -> CustomPluginSummary)
-> Parser (Maybe CustomPluginRevisionSummary)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe CustomPluginState
      -> Maybe Text
      -> CustomPluginSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomPluginRevisionSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"latestRevision")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe CustomPluginState
   -> Maybe Text
   -> CustomPluginSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe CustomPluginState -> Maybe Text -> CustomPluginSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe Text
   -> Maybe CustomPluginState -> Maybe Text -> CustomPluginSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe CustomPluginState -> Maybe Text -> CustomPluginSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customPluginArn")
            Parser
  (Maybe CustomPluginState -> Maybe Text -> CustomPluginSummary)
-> Parser (Maybe CustomPluginState)
-> Parser (Maybe Text -> CustomPluginSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomPluginState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customPluginState")
            Parser (Maybe Text -> CustomPluginSummary)
-> Parser (Maybe Text) -> Parser CustomPluginSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
      )

instance Prelude.Hashable CustomPluginSummary

instance Prelude.NFData CustomPluginSummary