{-# 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.DMS.Types.RefreshSchemasStatus
-- 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.DMS.Types.RefreshSchemasStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types.RefreshSchemasStatusTypeValue
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides information that describes status of a schema at an endpoint
-- specified by the @DescribeRefreshSchemaStatus@ operation.
--
-- /See:/ 'newRefreshSchemasStatus' smart constructor.
data RefreshSchemasStatus = RefreshSchemasStatus'
  { -- | The Amazon Resource Name (ARN) string that uniquely identifies the
    -- endpoint.
    RefreshSchemasStatus -> Maybe Text
endpointArn :: Prelude.Maybe Prelude.Text,
    -- | The last failure message for the schema.
    RefreshSchemasStatus -> Maybe Text
lastFailureMessage :: Prelude.Maybe Prelude.Text,
    -- | The date the schema was last refreshed.
    RefreshSchemasStatus -> Maybe POSIX
lastRefreshDate :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the replication instance.
    RefreshSchemasStatus -> Maybe Text
replicationInstanceArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the schema.
    RefreshSchemasStatus -> Maybe RefreshSchemasStatusTypeValue
status :: Prelude.Maybe RefreshSchemasStatusTypeValue
  }
  deriving (RefreshSchemasStatus -> RefreshSchemasStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RefreshSchemasStatus -> RefreshSchemasStatus -> Bool
$c/= :: RefreshSchemasStatus -> RefreshSchemasStatus -> Bool
== :: RefreshSchemasStatus -> RefreshSchemasStatus -> Bool
$c== :: RefreshSchemasStatus -> RefreshSchemasStatus -> Bool
Prelude.Eq, ReadPrec [RefreshSchemasStatus]
ReadPrec RefreshSchemasStatus
Int -> ReadS RefreshSchemasStatus
ReadS [RefreshSchemasStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RefreshSchemasStatus]
$creadListPrec :: ReadPrec [RefreshSchemasStatus]
readPrec :: ReadPrec RefreshSchemasStatus
$creadPrec :: ReadPrec RefreshSchemasStatus
readList :: ReadS [RefreshSchemasStatus]
$creadList :: ReadS [RefreshSchemasStatus]
readsPrec :: Int -> ReadS RefreshSchemasStatus
$creadsPrec :: Int -> ReadS RefreshSchemasStatus
Prelude.Read, Int -> RefreshSchemasStatus -> ShowS
[RefreshSchemasStatus] -> ShowS
RefreshSchemasStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RefreshSchemasStatus] -> ShowS
$cshowList :: [RefreshSchemasStatus] -> ShowS
show :: RefreshSchemasStatus -> String
$cshow :: RefreshSchemasStatus -> String
showsPrec :: Int -> RefreshSchemasStatus -> ShowS
$cshowsPrec :: Int -> RefreshSchemasStatus -> ShowS
Prelude.Show, forall x. Rep RefreshSchemasStatus x -> RefreshSchemasStatus
forall x. RefreshSchemasStatus -> Rep RefreshSchemasStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RefreshSchemasStatus x -> RefreshSchemasStatus
$cfrom :: forall x. RefreshSchemasStatus -> Rep RefreshSchemasStatus x
Prelude.Generic)

-- |
-- Create a value of 'RefreshSchemasStatus' 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:
--
-- 'endpointArn', 'refreshSchemasStatus_endpointArn' - The Amazon Resource Name (ARN) string that uniquely identifies the
-- endpoint.
--
-- 'lastFailureMessage', 'refreshSchemasStatus_lastFailureMessage' - The last failure message for the schema.
--
-- 'lastRefreshDate', 'refreshSchemasStatus_lastRefreshDate' - The date the schema was last refreshed.
--
-- 'replicationInstanceArn', 'refreshSchemasStatus_replicationInstanceArn' - The Amazon Resource Name (ARN) of the replication instance.
--
-- 'status', 'refreshSchemasStatus_status' - The status of the schema.
newRefreshSchemasStatus ::
  RefreshSchemasStatus
newRefreshSchemasStatus :: RefreshSchemasStatus
newRefreshSchemasStatus =
  RefreshSchemasStatus'
    { $sel:endpointArn:RefreshSchemasStatus' :: Maybe Text
endpointArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastFailureMessage:RefreshSchemasStatus' :: Maybe Text
lastFailureMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:lastRefreshDate:RefreshSchemasStatus' :: Maybe POSIX
lastRefreshDate = forall a. Maybe a
Prelude.Nothing,
      $sel:replicationInstanceArn:RefreshSchemasStatus' :: Maybe Text
replicationInstanceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:RefreshSchemasStatus' :: Maybe RefreshSchemasStatusTypeValue
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) string that uniquely identifies the
-- endpoint.
refreshSchemasStatus_endpointArn :: Lens.Lens' RefreshSchemasStatus (Prelude.Maybe Prelude.Text)
refreshSchemasStatus_endpointArn :: Lens' RefreshSchemasStatus (Maybe Text)
refreshSchemasStatus_endpointArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasStatus' {Maybe Text
endpointArn :: Maybe Text
$sel:endpointArn:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
endpointArn} -> Maybe Text
endpointArn) (\s :: RefreshSchemasStatus
s@RefreshSchemasStatus' {} Maybe Text
a -> RefreshSchemasStatus
s {$sel:endpointArn:RefreshSchemasStatus' :: Maybe Text
endpointArn = Maybe Text
a} :: RefreshSchemasStatus)

-- | The last failure message for the schema.
refreshSchemasStatus_lastFailureMessage :: Lens.Lens' RefreshSchemasStatus (Prelude.Maybe Prelude.Text)
refreshSchemasStatus_lastFailureMessage :: Lens' RefreshSchemasStatus (Maybe Text)
refreshSchemasStatus_lastFailureMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasStatus' {Maybe Text
lastFailureMessage :: Maybe Text
$sel:lastFailureMessage:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
lastFailureMessage} -> Maybe Text
lastFailureMessage) (\s :: RefreshSchemasStatus
s@RefreshSchemasStatus' {} Maybe Text
a -> RefreshSchemasStatus
s {$sel:lastFailureMessage:RefreshSchemasStatus' :: Maybe Text
lastFailureMessage = Maybe Text
a} :: RefreshSchemasStatus)

-- | The date the schema was last refreshed.
refreshSchemasStatus_lastRefreshDate :: Lens.Lens' RefreshSchemasStatus (Prelude.Maybe Prelude.UTCTime)
refreshSchemasStatus_lastRefreshDate :: Lens' RefreshSchemasStatus (Maybe UTCTime)
refreshSchemasStatus_lastRefreshDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasStatus' {Maybe POSIX
lastRefreshDate :: Maybe POSIX
$sel:lastRefreshDate:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe POSIX
lastRefreshDate} -> Maybe POSIX
lastRefreshDate) (\s :: RefreshSchemasStatus
s@RefreshSchemasStatus' {} Maybe POSIX
a -> RefreshSchemasStatus
s {$sel:lastRefreshDate:RefreshSchemasStatus' :: Maybe POSIX
lastRefreshDate = Maybe POSIX
a} :: RefreshSchemasStatus) 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 Amazon Resource Name (ARN) of the replication instance.
refreshSchemasStatus_replicationInstanceArn :: Lens.Lens' RefreshSchemasStatus (Prelude.Maybe Prelude.Text)
refreshSchemasStatus_replicationInstanceArn :: Lens' RefreshSchemasStatus (Maybe Text)
refreshSchemasStatus_replicationInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasStatus' {Maybe Text
replicationInstanceArn :: Maybe Text
$sel:replicationInstanceArn:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
replicationInstanceArn} -> Maybe Text
replicationInstanceArn) (\s :: RefreshSchemasStatus
s@RefreshSchemasStatus' {} Maybe Text
a -> RefreshSchemasStatus
s {$sel:replicationInstanceArn:RefreshSchemasStatus' :: Maybe Text
replicationInstanceArn = Maybe Text
a} :: RefreshSchemasStatus)

-- | The status of the schema.
refreshSchemasStatus_status :: Lens.Lens' RefreshSchemasStatus (Prelude.Maybe RefreshSchemasStatusTypeValue)
refreshSchemasStatus_status :: Lens' RefreshSchemasStatus (Maybe RefreshSchemasStatusTypeValue)
refreshSchemasStatus_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasStatus' {Maybe RefreshSchemasStatusTypeValue
status :: Maybe RefreshSchemasStatusTypeValue
$sel:status:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe RefreshSchemasStatusTypeValue
status} -> Maybe RefreshSchemasStatusTypeValue
status) (\s :: RefreshSchemasStatus
s@RefreshSchemasStatus' {} Maybe RefreshSchemasStatusTypeValue
a -> RefreshSchemasStatus
s {$sel:status:RefreshSchemasStatus' :: Maybe RefreshSchemasStatusTypeValue
status = Maybe RefreshSchemasStatusTypeValue
a} :: RefreshSchemasStatus)

instance Data.FromJSON RefreshSchemasStatus where
  parseJSON :: Value -> Parser RefreshSchemasStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RefreshSchemasStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe RefreshSchemasStatusTypeValue
-> RefreshSchemasStatus
RefreshSchemasStatus'
            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
"EndpointArn")
            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
"LastFailureMessage")
            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
"LastRefreshDate")
            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
"ReplicationInstanceArn")
            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
"Status")
      )

instance Prelude.Hashable RefreshSchemasStatus where
  hashWithSalt :: Int -> RefreshSchemasStatus -> Int
hashWithSalt Int
_salt RefreshSchemasStatus' {Maybe Text
Maybe POSIX
Maybe RefreshSchemasStatusTypeValue
status :: Maybe RefreshSchemasStatusTypeValue
replicationInstanceArn :: Maybe Text
lastRefreshDate :: Maybe POSIX
lastFailureMessage :: Maybe Text
endpointArn :: Maybe Text
$sel:status:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe RefreshSchemasStatusTypeValue
$sel:replicationInstanceArn:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
$sel:lastRefreshDate:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe POSIX
$sel:lastFailureMessage:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
$sel:endpointArn:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastFailureMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastRefreshDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationInstanceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RefreshSchemasStatusTypeValue
status

instance Prelude.NFData RefreshSchemasStatus where
  rnf :: RefreshSchemasStatus -> ()
rnf RefreshSchemasStatus' {Maybe Text
Maybe POSIX
Maybe RefreshSchemasStatusTypeValue
status :: Maybe RefreshSchemasStatusTypeValue
replicationInstanceArn :: Maybe Text
lastRefreshDate :: Maybe POSIX
lastFailureMessage :: Maybe Text
endpointArn :: Maybe Text
$sel:status:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe RefreshSchemasStatusTypeValue
$sel:replicationInstanceArn:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
$sel:lastRefreshDate:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe POSIX
$sel:lastFailureMessage:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
$sel:endpointArn:RefreshSchemasStatus' :: RefreshSchemasStatus -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastFailureMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastRefreshDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationInstanceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RefreshSchemasStatusTypeValue
status