{-# 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.JSONInput
-- 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.JSONInput 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
import Amazonka.S3.Types.JSONType

-- | Specifies JSON as object\'s input serialization format.
--
-- /See:/ 'newJSONInput' smart constructor.
data JSONInput = JSONInput'
  { -- | The type of JSON. Valid values: Document, Lines.
    JSONInput -> Maybe JSONType
type' :: Prelude.Maybe JSONType
  }
  deriving (JSONInput -> JSONInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JSONInput -> JSONInput -> Bool
$c/= :: JSONInput -> JSONInput -> Bool
== :: JSONInput -> JSONInput -> Bool
$c== :: JSONInput -> JSONInput -> Bool
Prelude.Eq, ReadPrec [JSONInput]
ReadPrec JSONInput
Int -> ReadS JSONInput
ReadS [JSONInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JSONInput]
$creadListPrec :: ReadPrec [JSONInput]
readPrec :: ReadPrec JSONInput
$creadPrec :: ReadPrec JSONInput
readList :: ReadS [JSONInput]
$creadList :: ReadS [JSONInput]
readsPrec :: Int -> ReadS JSONInput
$creadsPrec :: Int -> ReadS JSONInput
Prelude.Read, Int -> JSONInput -> ShowS
[JSONInput] -> ShowS
JSONInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JSONInput] -> ShowS
$cshowList :: [JSONInput] -> ShowS
show :: JSONInput -> String
$cshow :: JSONInput -> String
showsPrec :: Int -> JSONInput -> ShowS
$cshowsPrec :: Int -> JSONInput -> ShowS
Prelude.Show, forall x. Rep JSONInput x -> JSONInput
forall x. JSONInput -> Rep JSONInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JSONInput x -> JSONInput
$cfrom :: forall x. JSONInput -> Rep JSONInput x
Prelude.Generic)

-- |
-- Create a value of 'JSONInput' 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:
--
-- 'type'', 'jSONInput_type' - The type of JSON. Valid values: Document, Lines.
newJSONInput ::
  JSONInput
newJSONInput :: JSONInput
newJSONInput = JSONInput' {$sel:type':JSONInput' :: Maybe JSONType
type' = forall a. Maybe a
Prelude.Nothing}

-- | The type of JSON. Valid values: Document, Lines.
jSONInput_type :: Lens.Lens' JSONInput (Prelude.Maybe JSONType)
jSONInput_type :: Lens' JSONInput (Maybe JSONType)
jSONInput_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JSONInput' {Maybe JSONType
type' :: Maybe JSONType
$sel:type':JSONInput' :: JSONInput -> Maybe JSONType
type'} -> Maybe JSONType
type') (\s :: JSONInput
s@JSONInput' {} Maybe JSONType
a -> JSONInput
s {$sel:type':JSONInput' :: Maybe JSONType
type' = Maybe JSONType
a} :: JSONInput)

instance Prelude.Hashable JSONInput where
  hashWithSalt :: Int -> JSONInput -> Int
hashWithSalt Int
_salt JSONInput' {Maybe JSONType
type' :: Maybe JSONType
$sel:type':JSONInput' :: JSONInput -> Maybe JSONType
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JSONType
type'

instance Prelude.NFData JSONInput where
  rnf :: JSONInput -> ()
rnf JSONInput' {Maybe JSONType
type' :: Maybe JSONType
$sel:type':JSONInput' :: JSONInput -> Maybe JSONType
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe JSONType
type'

instance Data.ToXML JSONInput where
  toXML :: JSONInput -> XML
toXML JSONInput' {Maybe JSONType
type' :: Maybe JSONType
$sel:type':JSONInput' :: JSONInput -> Maybe JSONType
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"Type" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe JSONType
type']