{-# 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.IoTAnalytics.Types.OutputFileUriValue
-- 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.IoTAnalytics.Types.OutputFileUriValue 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

-- | The value of the variable as a structure that specifies an output file
-- URI.
--
-- /See:/ 'newOutputFileUriValue' smart constructor.
data OutputFileUriValue = OutputFileUriValue'
  { -- | The URI of the location where dataset contents are stored, usually the
    -- URI of a file in an S3 bucket.
    OutputFileUriValue -> Text
fileName :: Prelude.Text
  }
  deriving (OutputFileUriValue -> OutputFileUriValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputFileUriValue -> OutputFileUriValue -> Bool
$c/= :: OutputFileUriValue -> OutputFileUriValue -> Bool
== :: OutputFileUriValue -> OutputFileUriValue -> Bool
$c== :: OutputFileUriValue -> OutputFileUriValue -> Bool
Prelude.Eq, ReadPrec [OutputFileUriValue]
ReadPrec OutputFileUriValue
Int -> ReadS OutputFileUriValue
ReadS [OutputFileUriValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputFileUriValue]
$creadListPrec :: ReadPrec [OutputFileUriValue]
readPrec :: ReadPrec OutputFileUriValue
$creadPrec :: ReadPrec OutputFileUriValue
readList :: ReadS [OutputFileUriValue]
$creadList :: ReadS [OutputFileUriValue]
readsPrec :: Int -> ReadS OutputFileUriValue
$creadsPrec :: Int -> ReadS OutputFileUriValue
Prelude.Read, Int -> OutputFileUriValue -> ShowS
[OutputFileUriValue] -> ShowS
OutputFileUriValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputFileUriValue] -> ShowS
$cshowList :: [OutputFileUriValue] -> ShowS
show :: OutputFileUriValue -> String
$cshow :: OutputFileUriValue -> String
showsPrec :: Int -> OutputFileUriValue -> ShowS
$cshowsPrec :: Int -> OutputFileUriValue -> ShowS
Prelude.Show, forall x. Rep OutputFileUriValue x -> OutputFileUriValue
forall x. OutputFileUriValue -> Rep OutputFileUriValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputFileUriValue x -> OutputFileUriValue
$cfrom :: forall x. OutputFileUriValue -> Rep OutputFileUriValue x
Prelude.Generic)

-- |
-- Create a value of 'OutputFileUriValue' 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:
--
-- 'fileName', 'outputFileUriValue_fileName' - The URI of the location where dataset contents are stored, usually the
-- URI of a file in an S3 bucket.
newOutputFileUriValue ::
  -- | 'fileName'
  Prelude.Text ->
  OutputFileUriValue
newOutputFileUriValue :: Text -> OutputFileUriValue
newOutputFileUriValue Text
pFileName_ =
  OutputFileUriValue' {$sel:fileName:OutputFileUriValue' :: Text
fileName = Text
pFileName_}

-- | The URI of the location where dataset contents are stored, usually the
-- URI of a file in an S3 bucket.
outputFileUriValue_fileName :: Lens.Lens' OutputFileUriValue Prelude.Text
outputFileUriValue_fileName :: Lens' OutputFileUriValue Text
outputFileUriValue_fileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputFileUriValue' {Text
fileName :: Text
$sel:fileName:OutputFileUriValue' :: OutputFileUriValue -> Text
fileName} -> Text
fileName) (\s :: OutputFileUriValue
s@OutputFileUriValue' {} Text
a -> OutputFileUriValue
s {$sel:fileName:OutputFileUriValue' :: Text
fileName = Text
a} :: OutputFileUriValue)

instance Data.FromJSON OutputFileUriValue where
  parseJSON :: Value -> Parser OutputFileUriValue
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OutputFileUriValue"
      ( \Object
x ->
          Text -> OutputFileUriValue
OutputFileUriValue'
            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
"fileName")
      )

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

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

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