{-# 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.S3.Types.JSONOutput
-- 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.S3.Types.JSONOutput 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
import Amazonka.S3.Internal

-- | Specifies JSON as request\'s output serialization format.
--
-- /See:/ 'newJSONOutput' smart constructor.
data JSONOutput = JSONOutput'
  { -- | The value used to separate individual records in the output. If no value
    -- is specified, Amazon S3 uses a newline character (\'\\n\').
    JSONOutput -> Maybe Text
recordDelimiter :: Prelude.Maybe Prelude.Text
  }
  deriving (JSONOutput -> JSONOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JSONOutput -> JSONOutput -> Bool
$c/= :: JSONOutput -> JSONOutput -> Bool
== :: JSONOutput -> JSONOutput -> Bool
$c== :: JSONOutput -> JSONOutput -> Bool
Prelude.Eq, ReadPrec [JSONOutput]
ReadPrec JSONOutput
Int -> ReadS JSONOutput
ReadS [JSONOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JSONOutput]
$creadListPrec :: ReadPrec [JSONOutput]
readPrec :: ReadPrec JSONOutput
$creadPrec :: ReadPrec JSONOutput
readList :: ReadS [JSONOutput]
$creadList :: ReadS [JSONOutput]
readsPrec :: Int -> ReadS JSONOutput
$creadsPrec :: Int -> ReadS JSONOutput
Prelude.Read, Int -> JSONOutput -> ShowS
[JSONOutput] -> ShowS
JSONOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JSONOutput] -> ShowS
$cshowList :: [JSONOutput] -> ShowS
show :: JSONOutput -> String
$cshow :: JSONOutput -> String
showsPrec :: Int -> JSONOutput -> ShowS
$cshowsPrec :: Int -> JSONOutput -> ShowS
Prelude.Show, forall x. Rep JSONOutput x -> JSONOutput
forall x. JSONOutput -> Rep JSONOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JSONOutput x -> JSONOutput
$cfrom :: forall x. JSONOutput -> Rep JSONOutput x
Prelude.Generic)

-- |
-- Create a value of 'JSONOutput' 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:
--
-- 'recordDelimiter', 'jSONOutput_recordDelimiter' - The value used to separate individual records in the output. If no value
-- is specified, Amazon S3 uses a newline character (\'\\n\').
newJSONOutput ::
  JSONOutput
newJSONOutput :: JSONOutput
newJSONOutput =
  JSONOutput' {$sel:recordDelimiter:JSONOutput' :: Maybe Text
recordDelimiter = forall a. Maybe a
Prelude.Nothing}

-- | The value used to separate individual records in the output. If no value
-- is specified, Amazon S3 uses a newline character (\'\\n\').
jSONOutput_recordDelimiter :: Lens.Lens' JSONOutput (Prelude.Maybe Prelude.Text)
jSONOutput_recordDelimiter :: Lens' JSONOutput (Maybe Text)
jSONOutput_recordDelimiter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JSONOutput' {Maybe Text
recordDelimiter :: Maybe Text
$sel:recordDelimiter:JSONOutput' :: JSONOutput -> Maybe Text
recordDelimiter} -> Maybe Text
recordDelimiter) (\s :: JSONOutput
s@JSONOutput' {} Maybe Text
a -> JSONOutput
s {$sel:recordDelimiter:JSONOutput' :: Maybe Text
recordDelimiter = Maybe Text
a} :: JSONOutput)

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

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

instance Data.ToXML JSONOutput where
  toXML :: JSONOutput -> XML
toXML JSONOutput' {Maybe Text
recordDelimiter :: Maybe Text
$sel:recordDelimiter:JSONOutput' :: JSONOutput -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [Name
"RecordDelimiter" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
recordDelimiter]