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

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

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

-- |
-- Create a value of 'CustomPluginLocation' 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', 'customPluginLocation_s3Location' - The S3 bucket Amazon Resource Name (ARN), file key, and object version
-- of the plugin file stored in Amazon S3.
newCustomPluginLocation ::
  -- | 's3Location'
  S3Location ->
  CustomPluginLocation
newCustomPluginLocation :: S3Location -> CustomPluginLocation
newCustomPluginLocation S3Location
pS3Location_ =
  CustomPluginLocation' :: S3Location -> CustomPluginLocation
CustomPluginLocation' {$sel:s3Location:CustomPluginLocation' :: S3Location
s3Location = S3Location
pS3Location_}

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

instance Prelude.Hashable CustomPluginLocation

instance Prelude.NFData CustomPluginLocation

instance Core.ToJSON CustomPluginLocation where
  toJSON :: CustomPluginLocation -> Value
toJSON CustomPluginLocation' {S3Location
s3Location :: S3Location
$sel:s3Location:CustomPluginLocation' :: CustomPluginLocation -> S3Location
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"s3Location" Text -> S3Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3Location
s3Location)]
      )