{-# 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.SageMaker.Types.ServiceCatalogProvisionedProductDetails
-- 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.SageMaker.Types.ServiceCatalogProvisionedProductDetails 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

-- | Details of a provisioned service catalog product. For information about
-- service catalog, see
-- <https://docs.aws.amazon.com/servicecatalog/latest/adminguide/introduction.html What is Amazon Web Services Service Catalog>.
--
-- /See:/ 'newServiceCatalogProvisionedProductDetails' smart constructor.
data ServiceCatalogProvisionedProductDetails = ServiceCatalogProvisionedProductDetails'
  { -- | The ID of the provisioned product.
    ServiceCatalogProvisionedProductDetails -> Maybe Text
provisionedProductId :: Prelude.Maybe Prelude.Text,
    -- | The current status of the product.
    --
    -- -   @AVAILABLE@ - Stable state, ready to perform any operation. The most
    --     recent operation succeeded and completed.
    --
    -- -   @UNDER_CHANGE@ - Transitive state. Operations performed might not
    --     have valid results. Wait for an AVAILABLE status before performing
    --     operations.
    --
    -- -   @TAINTED@ - Stable state, ready to perform any operation. The stack
    --     has completed the requested operation but is not exactly what was
    --     requested. For example, a request to update to a new version failed
    --     and the stack rolled back to the current version.
    --
    -- -   @ERROR@ - An unexpected error occurred. The provisioned product
    --     exists but the stack is not running. For example, CloudFormation
    --     received a parameter value that was not valid and could not launch
    --     the stack.
    --
    -- -   @PLAN_IN_PROGRESS@ - Transitive state. The plan operations were
    --     performed to provision a new product, but resources have not yet
    --     been created. After reviewing the list of resources to be created,
    --     execute the plan. Wait for an AVAILABLE status before performing
    --     operations.
    ServiceCatalogProvisionedProductDetails -> Maybe Text
provisionedProductStatusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceCatalogProvisionedProductDetails
-> ServiceCatalogProvisionedProductDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceCatalogProvisionedProductDetails
-> ServiceCatalogProvisionedProductDetails -> Bool
$c/= :: ServiceCatalogProvisionedProductDetails
-> ServiceCatalogProvisionedProductDetails -> Bool
== :: ServiceCatalogProvisionedProductDetails
-> ServiceCatalogProvisionedProductDetails -> Bool
$c== :: ServiceCatalogProvisionedProductDetails
-> ServiceCatalogProvisionedProductDetails -> Bool
Prelude.Eq, ReadPrec [ServiceCatalogProvisionedProductDetails]
ReadPrec ServiceCatalogProvisionedProductDetails
Int -> ReadS ServiceCatalogProvisionedProductDetails
ReadS [ServiceCatalogProvisionedProductDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceCatalogProvisionedProductDetails]
$creadListPrec :: ReadPrec [ServiceCatalogProvisionedProductDetails]
readPrec :: ReadPrec ServiceCatalogProvisionedProductDetails
$creadPrec :: ReadPrec ServiceCatalogProvisionedProductDetails
readList :: ReadS [ServiceCatalogProvisionedProductDetails]
$creadList :: ReadS [ServiceCatalogProvisionedProductDetails]
readsPrec :: Int -> ReadS ServiceCatalogProvisionedProductDetails
$creadsPrec :: Int -> ReadS ServiceCatalogProvisionedProductDetails
Prelude.Read, Int -> ServiceCatalogProvisionedProductDetails -> ShowS
[ServiceCatalogProvisionedProductDetails] -> ShowS
ServiceCatalogProvisionedProductDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceCatalogProvisionedProductDetails] -> ShowS
$cshowList :: [ServiceCatalogProvisionedProductDetails] -> ShowS
show :: ServiceCatalogProvisionedProductDetails -> String
$cshow :: ServiceCatalogProvisionedProductDetails -> String
showsPrec :: Int -> ServiceCatalogProvisionedProductDetails -> ShowS
$cshowsPrec :: Int -> ServiceCatalogProvisionedProductDetails -> ShowS
Prelude.Show, forall x.
Rep ServiceCatalogProvisionedProductDetails x
-> ServiceCatalogProvisionedProductDetails
forall x.
ServiceCatalogProvisionedProductDetails
-> Rep ServiceCatalogProvisionedProductDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ServiceCatalogProvisionedProductDetails x
-> ServiceCatalogProvisionedProductDetails
$cfrom :: forall x.
ServiceCatalogProvisionedProductDetails
-> Rep ServiceCatalogProvisionedProductDetails x
Prelude.Generic)

-- |
-- Create a value of 'ServiceCatalogProvisionedProductDetails' 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:
--
-- 'provisionedProductId', 'serviceCatalogProvisionedProductDetails_provisionedProductId' - The ID of the provisioned product.
--
-- 'provisionedProductStatusMessage', 'serviceCatalogProvisionedProductDetails_provisionedProductStatusMessage' - The current status of the product.
--
-- -   @AVAILABLE@ - Stable state, ready to perform any operation. The most
--     recent operation succeeded and completed.
--
-- -   @UNDER_CHANGE@ - Transitive state. Operations performed might not
--     have valid results. Wait for an AVAILABLE status before performing
--     operations.
--
-- -   @TAINTED@ - Stable state, ready to perform any operation. The stack
--     has completed the requested operation but is not exactly what was
--     requested. For example, a request to update to a new version failed
--     and the stack rolled back to the current version.
--
-- -   @ERROR@ - An unexpected error occurred. The provisioned product
--     exists but the stack is not running. For example, CloudFormation
--     received a parameter value that was not valid and could not launch
--     the stack.
--
-- -   @PLAN_IN_PROGRESS@ - Transitive state. The plan operations were
--     performed to provision a new product, but resources have not yet
--     been created. After reviewing the list of resources to be created,
--     execute the plan. Wait for an AVAILABLE status before performing
--     operations.
newServiceCatalogProvisionedProductDetails ::
  ServiceCatalogProvisionedProductDetails
newServiceCatalogProvisionedProductDetails :: ServiceCatalogProvisionedProductDetails
newServiceCatalogProvisionedProductDetails =
  ServiceCatalogProvisionedProductDetails'
    { $sel:provisionedProductId:ServiceCatalogProvisionedProductDetails' :: Maybe Text
provisionedProductId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProductStatusMessage:ServiceCatalogProvisionedProductDetails' :: Maybe Text
provisionedProductStatusMessage =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the provisioned product.
serviceCatalogProvisionedProductDetails_provisionedProductId :: Lens.Lens' ServiceCatalogProvisionedProductDetails (Prelude.Maybe Prelude.Text)
serviceCatalogProvisionedProductDetails_provisionedProductId :: Lens' ServiceCatalogProvisionedProductDetails (Maybe Text)
serviceCatalogProvisionedProductDetails_provisionedProductId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceCatalogProvisionedProductDetails' {Maybe Text
provisionedProductId :: Maybe Text
$sel:provisionedProductId:ServiceCatalogProvisionedProductDetails' :: ServiceCatalogProvisionedProductDetails -> Maybe Text
provisionedProductId} -> Maybe Text
provisionedProductId) (\s :: ServiceCatalogProvisionedProductDetails
s@ServiceCatalogProvisionedProductDetails' {} Maybe Text
a -> ServiceCatalogProvisionedProductDetails
s {$sel:provisionedProductId:ServiceCatalogProvisionedProductDetails' :: Maybe Text
provisionedProductId = Maybe Text
a} :: ServiceCatalogProvisionedProductDetails)

-- | The current status of the product.
--
-- -   @AVAILABLE@ - Stable state, ready to perform any operation. The most
--     recent operation succeeded and completed.
--
-- -   @UNDER_CHANGE@ - Transitive state. Operations performed might not
--     have valid results. Wait for an AVAILABLE status before performing
--     operations.
--
-- -   @TAINTED@ - Stable state, ready to perform any operation. The stack
--     has completed the requested operation but is not exactly what was
--     requested. For example, a request to update to a new version failed
--     and the stack rolled back to the current version.
--
-- -   @ERROR@ - An unexpected error occurred. The provisioned product
--     exists but the stack is not running. For example, CloudFormation
--     received a parameter value that was not valid and could not launch
--     the stack.
--
-- -   @PLAN_IN_PROGRESS@ - Transitive state. The plan operations were
--     performed to provision a new product, but resources have not yet
--     been created. After reviewing the list of resources to be created,
--     execute the plan. Wait for an AVAILABLE status before performing
--     operations.
serviceCatalogProvisionedProductDetails_provisionedProductStatusMessage :: Lens.Lens' ServiceCatalogProvisionedProductDetails (Prelude.Maybe Prelude.Text)
serviceCatalogProvisionedProductDetails_provisionedProductStatusMessage :: Lens' ServiceCatalogProvisionedProductDetails (Maybe Text)
serviceCatalogProvisionedProductDetails_provisionedProductStatusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceCatalogProvisionedProductDetails' {Maybe Text
provisionedProductStatusMessage :: Maybe Text
$sel:provisionedProductStatusMessage:ServiceCatalogProvisionedProductDetails' :: ServiceCatalogProvisionedProductDetails -> Maybe Text
provisionedProductStatusMessage} -> Maybe Text
provisionedProductStatusMessage) (\s :: ServiceCatalogProvisionedProductDetails
s@ServiceCatalogProvisionedProductDetails' {} Maybe Text
a -> ServiceCatalogProvisionedProductDetails
s {$sel:provisionedProductStatusMessage:ServiceCatalogProvisionedProductDetails' :: Maybe Text
provisionedProductStatusMessage = Maybe Text
a} :: ServiceCatalogProvisionedProductDetails)

instance
  Data.FromJSON
    ServiceCatalogProvisionedProductDetails
  where
  parseJSON :: Value -> Parser ServiceCatalogProvisionedProductDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ServiceCatalogProvisionedProductDetails"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ServiceCatalogProvisionedProductDetails
ServiceCatalogProvisionedProductDetails'
            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
"ProvisionedProductId")
            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
"ProvisionedProductStatusMessage")
      )

instance
  Prelude.Hashable
    ServiceCatalogProvisionedProductDetails
  where
  hashWithSalt :: Int -> ServiceCatalogProvisionedProductDetails -> Int
hashWithSalt
    Int
_salt
    ServiceCatalogProvisionedProductDetails' {Maybe Text
provisionedProductStatusMessage :: Maybe Text
provisionedProductId :: Maybe Text
$sel:provisionedProductStatusMessage:ServiceCatalogProvisionedProductDetails' :: ServiceCatalogProvisionedProductDetails -> Maybe Text
$sel:provisionedProductId:ServiceCatalogProvisionedProductDetails' :: ServiceCatalogProvisionedProductDetails -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
provisionedProductId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
provisionedProductStatusMessage

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