{-# 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.ElasticBeanstalk.Types.S3Location where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3Location = S3Location'
{
S3Location -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
S3Location -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text
}
deriving (S3Location -> S3Location -> Bool
(S3Location -> S3Location -> Bool)
-> (S3Location -> S3Location -> Bool) -> Eq S3Location
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3Location -> S3Location -> Bool
$c/= :: S3Location -> S3Location -> Bool
== :: S3Location -> S3Location -> Bool
$c== :: S3Location -> S3Location -> Bool
Prelude.Eq, ReadPrec [S3Location]
ReadPrec S3Location
Int -> ReadS S3Location
ReadS [S3Location]
(Int -> ReadS S3Location)
-> ReadS [S3Location]
-> ReadPrec S3Location
-> ReadPrec [S3Location]
-> Read S3Location
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3Location]
$creadListPrec :: ReadPrec [S3Location]
readPrec :: ReadPrec S3Location
$creadPrec :: ReadPrec S3Location
readList :: ReadS [S3Location]
$creadList :: ReadS [S3Location]
readsPrec :: Int -> ReadS S3Location
$creadsPrec :: Int -> ReadS S3Location
Prelude.Read, Int -> S3Location -> ShowS
[S3Location] -> ShowS
S3Location -> String
(Int -> S3Location -> ShowS)
-> (S3Location -> String)
-> ([S3Location] -> ShowS)
-> Show S3Location
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3Location] -> ShowS
$cshowList :: [S3Location] -> ShowS
show :: S3Location -> String
$cshow :: S3Location -> String
showsPrec :: Int -> S3Location -> ShowS
$cshowsPrec :: Int -> S3Location -> ShowS
Prelude.Show, (forall x. S3Location -> Rep S3Location x)
-> (forall x. Rep S3Location x -> S3Location) -> Generic S3Location
forall x. Rep S3Location x -> S3Location
forall x. S3Location -> Rep S3Location x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3Location x -> S3Location
$cfrom :: forall x. S3Location -> Rep S3Location x
Prelude.Generic)
newS3Location ::
S3Location
newS3Location :: S3Location
newS3Location =
S3Location' :: Maybe Text -> Maybe Text -> S3Location
S3Location'
{ $sel:s3Key:S3Location' :: Maybe Text
s3Key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:S3Location' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
s3Location_s3Key :: Lens.Lens' S3Location (Prelude.Maybe Prelude.Text)
s3Location_s3Key :: (Maybe Text -> f (Maybe Text)) -> S3Location -> f S3Location
s3Location_s3Key = (S3Location -> Maybe Text)
-> (S3Location -> Maybe Text -> S3Location)
-> Lens S3Location S3Location (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Location' {Maybe Text
s3Key :: Maybe Text
$sel:s3Key:S3Location' :: S3Location -> Maybe Text
s3Key} -> Maybe Text
s3Key) (\s :: S3Location
s@S3Location' {} Maybe Text
a -> S3Location
s {$sel:s3Key:S3Location' :: Maybe Text
s3Key = Maybe Text
a} :: S3Location)
s3Location_s3Bucket :: Lens.Lens' S3Location (Prelude.Maybe Prelude.Text)
s3Location_s3Bucket :: (Maybe Text -> f (Maybe Text)) -> S3Location -> f S3Location
s3Location_s3Bucket = (S3Location -> Maybe Text)
-> (S3Location -> Maybe Text -> S3Location)
-> Lens S3Location S3Location (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Location' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:S3Location' :: S3Location -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: S3Location
s@S3Location' {} Maybe Text
a -> S3Location
s {$sel:s3Bucket:S3Location' :: Maybe Text
s3Bucket = Maybe Text
a} :: S3Location)
instance Core.FromXML S3Location where
parseXML :: [Node] -> Either String S3Location
parseXML [Node]
x =
Maybe Text -> Maybe Text -> S3Location
S3Location'
(Maybe Text -> Maybe Text -> S3Location)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> S3Location)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"S3Key")
Either String (Maybe Text -> S3Location)
-> Either String (Maybe Text) -> Either String S3Location
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"S3Bucket")
instance Prelude.Hashable S3Location
instance Prelude.NFData S3Location
instance Core.ToQuery S3Location where
toQuery :: S3Location -> QueryString
toQuery S3Location' {Maybe Text
s3Bucket :: Maybe Text
s3Key :: Maybe Text
$sel:s3Bucket:S3Location' :: S3Location -> Maybe Text
$sel:s3Key:S3Location' :: S3Location -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"S3Key" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
s3Key, ByteString
"S3Bucket" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
s3Bucket]