{-# 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.Panorama.Types.OutPutS3Location
-- 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.Panorama.Types.OutPutS3Location where

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

-- | The location of an output object in Amazon S3.
--
-- /See:/ 'newOutPutS3Location' smart constructor.
data OutPutS3Location = OutPutS3Location'
  { -- | The object\'s bucket.
    OutPutS3Location -> Text
bucketName :: Prelude.Text,
    -- | The object\'s key.
    OutPutS3Location -> Text
objectKey :: Prelude.Text
  }
  deriving (OutPutS3Location -> OutPutS3Location -> Bool
(OutPutS3Location -> OutPutS3Location -> Bool)
-> (OutPutS3Location -> OutPutS3Location -> Bool)
-> Eq OutPutS3Location
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutPutS3Location -> OutPutS3Location -> Bool
$c/= :: OutPutS3Location -> OutPutS3Location -> Bool
== :: OutPutS3Location -> OutPutS3Location -> Bool
$c== :: OutPutS3Location -> OutPutS3Location -> Bool
Prelude.Eq, ReadPrec [OutPutS3Location]
ReadPrec OutPutS3Location
Int -> ReadS OutPutS3Location
ReadS [OutPutS3Location]
(Int -> ReadS OutPutS3Location)
-> ReadS [OutPutS3Location]
-> ReadPrec OutPutS3Location
-> ReadPrec [OutPutS3Location]
-> Read OutPutS3Location
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutPutS3Location]
$creadListPrec :: ReadPrec [OutPutS3Location]
readPrec :: ReadPrec OutPutS3Location
$creadPrec :: ReadPrec OutPutS3Location
readList :: ReadS [OutPutS3Location]
$creadList :: ReadS [OutPutS3Location]
readsPrec :: Int -> ReadS OutPutS3Location
$creadsPrec :: Int -> ReadS OutPutS3Location
Prelude.Read, Int -> OutPutS3Location -> ShowS
[OutPutS3Location] -> ShowS
OutPutS3Location -> String
(Int -> OutPutS3Location -> ShowS)
-> (OutPutS3Location -> String)
-> ([OutPutS3Location] -> ShowS)
-> Show OutPutS3Location
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutPutS3Location] -> ShowS
$cshowList :: [OutPutS3Location] -> ShowS
show :: OutPutS3Location -> String
$cshow :: OutPutS3Location -> String
showsPrec :: Int -> OutPutS3Location -> ShowS
$cshowsPrec :: Int -> OutPutS3Location -> ShowS
Prelude.Show, (forall x. OutPutS3Location -> Rep OutPutS3Location x)
-> (forall x. Rep OutPutS3Location x -> OutPutS3Location)
-> Generic OutPutS3Location
forall x. Rep OutPutS3Location x -> OutPutS3Location
forall x. OutPutS3Location -> Rep OutPutS3Location x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutPutS3Location x -> OutPutS3Location
$cfrom :: forall x. OutPutS3Location -> Rep OutPutS3Location x
Prelude.Generic)

-- |
-- Create a value of 'OutPutS3Location' 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:
--
-- 'bucketName', 'outPutS3Location_bucketName' - The object\'s bucket.
--
-- 'objectKey', 'outPutS3Location_objectKey' - The object\'s key.
newOutPutS3Location ::
  -- | 'bucketName'
  Prelude.Text ->
  -- | 'objectKey'
  Prelude.Text ->
  OutPutS3Location
newOutPutS3Location :: Text -> Text -> OutPutS3Location
newOutPutS3Location Text
pBucketName_ Text
pObjectKey_ =
  OutPutS3Location' :: Text -> Text -> OutPutS3Location
OutPutS3Location'
    { $sel:bucketName:OutPutS3Location' :: Text
bucketName = Text
pBucketName_,
      $sel:objectKey:OutPutS3Location' :: Text
objectKey = Text
pObjectKey_
    }

-- | The object\'s bucket.
outPutS3Location_bucketName :: Lens.Lens' OutPutS3Location Prelude.Text
outPutS3Location_bucketName :: (Text -> f Text) -> OutPutS3Location -> f OutPutS3Location
outPutS3Location_bucketName = (OutPutS3Location -> Text)
-> (OutPutS3Location -> Text -> OutPutS3Location)
-> Lens OutPutS3Location OutPutS3Location Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutPutS3Location' {Text
bucketName :: Text
$sel:bucketName:OutPutS3Location' :: OutPutS3Location -> Text
bucketName} -> Text
bucketName) (\s :: OutPutS3Location
s@OutPutS3Location' {} Text
a -> OutPutS3Location
s {$sel:bucketName:OutPutS3Location' :: Text
bucketName = Text
a} :: OutPutS3Location)

-- | The object\'s key.
outPutS3Location_objectKey :: Lens.Lens' OutPutS3Location Prelude.Text
outPutS3Location_objectKey :: (Text -> f Text) -> OutPutS3Location -> f OutPutS3Location
outPutS3Location_objectKey = (OutPutS3Location -> Text)
-> (OutPutS3Location -> Text -> OutPutS3Location)
-> Lens OutPutS3Location OutPutS3Location Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutPutS3Location' {Text
objectKey :: Text
$sel:objectKey:OutPutS3Location' :: OutPutS3Location -> Text
objectKey} -> Text
objectKey) (\s :: OutPutS3Location
s@OutPutS3Location' {} Text
a -> OutPutS3Location
s {$sel:objectKey:OutPutS3Location' :: Text
objectKey = Text
a} :: OutPutS3Location)

instance Core.FromJSON OutPutS3Location where
  parseJSON :: Value -> Parser OutPutS3Location
parseJSON =
    String
-> (Object -> Parser OutPutS3Location)
-> Value
-> Parser OutPutS3Location
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OutPutS3Location"
      ( \Object
x ->
          Text -> Text -> OutPutS3Location
OutPutS3Location'
            (Text -> Text -> OutPutS3Location)
-> Parser Text -> Parser (Text -> OutPutS3Location)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BucketName")
            Parser (Text -> OutPutS3Location)
-> Parser Text -> Parser OutPutS3Location
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ObjectKey")
      )

instance Prelude.Hashable OutPutS3Location

instance Prelude.NFData OutPutS3Location