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

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.S3LocationDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the location of a custom plugin.
--
-- /See:/ 'newCustomPluginLocationDescription' smart constructor.
data CustomPluginLocationDescription = CustomPluginLocationDescription'
  { -- | The S3 bucket Amazon Resource Name (ARN), file key, and object version
    -- of the plugin file stored in Amazon S3.
    CustomPluginLocationDescription -> Maybe S3LocationDescription
s3Location :: Prelude.Maybe S3LocationDescription
  }
  deriving (CustomPluginLocationDescription
-> CustomPluginLocationDescription -> Bool
(CustomPluginLocationDescription
 -> CustomPluginLocationDescription -> Bool)
-> (CustomPluginLocationDescription
    -> CustomPluginLocationDescription -> Bool)
-> Eq CustomPluginLocationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomPluginLocationDescription
-> CustomPluginLocationDescription -> Bool
$c/= :: CustomPluginLocationDescription
-> CustomPluginLocationDescription -> Bool
== :: CustomPluginLocationDescription
-> CustomPluginLocationDescription -> Bool
$c== :: CustomPluginLocationDescription
-> CustomPluginLocationDescription -> Bool
Prelude.Eq, ReadPrec [CustomPluginLocationDescription]
ReadPrec CustomPluginLocationDescription
Int -> ReadS CustomPluginLocationDescription
ReadS [CustomPluginLocationDescription]
(Int -> ReadS CustomPluginLocationDescription)
-> ReadS [CustomPluginLocationDescription]
-> ReadPrec CustomPluginLocationDescription
-> ReadPrec [CustomPluginLocationDescription]
-> Read CustomPluginLocationDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomPluginLocationDescription]
$creadListPrec :: ReadPrec [CustomPluginLocationDescription]
readPrec :: ReadPrec CustomPluginLocationDescription
$creadPrec :: ReadPrec CustomPluginLocationDescription
readList :: ReadS [CustomPluginLocationDescription]
$creadList :: ReadS [CustomPluginLocationDescription]
readsPrec :: Int -> ReadS CustomPluginLocationDescription
$creadsPrec :: Int -> ReadS CustomPluginLocationDescription
Prelude.Read, Int -> CustomPluginLocationDescription -> ShowS
[CustomPluginLocationDescription] -> ShowS
CustomPluginLocationDescription -> String
(Int -> CustomPluginLocationDescription -> ShowS)
-> (CustomPluginLocationDescription -> String)
-> ([CustomPluginLocationDescription] -> ShowS)
-> Show CustomPluginLocationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomPluginLocationDescription] -> ShowS
$cshowList :: [CustomPluginLocationDescription] -> ShowS
show :: CustomPluginLocationDescription -> String
$cshow :: CustomPluginLocationDescription -> String
showsPrec :: Int -> CustomPluginLocationDescription -> ShowS
$cshowsPrec :: Int -> CustomPluginLocationDescription -> ShowS
Prelude.Show, (forall x.
 CustomPluginLocationDescription
 -> Rep CustomPluginLocationDescription x)
-> (forall x.
    Rep CustomPluginLocationDescription x
    -> CustomPluginLocationDescription)
-> Generic CustomPluginLocationDescription
forall x.
Rep CustomPluginLocationDescription x
-> CustomPluginLocationDescription
forall x.
CustomPluginLocationDescription
-> Rep CustomPluginLocationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomPluginLocationDescription x
-> CustomPluginLocationDescription
$cfrom :: forall x.
CustomPluginLocationDescription
-> Rep CustomPluginLocationDescription x
Prelude.Generic)

-- |
-- Create a value of 'CustomPluginLocationDescription' 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:
--
-- 's3Location', 'customPluginLocationDescription_s3Location' - The S3 bucket Amazon Resource Name (ARN), file key, and object version
-- of the plugin file stored in Amazon S3.
newCustomPluginLocationDescription ::
  CustomPluginLocationDescription
newCustomPluginLocationDescription :: CustomPluginLocationDescription
newCustomPluginLocationDescription =
  CustomPluginLocationDescription' :: Maybe S3LocationDescription -> CustomPluginLocationDescription
CustomPluginLocationDescription'
    { $sel:s3Location:CustomPluginLocationDescription' :: Maybe S3LocationDescription
s3Location =
        Maybe S3LocationDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | The S3 bucket Amazon Resource Name (ARN), file key, and object version
-- of the plugin file stored in Amazon S3.
customPluginLocationDescription_s3Location :: Lens.Lens' CustomPluginLocationDescription (Prelude.Maybe S3LocationDescription)
customPluginLocationDescription_s3Location :: (Maybe S3LocationDescription -> f (Maybe S3LocationDescription))
-> CustomPluginLocationDescription
-> f CustomPluginLocationDescription
customPluginLocationDescription_s3Location = (CustomPluginLocationDescription -> Maybe S3LocationDescription)
-> (CustomPluginLocationDescription
    -> Maybe S3LocationDescription -> CustomPluginLocationDescription)
-> Lens
     CustomPluginLocationDescription
     CustomPluginLocationDescription
     (Maybe S3LocationDescription)
     (Maybe S3LocationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomPluginLocationDescription' {Maybe S3LocationDescription
s3Location :: Maybe S3LocationDescription
$sel:s3Location:CustomPluginLocationDescription' :: CustomPluginLocationDescription -> Maybe S3LocationDescription
s3Location} -> Maybe S3LocationDescription
s3Location) (\s :: CustomPluginLocationDescription
s@CustomPluginLocationDescription' {} Maybe S3LocationDescription
a -> CustomPluginLocationDescription
s {$sel:s3Location:CustomPluginLocationDescription' :: Maybe S3LocationDescription
s3Location = Maybe S3LocationDescription
a} :: CustomPluginLocationDescription)

instance
  Core.FromJSON
    CustomPluginLocationDescription
  where
  parseJSON :: Value -> Parser CustomPluginLocationDescription
parseJSON =
    String
-> (Object -> Parser CustomPluginLocationDescription)
-> Value
-> Parser CustomPluginLocationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomPluginLocationDescription"
      ( \Object
x ->
          Maybe S3LocationDescription -> CustomPluginLocationDescription
CustomPluginLocationDescription'
            (Maybe S3LocationDescription -> CustomPluginLocationDescription)
-> Parser (Maybe S3LocationDescription)
-> Parser CustomPluginLocationDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3LocationDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3Location")
      )

instance
  Prelude.Hashable
    CustomPluginLocationDescription

instance
  Prelude.NFData
    CustomPluginLocationDescription