{-# 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.GroundStation.Types.S3RecordingDetails
-- 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.GroundStation.Types.S3RecordingDetails where

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

-- | Details about an S3 recording @Config@ used in a contact.
--
-- /See:/ 'newS3RecordingDetails' smart constructor.
data S3RecordingDetails = S3RecordingDetails'
  { -- | Template of the S3 key used.
    S3RecordingDetails -> Maybe Text
keyTemplate :: Prelude.Maybe Prelude.Text,
    -- | ARN of the bucket used.
    S3RecordingDetails -> Maybe Text
bucketArn :: Prelude.Maybe Prelude.Text
  }
  deriving (S3RecordingDetails -> S3RecordingDetails -> Bool
(S3RecordingDetails -> S3RecordingDetails -> Bool)
-> (S3RecordingDetails -> S3RecordingDetails -> Bool)
-> Eq S3RecordingDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3RecordingDetails -> S3RecordingDetails -> Bool
$c/= :: S3RecordingDetails -> S3RecordingDetails -> Bool
== :: S3RecordingDetails -> S3RecordingDetails -> Bool
$c== :: S3RecordingDetails -> S3RecordingDetails -> Bool
Prelude.Eq, ReadPrec [S3RecordingDetails]
ReadPrec S3RecordingDetails
Int -> ReadS S3RecordingDetails
ReadS [S3RecordingDetails]
(Int -> ReadS S3RecordingDetails)
-> ReadS [S3RecordingDetails]
-> ReadPrec S3RecordingDetails
-> ReadPrec [S3RecordingDetails]
-> Read S3RecordingDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3RecordingDetails]
$creadListPrec :: ReadPrec [S3RecordingDetails]
readPrec :: ReadPrec S3RecordingDetails
$creadPrec :: ReadPrec S3RecordingDetails
readList :: ReadS [S3RecordingDetails]
$creadList :: ReadS [S3RecordingDetails]
readsPrec :: Int -> ReadS S3RecordingDetails
$creadsPrec :: Int -> ReadS S3RecordingDetails
Prelude.Read, Int -> S3RecordingDetails -> ShowS
[S3RecordingDetails] -> ShowS
S3RecordingDetails -> String
(Int -> S3RecordingDetails -> ShowS)
-> (S3RecordingDetails -> String)
-> ([S3RecordingDetails] -> ShowS)
-> Show S3RecordingDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3RecordingDetails] -> ShowS
$cshowList :: [S3RecordingDetails] -> ShowS
show :: S3RecordingDetails -> String
$cshow :: S3RecordingDetails -> String
showsPrec :: Int -> S3RecordingDetails -> ShowS
$cshowsPrec :: Int -> S3RecordingDetails -> ShowS
Prelude.Show, (forall x. S3RecordingDetails -> Rep S3RecordingDetails x)
-> (forall x. Rep S3RecordingDetails x -> S3RecordingDetails)
-> Generic S3RecordingDetails
forall x. Rep S3RecordingDetails x -> S3RecordingDetails
forall x. S3RecordingDetails -> Rep S3RecordingDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3RecordingDetails x -> S3RecordingDetails
$cfrom :: forall x. S3RecordingDetails -> Rep S3RecordingDetails x
Prelude.Generic)

-- |
-- Create a value of 'S3RecordingDetails' 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:
--
-- 'keyTemplate', 's3RecordingDetails_keyTemplate' - Template of the S3 key used.
--
-- 'bucketArn', 's3RecordingDetails_bucketArn' - ARN of the bucket used.
newS3RecordingDetails ::
  S3RecordingDetails
newS3RecordingDetails :: S3RecordingDetails
newS3RecordingDetails =
  S3RecordingDetails' :: Maybe Text -> Maybe Text -> S3RecordingDetails
S3RecordingDetails'
    { $sel:keyTemplate:S3RecordingDetails' :: Maybe Text
keyTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketArn:S3RecordingDetails' :: Maybe Text
bucketArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Template of the S3 key used.
s3RecordingDetails_keyTemplate :: Lens.Lens' S3RecordingDetails (Prelude.Maybe Prelude.Text)
s3RecordingDetails_keyTemplate :: (Maybe Text -> f (Maybe Text))
-> S3RecordingDetails -> f S3RecordingDetails
s3RecordingDetails_keyTemplate = (S3RecordingDetails -> Maybe Text)
-> (S3RecordingDetails -> Maybe Text -> S3RecordingDetails)
-> Lens
     S3RecordingDetails S3RecordingDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3RecordingDetails' {Maybe Text
keyTemplate :: Maybe Text
$sel:keyTemplate:S3RecordingDetails' :: S3RecordingDetails -> Maybe Text
keyTemplate} -> Maybe Text
keyTemplate) (\s :: S3RecordingDetails
s@S3RecordingDetails' {} Maybe Text
a -> S3RecordingDetails
s {$sel:keyTemplate:S3RecordingDetails' :: Maybe Text
keyTemplate = Maybe Text
a} :: S3RecordingDetails)

-- | ARN of the bucket used.
s3RecordingDetails_bucketArn :: Lens.Lens' S3RecordingDetails (Prelude.Maybe Prelude.Text)
s3RecordingDetails_bucketArn :: (Maybe Text -> f (Maybe Text))
-> S3RecordingDetails -> f S3RecordingDetails
s3RecordingDetails_bucketArn = (S3RecordingDetails -> Maybe Text)
-> (S3RecordingDetails -> Maybe Text -> S3RecordingDetails)
-> Lens
     S3RecordingDetails S3RecordingDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3RecordingDetails' {Maybe Text
bucketArn :: Maybe Text
$sel:bucketArn:S3RecordingDetails' :: S3RecordingDetails -> Maybe Text
bucketArn} -> Maybe Text
bucketArn) (\s :: S3RecordingDetails
s@S3RecordingDetails' {} Maybe Text
a -> S3RecordingDetails
s {$sel:bucketArn:S3RecordingDetails' :: Maybe Text
bucketArn = Maybe Text
a} :: S3RecordingDetails)

instance Core.FromJSON S3RecordingDetails where
  parseJSON :: Value -> Parser S3RecordingDetails
parseJSON =
    String
-> (Object -> Parser S3RecordingDetails)
-> Value
-> Parser S3RecordingDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3RecordingDetails"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> S3RecordingDetails
S3RecordingDetails'
            (Maybe Text -> Maybe Text -> S3RecordingDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> S3RecordingDetails)
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
"keyTemplate")
            Parser (Maybe Text -> S3RecordingDetails)
-> Parser (Maybe Text) -> Parser S3RecordingDetails
forall (f :: * -> *) a b. Applicative f => 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
"bucketArn")
      )

instance Prelude.Hashable S3RecordingDetails

instance Prelude.NFData S3RecordingDetails