{-# 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.S3.Types.RestoreRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.GlacierJobParameters
import Amazonka.S3.Types.OutputLocation
import Amazonka.S3.Types.RestoreRequestType
import Amazonka.S3.Types.SelectParameters
import Amazonka.S3.Types.Tier
data RestoreRequest = RestoreRequest'
{
RestoreRequest -> Maybe Int
days :: Prelude.Maybe Prelude.Int,
RestoreRequest -> Maybe SelectParameters
selectParameters :: Prelude.Maybe SelectParameters,
RestoreRequest -> Maybe OutputLocation
outputLocation :: Prelude.Maybe OutputLocation,
RestoreRequest -> Maybe Tier
tier :: Prelude.Maybe Tier,
RestoreRequest -> Maybe GlacierJobParameters
glacierJobParameters :: Prelude.Maybe GlacierJobParameters,
RestoreRequest -> Maybe RestoreRequestType
type' :: Prelude.Maybe RestoreRequestType,
RestoreRequest -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (RestoreRequest -> RestoreRequest -> Bool
(RestoreRequest -> RestoreRequest -> Bool)
-> (RestoreRequest -> RestoreRequest -> Bool) -> Eq RestoreRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreRequest -> RestoreRequest -> Bool
$c/= :: RestoreRequest -> RestoreRequest -> Bool
== :: RestoreRequest -> RestoreRequest -> Bool
$c== :: RestoreRequest -> RestoreRequest -> Bool
Prelude.Eq, Int -> RestoreRequest -> ShowS
[RestoreRequest] -> ShowS
RestoreRequest -> String
(Int -> RestoreRequest -> ShowS)
-> (RestoreRequest -> String)
-> ([RestoreRequest] -> ShowS)
-> Show RestoreRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreRequest] -> ShowS
$cshowList :: [RestoreRequest] -> ShowS
show :: RestoreRequest -> String
$cshow :: RestoreRequest -> String
showsPrec :: Int -> RestoreRequest -> ShowS
$cshowsPrec :: Int -> RestoreRequest -> ShowS
Prelude.Show, (forall x. RestoreRequest -> Rep RestoreRequest x)
-> (forall x. Rep RestoreRequest x -> RestoreRequest)
-> Generic RestoreRequest
forall x. Rep RestoreRequest x -> RestoreRequest
forall x. RestoreRequest -> Rep RestoreRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestoreRequest x -> RestoreRequest
$cfrom :: forall x. RestoreRequest -> Rep RestoreRequest x
Prelude.Generic)
newRestoreRequest ::
RestoreRequest
newRestoreRequest :: RestoreRequest
newRestoreRequest =
RestoreRequest' :: Maybe Int
-> Maybe SelectParameters
-> Maybe OutputLocation
-> Maybe Tier
-> Maybe GlacierJobParameters
-> Maybe RestoreRequestType
-> Maybe Text
-> RestoreRequest
RestoreRequest'
{ $sel:days:RestoreRequest' :: Maybe Int
days = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:selectParameters:RestoreRequest' :: Maybe SelectParameters
selectParameters = Maybe SelectParameters
forall a. Maybe a
Prelude.Nothing,
$sel:outputLocation:RestoreRequest' :: Maybe OutputLocation
outputLocation = Maybe OutputLocation
forall a. Maybe a
Prelude.Nothing,
$sel:tier:RestoreRequest' :: Maybe Tier
tier = Maybe Tier
forall a. Maybe a
Prelude.Nothing,
$sel:glacierJobParameters:RestoreRequest' :: Maybe GlacierJobParameters
glacierJobParameters = Maybe GlacierJobParameters
forall a. Maybe a
Prelude.Nothing,
$sel:type':RestoreRequest' :: Maybe RestoreRequestType
type' = Maybe RestoreRequestType
forall a. Maybe a
Prelude.Nothing,
$sel:description:RestoreRequest' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
restoreRequest_days :: Lens.Lens' RestoreRequest (Prelude.Maybe Prelude.Int)
restoreRequest_days :: (Maybe Int -> f (Maybe Int)) -> RestoreRequest -> f RestoreRequest
restoreRequest_days = (RestoreRequest -> Maybe Int)
-> (RestoreRequest -> Maybe Int -> RestoreRequest)
-> Lens RestoreRequest RestoreRequest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe Int
days :: Maybe Int
$sel:days:RestoreRequest' :: RestoreRequest -> Maybe Int
days} -> Maybe Int
days) (\s :: RestoreRequest
s@RestoreRequest' {} Maybe Int
a -> RestoreRequest
s {$sel:days:RestoreRequest' :: Maybe Int
days = Maybe Int
a} :: RestoreRequest)
restoreRequest_selectParameters :: Lens.Lens' RestoreRequest (Prelude.Maybe SelectParameters)
restoreRequest_selectParameters :: (Maybe SelectParameters -> f (Maybe SelectParameters))
-> RestoreRequest -> f RestoreRequest
restoreRequest_selectParameters = (RestoreRequest -> Maybe SelectParameters)
-> (RestoreRequest -> Maybe SelectParameters -> RestoreRequest)
-> Lens
RestoreRequest
RestoreRequest
(Maybe SelectParameters)
(Maybe SelectParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe SelectParameters
selectParameters :: Maybe SelectParameters
$sel:selectParameters:RestoreRequest' :: RestoreRequest -> Maybe SelectParameters
selectParameters} -> Maybe SelectParameters
selectParameters) (\s :: RestoreRequest
s@RestoreRequest' {} Maybe SelectParameters
a -> RestoreRequest
s {$sel:selectParameters:RestoreRequest' :: Maybe SelectParameters
selectParameters = Maybe SelectParameters
a} :: RestoreRequest)
restoreRequest_outputLocation :: Lens.Lens' RestoreRequest (Prelude.Maybe OutputLocation)
restoreRequest_outputLocation :: (Maybe OutputLocation -> f (Maybe OutputLocation))
-> RestoreRequest -> f RestoreRequest
restoreRequest_outputLocation = (RestoreRequest -> Maybe OutputLocation)
-> (RestoreRequest -> Maybe OutputLocation -> RestoreRequest)
-> Lens
RestoreRequest
RestoreRequest
(Maybe OutputLocation)
(Maybe OutputLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe OutputLocation
outputLocation :: Maybe OutputLocation
$sel:outputLocation:RestoreRequest' :: RestoreRequest -> Maybe OutputLocation
outputLocation} -> Maybe OutputLocation
outputLocation) (\s :: RestoreRequest
s@RestoreRequest' {} Maybe OutputLocation
a -> RestoreRequest
s {$sel:outputLocation:RestoreRequest' :: Maybe OutputLocation
outputLocation = Maybe OutputLocation
a} :: RestoreRequest)
restoreRequest_tier :: Lens.Lens' RestoreRequest (Prelude.Maybe Tier)
restoreRequest_tier :: (Maybe Tier -> f (Maybe Tier))
-> RestoreRequest -> f RestoreRequest
restoreRequest_tier = (RestoreRequest -> Maybe Tier)
-> (RestoreRequest -> Maybe Tier -> RestoreRequest)
-> Lens RestoreRequest RestoreRequest (Maybe Tier) (Maybe Tier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe Tier
tier :: Maybe Tier
$sel:tier:RestoreRequest' :: RestoreRequest -> Maybe Tier
tier} -> Maybe Tier
tier) (\s :: RestoreRequest
s@RestoreRequest' {} Maybe Tier
a -> RestoreRequest
s {$sel:tier:RestoreRequest' :: Maybe Tier
tier = Maybe Tier
a} :: RestoreRequest)
restoreRequest_glacierJobParameters :: Lens.Lens' RestoreRequest (Prelude.Maybe GlacierJobParameters)
restoreRequest_glacierJobParameters :: (Maybe GlacierJobParameters -> f (Maybe GlacierJobParameters))
-> RestoreRequest -> f RestoreRequest
restoreRequest_glacierJobParameters = (RestoreRequest -> Maybe GlacierJobParameters)
-> (RestoreRequest -> Maybe GlacierJobParameters -> RestoreRequest)
-> Lens
RestoreRequest
RestoreRequest
(Maybe GlacierJobParameters)
(Maybe GlacierJobParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe GlacierJobParameters
glacierJobParameters :: Maybe GlacierJobParameters
$sel:glacierJobParameters:RestoreRequest' :: RestoreRequest -> Maybe GlacierJobParameters
glacierJobParameters} -> Maybe GlacierJobParameters
glacierJobParameters) (\s :: RestoreRequest
s@RestoreRequest' {} Maybe GlacierJobParameters
a -> RestoreRequest
s {$sel:glacierJobParameters:RestoreRequest' :: Maybe GlacierJobParameters
glacierJobParameters = Maybe GlacierJobParameters
a} :: RestoreRequest)
restoreRequest_type :: Lens.Lens' RestoreRequest (Prelude.Maybe RestoreRequestType)
restoreRequest_type :: (Maybe RestoreRequestType -> f (Maybe RestoreRequestType))
-> RestoreRequest -> f RestoreRequest
restoreRequest_type = (RestoreRequest -> Maybe RestoreRequestType)
-> (RestoreRequest -> Maybe RestoreRequestType -> RestoreRequest)
-> Lens
RestoreRequest
RestoreRequest
(Maybe RestoreRequestType)
(Maybe RestoreRequestType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe RestoreRequestType
type' :: Maybe RestoreRequestType
$sel:type':RestoreRequest' :: RestoreRequest -> Maybe RestoreRequestType
type'} -> Maybe RestoreRequestType
type') (\s :: RestoreRequest
s@RestoreRequest' {} Maybe RestoreRequestType
a -> RestoreRequest
s {$sel:type':RestoreRequest' :: Maybe RestoreRequestType
type' = Maybe RestoreRequestType
a} :: RestoreRequest)
restoreRequest_description :: Lens.Lens' RestoreRequest (Prelude.Maybe Prelude.Text)
restoreRequest_description :: (Maybe Text -> f (Maybe Text))
-> RestoreRequest -> f RestoreRequest
restoreRequest_description = (RestoreRequest -> Maybe Text)
-> (RestoreRequest -> Maybe Text -> RestoreRequest)
-> Lens RestoreRequest RestoreRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreRequest' {Maybe Text
description :: Maybe Text
$sel:description:RestoreRequest' :: RestoreRequest -> Maybe Text
description} -> Maybe Text
description) (\s :: RestoreRequest
s@RestoreRequest' {} Maybe Text
a -> RestoreRequest
s {$sel:description:RestoreRequest' :: Maybe Text
description = Maybe Text
a} :: RestoreRequest)
instance Prelude.Hashable RestoreRequest
instance Prelude.NFData RestoreRequest
instance Core.ToXML RestoreRequest where
toXML :: RestoreRequest -> XML
toXML RestoreRequest' {Maybe Int
Maybe Text
Maybe RestoreRequestType
Maybe SelectParameters
Maybe Tier
Maybe GlacierJobParameters
Maybe OutputLocation
description :: Maybe Text
type' :: Maybe RestoreRequestType
glacierJobParameters :: Maybe GlacierJobParameters
tier :: Maybe Tier
outputLocation :: Maybe OutputLocation
selectParameters :: Maybe SelectParameters
days :: Maybe Int
$sel:description:RestoreRequest' :: RestoreRequest -> Maybe Text
$sel:type':RestoreRequest' :: RestoreRequest -> Maybe RestoreRequestType
$sel:glacierJobParameters:RestoreRequest' :: RestoreRequest -> Maybe GlacierJobParameters
$sel:tier:RestoreRequest' :: RestoreRequest -> Maybe Tier
$sel:outputLocation:RestoreRequest' :: RestoreRequest -> Maybe OutputLocation
$sel:selectParameters:RestoreRequest' :: RestoreRequest -> Maybe SelectParameters
$sel:days:RestoreRequest' :: RestoreRequest -> Maybe Int
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Days" Name -> Maybe Int -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Int
days,
Name
"SelectParameters" Name -> Maybe SelectParameters -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe SelectParameters
selectParameters,
Name
"OutputLocation" Name -> Maybe OutputLocation -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe OutputLocation
outputLocation,
Name
"Tier" Name -> Maybe Tier -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Tier
tier,
Name
"GlacierJobParameters" Name -> Maybe GlacierJobParameters -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe GlacierJobParameters
glacierJobParameters,
Name
"Type" Name -> Maybe RestoreRequestType -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe RestoreRequestType
type',
Name
"Description" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
description
]