{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaTailor.Types.AccessConfiguration
import Amazonka.MediaTailor.Types.DefaultSegmentDeliveryConfiguration
import Amazonka.MediaTailor.Types.HttpConfiguration
import Amazonka.MediaTailor.Types.SegmentDeliveryConfiguration
import qualified Amazonka.Prelude as Prelude
data SourceLocation = SourceLocation'
{
SourceLocation -> Maybe AccessConfiguration
accessConfiguration :: Prelude.Maybe AccessConfiguration,
SourceLocation -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
SourceLocation -> Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration :: Prelude.Maybe DefaultSegmentDeliveryConfiguration,
SourceLocation -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
SourceLocation -> Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations :: Prelude.Maybe [SegmentDeliveryConfiguration],
SourceLocation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SourceLocation -> Text
arn :: Prelude.Text,
SourceLocation -> HttpConfiguration
httpConfiguration :: HttpConfiguration,
SourceLocation -> Text
sourceLocationName :: Prelude.Text
}
deriving (SourceLocation -> SourceLocation -> Bool
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]
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
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. 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
pArn_
HttpConfiguration
pHttpConfiguration_
Text
pSourceLocationName_ =
SourceLocation'
{ $sel:accessConfiguration:SourceLocation' :: Maybe AccessConfiguration
accessConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:SourceLocation' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:defaultSegmentDeliveryConfiguration:SourceLocation' :: Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:SourceLocation' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
$sel:segmentDeliveryConfigurations:SourceLocation' :: Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations = forall a. Maybe a
Prelude.Nothing,
$sel:tags:SourceLocation' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:arn:SourceLocation' :: Text
arn = Text
pArn_,
$sel:httpConfiguration:SourceLocation' :: HttpConfiguration
httpConfiguration = HttpConfiguration
pHttpConfiguration_,
$sel:sourceLocationName:SourceLocation' :: Text
sourceLocationName = Text
pSourceLocationName_
}
sourceLocation_accessConfiguration :: Lens.Lens' SourceLocation (Prelude.Maybe AccessConfiguration)
sourceLocation_accessConfiguration :: Lens' SourceLocation (Maybe AccessConfiguration)
sourceLocation_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_creationTime :: Lens.Lens' SourceLocation (Prelude.Maybe Prelude.UTCTime)
sourceLocation_creationTime :: Lens' SourceLocation (Maybe UTCTime)
sourceLocation_creationTime = 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) 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
sourceLocation_defaultSegmentDeliveryConfiguration :: Lens.Lens' SourceLocation (Prelude.Maybe DefaultSegmentDeliveryConfiguration)
sourceLocation_defaultSegmentDeliveryConfiguration :: Lens' SourceLocation (Maybe DefaultSegmentDeliveryConfiguration)
sourceLocation_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_lastModifiedTime :: Lens.Lens' SourceLocation (Prelude.Maybe Prelude.UTCTime)
sourceLocation_lastModifiedTime :: Lens' SourceLocation (Maybe UTCTime)
sourceLocation_lastModifiedTime = 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) 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
sourceLocation_segmentDeliveryConfigurations :: Lens.Lens' SourceLocation (Prelude.Maybe [SegmentDeliveryConfiguration])
sourceLocation_segmentDeliveryConfigurations :: Lens' SourceLocation (Maybe [SegmentDeliveryConfiguration])
sourceLocation_segmentDeliveryConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceLocation' {Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations :: Maybe [SegmentDeliveryConfiguration]
$sel:segmentDeliveryConfigurations:SourceLocation' :: SourceLocation -> Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations} -> Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations) (\s :: SourceLocation
s@SourceLocation' {} Maybe [SegmentDeliveryConfiguration]
a -> SourceLocation
s {$sel:segmentDeliveryConfigurations:SourceLocation' :: Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations = Maybe [SegmentDeliveryConfiguration]
a} :: SourceLocation) 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
sourceLocation_tags :: Lens.Lens' SourceLocation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sourceLocation_tags :: Lens' SourceLocation (Maybe (HashMap Text Text))
sourceLocation_tags = 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) 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
sourceLocation_arn :: Lens.Lens' SourceLocation Prelude.Text
sourceLocation_arn :: Lens' SourceLocation Text
sourceLocation_arn = 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)
sourceLocation_httpConfiguration :: Lens.Lens' SourceLocation HttpConfiguration
sourceLocation_httpConfiguration :: Lens' SourceLocation HttpConfiguration
sourceLocation_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_sourceLocationName :: Lens.Lens' SourceLocation Prelude.Text
sourceLocation_sourceLocationName :: Lens' SourceLocation Text
sourceLocation_sourceLocationName = 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)
instance Data.FromJSON SourceLocation where
parseJSON :: Value -> Parser SourceLocation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SourceLocation"
( \Object
x ->
Maybe AccessConfiguration
-> Maybe POSIX
-> Maybe DefaultSegmentDeliveryConfiguration
-> Maybe POSIX
-> Maybe [SegmentDeliveryConfiguration]
-> Maybe (HashMap Text Text)
-> Text
-> HttpConfiguration
-> Text
-> SourceLocation
SourceLocation'
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
"AccessConfiguration")
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
"CreationTime")
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
"DefaultSegmentDeliveryConfiguration")
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
"LastModifiedTime")
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
"SegmentDeliveryConfigurations"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"HttpConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SourceLocationName")
)
instance Prelude.Hashable SourceLocation where
hashWithSalt :: Int -> SourceLocation -> Int
hashWithSalt Int
_salt SourceLocation' {Maybe [SegmentDeliveryConfiguration]
Maybe (HashMap Text Text)
Maybe POSIX
Maybe DefaultSegmentDeliveryConfiguration
Maybe AccessConfiguration
Text
HttpConfiguration
sourceLocationName :: Text
httpConfiguration :: HttpConfiguration
arn :: Text
tags :: Maybe (HashMap Text Text)
segmentDeliveryConfigurations :: Maybe [SegmentDeliveryConfiguration]
lastModifiedTime :: Maybe POSIX
defaultSegmentDeliveryConfiguration :: Maybe DefaultSegmentDeliveryConfiguration
creationTime :: Maybe POSIX
accessConfiguration :: Maybe AccessConfiguration
$sel:sourceLocationName:SourceLocation' :: SourceLocation -> Text
$sel:httpConfiguration:SourceLocation' :: SourceLocation -> HttpConfiguration
$sel:arn:SourceLocation' :: SourceLocation -> Text
$sel:tags:SourceLocation' :: SourceLocation -> Maybe (HashMap Text Text)
$sel:segmentDeliveryConfigurations:SourceLocation' :: SourceLocation -> Maybe [SegmentDeliveryConfiguration]
$sel:lastModifiedTime:SourceLocation' :: SourceLocation -> Maybe POSIX
$sel:defaultSegmentDeliveryConfiguration:SourceLocation' :: SourceLocation -> Maybe DefaultSegmentDeliveryConfiguration
$sel:creationTime:SourceLocation' :: SourceLocation -> Maybe POSIX
$sel:accessConfiguration:SourceLocation' :: SourceLocation -> Maybe AccessConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccessConfiguration
accessConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HttpConfiguration
httpConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceLocationName
instance Prelude.NFData SourceLocation where
rnf :: SourceLocation -> ()
rnf SourceLocation' {Maybe [SegmentDeliveryConfiguration]
Maybe (HashMap Text Text)
Maybe POSIX
Maybe DefaultSegmentDeliveryConfiguration
Maybe AccessConfiguration
Text
HttpConfiguration
sourceLocationName :: Text
httpConfiguration :: HttpConfiguration
arn :: Text
tags :: Maybe (HashMap Text Text)
segmentDeliveryConfigurations :: Maybe [SegmentDeliveryConfiguration]
lastModifiedTime :: Maybe POSIX
defaultSegmentDeliveryConfiguration :: Maybe DefaultSegmentDeliveryConfiguration
creationTime :: Maybe POSIX
accessConfiguration :: Maybe AccessConfiguration
$sel:sourceLocationName:SourceLocation' :: SourceLocation -> Text
$sel:httpConfiguration:SourceLocation' :: SourceLocation -> HttpConfiguration
$sel:arn:SourceLocation' :: SourceLocation -> Text
$sel:tags:SourceLocation' :: SourceLocation -> Maybe (HashMap Text Text)
$sel:segmentDeliveryConfigurations:SourceLocation' :: SourceLocation -> Maybe [SegmentDeliveryConfiguration]
$sel:lastModifiedTime:SourceLocation' :: SourceLocation -> Maybe POSIX
$sel:defaultSegmentDeliveryConfiguration:SourceLocation' :: SourceLocation -> Maybe DefaultSegmentDeliveryConfiguration
$sel:creationTime:SourceLocation' :: SourceLocation -> Maybe POSIX
$sel:accessConfiguration:SourceLocation' :: SourceLocation -> Maybe AccessConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AccessConfiguration
accessConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DefaultSegmentDeliveryConfiguration
defaultSegmentDeliveryConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SegmentDeliveryConfiguration]
segmentDeliveryConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HttpConfiguration
httpConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceLocationName