{-# 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.Outposts.Types.CatalogItem
-- 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.Outposts.Types.CatalogItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Outposts.Types.CatalogItemStatus
import Amazonka.Outposts.Types.EC2Capacity
import Amazonka.Outposts.Types.SupportedStorageEnum
import qualified Amazonka.Prelude as Prelude

-- | Information about a catalog item.
--
-- /See:/ 'newCatalogItem' smart constructor.
data CatalogItem = CatalogItem'
  { -- | The ID of the catalog item.
    CatalogItem -> Maybe Text
catalogItemId :: Prelude.Maybe Prelude.Text,
    -- | Information about the EC2 capacity of an item.
    CatalogItem -> Maybe [EC2Capacity]
eC2Capacities :: Prelude.Maybe [EC2Capacity],
    -- | The status of a catalog item.
    CatalogItem -> Maybe CatalogItemStatus
itemStatus :: Prelude.Maybe CatalogItemStatus,
    -- | Information about the power draw of an item.
    CatalogItem -> Maybe Double
powerKva :: Prelude.Maybe Prelude.Double,
    -- | The supported storage options for the catalog item.
    CatalogItem -> Maybe [SupportedStorageEnum]
supportedStorage :: Prelude.Maybe [SupportedStorageEnum],
    -- | The uplink speed this catalog item requires for the connection to the
    -- Region.
    CatalogItem -> Maybe [Int]
supportedUplinkGbps :: Prelude.Maybe [Prelude.Int],
    -- | The weight of the item in pounds.
    CatalogItem -> Maybe Int
weightLbs :: Prelude.Maybe Prelude.Int
  }
  deriving (CatalogItem -> CatalogItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CatalogItem -> CatalogItem -> Bool
$c/= :: CatalogItem -> CatalogItem -> Bool
== :: CatalogItem -> CatalogItem -> Bool
$c== :: CatalogItem -> CatalogItem -> Bool
Prelude.Eq, ReadPrec [CatalogItem]
ReadPrec CatalogItem
Int -> ReadS CatalogItem
ReadS [CatalogItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CatalogItem]
$creadListPrec :: ReadPrec [CatalogItem]
readPrec :: ReadPrec CatalogItem
$creadPrec :: ReadPrec CatalogItem
readList :: ReadS [CatalogItem]
$creadList :: ReadS [CatalogItem]
readsPrec :: Int -> ReadS CatalogItem
$creadsPrec :: Int -> ReadS CatalogItem
Prelude.Read, Int -> CatalogItem -> ShowS
[CatalogItem] -> ShowS
CatalogItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CatalogItem] -> ShowS
$cshowList :: [CatalogItem] -> ShowS
show :: CatalogItem -> String
$cshow :: CatalogItem -> String
showsPrec :: Int -> CatalogItem -> ShowS
$cshowsPrec :: Int -> CatalogItem -> ShowS
Prelude.Show, forall x. Rep CatalogItem x -> CatalogItem
forall x. CatalogItem -> Rep CatalogItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CatalogItem x -> CatalogItem
$cfrom :: forall x. CatalogItem -> Rep CatalogItem x
Prelude.Generic)

-- |
-- Create a value of 'CatalogItem' 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:
--
-- 'catalogItemId', 'catalogItem_catalogItemId' - The ID of the catalog item.
--
-- 'eC2Capacities', 'catalogItem_eC2Capacities' - Information about the EC2 capacity of an item.
--
-- 'itemStatus', 'catalogItem_itemStatus' - The status of a catalog item.
--
-- 'powerKva', 'catalogItem_powerKva' - Information about the power draw of an item.
--
-- 'supportedStorage', 'catalogItem_supportedStorage' - The supported storage options for the catalog item.
--
-- 'supportedUplinkGbps', 'catalogItem_supportedUplinkGbps' - The uplink speed this catalog item requires for the connection to the
-- Region.
--
-- 'weightLbs', 'catalogItem_weightLbs' - The weight of the item in pounds.
newCatalogItem ::
  CatalogItem
newCatalogItem :: CatalogItem
newCatalogItem =
  CatalogItem'
    { $sel:catalogItemId:CatalogItem' :: Maybe Text
catalogItemId = forall a. Maybe a
Prelude.Nothing,
      $sel:eC2Capacities:CatalogItem' :: Maybe [EC2Capacity]
eC2Capacities = forall a. Maybe a
Prelude.Nothing,
      $sel:itemStatus:CatalogItem' :: Maybe CatalogItemStatus
itemStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:powerKva:CatalogItem' :: Maybe Double
powerKva = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedStorage:CatalogItem' :: Maybe [SupportedStorageEnum]
supportedStorage = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedUplinkGbps:CatalogItem' :: Maybe [Int]
supportedUplinkGbps = forall a. Maybe a
Prelude.Nothing,
      $sel:weightLbs:CatalogItem' :: Maybe Int
weightLbs = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the catalog item.
catalogItem_catalogItemId :: Lens.Lens' CatalogItem (Prelude.Maybe Prelude.Text)
catalogItem_catalogItemId :: Lens' CatalogItem (Maybe Text)
catalogItem_catalogItemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe Text
catalogItemId :: Maybe Text
$sel:catalogItemId:CatalogItem' :: CatalogItem -> Maybe Text
catalogItemId} -> Maybe Text
catalogItemId) (\s :: CatalogItem
s@CatalogItem' {} Maybe Text
a -> CatalogItem
s {$sel:catalogItemId:CatalogItem' :: Maybe Text
catalogItemId = Maybe Text
a} :: CatalogItem)

-- | Information about the EC2 capacity of an item.
catalogItem_eC2Capacities :: Lens.Lens' CatalogItem (Prelude.Maybe [EC2Capacity])
catalogItem_eC2Capacities :: Lens' CatalogItem (Maybe [EC2Capacity])
catalogItem_eC2Capacities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe [EC2Capacity]
eC2Capacities :: Maybe [EC2Capacity]
$sel:eC2Capacities:CatalogItem' :: CatalogItem -> Maybe [EC2Capacity]
eC2Capacities} -> Maybe [EC2Capacity]
eC2Capacities) (\s :: CatalogItem
s@CatalogItem' {} Maybe [EC2Capacity]
a -> CatalogItem
s {$sel:eC2Capacities:CatalogItem' :: Maybe [EC2Capacity]
eC2Capacities = Maybe [EC2Capacity]
a} :: CatalogItem) 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

-- | The status of a catalog item.
catalogItem_itemStatus :: Lens.Lens' CatalogItem (Prelude.Maybe CatalogItemStatus)
catalogItem_itemStatus :: Lens' CatalogItem (Maybe CatalogItemStatus)
catalogItem_itemStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe CatalogItemStatus
itemStatus :: Maybe CatalogItemStatus
$sel:itemStatus:CatalogItem' :: CatalogItem -> Maybe CatalogItemStatus
itemStatus} -> Maybe CatalogItemStatus
itemStatus) (\s :: CatalogItem
s@CatalogItem' {} Maybe CatalogItemStatus
a -> CatalogItem
s {$sel:itemStatus:CatalogItem' :: Maybe CatalogItemStatus
itemStatus = Maybe CatalogItemStatus
a} :: CatalogItem)

-- | Information about the power draw of an item.
catalogItem_powerKva :: Lens.Lens' CatalogItem (Prelude.Maybe Prelude.Double)
catalogItem_powerKva :: Lens' CatalogItem (Maybe Double)
catalogItem_powerKva = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe Double
powerKva :: Maybe Double
$sel:powerKva:CatalogItem' :: CatalogItem -> Maybe Double
powerKva} -> Maybe Double
powerKva) (\s :: CatalogItem
s@CatalogItem' {} Maybe Double
a -> CatalogItem
s {$sel:powerKva:CatalogItem' :: Maybe Double
powerKva = Maybe Double
a} :: CatalogItem)

-- | The supported storage options for the catalog item.
catalogItem_supportedStorage :: Lens.Lens' CatalogItem (Prelude.Maybe [SupportedStorageEnum])
catalogItem_supportedStorage :: Lens' CatalogItem (Maybe [SupportedStorageEnum])
catalogItem_supportedStorage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe [SupportedStorageEnum]
supportedStorage :: Maybe [SupportedStorageEnum]
$sel:supportedStorage:CatalogItem' :: CatalogItem -> Maybe [SupportedStorageEnum]
supportedStorage} -> Maybe [SupportedStorageEnum]
supportedStorage) (\s :: CatalogItem
s@CatalogItem' {} Maybe [SupportedStorageEnum]
a -> CatalogItem
s {$sel:supportedStorage:CatalogItem' :: Maybe [SupportedStorageEnum]
supportedStorage = Maybe [SupportedStorageEnum]
a} :: CatalogItem) 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

-- | The uplink speed this catalog item requires for the connection to the
-- Region.
catalogItem_supportedUplinkGbps :: Lens.Lens' CatalogItem (Prelude.Maybe [Prelude.Int])
catalogItem_supportedUplinkGbps :: Lens' CatalogItem (Maybe [Int])
catalogItem_supportedUplinkGbps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe [Int]
supportedUplinkGbps :: Maybe [Int]
$sel:supportedUplinkGbps:CatalogItem' :: CatalogItem -> Maybe [Int]
supportedUplinkGbps} -> Maybe [Int]
supportedUplinkGbps) (\s :: CatalogItem
s@CatalogItem' {} Maybe [Int]
a -> CatalogItem
s {$sel:supportedUplinkGbps:CatalogItem' :: Maybe [Int]
supportedUplinkGbps = Maybe [Int]
a} :: CatalogItem) 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

-- | The weight of the item in pounds.
catalogItem_weightLbs :: Lens.Lens' CatalogItem (Prelude.Maybe Prelude.Int)
catalogItem_weightLbs :: Lens' CatalogItem (Maybe Int)
catalogItem_weightLbs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogItem' {Maybe Int
weightLbs :: Maybe Int
$sel:weightLbs:CatalogItem' :: CatalogItem -> Maybe Int
weightLbs} -> Maybe Int
weightLbs) (\s :: CatalogItem
s@CatalogItem' {} Maybe Int
a -> CatalogItem
s {$sel:weightLbs:CatalogItem' :: Maybe Int
weightLbs = Maybe Int
a} :: CatalogItem)

instance Data.FromJSON CatalogItem where
  parseJSON :: Value -> Parser CatalogItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CatalogItem"
      ( \Object
x ->
          Maybe Text
-> Maybe [EC2Capacity]
-> Maybe CatalogItemStatus
-> Maybe Double
-> Maybe [SupportedStorageEnum]
-> Maybe [Int]
-> Maybe Int
-> CatalogItem
CatalogItem'
            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
"CatalogItemId")
            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
"EC2Capacities" 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
"ItemStatus")
            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
"PowerKva")
            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
"SupportedStorage"
                            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
"SupportedUplinkGbps"
                            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
"WeightLbs")
      )

instance Prelude.Hashable CatalogItem where
  hashWithSalt :: Int -> CatalogItem -> Int
hashWithSalt Int
_salt CatalogItem' {Maybe Double
Maybe Int
Maybe [Int]
Maybe [EC2Capacity]
Maybe [SupportedStorageEnum]
Maybe Text
Maybe CatalogItemStatus
weightLbs :: Maybe Int
supportedUplinkGbps :: Maybe [Int]
supportedStorage :: Maybe [SupportedStorageEnum]
powerKva :: Maybe Double
itemStatus :: Maybe CatalogItemStatus
eC2Capacities :: Maybe [EC2Capacity]
catalogItemId :: Maybe Text
$sel:weightLbs:CatalogItem' :: CatalogItem -> Maybe Int
$sel:supportedUplinkGbps:CatalogItem' :: CatalogItem -> Maybe [Int]
$sel:supportedStorage:CatalogItem' :: CatalogItem -> Maybe [SupportedStorageEnum]
$sel:powerKva:CatalogItem' :: CatalogItem -> Maybe Double
$sel:itemStatus:CatalogItem' :: CatalogItem -> Maybe CatalogItemStatus
$sel:eC2Capacities:CatalogItem' :: CatalogItem -> Maybe [EC2Capacity]
$sel:catalogItemId:CatalogItem' :: CatalogItem -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogItemId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EC2Capacity]
eC2Capacities
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CatalogItemStatus
itemStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
powerKva
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SupportedStorageEnum]
supportedStorage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Int]
supportedUplinkGbps
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
weightLbs

instance Prelude.NFData CatalogItem where
  rnf :: CatalogItem -> ()
rnf CatalogItem' {Maybe Double
Maybe Int
Maybe [Int]
Maybe [EC2Capacity]
Maybe [SupportedStorageEnum]
Maybe Text
Maybe CatalogItemStatus
weightLbs :: Maybe Int
supportedUplinkGbps :: Maybe [Int]
supportedStorage :: Maybe [SupportedStorageEnum]
powerKva :: Maybe Double
itemStatus :: Maybe CatalogItemStatus
eC2Capacities :: Maybe [EC2Capacity]
catalogItemId :: Maybe Text
$sel:weightLbs:CatalogItem' :: CatalogItem -> Maybe Int
$sel:supportedUplinkGbps:CatalogItem' :: CatalogItem -> Maybe [Int]
$sel:supportedStorage:CatalogItem' :: CatalogItem -> Maybe [SupportedStorageEnum]
$sel:powerKva:CatalogItem' :: CatalogItem -> Maybe Double
$sel:itemStatus:CatalogItem' :: CatalogItem -> Maybe CatalogItemStatus
$sel:eC2Capacities:CatalogItem' :: CatalogItem -> Maybe [EC2Capacity]
$sel:catalogItemId:CatalogItem' :: CatalogItem -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogItemId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EC2Capacity]
eC2Capacities
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CatalogItemStatus
itemStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
powerKva
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SupportedStorageEnum]
supportedStorage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Int]
supportedUplinkGbps
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
weightLbs