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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details about a custom plugin file.
--
-- /See:/ 'newCustomPluginFileDescription' smart constructor.
data CustomPluginFileDescription = CustomPluginFileDescription'
  { -- | The hex-encoded MD5 checksum of the custom plugin file. You can use it
    -- to validate the file.
    CustomPluginFileDescription -> Maybe Text
fileMd5 :: Prelude.Maybe Prelude.Text,
    -- | The size in bytes of the custom plugin file. You can use it to validate
    -- the file.
    CustomPluginFileDescription -> Maybe Integer
fileSize :: Prelude.Maybe Prelude.Integer
  }
  deriving (CustomPluginFileDescription -> CustomPluginFileDescription -> Bool
(CustomPluginFileDescription
 -> CustomPluginFileDescription -> Bool)
-> (CustomPluginFileDescription
    -> CustomPluginFileDescription -> Bool)
-> Eq CustomPluginFileDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomPluginFileDescription -> CustomPluginFileDescription -> Bool
$c/= :: CustomPluginFileDescription -> CustomPluginFileDescription -> Bool
== :: CustomPluginFileDescription -> CustomPluginFileDescription -> Bool
$c== :: CustomPluginFileDescription -> CustomPluginFileDescription -> Bool
Prelude.Eq, ReadPrec [CustomPluginFileDescription]
ReadPrec CustomPluginFileDescription
Int -> ReadS CustomPluginFileDescription
ReadS [CustomPluginFileDescription]
(Int -> ReadS CustomPluginFileDescription)
-> ReadS [CustomPluginFileDescription]
-> ReadPrec CustomPluginFileDescription
-> ReadPrec [CustomPluginFileDescription]
-> Read CustomPluginFileDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomPluginFileDescription]
$creadListPrec :: ReadPrec [CustomPluginFileDescription]
readPrec :: ReadPrec CustomPluginFileDescription
$creadPrec :: ReadPrec CustomPluginFileDescription
readList :: ReadS [CustomPluginFileDescription]
$creadList :: ReadS [CustomPluginFileDescription]
readsPrec :: Int -> ReadS CustomPluginFileDescription
$creadsPrec :: Int -> ReadS CustomPluginFileDescription
Prelude.Read, Int -> CustomPluginFileDescription -> ShowS
[CustomPluginFileDescription] -> ShowS
CustomPluginFileDescription -> String
(Int -> CustomPluginFileDescription -> ShowS)
-> (CustomPluginFileDescription -> String)
-> ([CustomPluginFileDescription] -> ShowS)
-> Show CustomPluginFileDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomPluginFileDescription] -> ShowS
$cshowList :: [CustomPluginFileDescription] -> ShowS
show :: CustomPluginFileDescription -> String
$cshow :: CustomPluginFileDescription -> String
showsPrec :: Int -> CustomPluginFileDescription -> ShowS
$cshowsPrec :: Int -> CustomPluginFileDescription -> ShowS
Prelude.Show, (forall x.
 CustomPluginFileDescription -> Rep CustomPluginFileDescription x)
-> (forall x.
    Rep CustomPluginFileDescription x -> CustomPluginFileDescription)
-> Generic CustomPluginFileDescription
forall x.
Rep CustomPluginFileDescription x -> CustomPluginFileDescription
forall x.
CustomPluginFileDescription -> Rep CustomPluginFileDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomPluginFileDescription x -> CustomPluginFileDescription
$cfrom :: forall x.
CustomPluginFileDescription -> Rep CustomPluginFileDescription x
Prelude.Generic)

-- |
-- Create a value of 'CustomPluginFileDescription' 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:
--
-- 'fileMd5', 'customPluginFileDescription_fileMd5' - The hex-encoded MD5 checksum of the custom plugin file. You can use it
-- to validate the file.
--
-- 'fileSize', 'customPluginFileDescription_fileSize' - The size in bytes of the custom plugin file. You can use it to validate
-- the file.
newCustomPluginFileDescription ::
  CustomPluginFileDescription
newCustomPluginFileDescription :: CustomPluginFileDescription
newCustomPluginFileDescription =
  CustomPluginFileDescription' :: Maybe Text -> Maybe Integer -> CustomPluginFileDescription
CustomPluginFileDescription'
    { $sel:fileMd5:CustomPluginFileDescription' :: Maybe Text
fileMd5 =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fileSize:CustomPluginFileDescription' :: Maybe Integer
fileSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The hex-encoded MD5 checksum of the custom plugin file. You can use it
-- to validate the file.
customPluginFileDescription_fileMd5 :: Lens.Lens' CustomPluginFileDescription (Prelude.Maybe Prelude.Text)
customPluginFileDescription_fileMd5 :: (Maybe Text -> f (Maybe Text))
-> CustomPluginFileDescription -> f CustomPluginFileDescription
customPluginFileDescription_fileMd5 = (CustomPluginFileDescription -> Maybe Text)
-> (CustomPluginFileDescription
    -> Maybe Text -> CustomPluginFileDescription)
-> Lens
     CustomPluginFileDescription
     CustomPluginFileDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginFileDescription' {Maybe Text
fileMd5 :: Maybe Text
$sel:fileMd5:CustomPluginFileDescription' :: CustomPluginFileDescription -> Maybe Text
fileMd5} -> Maybe Text
fileMd5) (\s :: CustomPluginFileDescription
s@CustomPluginFileDescription' {} Maybe Text
a -> CustomPluginFileDescription
s {$sel:fileMd5:CustomPluginFileDescription' :: Maybe Text
fileMd5 = Maybe Text
a} :: CustomPluginFileDescription)

-- | The size in bytes of the custom plugin file. You can use it to validate
-- the file.
customPluginFileDescription_fileSize :: Lens.Lens' CustomPluginFileDescription (Prelude.Maybe Prelude.Integer)
customPluginFileDescription_fileSize :: (Maybe Integer -> f (Maybe Integer))
-> CustomPluginFileDescription -> f CustomPluginFileDescription
customPluginFileDescription_fileSize = (CustomPluginFileDescription -> Maybe Integer)
-> (CustomPluginFileDescription
    -> Maybe Integer -> CustomPluginFileDescription)
-> Lens
     CustomPluginFileDescription
     CustomPluginFileDescription
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginFileDescription' {Maybe Integer
fileSize :: Maybe Integer
$sel:fileSize:CustomPluginFileDescription' :: CustomPluginFileDescription -> Maybe Integer
fileSize} -> Maybe Integer
fileSize) (\s :: CustomPluginFileDescription
s@CustomPluginFileDescription' {} Maybe Integer
a -> CustomPluginFileDescription
s {$sel:fileSize:CustomPluginFileDescription' :: Maybe Integer
fileSize = Maybe Integer
a} :: CustomPluginFileDescription)

instance Core.FromJSON CustomPluginFileDescription where
  parseJSON :: Value -> Parser CustomPluginFileDescription
parseJSON =
    String
-> (Object -> Parser CustomPluginFileDescription)
-> Value
-> Parser CustomPluginFileDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomPluginFileDescription"
      ( \Object
x ->
          Maybe Text -> Maybe Integer -> CustomPluginFileDescription
CustomPluginFileDescription'
            (Maybe Text -> Maybe Integer -> CustomPluginFileDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> CustomPluginFileDescription)
forall (f :: * -> *) a b. Functor 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
"fileMd5")
            Parser (Maybe Integer -> CustomPluginFileDescription)
-> Parser (Maybe Integer) -> Parser CustomPluginFileDescription
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
"fileSize")
      )

instance Prelude.Hashable CustomPluginFileDescription

instance Prelude.NFData CustomPluginFileDescription