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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EKS.Types.Compatibility
import qualified Amazonka.Prelude as Prelude

-- | Information about an add-on version.
--
-- /See:/ 'newAddonVersionInfo' smart constructor.
data AddonVersionInfo = AddonVersionInfo'
  { -- | The version of the add-on.
    AddonVersionInfo -> Maybe Text
addonVersion :: Prelude.Maybe Prelude.Text,
    -- | The architectures that the version supports.
    AddonVersionInfo -> Maybe [Text]
architecture :: Prelude.Maybe [Prelude.Text],
    -- | An object representing the compatibilities of a version.
    AddonVersionInfo -> Maybe [Compatibility]
compatibilities :: Prelude.Maybe [Compatibility],
    -- | Whether the add-on requires configuration.
    AddonVersionInfo -> Maybe Bool
requiresConfiguration :: Prelude.Maybe Prelude.Bool
  }
  deriving (AddonVersionInfo -> AddonVersionInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddonVersionInfo -> AddonVersionInfo -> Bool
$c/= :: AddonVersionInfo -> AddonVersionInfo -> Bool
== :: AddonVersionInfo -> AddonVersionInfo -> Bool
$c== :: AddonVersionInfo -> AddonVersionInfo -> Bool
Prelude.Eq, ReadPrec [AddonVersionInfo]
ReadPrec AddonVersionInfo
Int -> ReadS AddonVersionInfo
ReadS [AddonVersionInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddonVersionInfo]
$creadListPrec :: ReadPrec [AddonVersionInfo]
readPrec :: ReadPrec AddonVersionInfo
$creadPrec :: ReadPrec AddonVersionInfo
readList :: ReadS [AddonVersionInfo]
$creadList :: ReadS [AddonVersionInfo]
readsPrec :: Int -> ReadS AddonVersionInfo
$creadsPrec :: Int -> ReadS AddonVersionInfo
Prelude.Read, Int -> AddonVersionInfo -> ShowS
[AddonVersionInfo] -> ShowS
AddonVersionInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddonVersionInfo] -> ShowS
$cshowList :: [AddonVersionInfo] -> ShowS
show :: AddonVersionInfo -> String
$cshow :: AddonVersionInfo -> String
showsPrec :: Int -> AddonVersionInfo -> ShowS
$cshowsPrec :: Int -> AddonVersionInfo -> ShowS
Prelude.Show, forall x. Rep AddonVersionInfo x -> AddonVersionInfo
forall x. AddonVersionInfo -> Rep AddonVersionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddonVersionInfo x -> AddonVersionInfo
$cfrom :: forall x. AddonVersionInfo -> Rep AddonVersionInfo x
Prelude.Generic)

-- |
-- Create a value of 'AddonVersionInfo' 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:
--
-- 'addonVersion', 'addonVersionInfo_addonVersion' - The version of the add-on.
--
-- 'architecture', 'addonVersionInfo_architecture' - The architectures that the version supports.
--
-- 'compatibilities', 'addonVersionInfo_compatibilities' - An object representing the compatibilities of a version.
--
-- 'requiresConfiguration', 'addonVersionInfo_requiresConfiguration' - Whether the add-on requires configuration.
newAddonVersionInfo ::
  AddonVersionInfo
newAddonVersionInfo :: AddonVersionInfo
newAddonVersionInfo =
  AddonVersionInfo'
    { $sel:addonVersion:AddonVersionInfo' :: Maybe Text
addonVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:architecture:AddonVersionInfo' :: Maybe [Text]
architecture = forall a. Maybe a
Prelude.Nothing,
      $sel:compatibilities:AddonVersionInfo' :: Maybe [Compatibility]
compatibilities = forall a. Maybe a
Prelude.Nothing,
      $sel:requiresConfiguration:AddonVersionInfo' :: Maybe Bool
requiresConfiguration = forall a. Maybe a
Prelude.Nothing
    }

-- | The version of the add-on.
addonVersionInfo_addonVersion :: Lens.Lens' AddonVersionInfo (Prelude.Maybe Prelude.Text)
addonVersionInfo_addonVersion :: Lens' AddonVersionInfo (Maybe Text)
addonVersionInfo_addonVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonVersionInfo' {Maybe Text
addonVersion :: Maybe Text
$sel:addonVersion:AddonVersionInfo' :: AddonVersionInfo -> Maybe Text
addonVersion} -> Maybe Text
addonVersion) (\s :: AddonVersionInfo
s@AddonVersionInfo' {} Maybe Text
a -> AddonVersionInfo
s {$sel:addonVersion:AddonVersionInfo' :: Maybe Text
addonVersion = Maybe Text
a} :: AddonVersionInfo)

-- | The architectures that the version supports.
addonVersionInfo_architecture :: Lens.Lens' AddonVersionInfo (Prelude.Maybe [Prelude.Text])
addonVersionInfo_architecture :: Lens' AddonVersionInfo (Maybe [Text])
addonVersionInfo_architecture = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonVersionInfo' {Maybe [Text]
architecture :: Maybe [Text]
$sel:architecture:AddonVersionInfo' :: AddonVersionInfo -> Maybe [Text]
architecture} -> Maybe [Text]
architecture) (\s :: AddonVersionInfo
s@AddonVersionInfo' {} Maybe [Text]
a -> AddonVersionInfo
s {$sel:architecture:AddonVersionInfo' :: Maybe [Text]
architecture = Maybe [Text]
a} :: AddonVersionInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object representing the compatibilities of a version.
addonVersionInfo_compatibilities :: Lens.Lens' AddonVersionInfo (Prelude.Maybe [Compatibility])
addonVersionInfo_compatibilities :: Lens' AddonVersionInfo (Maybe [Compatibility])
addonVersionInfo_compatibilities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonVersionInfo' {Maybe [Compatibility]
compatibilities :: Maybe [Compatibility]
$sel:compatibilities:AddonVersionInfo' :: AddonVersionInfo -> Maybe [Compatibility]
compatibilities} -> Maybe [Compatibility]
compatibilities) (\s :: AddonVersionInfo
s@AddonVersionInfo' {} Maybe [Compatibility]
a -> AddonVersionInfo
s {$sel:compatibilities:AddonVersionInfo' :: Maybe [Compatibility]
compatibilities = Maybe [Compatibility]
a} :: AddonVersionInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether the add-on requires configuration.
addonVersionInfo_requiresConfiguration :: Lens.Lens' AddonVersionInfo (Prelude.Maybe Prelude.Bool)
addonVersionInfo_requiresConfiguration :: Lens' AddonVersionInfo (Maybe Bool)
addonVersionInfo_requiresConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonVersionInfo' {Maybe Bool
requiresConfiguration :: Maybe Bool
$sel:requiresConfiguration:AddonVersionInfo' :: AddonVersionInfo -> Maybe Bool
requiresConfiguration} -> Maybe Bool
requiresConfiguration) (\s :: AddonVersionInfo
s@AddonVersionInfo' {} Maybe Bool
a -> AddonVersionInfo
s {$sel:requiresConfiguration:AddonVersionInfo' :: Maybe Bool
requiresConfiguration = Maybe Bool
a} :: AddonVersionInfo)

instance Data.FromJSON AddonVersionInfo where
  parseJSON :: Value -> Parser AddonVersionInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AddonVersionInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe [Text]
-> Maybe [Compatibility]
-> Maybe Bool
-> AddonVersionInfo
AddonVersionInfo'
            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
"addonVersion")
            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
"architecture" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"compatibilities"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"requiresConfiguration")
      )

instance Prelude.Hashable AddonVersionInfo where
  hashWithSalt :: Int -> AddonVersionInfo -> Int
hashWithSalt Int
_salt AddonVersionInfo' {Maybe Bool
Maybe [Text]
Maybe [Compatibility]
Maybe Text
requiresConfiguration :: Maybe Bool
compatibilities :: Maybe [Compatibility]
architecture :: Maybe [Text]
addonVersion :: Maybe Text
$sel:requiresConfiguration:AddonVersionInfo' :: AddonVersionInfo -> Maybe Bool
$sel:compatibilities:AddonVersionInfo' :: AddonVersionInfo -> Maybe [Compatibility]
$sel:architecture:AddonVersionInfo' :: AddonVersionInfo -> Maybe [Text]
$sel:addonVersion:AddonVersionInfo' :: AddonVersionInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addonVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
architecture
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Compatibility]
compatibilities
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
requiresConfiguration

instance Prelude.NFData AddonVersionInfo where
  rnf :: AddonVersionInfo -> ()
rnf AddonVersionInfo' {Maybe Bool
Maybe [Text]
Maybe [Compatibility]
Maybe Text
requiresConfiguration :: Maybe Bool
compatibilities :: Maybe [Compatibility]
architecture :: Maybe [Text]
addonVersion :: Maybe Text
$sel:requiresConfiguration:AddonVersionInfo' :: AddonVersionInfo -> Maybe Bool
$sel:compatibilities:AddonVersionInfo' :: AddonVersionInfo -> Maybe [Compatibility]
$sel:architecture:AddonVersionInfo' :: AddonVersionInfo -> Maybe [Text]
$sel:addonVersion:AddonVersionInfo' :: AddonVersionInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addonVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
architecture
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Compatibility]
compatibilities
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
requiresConfiguration