{-# 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.OfflineStoreStatus
-- 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.OfflineStoreStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.OfflineStoreStatusValue

-- | The status of @OfflineStore@.
--
-- /See:/ 'newOfflineStoreStatus' smart constructor.
data OfflineStoreStatus = OfflineStoreStatus'
  { -- | The justification for why the OfflineStoreStatus is Blocked (if
    -- applicable).
    OfflineStoreStatus -> Maybe Text
blockedReason :: Prelude.Maybe Prelude.Text,
    -- | An @OfflineStore@ status.
    OfflineStoreStatus -> OfflineStoreStatusValue
status :: OfflineStoreStatusValue
  }
  deriving (OfflineStoreStatus -> OfflineStoreStatus -> Bool
(OfflineStoreStatus -> OfflineStoreStatus -> Bool)
-> (OfflineStoreStatus -> OfflineStoreStatus -> Bool)
-> Eq OfflineStoreStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OfflineStoreStatus -> OfflineStoreStatus -> Bool
$c/= :: OfflineStoreStatus -> OfflineStoreStatus -> Bool
== :: OfflineStoreStatus -> OfflineStoreStatus -> Bool
$c== :: OfflineStoreStatus -> OfflineStoreStatus -> Bool
Prelude.Eq, ReadPrec [OfflineStoreStatus]
ReadPrec OfflineStoreStatus
Int -> ReadS OfflineStoreStatus
ReadS [OfflineStoreStatus]
(Int -> ReadS OfflineStoreStatus)
-> ReadS [OfflineStoreStatus]
-> ReadPrec OfflineStoreStatus
-> ReadPrec [OfflineStoreStatus]
-> Read OfflineStoreStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OfflineStoreStatus]
$creadListPrec :: ReadPrec [OfflineStoreStatus]
readPrec :: ReadPrec OfflineStoreStatus
$creadPrec :: ReadPrec OfflineStoreStatus
readList :: ReadS [OfflineStoreStatus]
$creadList :: ReadS [OfflineStoreStatus]
readsPrec :: Int -> ReadS OfflineStoreStatus
$creadsPrec :: Int -> ReadS OfflineStoreStatus
Prelude.Read, Int -> OfflineStoreStatus -> ShowS
[OfflineStoreStatus] -> ShowS
OfflineStoreStatus -> String
(Int -> OfflineStoreStatus -> ShowS)
-> (OfflineStoreStatus -> String)
-> ([OfflineStoreStatus] -> ShowS)
-> Show OfflineStoreStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OfflineStoreStatus] -> ShowS
$cshowList :: [OfflineStoreStatus] -> ShowS
show :: OfflineStoreStatus -> String
$cshow :: OfflineStoreStatus -> String
showsPrec :: Int -> OfflineStoreStatus -> ShowS
$cshowsPrec :: Int -> OfflineStoreStatus -> ShowS
Prelude.Show, (forall x. OfflineStoreStatus -> Rep OfflineStoreStatus x)
-> (forall x. Rep OfflineStoreStatus x -> OfflineStoreStatus)
-> Generic OfflineStoreStatus
forall x. Rep OfflineStoreStatus x -> OfflineStoreStatus
forall x. OfflineStoreStatus -> Rep OfflineStoreStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OfflineStoreStatus x -> OfflineStoreStatus
$cfrom :: forall x. OfflineStoreStatus -> Rep OfflineStoreStatus x
Prelude.Generic)

-- |
-- Create a value of 'OfflineStoreStatus' 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:
--
-- 'blockedReason', 'offlineStoreStatus_blockedReason' - The justification for why the OfflineStoreStatus is Blocked (if
-- applicable).
--
-- 'status', 'offlineStoreStatus_status' - An @OfflineStore@ status.
newOfflineStoreStatus ::
  -- | 'status'
  OfflineStoreStatusValue ->
  OfflineStoreStatus
newOfflineStoreStatus :: OfflineStoreStatusValue -> OfflineStoreStatus
newOfflineStoreStatus OfflineStoreStatusValue
pStatus_ =
  OfflineStoreStatus' :: Maybe Text -> OfflineStoreStatusValue -> OfflineStoreStatus
OfflineStoreStatus'
    { $sel:blockedReason:OfflineStoreStatus' :: Maybe Text
blockedReason =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:OfflineStoreStatus' :: OfflineStoreStatusValue
status = OfflineStoreStatusValue
pStatus_
    }

-- | The justification for why the OfflineStoreStatus is Blocked (if
-- applicable).
offlineStoreStatus_blockedReason :: Lens.Lens' OfflineStoreStatus (Prelude.Maybe Prelude.Text)
offlineStoreStatus_blockedReason :: (Maybe Text -> f (Maybe Text))
-> OfflineStoreStatus -> f OfflineStoreStatus
offlineStoreStatus_blockedReason = (OfflineStoreStatus -> Maybe Text)
-> (OfflineStoreStatus -> Maybe Text -> OfflineStoreStatus)
-> Lens
     OfflineStoreStatus OfflineStoreStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfflineStoreStatus' {Maybe Text
blockedReason :: Maybe Text
$sel:blockedReason:OfflineStoreStatus' :: OfflineStoreStatus -> Maybe Text
blockedReason} -> Maybe Text
blockedReason) (\s :: OfflineStoreStatus
s@OfflineStoreStatus' {} Maybe Text
a -> OfflineStoreStatus
s {$sel:blockedReason:OfflineStoreStatus' :: Maybe Text
blockedReason = Maybe Text
a} :: OfflineStoreStatus)

-- | An @OfflineStore@ status.
offlineStoreStatus_status :: Lens.Lens' OfflineStoreStatus OfflineStoreStatusValue
offlineStoreStatus_status :: (OfflineStoreStatusValue -> f OfflineStoreStatusValue)
-> OfflineStoreStatus -> f OfflineStoreStatus
offlineStoreStatus_status = (OfflineStoreStatus -> OfflineStoreStatusValue)
-> (OfflineStoreStatus
    -> OfflineStoreStatusValue -> OfflineStoreStatus)
-> Lens
     OfflineStoreStatus
     OfflineStoreStatus
     OfflineStoreStatusValue
     OfflineStoreStatusValue
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfflineStoreStatus' {OfflineStoreStatusValue
status :: OfflineStoreStatusValue
$sel:status:OfflineStoreStatus' :: OfflineStoreStatus -> OfflineStoreStatusValue
status} -> OfflineStoreStatusValue
status) (\s :: OfflineStoreStatus
s@OfflineStoreStatus' {} OfflineStoreStatusValue
a -> OfflineStoreStatus
s {$sel:status:OfflineStoreStatus' :: OfflineStoreStatusValue
status = OfflineStoreStatusValue
a} :: OfflineStoreStatus)

instance Core.FromJSON OfflineStoreStatus where
  parseJSON :: Value -> Parser OfflineStoreStatus
parseJSON =
    String
-> (Object -> Parser OfflineStoreStatus)
-> Value
-> Parser OfflineStoreStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OfflineStoreStatus"
      ( \Object
x ->
          Maybe Text -> OfflineStoreStatusValue -> OfflineStoreStatus
OfflineStoreStatus'
            (Maybe Text -> OfflineStoreStatusValue -> OfflineStoreStatus)
-> Parser (Maybe Text)
-> Parser (OfflineStoreStatusValue -> OfflineStoreStatus)
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
"BlockedReason")
            Parser (OfflineStoreStatusValue -> OfflineStoreStatus)
-> Parser OfflineStoreStatusValue -> Parser OfflineStoreStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser OfflineStoreStatusValue
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Status")
      )

instance Prelude.Hashable OfflineStoreStatus

instance Prelude.NFData OfflineStoreStatus