{-# 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.ServiceCatalog.Types.PortfolioDetail
-- 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.ServiceCatalog.Types.PortfolioDetail 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 a portfolio.
--
-- /See:/ 'newPortfolioDetail' smart constructor.
data PortfolioDetail = PortfolioDetail'
  { -- | The ARN assigned to the portfolio.
    PortfolioDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The UTC time stamp of the creation time.
    PortfolioDetail -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | The description of the portfolio.
    PortfolioDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name to use for display purposes.
    PortfolioDetail -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The portfolio identifier.
    PortfolioDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the portfolio provider.
    PortfolioDetail -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text
  }
  deriving (PortfolioDetail -> PortfolioDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PortfolioDetail -> PortfolioDetail -> Bool
$c/= :: PortfolioDetail -> PortfolioDetail -> Bool
== :: PortfolioDetail -> PortfolioDetail -> Bool
$c== :: PortfolioDetail -> PortfolioDetail -> Bool
Prelude.Eq, ReadPrec [PortfolioDetail]
ReadPrec PortfolioDetail
Int -> ReadS PortfolioDetail
ReadS [PortfolioDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PortfolioDetail]
$creadListPrec :: ReadPrec [PortfolioDetail]
readPrec :: ReadPrec PortfolioDetail
$creadPrec :: ReadPrec PortfolioDetail
readList :: ReadS [PortfolioDetail]
$creadList :: ReadS [PortfolioDetail]
readsPrec :: Int -> ReadS PortfolioDetail
$creadsPrec :: Int -> ReadS PortfolioDetail
Prelude.Read, Int -> PortfolioDetail -> ShowS
[PortfolioDetail] -> ShowS
PortfolioDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PortfolioDetail] -> ShowS
$cshowList :: [PortfolioDetail] -> ShowS
show :: PortfolioDetail -> String
$cshow :: PortfolioDetail -> String
showsPrec :: Int -> PortfolioDetail -> ShowS
$cshowsPrec :: Int -> PortfolioDetail -> ShowS
Prelude.Show, forall x. Rep PortfolioDetail x -> PortfolioDetail
forall x. PortfolioDetail -> Rep PortfolioDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PortfolioDetail x -> PortfolioDetail
$cfrom :: forall x. PortfolioDetail -> Rep PortfolioDetail x
Prelude.Generic)

-- |
-- Create a value of 'PortfolioDetail' 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:
--
-- 'arn', 'portfolioDetail_arn' - The ARN assigned to the portfolio.
--
-- 'createdTime', 'portfolioDetail_createdTime' - The UTC time stamp of the creation time.
--
-- 'description', 'portfolioDetail_description' - The description of the portfolio.
--
-- 'displayName', 'portfolioDetail_displayName' - The name to use for display purposes.
--
-- 'id', 'portfolioDetail_id' - The portfolio identifier.
--
-- 'providerName', 'portfolioDetail_providerName' - The name of the portfolio provider.
newPortfolioDetail ::
  PortfolioDetail
newPortfolioDetail :: PortfolioDetail
newPortfolioDetail =
  PortfolioDetail'
    { $sel:arn:PortfolioDetail' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:PortfolioDetail' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:PortfolioDetail' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:PortfolioDetail' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:id:PortfolioDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:providerName:PortfolioDetail' :: Maybe Text
providerName = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN assigned to the portfolio.
portfolioDetail_arn :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_arn :: Lens' PortfolioDetail (Maybe Text)
portfolioDetail_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:PortfolioDetail' :: PortfolioDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PortfolioDetail
s@PortfolioDetail' {} Maybe Text
a -> PortfolioDetail
s {$sel:arn:PortfolioDetail' :: Maybe Text
arn = Maybe Text
a} :: PortfolioDetail)

-- | The UTC time stamp of the creation time.
portfolioDetail_createdTime :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.UTCTime)
portfolioDetail_createdTime :: Lens' PortfolioDetail (Maybe UTCTime)
portfolioDetail_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioDetail' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:PortfolioDetail' :: PortfolioDetail -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: PortfolioDetail
s@PortfolioDetail' {} Maybe POSIX
a -> PortfolioDetail
s {$sel:createdTime:PortfolioDetail' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: PortfolioDetail) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The description of the portfolio.
portfolioDetail_description :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_description :: Lens' PortfolioDetail (Maybe Text)
portfolioDetail_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioDetail' {Maybe Text
description :: Maybe Text
$sel:description:PortfolioDetail' :: PortfolioDetail -> Maybe Text
description} -> Maybe Text
description) (\s :: PortfolioDetail
s@PortfolioDetail' {} Maybe Text
a -> PortfolioDetail
s {$sel:description:PortfolioDetail' :: Maybe Text
description = Maybe Text
a} :: PortfolioDetail)

-- | The name to use for display purposes.
portfolioDetail_displayName :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_displayName :: Lens' PortfolioDetail (Maybe Text)
portfolioDetail_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioDetail' {Maybe Text
displayName :: Maybe Text
$sel:displayName:PortfolioDetail' :: PortfolioDetail -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: PortfolioDetail
s@PortfolioDetail' {} Maybe Text
a -> PortfolioDetail
s {$sel:displayName:PortfolioDetail' :: Maybe Text
displayName = Maybe Text
a} :: PortfolioDetail)

-- | The portfolio identifier.
portfolioDetail_id :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_id :: Lens' PortfolioDetail (Maybe Text)
portfolioDetail_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioDetail' {Maybe Text
id :: Maybe Text
$sel:id:PortfolioDetail' :: PortfolioDetail -> Maybe Text
id} -> Maybe Text
id) (\s :: PortfolioDetail
s@PortfolioDetail' {} Maybe Text
a -> PortfolioDetail
s {$sel:id:PortfolioDetail' :: Maybe Text
id = Maybe Text
a} :: PortfolioDetail)

-- | The name of the portfolio provider.
portfolioDetail_providerName :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_providerName :: Lens' PortfolioDetail (Maybe Text)
portfolioDetail_providerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortfolioDetail' {Maybe Text
providerName :: Maybe Text
$sel:providerName:PortfolioDetail' :: PortfolioDetail -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: PortfolioDetail
s@PortfolioDetail' {} Maybe Text
a -> PortfolioDetail
s {$sel:providerName:PortfolioDetail' :: Maybe Text
providerName = Maybe Text
a} :: PortfolioDetail)

instance Data.FromJSON PortfolioDetail where
  parseJSON :: Value -> Parser PortfolioDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PortfolioDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PortfolioDetail
PortfolioDetail'
            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
"ARN")
            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
"CreatedTime")
            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
"Description")
            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
"DisplayName")
            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
"Id")
            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
"ProviderName")
      )

instance Prelude.Hashable PortfolioDetail where
  hashWithSalt :: Int -> PortfolioDetail -> Int
hashWithSalt Int
_salt PortfolioDetail' {Maybe Text
Maybe POSIX
providerName :: Maybe Text
id :: Maybe Text
displayName :: Maybe Text
description :: Maybe Text
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:providerName:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:id:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:displayName:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:description:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:createdTime:PortfolioDetail' :: PortfolioDetail -> Maybe POSIX
$sel:arn:PortfolioDetail' :: PortfolioDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
providerName

instance Prelude.NFData PortfolioDetail where
  rnf :: PortfolioDetail -> ()
rnf PortfolioDetail' {Maybe Text
Maybe POSIX
providerName :: Maybe Text
id :: Maybe Text
displayName :: Maybe Text
description :: Maybe Text
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:providerName:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:id:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:displayName:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:description:PortfolioDetail' :: PortfolioDetail -> Maybe Text
$sel:createdTime:PortfolioDetail' :: PortfolioDetail -> Maybe POSIX
$sel:arn:PortfolioDetail' :: PortfolioDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
providerName