{-# 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.SSM.Types.S3OutputUrl
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSM.Types.S3OutputUrl where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A URL for the Amazon Web Services Systems Manager (Systems Manager)
-- bucket where you want to store the results of this request.
--
-- /See:/ 'newS3OutputUrl' smart constructor.
data S3OutputUrl = S3OutputUrl'
  { -- | A URL for an S3 bucket where you want to store the results of this
    -- request.
    S3OutputUrl -> Maybe Text
outputUrl :: Prelude.Maybe Prelude.Text
  }
  deriving (S3OutputUrl -> S3OutputUrl -> Bool
(S3OutputUrl -> S3OutputUrl -> Bool)
-> (S3OutputUrl -> S3OutputUrl -> Bool) -> Eq S3OutputUrl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3OutputUrl -> S3OutputUrl -> Bool
$c/= :: S3OutputUrl -> S3OutputUrl -> Bool
== :: S3OutputUrl -> S3OutputUrl -> Bool
$c== :: S3OutputUrl -> S3OutputUrl -> Bool
Prelude.Eq, ReadPrec [S3OutputUrl]
ReadPrec S3OutputUrl
Int -> ReadS S3OutputUrl
ReadS [S3OutputUrl]
(Int -> ReadS S3OutputUrl)
-> ReadS [S3OutputUrl]
-> ReadPrec S3OutputUrl
-> ReadPrec [S3OutputUrl]
-> Read S3OutputUrl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3OutputUrl]
$creadListPrec :: ReadPrec [S3OutputUrl]
readPrec :: ReadPrec S3OutputUrl
$creadPrec :: ReadPrec S3OutputUrl
readList :: ReadS [S3OutputUrl]
$creadList :: ReadS [S3OutputUrl]
readsPrec :: Int -> ReadS S3OutputUrl
$creadsPrec :: Int -> ReadS S3OutputUrl
Prelude.Read, Int -> S3OutputUrl -> ShowS
[S3OutputUrl] -> ShowS
S3OutputUrl -> String
(Int -> S3OutputUrl -> ShowS)
-> (S3OutputUrl -> String)
-> ([S3OutputUrl] -> ShowS)
-> Show S3OutputUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3OutputUrl] -> ShowS
$cshowList :: [S3OutputUrl] -> ShowS
show :: S3OutputUrl -> String
$cshow :: S3OutputUrl -> String
showsPrec :: Int -> S3OutputUrl -> ShowS
$cshowsPrec :: Int -> S3OutputUrl -> ShowS
Prelude.Show, (forall x. S3OutputUrl -> Rep S3OutputUrl x)
-> (forall x. Rep S3OutputUrl x -> S3OutputUrl)
-> Generic S3OutputUrl
forall x. Rep S3OutputUrl x -> S3OutputUrl
forall x. S3OutputUrl -> Rep S3OutputUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3OutputUrl x -> S3OutputUrl
$cfrom :: forall x. S3OutputUrl -> Rep S3OutputUrl x
Prelude.Generic)

-- |
-- Create a value of 'S3OutputUrl' 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:
--
-- 'outputUrl', 's3OutputUrl_outputUrl' - A URL for an S3 bucket where you want to store the results of this
-- request.
newS3OutputUrl ::
  S3OutputUrl
newS3OutputUrl :: S3OutputUrl
newS3OutputUrl =
  S3OutputUrl' :: Maybe Text -> S3OutputUrl
S3OutputUrl' {$sel:outputUrl:S3OutputUrl' :: Maybe Text
outputUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | A URL for an S3 bucket where you want to store the results of this
-- request.
s3OutputUrl_outputUrl :: Lens.Lens' S3OutputUrl (Prelude.Maybe Prelude.Text)
s3OutputUrl_outputUrl :: (Maybe Text -> f (Maybe Text)) -> S3OutputUrl -> f S3OutputUrl
s3OutputUrl_outputUrl = (S3OutputUrl -> Maybe Text)
-> (S3OutputUrl -> Maybe Text -> S3OutputUrl)
-> Lens S3OutputUrl S3OutputUrl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3OutputUrl' {Maybe Text
outputUrl :: Maybe Text
$sel:outputUrl:S3OutputUrl' :: S3OutputUrl -> Maybe Text
outputUrl} -> Maybe Text
outputUrl) (\s :: S3OutputUrl
s@S3OutputUrl' {} Maybe Text
a -> S3OutputUrl
s {$sel:outputUrl:S3OutputUrl' :: Maybe Text
outputUrl = Maybe Text
a} :: S3OutputUrl)

instance Core.FromJSON S3OutputUrl where
  parseJSON :: Value -> Parser S3OutputUrl
parseJSON =
    String
-> (Object -> Parser S3OutputUrl) -> Value -> Parser S3OutputUrl
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3OutputUrl"
      ( \Object
x ->
          Maybe Text -> S3OutputUrl
S3OutputUrl' (Maybe Text -> S3OutputUrl)
-> Parser (Maybe Text) -> Parser S3OutputUrl
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutputUrl")
      )

instance Prelude.Hashable S3OutputUrl

instance Prelude.NFData S3OutputUrl