{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.S3.Types.OutputLocation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.S3.Types.OutputLocation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.S3Location

-- | Describes the location where the restore job\'s output is stored.
--
-- /See:/ 'newOutputLocation' smart constructor.
data OutputLocation = OutputLocation'
  { -- | Describes an S3 location that will receive the results of the restore
    -- request.
    OutputLocation -> Maybe S3Location
s3 :: Prelude.Maybe S3Location
  }
  deriving (OutputLocation -> OutputLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputLocation -> OutputLocation -> Bool
$c/= :: OutputLocation -> OutputLocation -> Bool
== :: OutputLocation -> OutputLocation -> Bool
$c== :: OutputLocation -> OutputLocation -> Bool
Prelude.Eq, Int -> OutputLocation -> ShowS
[OutputLocation] -> ShowS
OutputLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputLocation] -> ShowS
$cshowList :: [OutputLocation] -> ShowS
show :: OutputLocation -> String
$cshow :: OutputLocation -> String
showsPrec :: Int -> OutputLocation -> ShowS
$cshowsPrec :: Int -> OutputLocation -> ShowS
Prelude.Show, forall x. Rep OutputLocation x -> OutputLocation
forall x. OutputLocation -> Rep OutputLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputLocation x -> OutputLocation
$cfrom :: forall x. OutputLocation -> Rep OutputLocation x
Prelude.Generic)

-- |
-- Create a value of 'OutputLocation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 's3', 'outputLocation_s3' - Describes an S3 location that will receive the results of the restore
-- request.
newOutputLocation ::
  OutputLocation
newOutputLocation :: OutputLocation
newOutputLocation =
  OutputLocation' {$sel:s3:OutputLocation' :: Maybe S3Location
s3 = forall a. Maybe a
Prelude.Nothing}

-- | Describes an S3 location that will receive the results of the restore
-- request.
outputLocation_s3 :: Lens.Lens' OutputLocation (Prelude.Maybe S3Location)
outputLocation_s3 :: Lens' OutputLocation (Maybe S3Location)
outputLocation_s3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputLocation' {Maybe S3Location
s3 :: Maybe S3Location
$sel:s3:OutputLocation' :: OutputLocation -> Maybe S3Location
s3} -> Maybe S3Location
s3) (\s :: OutputLocation
s@OutputLocation' {} Maybe S3Location
a -> OutputLocation
s {$sel:s3:OutputLocation' :: Maybe S3Location
s3 = Maybe S3Location
a} :: OutputLocation)

instance Prelude.Hashable OutputLocation where
  hashWithSalt :: Int -> OutputLocation -> Int
hashWithSalt Int
_salt OutputLocation' {Maybe S3Location
s3 :: Maybe S3Location
$sel:s3:OutputLocation' :: OutputLocation -> Maybe S3Location
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Location
s3

instance Prelude.NFData OutputLocation where
  rnf :: OutputLocation -> ()
rnf OutputLocation' {Maybe S3Location
s3 :: Maybe S3Location
$sel:s3:OutputLocation' :: OutputLocation -> Maybe S3Location
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Location
s3

instance Data.ToXML OutputLocation where
  toXML :: OutputLocation -> XML
toXML OutputLocation' {Maybe S3Location
s3 :: Maybe S3Location
$sel:s3:OutputLocation' :: OutputLocation -> Maybe S3Location
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"S3" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe S3Location
s3]