{-# 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-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.CustomPluginLocationDescription 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.S3LocationDescription
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
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]
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
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.
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'
    { $sel:s3Location:CustomPluginLocationDescription' :: Maybe S3LocationDescription
s3Location =
        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 :: Lens' CustomPluginLocationDescription (Maybe S3LocationDescription)
customPluginLocationDescription_s3Location = 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
  Data.FromJSON
    CustomPluginLocationDescription
  where
  parseJSON :: Value -> Parser CustomPluginLocationDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CustomPluginLocationDescription"
      ( \Object
x ->
          Maybe S3LocationDescription -> CustomPluginLocationDescription
CustomPluginLocationDescription'
            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
"s3Location")
      )

instance
  Prelude.Hashable
    CustomPluginLocationDescription
  where
  hashWithSalt :: Int -> CustomPluginLocationDescription -> Int
hashWithSalt
    Int
_salt
    CustomPluginLocationDescription' {Maybe S3LocationDescription
s3Location :: Maybe S3LocationDescription
$sel:s3Location:CustomPluginLocationDescription' :: CustomPluginLocationDescription -> Maybe S3LocationDescription
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3LocationDescription
s3Location

instance
  Prelude.NFData
    CustomPluginLocationDescription
  where
  rnf :: CustomPluginLocationDescription -> ()
rnf CustomPluginLocationDescription' {Maybe S3LocationDescription
s3Location :: Maybe S3LocationDescription
$sel:s3Location:CustomPluginLocationDescription' :: CustomPluginLocationDescription -> Maybe S3LocationDescription
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe S3LocationDescription
s3Location