{-# 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.QuickSight.Types.ManifestFileLocation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ManifestFileLocation = ManifestFileLocation'
{
ManifestFileLocation -> Text
bucket :: Prelude.Text,
ManifestFileLocation -> Text
key :: Prelude.Text
}
deriving (ManifestFileLocation -> ManifestFileLocation -> Bool
(ManifestFileLocation -> ManifestFileLocation -> Bool)
-> (ManifestFileLocation -> ManifestFileLocation -> Bool)
-> Eq ManifestFileLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManifestFileLocation -> ManifestFileLocation -> Bool
$c/= :: ManifestFileLocation -> ManifestFileLocation -> Bool
== :: ManifestFileLocation -> ManifestFileLocation -> Bool
$c== :: ManifestFileLocation -> ManifestFileLocation -> Bool
Prelude.Eq, ReadPrec [ManifestFileLocation]
ReadPrec ManifestFileLocation
Int -> ReadS ManifestFileLocation
ReadS [ManifestFileLocation]
(Int -> ReadS ManifestFileLocation)
-> ReadS [ManifestFileLocation]
-> ReadPrec ManifestFileLocation
-> ReadPrec [ManifestFileLocation]
-> Read ManifestFileLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManifestFileLocation]
$creadListPrec :: ReadPrec [ManifestFileLocation]
readPrec :: ReadPrec ManifestFileLocation
$creadPrec :: ReadPrec ManifestFileLocation
readList :: ReadS [ManifestFileLocation]
$creadList :: ReadS [ManifestFileLocation]
readsPrec :: Int -> ReadS ManifestFileLocation
$creadsPrec :: Int -> ReadS ManifestFileLocation
Prelude.Read, Int -> ManifestFileLocation -> ShowS
[ManifestFileLocation] -> ShowS
ManifestFileLocation -> String
(Int -> ManifestFileLocation -> ShowS)
-> (ManifestFileLocation -> String)
-> ([ManifestFileLocation] -> ShowS)
-> Show ManifestFileLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManifestFileLocation] -> ShowS
$cshowList :: [ManifestFileLocation] -> ShowS
show :: ManifestFileLocation -> String
$cshow :: ManifestFileLocation -> String
showsPrec :: Int -> ManifestFileLocation -> ShowS
$cshowsPrec :: Int -> ManifestFileLocation -> ShowS
Prelude.Show, (forall x. ManifestFileLocation -> Rep ManifestFileLocation x)
-> (forall x. Rep ManifestFileLocation x -> ManifestFileLocation)
-> Generic ManifestFileLocation
forall x. Rep ManifestFileLocation x -> ManifestFileLocation
forall x. ManifestFileLocation -> Rep ManifestFileLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManifestFileLocation x -> ManifestFileLocation
$cfrom :: forall x. ManifestFileLocation -> Rep ManifestFileLocation x
Prelude.Generic)
newManifestFileLocation ::
Prelude.Text ->
Prelude.Text ->
ManifestFileLocation
newManifestFileLocation :: Text -> Text -> ManifestFileLocation
newManifestFileLocation Text
pBucket_ Text
pKey_ =
ManifestFileLocation' :: Text -> Text -> ManifestFileLocation
ManifestFileLocation'
{ $sel:bucket:ManifestFileLocation' :: Text
bucket = Text
pBucket_,
$sel:key:ManifestFileLocation' :: Text
key = Text
pKey_
}
manifestFileLocation_bucket :: Lens.Lens' ManifestFileLocation Prelude.Text
manifestFileLocation_bucket :: (Text -> f Text) -> ManifestFileLocation -> f ManifestFileLocation
manifestFileLocation_bucket = (ManifestFileLocation -> Text)
-> (ManifestFileLocation -> Text -> ManifestFileLocation)
-> Lens ManifestFileLocation ManifestFileLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManifestFileLocation' {Text
bucket :: Text
$sel:bucket:ManifestFileLocation' :: ManifestFileLocation -> Text
bucket} -> Text
bucket) (\s :: ManifestFileLocation
s@ManifestFileLocation' {} Text
a -> ManifestFileLocation
s {$sel:bucket:ManifestFileLocation' :: Text
bucket = Text
a} :: ManifestFileLocation)
manifestFileLocation_key :: Lens.Lens' ManifestFileLocation Prelude.Text
manifestFileLocation_key :: (Text -> f Text) -> ManifestFileLocation -> f ManifestFileLocation
manifestFileLocation_key = (ManifestFileLocation -> Text)
-> (ManifestFileLocation -> Text -> ManifestFileLocation)
-> Lens ManifestFileLocation ManifestFileLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManifestFileLocation' {Text
key :: Text
$sel:key:ManifestFileLocation' :: ManifestFileLocation -> Text
key} -> Text
key) (\s :: ManifestFileLocation
s@ManifestFileLocation' {} Text
a -> ManifestFileLocation
s {$sel:key:ManifestFileLocation' :: Text
key = Text
a} :: ManifestFileLocation)
instance Core.FromJSON ManifestFileLocation where
parseJSON :: Value -> Parser ManifestFileLocation
parseJSON =
String
-> (Object -> Parser ManifestFileLocation)
-> Value
-> Parser ManifestFileLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ManifestFileLocation"
( \Object
x ->
Text -> Text -> ManifestFileLocation
ManifestFileLocation'
(Text -> Text -> ManifestFileLocation)
-> Parser Text -> Parser (Text -> ManifestFileLocation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Bucket") Parser (Text -> ManifestFileLocation)
-> Parser Text -> Parser ManifestFileLocation
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
"Key")
)
instance Prelude.Hashable ManifestFileLocation
instance Prelude.NFData ManifestFileLocation
instance Core.ToJSON ManifestFileLocation where
toJSON :: ManifestFileLocation -> Value
toJSON ManifestFileLocation' {Text
key :: Text
bucket :: Text
$sel:key:ManifestFileLocation' :: ManifestFileLocation -> Text
$sel:bucket:ManifestFileLocation' :: ManifestFileLocation -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Bucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucket),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
key)
]
)