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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Panorama.Types.S3Location
import qualified Amazonka.Prelude as Prelude

-- | A package version input configuration.
--
-- /See:/ 'newPackageVersionInputConfig' smart constructor.
data PackageVersionInputConfig = PackageVersionInputConfig'
  { -- | A location in Amazon S3.
    PackageVersionInputConfig -> S3Location
s3Location :: S3Location
  }
  deriving (PackageVersionInputConfig -> PackageVersionInputConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageVersionInputConfig -> PackageVersionInputConfig -> Bool
$c/= :: PackageVersionInputConfig -> PackageVersionInputConfig -> Bool
== :: PackageVersionInputConfig -> PackageVersionInputConfig -> Bool
$c== :: PackageVersionInputConfig -> PackageVersionInputConfig -> Bool
Prelude.Eq, ReadPrec [PackageVersionInputConfig]
ReadPrec PackageVersionInputConfig
Int -> ReadS PackageVersionInputConfig
ReadS [PackageVersionInputConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageVersionInputConfig]
$creadListPrec :: ReadPrec [PackageVersionInputConfig]
readPrec :: ReadPrec PackageVersionInputConfig
$creadPrec :: ReadPrec PackageVersionInputConfig
readList :: ReadS [PackageVersionInputConfig]
$creadList :: ReadS [PackageVersionInputConfig]
readsPrec :: Int -> ReadS PackageVersionInputConfig
$creadsPrec :: Int -> ReadS PackageVersionInputConfig
Prelude.Read, Int -> PackageVersionInputConfig -> ShowS
[PackageVersionInputConfig] -> ShowS
PackageVersionInputConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageVersionInputConfig] -> ShowS
$cshowList :: [PackageVersionInputConfig] -> ShowS
show :: PackageVersionInputConfig -> String
$cshow :: PackageVersionInputConfig -> String
showsPrec :: Int -> PackageVersionInputConfig -> ShowS
$cshowsPrec :: Int -> PackageVersionInputConfig -> ShowS
Prelude.Show, forall x.
Rep PackageVersionInputConfig x -> PackageVersionInputConfig
forall x.
PackageVersionInputConfig -> Rep PackageVersionInputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PackageVersionInputConfig x -> PackageVersionInputConfig
$cfrom :: forall x.
PackageVersionInputConfig -> Rep PackageVersionInputConfig x
Prelude.Generic)

-- |
-- Create a value of 'PackageVersionInputConfig' 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', 'packageVersionInputConfig_s3Location' - A location in Amazon S3.
newPackageVersionInputConfig ::
  -- | 's3Location'
  S3Location ->
  PackageVersionInputConfig
newPackageVersionInputConfig :: S3Location -> PackageVersionInputConfig
newPackageVersionInputConfig S3Location
pS3Location_ =
  PackageVersionInputConfig'
    { $sel:s3Location:PackageVersionInputConfig' :: S3Location
s3Location =
        S3Location
pS3Location_
    }

-- | A location in Amazon S3.
packageVersionInputConfig_s3Location :: Lens.Lens' PackageVersionInputConfig S3Location
packageVersionInputConfig_s3Location :: Lens' PackageVersionInputConfig S3Location
packageVersionInputConfig_s3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageVersionInputConfig' {S3Location
s3Location :: S3Location
$sel:s3Location:PackageVersionInputConfig' :: PackageVersionInputConfig -> S3Location
s3Location} -> S3Location
s3Location) (\s :: PackageVersionInputConfig
s@PackageVersionInputConfig' {} S3Location
a -> PackageVersionInputConfig
s {$sel:s3Location:PackageVersionInputConfig' :: S3Location
s3Location = S3Location
a} :: PackageVersionInputConfig)

instance Data.FromJSON PackageVersionInputConfig where
  parseJSON :: Value -> Parser PackageVersionInputConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PackageVersionInputConfig"
      ( \Object
x ->
          S3Location -> PackageVersionInputConfig
PackageVersionInputConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"S3Location")
      )

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

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

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