{-# 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.CustomPluginRevisionSummary
-- 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.CustomPluginRevisionSummary where

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.CustomPluginContentType
import Amazonka.KafkaConnect.Types.CustomPluginFileDescription
import Amazonka.KafkaConnect.Types.CustomPluginLocationDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details about the revision of a custom plugin.
--
-- /See:/ 'newCustomPluginRevisionSummary' smart constructor.
data CustomPluginRevisionSummary = CustomPluginRevisionSummary'
  { -- | The time that the custom plugin was created.
    CustomPluginRevisionSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | Information about the location of the custom plugin.
    CustomPluginRevisionSummary
-> Maybe CustomPluginLocationDescription
location :: Prelude.Maybe CustomPluginLocationDescription,
    -- | Details about the custom plugin file.
    CustomPluginRevisionSummary -> Maybe CustomPluginFileDescription
fileDescription :: Prelude.Maybe CustomPluginFileDescription,
    -- | The revision of the custom plugin.
    CustomPluginRevisionSummary -> Maybe Integer
revision :: Prelude.Maybe Prelude.Integer,
    -- | The description of the custom plugin.
    CustomPluginRevisionSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The format of the plugin file.
    CustomPluginRevisionSummary -> Maybe CustomPluginContentType
contentType :: Prelude.Maybe CustomPluginContentType
  }
  deriving (CustomPluginRevisionSummary -> CustomPluginRevisionSummary -> Bool
(CustomPluginRevisionSummary
 -> CustomPluginRevisionSummary -> Bool)
-> (CustomPluginRevisionSummary
    -> CustomPluginRevisionSummary -> Bool)
-> Eq CustomPluginRevisionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomPluginRevisionSummary -> CustomPluginRevisionSummary -> Bool
$c/= :: CustomPluginRevisionSummary -> CustomPluginRevisionSummary -> Bool
== :: CustomPluginRevisionSummary -> CustomPluginRevisionSummary -> Bool
$c== :: CustomPluginRevisionSummary -> CustomPluginRevisionSummary -> Bool
Prelude.Eq, ReadPrec [CustomPluginRevisionSummary]
ReadPrec CustomPluginRevisionSummary
Int -> ReadS CustomPluginRevisionSummary
ReadS [CustomPluginRevisionSummary]
(Int -> ReadS CustomPluginRevisionSummary)
-> ReadS [CustomPluginRevisionSummary]
-> ReadPrec CustomPluginRevisionSummary
-> ReadPrec [CustomPluginRevisionSummary]
-> Read CustomPluginRevisionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomPluginRevisionSummary]
$creadListPrec :: ReadPrec [CustomPluginRevisionSummary]
readPrec :: ReadPrec CustomPluginRevisionSummary
$creadPrec :: ReadPrec CustomPluginRevisionSummary
readList :: ReadS [CustomPluginRevisionSummary]
$creadList :: ReadS [CustomPluginRevisionSummary]
readsPrec :: Int -> ReadS CustomPluginRevisionSummary
$creadsPrec :: Int -> ReadS CustomPluginRevisionSummary
Prelude.Read, Int -> CustomPluginRevisionSummary -> ShowS
[CustomPluginRevisionSummary] -> ShowS
CustomPluginRevisionSummary -> String
(Int -> CustomPluginRevisionSummary -> ShowS)
-> (CustomPluginRevisionSummary -> String)
-> ([CustomPluginRevisionSummary] -> ShowS)
-> Show CustomPluginRevisionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomPluginRevisionSummary] -> ShowS
$cshowList :: [CustomPluginRevisionSummary] -> ShowS
show :: CustomPluginRevisionSummary -> String
$cshow :: CustomPluginRevisionSummary -> String
showsPrec :: Int -> CustomPluginRevisionSummary -> ShowS
$cshowsPrec :: Int -> CustomPluginRevisionSummary -> ShowS
Prelude.Show, (forall x.
 CustomPluginRevisionSummary -> Rep CustomPluginRevisionSummary x)
-> (forall x.
    Rep CustomPluginRevisionSummary x -> CustomPluginRevisionSummary)
-> Generic CustomPluginRevisionSummary
forall x.
Rep CustomPluginRevisionSummary x -> CustomPluginRevisionSummary
forall x.
CustomPluginRevisionSummary -> Rep CustomPluginRevisionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomPluginRevisionSummary x -> CustomPluginRevisionSummary
$cfrom :: forall x.
CustomPluginRevisionSummary -> Rep CustomPluginRevisionSummary x
Prelude.Generic)

-- |
-- Create a value of 'CustomPluginRevisionSummary' 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', 'customPluginRevisionSummary_creationTime' - The time that the custom plugin was created.
--
-- 'location', 'customPluginRevisionSummary_location' - Information about the location of the custom plugin.
--
-- 'fileDescription', 'customPluginRevisionSummary_fileDescription' - Details about the custom plugin file.
--
-- 'revision', 'customPluginRevisionSummary_revision' - The revision of the custom plugin.
--
-- 'description', 'customPluginRevisionSummary_description' - The description of the custom plugin.
--
-- 'contentType', 'customPluginRevisionSummary_contentType' - The format of the plugin file.
newCustomPluginRevisionSummary ::
  CustomPluginRevisionSummary
newCustomPluginRevisionSummary :: CustomPluginRevisionSummary
newCustomPluginRevisionSummary =
  CustomPluginRevisionSummary' :: Maybe POSIX
-> Maybe CustomPluginLocationDescription
-> Maybe CustomPluginFileDescription
-> Maybe Integer
-> Maybe Text
-> Maybe CustomPluginContentType
-> CustomPluginRevisionSummary
CustomPluginRevisionSummary'
    { $sel:creationTime:CustomPluginRevisionSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:location:CustomPluginRevisionSummary' :: Maybe CustomPluginLocationDescription
location = Maybe CustomPluginLocationDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:fileDescription:CustomPluginRevisionSummary' :: Maybe CustomPluginFileDescription
fileDescription = Maybe CustomPluginFileDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:revision:CustomPluginRevisionSummary' :: Maybe Integer
revision = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CustomPluginRevisionSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:CustomPluginRevisionSummary' :: Maybe CustomPluginContentType
contentType = Maybe CustomPluginContentType
forall a. Maybe a
Prelude.Nothing
    }

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

-- | Information about the location of the custom plugin.
customPluginRevisionSummary_location :: Lens.Lens' CustomPluginRevisionSummary (Prelude.Maybe CustomPluginLocationDescription)
customPluginRevisionSummary_location :: (Maybe CustomPluginLocationDescription
 -> f (Maybe CustomPluginLocationDescription))
-> CustomPluginRevisionSummary -> f CustomPluginRevisionSummary
customPluginRevisionSummary_location = (CustomPluginRevisionSummary
 -> Maybe CustomPluginLocationDescription)
-> (CustomPluginRevisionSummary
    -> Maybe CustomPluginLocationDescription
    -> CustomPluginRevisionSummary)
-> Lens
     CustomPluginRevisionSummary
     CustomPluginRevisionSummary
     (Maybe CustomPluginLocationDescription)
     (Maybe CustomPluginLocationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginRevisionSummary' {Maybe CustomPluginLocationDescription
location :: Maybe CustomPluginLocationDescription
$sel:location:CustomPluginRevisionSummary' :: CustomPluginRevisionSummary
-> Maybe CustomPluginLocationDescription
location} -> Maybe CustomPluginLocationDescription
location) (\s :: CustomPluginRevisionSummary
s@CustomPluginRevisionSummary' {} Maybe CustomPluginLocationDescription
a -> CustomPluginRevisionSummary
s {$sel:location:CustomPluginRevisionSummary' :: Maybe CustomPluginLocationDescription
location = Maybe CustomPluginLocationDescription
a} :: CustomPluginRevisionSummary)

-- | Details about the custom plugin file.
customPluginRevisionSummary_fileDescription :: Lens.Lens' CustomPluginRevisionSummary (Prelude.Maybe CustomPluginFileDescription)
customPluginRevisionSummary_fileDescription :: (Maybe CustomPluginFileDescription
 -> f (Maybe CustomPluginFileDescription))
-> CustomPluginRevisionSummary -> f CustomPluginRevisionSummary
customPluginRevisionSummary_fileDescription = (CustomPluginRevisionSummary -> Maybe CustomPluginFileDescription)
-> (CustomPluginRevisionSummary
    -> Maybe CustomPluginFileDescription
    -> CustomPluginRevisionSummary)
-> Lens
     CustomPluginRevisionSummary
     CustomPluginRevisionSummary
     (Maybe CustomPluginFileDescription)
     (Maybe CustomPluginFileDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginRevisionSummary' {Maybe CustomPluginFileDescription
fileDescription :: Maybe CustomPluginFileDescription
$sel:fileDescription:CustomPluginRevisionSummary' :: CustomPluginRevisionSummary -> Maybe CustomPluginFileDescription
fileDescription} -> Maybe CustomPluginFileDescription
fileDescription) (\s :: CustomPluginRevisionSummary
s@CustomPluginRevisionSummary' {} Maybe CustomPluginFileDescription
a -> CustomPluginRevisionSummary
s {$sel:fileDescription:CustomPluginRevisionSummary' :: Maybe CustomPluginFileDescription
fileDescription = Maybe CustomPluginFileDescription
a} :: CustomPluginRevisionSummary)

-- | The revision of the custom plugin.
customPluginRevisionSummary_revision :: Lens.Lens' CustomPluginRevisionSummary (Prelude.Maybe Prelude.Integer)
customPluginRevisionSummary_revision :: (Maybe Integer -> f (Maybe Integer))
-> CustomPluginRevisionSummary -> f CustomPluginRevisionSummary
customPluginRevisionSummary_revision = (CustomPluginRevisionSummary -> Maybe Integer)
-> (CustomPluginRevisionSummary
    -> Maybe Integer -> CustomPluginRevisionSummary)
-> Lens
     CustomPluginRevisionSummary
     CustomPluginRevisionSummary
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginRevisionSummary' {Maybe Integer
revision :: Maybe Integer
$sel:revision:CustomPluginRevisionSummary' :: CustomPluginRevisionSummary -> Maybe Integer
revision} -> Maybe Integer
revision) (\s :: CustomPluginRevisionSummary
s@CustomPluginRevisionSummary' {} Maybe Integer
a -> CustomPluginRevisionSummary
s {$sel:revision:CustomPluginRevisionSummary' :: Maybe Integer
revision = Maybe Integer
a} :: CustomPluginRevisionSummary)

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

-- | The format of the plugin file.
customPluginRevisionSummary_contentType :: Lens.Lens' CustomPluginRevisionSummary (Prelude.Maybe CustomPluginContentType)
customPluginRevisionSummary_contentType :: (Maybe CustomPluginContentType
 -> f (Maybe CustomPluginContentType))
-> CustomPluginRevisionSummary -> f CustomPluginRevisionSummary
customPluginRevisionSummary_contentType = (CustomPluginRevisionSummary -> Maybe CustomPluginContentType)
-> (CustomPluginRevisionSummary
    -> Maybe CustomPluginContentType -> CustomPluginRevisionSummary)
-> Lens
     CustomPluginRevisionSummary
     CustomPluginRevisionSummary
     (Maybe CustomPluginContentType)
     (Maybe CustomPluginContentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginRevisionSummary' {Maybe CustomPluginContentType
contentType :: Maybe CustomPluginContentType
$sel:contentType:CustomPluginRevisionSummary' :: CustomPluginRevisionSummary -> Maybe CustomPluginContentType
contentType} -> Maybe CustomPluginContentType
contentType) (\s :: CustomPluginRevisionSummary
s@CustomPluginRevisionSummary' {} Maybe CustomPluginContentType
a -> CustomPluginRevisionSummary
s {$sel:contentType:CustomPluginRevisionSummary' :: Maybe CustomPluginContentType
contentType = Maybe CustomPluginContentType
a} :: CustomPluginRevisionSummary)

instance Core.FromJSON CustomPluginRevisionSummary where
  parseJSON :: Value -> Parser CustomPluginRevisionSummary
parseJSON =
    String
-> (Object -> Parser CustomPluginRevisionSummary)
-> Value
-> Parser CustomPluginRevisionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomPluginRevisionSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe CustomPluginLocationDescription
-> Maybe CustomPluginFileDescription
-> Maybe Integer
-> Maybe Text
-> Maybe CustomPluginContentType
-> CustomPluginRevisionSummary
CustomPluginRevisionSummary'
            (Maybe POSIX
 -> Maybe CustomPluginLocationDescription
 -> Maybe CustomPluginFileDescription
 -> Maybe Integer
 -> Maybe Text
 -> Maybe CustomPluginContentType
 -> CustomPluginRevisionSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe CustomPluginLocationDescription
      -> Maybe CustomPluginFileDescription
      -> Maybe Integer
      -> Maybe Text
      -> Maybe CustomPluginContentType
      -> CustomPluginRevisionSummary)
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 CustomPluginLocationDescription
   -> Maybe CustomPluginFileDescription
   -> Maybe Integer
   -> Maybe Text
   -> Maybe CustomPluginContentType
   -> CustomPluginRevisionSummary)
-> Parser (Maybe CustomPluginLocationDescription)
-> Parser
     (Maybe CustomPluginFileDescription
      -> Maybe Integer
      -> Maybe Text
      -> Maybe CustomPluginContentType
      -> CustomPluginRevisionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomPluginLocationDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
            Parser
  (Maybe CustomPluginFileDescription
   -> Maybe Integer
   -> Maybe Text
   -> Maybe CustomPluginContentType
   -> CustomPluginRevisionSummary)
-> Parser (Maybe CustomPluginFileDescription)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe CustomPluginContentType
      -> CustomPluginRevisionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomPluginFileDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileDescription")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe CustomPluginContentType
   -> CustomPluginRevisionSummary)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe CustomPluginContentType -> CustomPluginRevisionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"revision")
            Parser
  (Maybe Text
   -> Maybe CustomPluginContentType -> CustomPluginRevisionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe CustomPluginContentType -> CustomPluginRevisionSummary)
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")
            Parser
  (Maybe CustomPluginContentType -> CustomPluginRevisionSummary)
-> Parser (Maybe CustomPluginContentType)
-> Parser CustomPluginRevisionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomPluginContentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"contentType")
      )

instance Prelude.Hashable CustomPluginRevisionSummary

instance Prelude.NFData CustomPluginRevisionSummary