{-# 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.Braket.Types.S3DataSource
-- 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.Braket.Types.S3DataSource 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 data stored in Amazon S3 used by the Amazon Braket
-- job.
--
-- /See:/ 'newS3DataSource' smart constructor.
data S3DataSource = S3DataSource'
  { -- | Depending on the value specified for the @S3DataType@, identifies either
    -- a key name prefix or a manifest that locates the S3 data source.
    S3DataSource -> Text
s3Uri :: Prelude.Text
  }
  deriving (S3DataSource -> S3DataSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3DataSource -> S3DataSource -> Bool
$c/= :: S3DataSource -> S3DataSource -> Bool
== :: S3DataSource -> S3DataSource -> Bool
$c== :: S3DataSource -> S3DataSource -> Bool
Prelude.Eq, ReadPrec [S3DataSource]
ReadPrec S3DataSource
Int -> ReadS S3DataSource
ReadS [S3DataSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3DataSource]
$creadListPrec :: ReadPrec [S3DataSource]
readPrec :: ReadPrec S3DataSource
$creadPrec :: ReadPrec S3DataSource
readList :: ReadS [S3DataSource]
$creadList :: ReadS [S3DataSource]
readsPrec :: Int -> ReadS S3DataSource
$creadsPrec :: Int -> ReadS S3DataSource
Prelude.Read, Int -> S3DataSource -> ShowS
[S3DataSource] -> ShowS
S3DataSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3DataSource] -> ShowS
$cshowList :: [S3DataSource] -> ShowS
show :: S3DataSource -> String
$cshow :: S3DataSource -> String
showsPrec :: Int -> S3DataSource -> ShowS
$cshowsPrec :: Int -> S3DataSource -> ShowS
Prelude.Show, forall x. Rep S3DataSource x -> S3DataSource
forall x. S3DataSource -> Rep S3DataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3DataSource x -> S3DataSource
$cfrom :: forall x. S3DataSource -> Rep S3DataSource x
Prelude.Generic)

-- |
-- Create a value of 'S3DataSource' 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:
--
-- 's3Uri', 's3DataSource_s3Uri' - Depending on the value specified for the @S3DataType@, identifies either
-- a key name prefix or a manifest that locates the S3 data source.
newS3DataSource ::
  -- | 's3Uri'
  Prelude.Text ->
  S3DataSource
newS3DataSource :: Text -> S3DataSource
newS3DataSource Text
pS3Uri_ =
  S3DataSource' {$sel:s3Uri:S3DataSource' :: Text
s3Uri = Text
pS3Uri_}

-- | Depending on the value specified for the @S3DataType@, identifies either
-- a key name prefix or a manifest that locates the S3 data source.
s3DataSource_s3Uri :: Lens.Lens' S3DataSource Prelude.Text
s3DataSource_s3Uri :: Lens' S3DataSource Text
s3DataSource_s3Uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DataSource' {Text
s3Uri :: Text
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
s3Uri} -> Text
s3Uri) (\s :: S3DataSource
s@S3DataSource' {} Text
a -> S3DataSource
s {$sel:s3Uri:S3DataSource' :: Text
s3Uri = Text
a} :: S3DataSource)

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

instance Prelude.Hashable S3DataSource where
  hashWithSalt :: Int -> S3DataSource -> Int
hashWithSalt Int
_salt S3DataSource' {Text
s3Uri :: Text
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Uri

instance Prelude.NFData S3DataSource where
  rnf :: S3DataSource -> ()
rnf S3DataSource' {Text
s3Uri :: Text
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
s3Uri

instance Data.ToJSON S3DataSource where
  toJSON :: S3DataSource -> Value
toJSON S3DataSource' {Text
s3Uri :: Text
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"s3Uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3Uri)]
      )