{-# 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.OutputSource
-- 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.SSM.Types.OutputSource 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

-- | Information about the source where the association execution details are
-- stored.
--
-- /See:/ 'newOutputSource' smart constructor.
data OutputSource = OutputSource'
  { -- | The ID of the output source, for example the URL of an S3 bucket.
    OutputSource -> Maybe Text
outputSourceId :: Prelude.Maybe Prelude.Text,
    -- | The type of source where the association execution details are stored,
    -- for example, Amazon S3.
    OutputSource -> Maybe Text
outputSourceType :: Prelude.Maybe Prelude.Text
  }
  deriving (OutputSource -> OutputSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputSource -> OutputSource -> Bool
$c/= :: OutputSource -> OutputSource -> Bool
== :: OutputSource -> OutputSource -> Bool
$c== :: OutputSource -> OutputSource -> Bool
Prelude.Eq, ReadPrec [OutputSource]
ReadPrec OutputSource
Int -> ReadS OutputSource
ReadS [OutputSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputSource]
$creadListPrec :: ReadPrec [OutputSource]
readPrec :: ReadPrec OutputSource
$creadPrec :: ReadPrec OutputSource
readList :: ReadS [OutputSource]
$creadList :: ReadS [OutputSource]
readsPrec :: Int -> ReadS OutputSource
$creadsPrec :: Int -> ReadS OutputSource
Prelude.Read, Int -> OutputSource -> ShowS
[OutputSource] -> ShowS
OutputSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputSource] -> ShowS
$cshowList :: [OutputSource] -> ShowS
show :: OutputSource -> String
$cshow :: OutputSource -> String
showsPrec :: Int -> OutputSource -> ShowS
$cshowsPrec :: Int -> OutputSource -> ShowS
Prelude.Show, forall x. Rep OutputSource x -> OutputSource
forall x. OutputSource -> Rep OutputSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputSource x -> OutputSource
$cfrom :: forall x. OutputSource -> Rep OutputSource x
Prelude.Generic)

-- |
-- Create a value of 'OutputSource' 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:
--
-- 'outputSourceId', 'outputSource_outputSourceId' - The ID of the output source, for example the URL of an S3 bucket.
--
-- 'outputSourceType', 'outputSource_outputSourceType' - The type of source where the association execution details are stored,
-- for example, Amazon S3.
newOutputSource ::
  OutputSource
newOutputSource :: OutputSource
newOutputSource =
  OutputSource'
    { $sel:outputSourceId:OutputSource' :: Maybe Text
outputSourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:outputSourceType:OutputSource' :: Maybe Text
outputSourceType = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the output source, for example the URL of an S3 bucket.
outputSource_outputSourceId :: Lens.Lens' OutputSource (Prelude.Maybe Prelude.Text)
outputSource_outputSourceId :: Lens' OutputSource (Maybe Text)
outputSource_outputSourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputSource' {Maybe Text
outputSourceId :: Maybe Text
$sel:outputSourceId:OutputSource' :: OutputSource -> Maybe Text
outputSourceId} -> Maybe Text
outputSourceId) (\s :: OutputSource
s@OutputSource' {} Maybe Text
a -> OutputSource
s {$sel:outputSourceId:OutputSource' :: Maybe Text
outputSourceId = Maybe Text
a} :: OutputSource)

-- | The type of source where the association execution details are stored,
-- for example, Amazon S3.
outputSource_outputSourceType :: Lens.Lens' OutputSource (Prelude.Maybe Prelude.Text)
outputSource_outputSourceType :: Lens' OutputSource (Maybe Text)
outputSource_outputSourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputSource' {Maybe Text
outputSourceType :: Maybe Text
$sel:outputSourceType:OutputSource' :: OutputSource -> Maybe Text
outputSourceType} -> Maybe Text
outputSourceType) (\s :: OutputSource
s@OutputSource' {} Maybe Text
a -> OutputSource
s {$sel:outputSourceType:OutputSource' :: Maybe Text
outputSourceType = Maybe Text
a} :: OutputSource)

instance Data.FromJSON OutputSource where
  parseJSON :: Value -> Parser OutputSource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OutputSource"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> OutputSource
OutputSource'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OutputSourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OutputSourceType")
      )

instance Prelude.Hashable OutputSource where
  hashWithSalt :: Int -> OutputSource -> Int
hashWithSalt Int
_salt OutputSource' {Maybe Text
outputSourceType :: Maybe Text
outputSourceId :: Maybe Text
$sel:outputSourceType:OutputSource' :: OutputSource -> Maybe Text
$sel:outputSourceId:OutputSource' :: OutputSource -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputSourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputSourceType

instance Prelude.NFData OutputSource where
  rnf :: OutputSource -> ()
rnf OutputSource' {Maybe Text
outputSourceType :: Maybe Text
outputSourceId :: Maybe Text
$sel:outputSourceType:OutputSource' :: OutputSource -> Maybe Text
$sel:outputSourceId:OutputSource' :: OutputSource -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputSourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputSourceType