{-# 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.Panorama.Types.PackageImportJobInputConfig
-- 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.Panorama.Types.PackageImportJobInputConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types.PackageVersionInputConfig
import qualified Amazonka.Prelude as Prelude

-- | A configuration for a package import job.
--
-- /See:/ 'newPackageImportJobInputConfig' smart constructor.
data PackageImportJobInputConfig = PackageImportJobInputConfig'
  { -- | The package version\'s input configuration.
    PackageImportJobInputConfig -> Maybe PackageVersionInputConfig
packageVersionInputConfig :: Prelude.Maybe PackageVersionInputConfig
  }
  deriving (PackageImportJobInputConfig -> PackageImportJobInputConfig -> Bool
(PackageImportJobInputConfig
 -> PackageImportJobInputConfig -> Bool)
-> (PackageImportJobInputConfig
    -> PackageImportJobInputConfig -> Bool)
-> Eq PackageImportJobInputConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageImportJobInputConfig -> PackageImportJobInputConfig -> Bool
$c/= :: PackageImportJobInputConfig -> PackageImportJobInputConfig -> Bool
== :: PackageImportJobInputConfig -> PackageImportJobInputConfig -> Bool
$c== :: PackageImportJobInputConfig -> PackageImportJobInputConfig -> Bool
Prelude.Eq, ReadPrec [PackageImportJobInputConfig]
ReadPrec PackageImportJobInputConfig
Int -> ReadS PackageImportJobInputConfig
ReadS [PackageImportJobInputConfig]
(Int -> ReadS PackageImportJobInputConfig)
-> ReadS [PackageImportJobInputConfig]
-> ReadPrec PackageImportJobInputConfig
-> ReadPrec [PackageImportJobInputConfig]
-> Read PackageImportJobInputConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageImportJobInputConfig]
$creadListPrec :: ReadPrec [PackageImportJobInputConfig]
readPrec :: ReadPrec PackageImportJobInputConfig
$creadPrec :: ReadPrec PackageImportJobInputConfig
readList :: ReadS [PackageImportJobInputConfig]
$creadList :: ReadS [PackageImportJobInputConfig]
readsPrec :: Int -> ReadS PackageImportJobInputConfig
$creadsPrec :: Int -> ReadS PackageImportJobInputConfig
Prelude.Read, Int -> PackageImportJobInputConfig -> ShowS
[PackageImportJobInputConfig] -> ShowS
PackageImportJobInputConfig -> String
(Int -> PackageImportJobInputConfig -> ShowS)
-> (PackageImportJobInputConfig -> String)
-> ([PackageImportJobInputConfig] -> ShowS)
-> Show PackageImportJobInputConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageImportJobInputConfig] -> ShowS
$cshowList :: [PackageImportJobInputConfig] -> ShowS
show :: PackageImportJobInputConfig -> String
$cshow :: PackageImportJobInputConfig -> String
showsPrec :: Int -> PackageImportJobInputConfig -> ShowS
$cshowsPrec :: Int -> PackageImportJobInputConfig -> ShowS
Prelude.Show, (forall x.
 PackageImportJobInputConfig -> Rep PackageImportJobInputConfig x)
-> (forall x.
    Rep PackageImportJobInputConfig x -> PackageImportJobInputConfig)
-> Generic PackageImportJobInputConfig
forall x.
Rep PackageImportJobInputConfig x -> PackageImportJobInputConfig
forall x.
PackageImportJobInputConfig -> Rep PackageImportJobInputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PackageImportJobInputConfig x -> PackageImportJobInputConfig
$cfrom :: forall x.
PackageImportJobInputConfig -> Rep PackageImportJobInputConfig x
Prelude.Generic)

-- |
-- Create a value of 'PackageImportJobInputConfig' 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:
--
-- 'packageVersionInputConfig', 'packageImportJobInputConfig_packageVersionInputConfig' - The package version\'s input configuration.
newPackageImportJobInputConfig ::
  PackageImportJobInputConfig
newPackageImportJobInputConfig :: PackageImportJobInputConfig
newPackageImportJobInputConfig =
  PackageImportJobInputConfig' :: Maybe PackageVersionInputConfig -> PackageImportJobInputConfig
PackageImportJobInputConfig'
    { $sel:packageVersionInputConfig:PackageImportJobInputConfig' :: Maybe PackageVersionInputConfig
packageVersionInputConfig =
        Maybe PackageVersionInputConfig
forall a. Maybe a
Prelude.Nothing
    }

-- | The package version\'s input configuration.
packageImportJobInputConfig_packageVersionInputConfig :: Lens.Lens' PackageImportJobInputConfig (Prelude.Maybe PackageVersionInputConfig)
packageImportJobInputConfig_packageVersionInputConfig :: (Maybe PackageVersionInputConfig
 -> f (Maybe PackageVersionInputConfig))
-> PackageImportJobInputConfig -> f PackageImportJobInputConfig
packageImportJobInputConfig_packageVersionInputConfig = (PackageImportJobInputConfig -> Maybe PackageVersionInputConfig)
-> (PackageImportJobInputConfig
    -> Maybe PackageVersionInputConfig -> PackageImportJobInputConfig)
-> Lens
     PackageImportJobInputConfig
     PackageImportJobInputConfig
     (Maybe PackageVersionInputConfig)
     (Maybe PackageVersionInputConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJobInputConfig' {Maybe PackageVersionInputConfig
packageVersionInputConfig :: Maybe PackageVersionInputConfig
$sel:packageVersionInputConfig:PackageImportJobInputConfig' :: PackageImportJobInputConfig -> Maybe PackageVersionInputConfig
packageVersionInputConfig} -> Maybe PackageVersionInputConfig
packageVersionInputConfig) (\s :: PackageImportJobInputConfig
s@PackageImportJobInputConfig' {} Maybe PackageVersionInputConfig
a -> PackageImportJobInputConfig
s {$sel:packageVersionInputConfig:PackageImportJobInputConfig' :: Maybe PackageVersionInputConfig
packageVersionInputConfig = Maybe PackageVersionInputConfig
a} :: PackageImportJobInputConfig)

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

instance Prelude.Hashable PackageImportJobInputConfig

instance Prelude.NFData PackageImportJobInputConfig

instance Core.ToJSON PackageImportJobInputConfig where
  toJSON :: PackageImportJobInputConfig -> Value
toJSON PackageImportJobInputConfig' {Maybe PackageVersionInputConfig
packageVersionInputConfig :: Maybe PackageVersionInputConfig
$sel:packageVersionInputConfig:PackageImportJobInputConfig' :: PackageImportJobInputConfig -> Maybe PackageVersionInputConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PackageVersionInputConfig" Text -> PackageVersionInputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PackageVersionInputConfig -> Pair)
-> Maybe PackageVersionInputConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PackageVersionInputConfig
packageVersionInputConfig
          ]
      )