{-# 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.MediaTailor.Types.SourceLocation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaTailor.Types.AccessConfiguration
import Amazonka.MediaTailor.Types.DefaultSegmentDeliveryConfiguration
import Amazonka.MediaTailor.Types.HttpConfiguration
import qualified Amazonka.Prelude as Prelude
data SourceLocation = SourceLocation'
{
SourceLocation -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
SourceLocation -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
SourceLocation -> Maybe AccessConfiguration
accessConfiguration :: Prelude.Maybe AccessConfiguration,
SourceLocation -> Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration :: Prelude.Maybe DefaultSegmentDeliveryConfiguration,
SourceLocation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SourceLocation -> Text
sourceLocationName :: Prelude.Text,
SourceLocation -> HttpConfiguration
httpConfiguration :: HttpConfiguration,
SourceLocation -> Text
arn :: Prelude.Text
}
deriving (SourceLocation -> SourceLocation -> Bool
(SourceLocation -> SourceLocation -> Bool)
-> (SourceLocation -> SourceLocation -> Bool) -> Eq SourceLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceLocation -> SourceLocation -> Bool
$c/= :: SourceLocation -> SourceLocation -> Bool
== :: SourceLocation -> SourceLocation -> Bool
$c== :: SourceLocation -> SourceLocation -> Bool
Prelude.Eq, ReadPrec [SourceLocation]
ReadPrec SourceLocation
Int -> ReadS SourceLocation
ReadS [SourceLocation]
(Int -> ReadS SourceLocation)
-> ReadS [SourceLocation]
-> ReadPrec SourceLocation
-> ReadPrec [SourceLocation]
-> Read SourceLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceLocation]
$creadListPrec :: ReadPrec [SourceLocation]
readPrec :: ReadPrec SourceLocation
$creadPrec :: ReadPrec SourceLocation
readList :: ReadS [SourceLocation]
$creadList :: ReadS [SourceLocation]
readsPrec :: Int -> ReadS SourceLocation
$creadsPrec :: Int -> ReadS SourceLocation
Prelude.Read, Int -> SourceLocation -> ShowS
[SourceLocation] -> ShowS
SourceLocation -> String
(Int -> SourceLocation -> ShowS)
-> (SourceLocation -> String)
-> ([SourceLocation] -> ShowS)
-> Show SourceLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceLocation] -> ShowS
$cshowList :: [SourceLocation] -> ShowS
show :: SourceLocation -> String
$cshow :: SourceLocation -> String
showsPrec :: Int -> SourceLocation -> ShowS
$cshowsPrec :: Int -> SourceLocation -> ShowS
Prelude.Show, (forall x. SourceLocation -> Rep SourceLocation x)
-> (forall x. Rep SourceLocation x -> SourceLocation)
-> Generic SourceLocation
forall x. Rep SourceLocation x -> SourceLocation
forall x. SourceLocation -> Rep SourceLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceLocation x -> SourceLocation
$cfrom :: forall x. SourceLocation -> Rep SourceLocation x
Prelude.Generic)
newSourceLocation ::
Prelude.Text ->
HttpConfiguration ->
Prelude.Text ->
SourceLocation
newSourceLocation :: Text -> HttpConfiguration -> Text -> SourceLocation
newSourceLocation
Text
pSourceLocationName_
HttpConfiguration
pHttpConfiguration_
Text
pArn_ =
SourceLocation' :: Maybe POSIX
-> Maybe POSIX
-> Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation
SourceLocation'
{ $sel:creationTime:SourceLocation' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:SourceLocation' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:accessConfiguration:SourceLocation' :: Maybe AccessConfiguration
accessConfiguration = Maybe AccessConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:defaultSegmentDeliveryConfiguration:SourceLocation' :: Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration =
Maybe DefaultSegmentDeliveryConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:tags:SourceLocation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:sourceLocationName:SourceLocation' :: Text
sourceLocationName = Text
pSourceLocationName_,
$sel:httpConfiguration:SourceLocation' :: HttpConfiguration
httpConfiguration = HttpConfiguration
pHttpConfiguration_,
$sel:arn:SourceLocation' :: Text
arn = Text
pArn_
}
sourceLocation_creationTime :: Lens.Lens' SourceLocation (Prelude.Maybe Prelude.UTCTime)
sourceLocation_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SourceLocation -> f SourceLocation
sourceLocation_creationTime = (SourceLocation -> Maybe POSIX)
-> (SourceLocation -> Maybe POSIX -> SourceLocation)
-> Lens SourceLocation SourceLocation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:SourceLocation' :: SourceLocation -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: SourceLocation
s@SourceLocation' {} Maybe POSIX
a -> SourceLocation
s {$sel:creationTime:SourceLocation' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: SourceLocation) ((Maybe POSIX -> f (Maybe POSIX))
-> SourceLocation -> f SourceLocation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SourceLocation
-> f SourceLocation
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
sourceLocation_lastModifiedTime :: Lens.Lens' SourceLocation (Prelude.Maybe Prelude.UTCTime)
sourceLocation_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SourceLocation -> f SourceLocation
sourceLocation_lastModifiedTime = (SourceLocation -> Maybe POSIX)
-> (SourceLocation -> Maybe POSIX -> SourceLocation)
-> Lens SourceLocation SourceLocation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:SourceLocation' :: SourceLocation -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: SourceLocation
s@SourceLocation' {} Maybe POSIX
a -> SourceLocation
s {$sel:lastModifiedTime:SourceLocation' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: SourceLocation) ((Maybe POSIX -> f (Maybe POSIX))
-> SourceLocation -> f SourceLocation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SourceLocation
-> f SourceLocation
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
sourceLocation_accessConfiguration :: Lens.Lens' SourceLocation (Prelude.Maybe AccessConfiguration)
sourceLocation_accessConfiguration :: (Maybe AccessConfiguration -> f (Maybe AccessConfiguration))
-> SourceLocation -> f SourceLocation
sourceLocation_accessConfiguration = (SourceLocation -> Maybe AccessConfiguration)
-> (SourceLocation -> Maybe AccessConfiguration -> SourceLocation)
-> Lens
SourceLocation
SourceLocation
(Maybe AccessConfiguration)
(Maybe AccessConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Maybe AccessConfiguration
accessConfiguration :: Maybe AccessConfiguration
$sel:accessConfiguration:SourceLocation' :: SourceLocation -> Maybe AccessConfiguration
accessConfiguration} -> Maybe AccessConfiguration
accessConfiguration) (\s :: SourceLocation
s@SourceLocation' {} Maybe AccessConfiguration
a -> SourceLocation
s {$sel:accessConfiguration:SourceLocation' :: Maybe AccessConfiguration
accessConfiguration = Maybe AccessConfiguration
a} :: SourceLocation)
sourceLocation_defaultSegmentDeliveryConfiguration :: Lens.Lens' SourceLocation (Prelude.Maybe DefaultSegmentDeliveryConfiguration)
sourceLocation_defaultSegmentDeliveryConfiguration :: (Maybe DefaultSegmentDeliveryConfiguration
-> f (Maybe DefaultSegmentDeliveryConfiguration))
-> SourceLocation -> f SourceLocation
sourceLocation_defaultSegmentDeliveryConfiguration = (SourceLocation -> Maybe DefaultSegmentDeliveryConfiguration)
-> (SourceLocation
-> Maybe DefaultSegmentDeliveryConfiguration -> SourceLocation)
-> Lens
SourceLocation
SourceLocation
(Maybe DefaultSegmentDeliveryConfiguration)
(Maybe DefaultSegmentDeliveryConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration :: Maybe DefaultSegmentDeliveryConfiguration
$sel:defaultSegmentDeliveryConfiguration:SourceLocation' :: SourceLocation -> Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration} -> Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration) (\s :: SourceLocation
s@SourceLocation' {} Maybe DefaultSegmentDeliveryConfiguration
a -> SourceLocation
s {$sel:defaultSegmentDeliveryConfiguration:SourceLocation' :: Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration = Maybe DefaultSegmentDeliveryConfiguration
a} :: SourceLocation)
sourceLocation_tags :: Lens.Lens' SourceLocation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sourceLocation_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SourceLocation -> f SourceLocation
sourceLocation_tags = (SourceLocation -> Maybe (HashMap Text Text))
-> (SourceLocation -> Maybe (HashMap Text Text) -> SourceLocation)
-> Lens
SourceLocation
SourceLocation
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SourceLocation' :: SourceLocation -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SourceLocation
s@SourceLocation' {} Maybe (HashMap Text Text)
a -> SourceLocation
s {$sel:tags:SourceLocation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SourceLocation) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SourceLocation -> f SourceLocation)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SourceLocation
-> f SourceLocation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sourceLocation_sourceLocationName :: Lens.Lens' SourceLocation Prelude.Text
sourceLocation_sourceLocationName :: (Text -> f Text) -> SourceLocation -> f SourceLocation
sourceLocation_sourceLocationName = (SourceLocation -> Text)
-> (SourceLocation -> Text -> SourceLocation)
-> Lens SourceLocation SourceLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Text
sourceLocationName :: Text
$sel:sourceLocationName:SourceLocation' :: SourceLocation -> Text
sourceLocationName} -> Text
sourceLocationName) (\s :: SourceLocation
s@SourceLocation' {} Text
a -> SourceLocation
s {$sel:sourceLocationName:SourceLocation' :: Text
sourceLocationName = Text
a} :: SourceLocation)
sourceLocation_httpConfiguration :: Lens.Lens' SourceLocation HttpConfiguration
sourceLocation_httpConfiguration :: (HttpConfiguration -> f HttpConfiguration)
-> SourceLocation -> f SourceLocation
sourceLocation_httpConfiguration = (SourceLocation -> HttpConfiguration)
-> (SourceLocation -> HttpConfiguration -> SourceLocation)
-> Lens
SourceLocation SourceLocation HttpConfiguration HttpConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {HttpConfiguration
httpConfiguration :: HttpConfiguration
$sel:httpConfiguration:SourceLocation' :: SourceLocation -> HttpConfiguration
httpConfiguration} -> HttpConfiguration
httpConfiguration) (\s :: SourceLocation
s@SourceLocation' {} HttpConfiguration
a -> SourceLocation
s {$sel:httpConfiguration:SourceLocation' :: HttpConfiguration
httpConfiguration = HttpConfiguration
a} :: SourceLocation)
sourceLocation_arn :: Lens.Lens' SourceLocation Prelude.Text
sourceLocation_arn :: (Text -> f Text) -> SourceLocation -> f SourceLocation
sourceLocation_arn = (SourceLocation -> Text)
-> (SourceLocation -> Text -> SourceLocation)
-> Lens SourceLocation SourceLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Text
arn :: Text
$sel:arn:SourceLocation' :: SourceLocation -> Text
arn} -> Text
arn) (\s :: SourceLocation
s@SourceLocation' {} Text
a -> SourceLocation
s {$sel:arn:SourceLocation' :: Text
arn = Text
a} :: SourceLocation)
instance Core.FromJSON SourceLocation where
parseJSON :: Value -> Parser SourceLocation
parseJSON =
String
-> (Object -> Parser SourceLocation)
-> Value
-> Parser SourceLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceLocation"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation
SourceLocation'
(Maybe POSIX
-> Maybe POSIX
-> Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
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 POSIX
-> Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
-> Parser (Maybe POSIX)
-> Parser
(Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
forall (f :: * -> *) a b. Applicative f => 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
"LastModifiedTime")
Parser
(Maybe AccessConfiguration
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
-> Parser (Maybe AccessConfiguration)
-> Parser
(Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AccessConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AccessConfiguration")
Parser
(Maybe DefaultSegmentDeliveryConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation)
-> Parser (Maybe DefaultSegmentDeliveryConfiguration)
-> Parser
(Maybe (HashMap Text Text)
-> Text -> HttpConfiguration -> Text -> SourceLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe DefaultSegmentDeliveryConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefaultSegmentDeliveryConfiguration")
Parser
(Maybe (HashMap Text Text)
-> Text -> HttpConfiguration -> Text -> SourceLocation)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> HttpConfiguration -> Text -> SourceLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> HttpConfiguration -> Text -> SourceLocation)
-> Parser Text
-> Parser (HttpConfiguration -> Text -> SourceLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceLocationName")
Parser (HttpConfiguration -> Text -> SourceLocation)
-> Parser HttpConfiguration -> Parser (Text -> SourceLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser HttpConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"HttpConfiguration")
Parser (Text -> SourceLocation)
-> Parser Text -> Parser SourceLocation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
)
instance Prelude.Hashable SourceLocation
instance Prelude.NFData SourceLocation