{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.KafkaConnect.Types.CustomPluginSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KafkaConnect.Types.CustomPluginRevisionSummary
import Amazonka.KafkaConnect.Types.CustomPluginState
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 ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | 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,
    -- | 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
  }
  deriving (CustomPluginSummary -> CustomPluginSummary -> Bool
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]
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
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. 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.
--
-- '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.
--
-- 'latestRevision', 'customPluginSummary_latestRevision' - The latest revision of the custom plugin.
--
-- 'name', 'customPluginSummary_name' - The name of the custom plugin.
newCustomPluginSummary ::
  CustomPluginSummary
newCustomPluginSummary :: CustomPluginSummary
newCustomPluginSummary =
  CustomPluginSummary'
    { $sel:creationTime:CustomPluginSummary' :: Maybe ISO8601
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:customPluginArn:CustomPluginSummary' :: Maybe Text
customPluginArn = forall a. Maybe a
Prelude.Nothing,
      $sel:customPluginState:CustomPluginSummary' :: Maybe CustomPluginState
customPluginState = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CustomPluginSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:CustomPluginSummary' :: Maybe CustomPluginRevisionSummary
latestRevision = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CustomPluginSummary' :: Maybe Text
name = 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 :: Lens' CustomPluginSummary (Maybe UTCTime)
customPluginSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginSummary' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:CustomPluginSummary' :: CustomPluginSummary -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: CustomPluginSummary
s@CustomPluginSummary' {} Maybe ISO8601
a -> CustomPluginSummary
s {$sel:creationTime:CustomPluginSummary' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: CustomPluginSummary) 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 Amazon Resource Name (ARN) of the custom plugin.
customPluginSummary_customPluginArn :: Lens.Lens' CustomPluginSummary (Prelude.Maybe Prelude.Text)
customPluginSummary_customPluginArn :: Lens' CustomPluginSummary (Maybe Text)
customPluginSummary_customPluginArn = 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 :: Lens' CustomPluginSummary (Maybe CustomPluginState)
customPluginSummary_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 :: Lens' CustomPluginSummary (Maybe Text)
customPluginSummary_description = 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)

-- | The latest revision of the custom plugin.
customPluginSummary_latestRevision :: Lens.Lens' CustomPluginSummary (Prelude.Maybe CustomPluginRevisionSummary)
customPluginSummary_latestRevision :: Lens' CustomPluginSummary (Maybe CustomPluginRevisionSummary)
customPluginSummary_latestRevision = 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 :: Lens' CustomPluginSummary (Maybe Text)
customPluginSummary_name = 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)

instance Data.FromJSON CustomPluginSummary where
  parseJSON :: Value -> Parser CustomPluginSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CustomPluginSummary"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe Text
-> Maybe CustomPluginState
-> Maybe Text
-> Maybe CustomPluginRevisionSummary
-> Maybe Text
-> CustomPluginSummary
CustomPluginSummary'
            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
"creationTime")
            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
"customPluginArn")
            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
"customPluginState")
            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
"description")
            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
"latestRevision")
            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
"name")
      )

instance Prelude.Hashable CustomPluginSummary where
  hashWithSalt :: Int -> CustomPluginSummary -> Int
hashWithSalt Int
_salt CustomPluginSummary' {Maybe Text
Maybe ISO8601
Maybe CustomPluginState
Maybe CustomPluginRevisionSummary
name :: Maybe Text
latestRevision :: Maybe CustomPluginRevisionSummary
description :: Maybe Text
customPluginState :: Maybe CustomPluginState
customPluginArn :: Maybe Text
creationTime :: Maybe ISO8601
$sel:name:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
$sel:latestRevision:CustomPluginSummary' :: CustomPluginSummary -> Maybe CustomPluginRevisionSummary
$sel:description:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
$sel:customPluginState:CustomPluginSummary' :: CustomPluginSummary -> Maybe CustomPluginState
$sel:customPluginArn:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
$sel:creationTime:CustomPluginSummary' :: CustomPluginSummary -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customPluginArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomPluginState
customPluginState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomPluginRevisionSummary
latestRevision
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData CustomPluginSummary where
  rnf :: CustomPluginSummary -> ()
rnf CustomPluginSummary' {Maybe Text
Maybe ISO8601
Maybe CustomPluginState
Maybe CustomPluginRevisionSummary
name :: Maybe Text
latestRevision :: Maybe CustomPluginRevisionSummary
description :: Maybe Text
customPluginState :: Maybe CustomPluginState
customPluginArn :: Maybe Text
creationTime :: Maybe ISO8601
$sel:name:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
$sel:latestRevision:CustomPluginSummary' :: CustomPluginSummary -> Maybe CustomPluginRevisionSummary
$sel:description:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
$sel:customPluginState:CustomPluginSummary' :: CustomPluginSummary -> Maybe CustomPluginState
$sel:customPluginArn:CustomPluginSummary' :: CustomPluginSummary -> Maybe Text
$sel:creationTime:CustomPluginSummary' :: CustomPluginSummary -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customPluginArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomPluginState
customPluginState
      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 CustomPluginRevisionSummary
latestRevision
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name