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