{-# 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.MediaStore.Types.Container where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaStore.Types.ContainerStatus
import qualified Amazonka.Prelude as Prelude
data Container = Container'
{
Container -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Container -> Maybe ContainerStatus
status :: Prelude.Maybe ContainerStatus,
Container -> Maybe Bool
accessLoggingEnabled :: Prelude.Maybe Prelude.Bool,
Container -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Container -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Container -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text
}
deriving (Container -> Container -> Bool
(Container -> Container -> Bool)
-> (Container -> Container -> Bool) -> Eq Container
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Container -> Container -> Bool
$c/= :: Container -> Container -> Bool
== :: Container -> Container -> Bool
$c== :: Container -> Container -> Bool
Prelude.Eq, ReadPrec [Container]
ReadPrec Container
Int -> ReadS Container
ReadS [Container]
(Int -> ReadS Container)
-> ReadS [Container]
-> ReadPrec Container
-> ReadPrec [Container]
-> Read Container
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Container]
$creadListPrec :: ReadPrec [Container]
readPrec :: ReadPrec Container
$creadPrec :: ReadPrec Container
readList :: ReadS [Container]
$creadList :: ReadS [Container]
readsPrec :: Int -> ReadS Container
$creadsPrec :: Int -> ReadS Container
Prelude.Read, Int -> Container -> ShowS
[Container] -> ShowS
Container -> String
(Int -> Container -> ShowS)
-> (Container -> String)
-> ([Container] -> ShowS)
-> Show Container
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Container] -> ShowS
$cshowList :: [Container] -> ShowS
show :: Container -> String
$cshow :: Container -> String
showsPrec :: Int -> Container -> ShowS
$cshowsPrec :: Int -> Container -> ShowS
Prelude.Show, (forall x. Container -> Rep Container x)
-> (forall x. Rep Container x -> Container) -> Generic Container
forall x. Rep Container x -> Container
forall x. Container -> Rep Container x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Container x -> Container
$cfrom :: forall x. Container -> Rep Container x
Prelude.Generic)
newContainer ::
Container
newContainer :: Container
newContainer =
Container' :: Maybe POSIX
-> Maybe ContainerStatus
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Container
Container'
{ $sel:creationTime:Container' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:status:Container' :: Maybe ContainerStatus
status = Maybe ContainerStatus
forall a. Maybe a
Prelude.Nothing,
$sel:accessLoggingEnabled:Container' :: Maybe Bool
accessLoggingEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Container' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Container' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoint:Container' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
container_creationTime :: Lens.Lens' Container (Prelude.Maybe Prelude.UTCTime)
container_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Container -> f Container
container_creationTime = (Container -> Maybe POSIX)
-> (Container -> Maybe POSIX -> Container)
-> Lens Container Container (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Container' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Container' :: Container -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Container
s@Container' {} Maybe POSIX
a -> Container
s {$sel:creationTime:Container' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Container) ((Maybe POSIX -> f (Maybe POSIX)) -> Container -> f Container)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Container
-> f Container
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
container_status :: Lens.Lens' Container (Prelude.Maybe ContainerStatus)
container_status :: (Maybe ContainerStatus -> f (Maybe ContainerStatus))
-> Container -> f Container
container_status = (Container -> Maybe ContainerStatus)
-> (Container -> Maybe ContainerStatus -> Container)
-> Lens
Container Container (Maybe ContainerStatus) (Maybe ContainerStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Container' {Maybe ContainerStatus
status :: Maybe ContainerStatus
$sel:status:Container' :: Container -> Maybe ContainerStatus
status} -> Maybe ContainerStatus
status) (\s :: Container
s@Container' {} Maybe ContainerStatus
a -> Container
s {$sel:status:Container' :: Maybe ContainerStatus
status = Maybe ContainerStatus
a} :: Container)
container_accessLoggingEnabled :: Lens.Lens' Container (Prelude.Maybe Prelude.Bool)
container_accessLoggingEnabled :: (Maybe Bool -> f (Maybe Bool)) -> Container -> f Container
container_accessLoggingEnabled = (Container -> Maybe Bool)
-> (Container -> Maybe Bool -> Container)
-> Lens Container Container (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Container' {Maybe Bool
accessLoggingEnabled :: Maybe Bool
$sel:accessLoggingEnabled:Container' :: Container -> Maybe Bool
accessLoggingEnabled} -> Maybe Bool
accessLoggingEnabled) (\s :: Container
s@Container' {} Maybe Bool
a -> Container
s {$sel:accessLoggingEnabled:Container' :: Maybe Bool
accessLoggingEnabled = Maybe Bool
a} :: Container)
container_arn :: Lens.Lens' Container (Prelude.Maybe Prelude.Text)
container_arn :: (Maybe Text -> f (Maybe Text)) -> Container -> f Container
container_arn = (Container -> Maybe Text)
-> (Container -> Maybe Text -> Container)
-> Lens Container Container (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Container' {Maybe Text
arn :: Maybe Text
$sel:arn:Container' :: Container -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Container
s@Container' {} Maybe Text
a -> Container
s {$sel:arn:Container' :: Maybe Text
arn = Maybe Text
a} :: Container)
container_name :: Lens.Lens' Container (Prelude.Maybe Prelude.Text)
container_name :: (Maybe Text -> f (Maybe Text)) -> Container -> f Container
container_name = (Container -> Maybe Text)
-> (Container -> Maybe Text -> Container)
-> Lens Container Container (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Container' {Maybe Text
name :: Maybe Text
$sel:name:Container' :: Container -> Maybe Text
name} -> Maybe Text
name) (\s :: Container
s@Container' {} Maybe Text
a -> Container
s {$sel:name:Container' :: Maybe Text
name = Maybe Text
a} :: Container)
container_endpoint :: Lens.Lens' Container (Prelude.Maybe Prelude.Text)
container_endpoint :: (Maybe Text -> f (Maybe Text)) -> Container -> f Container
container_endpoint = (Container -> Maybe Text)
-> (Container -> Maybe Text -> Container)
-> Lens Container Container (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Container' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:Container' :: Container -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: Container
s@Container' {} Maybe Text
a -> Container
s {$sel:endpoint:Container' :: Maybe Text
endpoint = Maybe Text
a} :: Container)
instance Core.FromJSON Container where
parseJSON :: Value -> Parser Container
parseJSON =
String -> (Object -> Parser Container) -> Value -> Parser Container
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Container"
( \Object
x ->
Maybe POSIX
-> Maybe ContainerStatus
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Container
Container'
(Maybe POSIX
-> Maybe ContainerStatus
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Container)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ContainerStatus
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Container)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
Parser
(Maybe ContainerStatus
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Container)
-> Parser (Maybe ContainerStatus)
-> Parser
(Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Container)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContainerStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Container)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Container)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AccessLoggingEnabled")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Container)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Container)
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
"ARN")
Parser (Maybe Text -> Maybe Text -> Container)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Container)
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
"Name")
Parser (Maybe Text -> Container)
-> Parser (Maybe Text) -> Parser Container
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
"Endpoint")
)
instance Prelude.Hashable Container
instance Prelude.NFData Container