{-# 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 #-}
module Amazonka.SSMSAP.Types.Database 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
import Amazonka.SSMSAP.Types.ApplicationCredential
import Amazonka.SSMSAP.Types.DatabaseStatus
import Amazonka.SSMSAP.Types.DatabaseType
data Database = Database'
{ Database -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
Database -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Database -> Maybe Text
componentId :: Prelude.Maybe Prelude.Text,
Database -> Maybe (NonEmpty ApplicationCredential)
credentials :: Prelude.Maybe (Prelude.NonEmpty ApplicationCredential),
Database -> Maybe Text
databaseId :: Prelude.Maybe Prelude.Text,
Database -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
Database -> Maybe DatabaseType
databaseType :: Prelude.Maybe DatabaseType,
Database -> Maybe POSIX
lastUpdated :: Prelude.Maybe Data.POSIX,
Database -> Maybe Text
primaryHost :: Prelude.Maybe Prelude.Text,
Database -> Maybe Int
sQLPort :: Prelude.Maybe Prelude.Int,
Database -> Maybe DatabaseStatus
status :: Prelude.Maybe DatabaseStatus
}
deriving (Database -> Database -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Database -> Database -> Bool
$c/= :: Database -> Database -> Bool
== :: Database -> Database -> Bool
$c== :: Database -> Database -> Bool
Prelude.Eq, Int -> Database -> ShowS
[Database] -> ShowS
Database -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Database] -> ShowS
$cshowList :: [Database] -> ShowS
show :: Database -> String
$cshow :: Database -> String
showsPrec :: Int -> Database -> ShowS
$cshowsPrec :: Int -> Database -> ShowS
Prelude.Show, forall x. Rep Database x -> Database
forall x. Database -> Rep Database x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Database x -> Database
$cfrom :: forall x. Database -> Rep Database x
Prelude.Generic)
newDatabase ::
Database
newDatabase :: Database
newDatabase =
Database'
{ $sel:applicationId:Database' :: Maybe Text
applicationId = forall a. Maybe a
Prelude.Nothing,
$sel:arn:Database' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:componentId:Database' :: Maybe Text
componentId = forall a. Maybe a
Prelude.Nothing,
$sel:credentials:Database' :: Maybe (NonEmpty ApplicationCredential)
credentials = forall a. Maybe a
Prelude.Nothing,
$sel:databaseId:Database' :: Maybe Text
databaseId = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:Database' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
$sel:databaseType:Database' :: Maybe DatabaseType
databaseType = forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdated:Database' :: Maybe POSIX
lastUpdated = forall a. Maybe a
Prelude.Nothing,
$sel:primaryHost:Database' :: Maybe Text
primaryHost = forall a. Maybe a
Prelude.Nothing,
$sel:sQLPort:Database' :: Maybe Int
sQLPort = forall a. Maybe a
Prelude.Nothing,
$sel:status:Database' :: Maybe DatabaseStatus
status = forall a. Maybe a
Prelude.Nothing
}
database_applicationId :: Lens.Lens' Database (Prelude.Maybe Prelude.Text)
database_applicationId :: Lens' Database (Maybe Text)
database_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Text
applicationId :: Maybe Text
$sel:applicationId:Database' :: Database -> Maybe Text
applicationId} -> Maybe Text
applicationId) (\s :: Database
s@Database' {} Maybe Text
a -> Database
s {$sel:applicationId:Database' :: Maybe Text
applicationId = Maybe Text
a} :: Database)
database_arn :: Lens.Lens' Database (Prelude.Maybe Prelude.Text)
database_arn :: Lens' Database (Maybe Text)
database_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Text
arn :: Maybe Text
$sel:arn:Database' :: Database -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Database
s@Database' {} Maybe Text
a -> Database
s {$sel:arn:Database' :: Maybe Text
arn = Maybe Text
a} :: Database)
database_componentId :: Lens.Lens' Database (Prelude.Maybe Prelude.Text)
database_componentId :: Lens' Database (Maybe Text)
database_componentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Text
componentId :: Maybe Text
$sel:componentId:Database' :: Database -> Maybe Text
componentId} -> Maybe Text
componentId) (\s :: Database
s@Database' {} Maybe Text
a -> Database
s {$sel:componentId:Database' :: Maybe Text
componentId = Maybe Text
a} :: Database)
database_credentials :: Lens.Lens' Database (Prelude.Maybe (Prelude.NonEmpty ApplicationCredential))
database_credentials :: Lens' Database (Maybe (NonEmpty ApplicationCredential))
database_credentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe (NonEmpty ApplicationCredential)
credentials :: Maybe (NonEmpty ApplicationCredential)
$sel:credentials:Database' :: Database -> Maybe (NonEmpty ApplicationCredential)
credentials} -> Maybe (NonEmpty ApplicationCredential)
credentials) (\s :: Database
s@Database' {} Maybe (NonEmpty ApplicationCredential)
a -> Database
s {$sel:credentials:Database' :: Maybe (NonEmpty ApplicationCredential)
credentials = Maybe (NonEmpty ApplicationCredential)
a} :: Database) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
database_databaseId :: Lens.Lens' Database (Prelude.Maybe Prelude.Text)
database_databaseId :: Lens' Database (Maybe Text)
database_databaseId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Text
databaseId :: Maybe Text
$sel:databaseId:Database' :: Database -> Maybe Text
databaseId} -> Maybe Text
databaseId) (\s :: Database
s@Database' {} Maybe Text
a -> Database
s {$sel:databaseId:Database' :: Maybe Text
databaseId = Maybe Text
a} :: Database)
database_databaseName :: Lens.Lens' Database (Prelude.Maybe Prelude.Text)
database_databaseName :: Lens' Database (Maybe Text)
database_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:Database' :: Database -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: Database
s@Database' {} Maybe Text
a -> Database
s {$sel:databaseName:Database' :: Maybe Text
databaseName = Maybe Text
a} :: Database)
database_databaseType :: Lens.Lens' Database (Prelude.Maybe DatabaseType)
database_databaseType :: Lens' Database (Maybe DatabaseType)
database_databaseType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe DatabaseType
databaseType :: Maybe DatabaseType
$sel:databaseType:Database' :: Database -> Maybe DatabaseType
databaseType} -> Maybe DatabaseType
databaseType) (\s :: Database
s@Database' {} Maybe DatabaseType
a -> Database
s {$sel:databaseType:Database' :: Maybe DatabaseType
databaseType = Maybe DatabaseType
a} :: Database)
database_lastUpdated :: Lens.Lens' Database (Prelude.Maybe Prelude.UTCTime)
database_lastUpdated :: Lens' Database (Maybe UTCTime)
database_lastUpdated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe POSIX
lastUpdated :: Maybe POSIX
$sel:lastUpdated:Database' :: Database -> Maybe POSIX
lastUpdated} -> Maybe POSIX
lastUpdated) (\s :: Database
s@Database' {} Maybe POSIX
a -> Database
s {$sel:lastUpdated:Database' :: Maybe POSIX
lastUpdated = Maybe POSIX
a} :: Database) 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
database_primaryHost :: Lens.Lens' Database (Prelude.Maybe Prelude.Text)
database_primaryHost :: Lens' Database (Maybe Text)
database_primaryHost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Text
primaryHost :: Maybe Text
$sel:primaryHost:Database' :: Database -> Maybe Text
primaryHost} -> Maybe Text
primaryHost) (\s :: Database
s@Database' {} Maybe Text
a -> Database
s {$sel:primaryHost:Database' :: Maybe Text
primaryHost = Maybe Text
a} :: Database)
database_sQLPort :: Lens.Lens' Database (Prelude.Maybe Prelude.Int)
database_sQLPort :: Lens' Database (Maybe Int)
database_sQLPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe Int
sQLPort :: Maybe Int
$sel:sQLPort:Database' :: Database -> Maybe Int
sQLPort} -> Maybe Int
sQLPort) (\s :: Database
s@Database' {} Maybe Int
a -> Database
s {$sel:sQLPort:Database' :: Maybe Int
sQLPort = Maybe Int
a} :: Database)
database_status :: Lens.Lens' Database (Prelude.Maybe DatabaseStatus)
database_status :: Lens' Database (Maybe DatabaseStatus)
database_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Database' {Maybe DatabaseStatus
status :: Maybe DatabaseStatus
$sel:status:Database' :: Database -> Maybe DatabaseStatus
status} -> Maybe DatabaseStatus
status) (\s :: Database
s@Database' {} Maybe DatabaseStatus
a -> Database
s {$sel:status:Database' :: Maybe DatabaseStatus
status = Maybe DatabaseStatus
a} :: Database)
instance Data.FromJSON Database where
parseJSON :: Value -> Parser Database
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Database"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty ApplicationCredential)
-> Maybe Text
-> Maybe Text
-> Maybe DatabaseType
-> Maybe POSIX
-> Maybe Text
-> Maybe Int
-> Maybe DatabaseStatus
-> Database
Database'
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
"ApplicationId")
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
"Arn")
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
"ComponentId")
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
"Credentials")
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
"DatabaseId")
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
"DatabaseName")
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
"DatabaseType")
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
"LastUpdated")
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
"PrimaryHost")
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
"SQLPort")
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 Database where
hashWithSalt :: Int -> Database -> Int
hashWithSalt Int
_salt Database' {Maybe Int
Maybe (NonEmpty ApplicationCredential)
Maybe Text
Maybe POSIX
Maybe DatabaseStatus
Maybe DatabaseType
status :: Maybe DatabaseStatus
sQLPort :: Maybe Int
primaryHost :: Maybe Text
lastUpdated :: Maybe POSIX
databaseType :: Maybe DatabaseType
databaseName :: Maybe Text
databaseId :: Maybe Text
credentials :: Maybe (NonEmpty ApplicationCredential)
componentId :: Maybe Text
arn :: Maybe Text
applicationId :: Maybe Text
$sel:status:Database' :: Database -> Maybe DatabaseStatus
$sel:sQLPort:Database' :: Database -> Maybe Int
$sel:primaryHost:Database' :: Database -> Maybe Text
$sel:lastUpdated:Database' :: Database -> Maybe POSIX
$sel:databaseType:Database' :: Database -> Maybe DatabaseType
$sel:databaseName:Database' :: Database -> Maybe Text
$sel:databaseId:Database' :: Database -> Maybe Text
$sel:credentials:Database' :: Database -> Maybe (NonEmpty ApplicationCredential)
$sel:componentId:Database' :: Database -> Maybe Text
$sel:arn:Database' :: Database -> Maybe Text
$sel:applicationId:Database' :: Database -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
applicationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
componentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ApplicationCredential)
credentials
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatabaseType
databaseType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdated
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
primaryHost
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
sQLPort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatabaseStatus
status
instance Prelude.NFData Database where
rnf :: Database -> ()
rnf Database' {Maybe Int
Maybe (NonEmpty ApplicationCredential)
Maybe Text
Maybe POSIX
Maybe DatabaseStatus
Maybe DatabaseType
status :: Maybe DatabaseStatus
sQLPort :: Maybe Int
primaryHost :: Maybe Text
lastUpdated :: Maybe POSIX
databaseType :: Maybe DatabaseType
databaseName :: Maybe Text
databaseId :: Maybe Text
credentials :: Maybe (NonEmpty ApplicationCredential)
componentId :: Maybe Text
arn :: Maybe Text
applicationId :: Maybe Text
$sel:status:Database' :: Database -> Maybe DatabaseStatus
$sel:sQLPort:Database' :: Database -> Maybe Int
$sel:primaryHost:Database' :: Database -> Maybe Text
$sel:lastUpdated:Database' :: Database -> Maybe POSIX
$sel:databaseType:Database' :: Database -> Maybe DatabaseType
$sel:databaseName:Database' :: Database -> Maybe Text
$sel:databaseId:Database' :: Database -> Maybe Text
$sel:credentials:Database' :: Database -> Maybe (NonEmpty ApplicationCredential)
$sel:componentId:Database' :: Database -> Maybe Text
$sel:arn:Database' :: Database -> Maybe Text
$sel:applicationId:Database' :: Database -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
componentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ApplicationCredential)
credentials
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatabaseType
databaseType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdated
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
primaryHost
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
sQLPort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatabaseStatus
status