{-# 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.EKS.Types.MarketplaceInformation
-- 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.EKS.Types.MarketplaceInformation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Information about an Amazon EKS add-on from the Amazon Web Services
-- Marketplace.
--
-- /See:/ 'newMarketplaceInformation' smart constructor.
data MarketplaceInformation = MarketplaceInformation'
  { -- | The product ID from the Amazon Web Services Marketplace.
    MarketplaceInformation -> Maybe Text
productId :: Prelude.Maybe Prelude.Text,
    -- | The product URL from the Amazon Web Services Marketplace.
    MarketplaceInformation -> Maybe Text
productUrl :: Prelude.Maybe Prelude.Text
  }
  deriving (MarketplaceInformation -> MarketplaceInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MarketplaceInformation -> MarketplaceInformation -> Bool
$c/= :: MarketplaceInformation -> MarketplaceInformation -> Bool
== :: MarketplaceInformation -> MarketplaceInformation -> Bool
$c== :: MarketplaceInformation -> MarketplaceInformation -> Bool
Prelude.Eq, ReadPrec [MarketplaceInformation]
ReadPrec MarketplaceInformation
Int -> ReadS MarketplaceInformation
ReadS [MarketplaceInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MarketplaceInformation]
$creadListPrec :: ReadPrec [MarketplaceInformation]
readPrec :: ReadPrec MarketplaceInformation
$creadPrec :: ReadPrec MarketplaceInformation
readList :: ReadS [MarketplaceInformation]
$creadList :: ReadS [MarketplaceInformation]
readsPrec :: Int -> ReadS MarketplaceInformation
$creadsPrec :: Int -> ReadS MarketplaceInformation
Prelude.Read, Int -> MarketplaceInformation -> ShowS
[MarketplaceInformation] -> ShowS
MarketplaceInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MarketplaceInformation] -> ShowS
$cshowList :: [MarketplaceInformation] -> ShowS
show :: MarketplaceInformation -> String
$cshow :: MarketplaceInformation -> String
showsPrec :: Int -> MarketplaceInformation -> ShowS
$cshowsPrec :: Int -> MarketplaceInformation -> ShowS
Prelude.Show, forall x. Rep MarketplaceInformation x -> MarketplaceInformation
forall x. MarketplaceInformation -> Rep MarketplaceInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MarketplaceInformation x -> MarketplaceInformation
$cfrom :: forall x. MarketplaceInformation -> Rep MarketplaceInformation x
Prelude.Generic)

-- |
-- Create a value of 'MarketplaceInformation' 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:
--
-- 'productId', 'marketplaceInformation_productId' - The product ID from the Amazon Web Services Marketplace.
--
-- 'productUrl', 'marketplaceInformation_productUrl' - The product URL from the Amazon Web Services Marketplace.
newMarketplaceInformation ::
  MarketplaceInformation
newMarketplaceInformation :: MarketplaceInformation
newMarketplaceInformation =
  MarketplaceInformation'
    { $sel:productId:MarketplaceInformation' :: Maybe Text
productId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:productUrl:MarketplaceInformation' :: Maybe Text
productUrl = forall a. Maybe a
Prelude.Nothing
    }

-- | The product ID from the Amazon Web Services Marketplace.
marketplaceInformation_productId :: Lens.Lens' MarketplaceInformation (Prelude.Maybe Prelude.Text)
marketplaceInformation_productId :: Lens' MarketplaceInformation (Maybe Text)
marketplaceInformation_productId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MarketplaceInformation' {Maybe Text
productId :: Maybe Text
$sel:productId:MarketplaceInformation' :: MarketplaceInformation -> Maybe Text
productId} -> Maybe Text
productId) (\s :: MarketplaceInformation
s@MarketplaceInformation' {} Maybe Text
a -> MarketplaceInformation
s {$sel:productId:MarketplaceInformation' :: Maybe Text
productId = Maybe Text
a} :: MarketplaceInformation)

-- | The product URL from the Amazon Web Services Marketplace.
marketplaceInformation_productUrl :: Lens.Lens' MarketplaceInformation (Prelude.Maybe Prelude.Text)
marketplaceInformation_productUrl :: Lens' MarketplaceInformation (Maybe Text)
marketplaceInformation_productUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MarketplaceInformation' {Maybe Text
productUrl :: Maybe Text
$sel:productUrl:MarketplaceInformation' :: MarketplaceInformation -> Maybe Text
productUrl} -> Maybe Text
productUrl) (\s :: MarketplaceInformation
s@MarketplaceInformation' {} Maybe Text
a -> MarketplaceInformation
s {$sel:productUrl:MarketplaceInformation' :: Maybe Text
productUrl = Maybe Text
a} :: MarketplaceInformation)

instance Data.FromJSON MarketplaceInformation where
  parseJSON :: Value -> Parser MarketplaceInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MarketplaceInformation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> MarketplaceInformation
MarketplaceInformation'
            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
"productId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"productUrl")
      )

instance Prelude.Hashable MarketplaceInformation where
  hashWithSalt :: Int -> MarketplaceInformation -> Int
hashWithSalt Int
_salt MarketplaceInformation' {Maybe Text
productUrl :: Maybe Text
productId :: Maybe Text
$sel:productUrl:MarketplaceInformation' :: MarketplaceInformation -> Maybe Text
$sel:productId:MarketplaceInformation' :: MarketplaceInformation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productUrl

instance Prelude.NFData MarketplaceInformation where
  rnf :: MarketplaceInformation -> ()
rnf MarketplaceInformation' {Maybe Text
productUrl :: Maybe Text
productId :: Maybe Text
$sel:productUrl:MarketplaceInformation' :: MarketplaceInformation -> Maybe Text
$sel:productId:MarketplaceInformation' :: MarketplaceInformation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productUrl