{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.PortfolioDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 Core.POSIX,
    -- | The portfolio identifier.
    PortfolioDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name to use for display purposes.
    PortfolioDetail -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The description of the portfolio.
    PortfolioDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the portfolio provider.
    PortfolioDetail -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text
  }
  deriving (PortfolioDetail -> PortfolioDetail -> Bool
(PortfolioDetail -> PortfolioDetail -> Bool)
-> (PortfolioDetail -> PortfolioDetail -> Bool)
-> Eq PortfolioDetail
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]
(Int -> ReadS PortfolioDetail)
-> ReadS [PortfolioDetail]
-> ReadPrec PortfolioDetail
-> ReadPrec [PortfolioDetail]
-> Read 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
(Int -> PortfolioDetail -> ShowS)
-> (PortfolioDetail -> String)
-> ([PortfolioDetail] -> ShowS)
-> Show PortfolioDetail
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. PortfolioDetail -> Rep PortfolioDetail x)
-> (forall x. Rep PortfolioDetail x -> PortfolioDetail)
-> Generic PortfolioDetail
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.
--
-- 'id', 'portfolioDetail_id' - The portfolio identifier.
--
-- 'displayName', 'portfolioDetail_displayName' - The name to use for display purposes.
--
-- 'description', 'portfolioDetail_description' - The description of the portfolio.
--
-- 'providerName', 'portfolioDetail_providerName' - The name of the portfolio provider.
newPortfolioDetail ::
  PortfolioDetail
newPortfolioDetail :: PortfolioDetail
newPortfolioDetail =
  PortfolioDetail' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PortfolioDetail
PortfolioDetail'
    { $sel:arn:PortfolioDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:PortfolioDetail' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:id:PortfolioDetail' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:PortfolioDetail' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:PortfolioDetail' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:providerName:PortfolioDetail' :: Maybe Text
providerName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN assigned to the portfolio.
portfolioDetail_arn :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_arn :: (Maybe Text -> f (Maybe Text))
-> PortfolioDetail -> f PortfolioDetail
portfolioDetail_arn = (PortfolioDetail -> Maybe Text)
-> (PortfolioDetail -> Maybe Text -> PortfolioDetail)
-> Lens PortfolioDetail PortfolioDetail (Maybe Text) (Maybe Text)
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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PortfolioDetail -> f PortfolioDetail
portfolioDetail_createdTime = (PortfolioDetail -> Maybe POSIX)
-> (PortfolioDetail -> Maybe POSIX -> PortfolioDetail)
-> Lens PortfolioDetail PortfolioDetail (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> PortfolioDetail -> f PortfolioDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PortfolioDetail
-> f PortfolioDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The portfolio identifier.
portfolioDetail_id :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_id :: (Maybe Text -> f (Maybe Text))
-> PortfolioDetail -> f PortfolioDetail
portfolioDetail_id = (PortfolioDetail -> Maybe Text)
-> (PortfolioDetail -> Maybe Text -> PortfolioDetail)
-> Lens PortfolioDetail PortfolioDetail (Maybe Text) (Maybe Text)
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 to use for display purposes.
portfolioDetail_displayName :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_displayName :: (Maybe Text -> f (Maybe Text))
-> PortfolioDetail -> f PortfolioDetail
portfolioDetail_displayName = (PortfolioDetail -> Maybe Text)
-> (PortfolioDetail -> Maybe Text -> PortfolioDetail)
-> Lens PortfolioDetail PortfolioDetail (Maybe Text) (Maybe Text)
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 description of the portfolio.
portfolioDetail_description :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_description :: (Maybe Text -> f (Maybe Text))
-> PortfolioDetail -> f PortfolioDetail
portfolioDetail_description = (PortfolioDetail -> Maybe Text)
-> (PortfolioDetail -> Maybe Text -> PortfolioDetail)
-> Lens PortfolioDetail PortfolioDetail (Maybe Text) (Maybe Text)
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 of the portfolio provider.
portfolioDetail_providerName :: Lens.Lens' PortfolioDetail (Prelude.Maybe Prelude.Text)
portfolioDetail_providerName :: (Maybe Text -> f (Maybe Text))
-> PortfolioDetail -> f PortfolioDetail
portfolioDetail_providerName = (PortfolioDetail -> Maybe Text)
-> (PortfolioDetail -> Maybe Text -> PortfolioDetail)
-> Lens PortfolioDetail PortfolioDetail (Maybe Text) (Maybe Text)
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 Core.FromJSON PortfolioDetail where
  parseJSON :: Value -> Parser PortfolioDetail
parseJSON =
    String
-> (Object -> Parser PortfolioDetail)
-> Value
-> Parser PortfolioDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PortfolioDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PortfolioDetail
PortfolioDetail'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> PortfolioDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PortfolioDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ARN")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PortfolioDetail)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> PortfolioDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> PortfolioDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> PortfolioDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> PortfolioDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PortfolioDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisplayName")
            Parser (Maybe Text -> Maybe Text -> PortfolioDetail)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PortfolioDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe Text -> PortfolioDetail)
-> Parser (Maybe Text) -> Parser PortfolioDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProviderName")
      )

instance Prelude.Hashable PortfolioDetail

instance Prelude.NFData PortfolioDetail