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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | The ID of the provisioned product.
    ServiceCatalogProvisionedProductDetails -> Maybe Text
provisionedProductId :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceCatalogProvisionedProductDetails
-> ServiceCatalogProvisionedProductDetails -> Bool
(ServiceCatalogProvisionedProductDetails
 -> ServiceCatalogProvisionedProductDetails -> Bool)
-> (ServiceCatalogProvisionedProductDetails
    -> ServiceCatalogProvisionedProductDetails -> Bool)
-> Eq ServiceCatalogProvisionedProductDetails
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]
(Int -> ReadS ServiceCatalogProvisionedProductDetails)
-> ReadS [ServiceCatalogProvisionedProductDetails]
-> ReadPrec ServiceCatalogProvisionedProductDetails
-> ReadPrec [ServiceCatalogProvisionedProductDetails]
-> Read 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
(Int -> ServiceCatalogProvisionedProductDetails -> ShowS)
-> (ServiceCatalogProvisionedProductDetails -> String)
-> ([ServiceCatalogProvisionedProductDetails] -> ShowS)
-> Show ServiceCatalogProvisionedProductDetails
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.
 ServiceCatalogProvisionedProductDetails
 -> Rep ServiceCatalogProvisionedProductDetails x)
-> (forall x.
    Rep ServiceCatalogProvisionedProductDetails x
    -> ServiceCatalogProvisionedProductDetails)
-> Generic ServiceCatalogProvisionedProductDetails
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:
--
-- '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.
--
-- 'provisionedProductId', 'serviceCatalogProvisionedProductDetails_provisionedProductId' - The ID of the provisioned product.
newServiceCatalogProvisionedProductDetails ::
  ServiceCatalogProvisionedProductDetails
newServiceCatalogProvisionedProductDetails :: ServiceCatalogProvisionedProductDetails
newServiceCatalogProvisionedProductDetails =
  ServiceCatalogProvisionedProductDetails' :: Maybe Text -> Maybe Text -> ServiceCatalogProvisionedProductDetails
ServiceCatalogProvisionedProductDetails'
    { $sel:provisionedProductStatusMessage:ServiceCatalogProvisionedProductDetails' :: Maybe Text
provisionedProductStatusMessage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProductId:ServiceCatalogProvisionedProductDetails' :: Maybe Text
provisionedProductId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ServiceCatalogProvisionedProductDetails
-> f ServiceCatalogProvisionedProductDetails
serviceCatalogProvisionedProductDetails_provisionedProductStatusMessage = (ServiceCatalogProvisionedProductDetails -> Maybe Text)
-> (ServiceCatalogProvisionedProductDetails
    -> Maybe Text -> ServiceCatalogProvisionedProductDetails)
-> Lens
     ServiceCatalogProvisionedProductDetails
     ServiceCatalogProvisionedProductDetails
     (Maybe Text)
     (Maybe Text)
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)

-- | The ID of the provisioned product.
serviceCatalogProvisionedProductDetails_provisionedProductId :: Lens.Lens' ServiceCatalogProvisionedProductDetails (Prelude.Maybe Prelude.Text)
serviceCatalogProvisionedProductDetails_provisionedProductId :: (Maybe Text -> f (Maybe Text))
-> ServiceCatalogProvisionedProductDetails
-> f ServiceCatalogProvisionedProductDetails
serviceCatalogProvisionedProductDetails_provisionedProductId = (ServiceCatalogProvisionedProductDetails -> Maybe Text)
-> (ServiceCatalogProvisionedProductDetails
    -> Maybe Text -> ServiceCatalogProvisionedProductDetails)
-> Lens
     ServiceCatalogProvisionedProductDetails
     ServiceCatalogProvisionedProductDetails
     (Maybe Text)
     (Maybe Text)
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)

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

instance
  Prelude.Hashable
    ServiceCatalogProvisionedProductDetails

instance
  Prelude.NFData
    ServiceCatalogProvisionedProductDetails