{-# 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-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.S3.Types.JSONInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(JSONInput -> JSONInput -> Bool)
-> (JSONInput -> JSONInput -> Bool) -> Eq JSONInput
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]
(Int -> ReadS JSONInput)
-> ReadS [JSONInput]
-> ReadPrec JSONInput
-> ReadPrec [JSONInput]
-> Read 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
(Int -> JSONInput -> ShowS)
-> (JSONInput -> String)
-> ([JSONInput] -> ShowS)
-> Show JSONInput
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. JSONInput -> Rep JSONInput x)
-> (forall x. Rep JSONInput x -> JSONInput) -> Generic JSONInput
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' :: Maybe JSONType -> JSONInput
JSONInput' {$sel:type':JSONInput' :: Maybe JSONType
type' = Maybe JSONType
forall a. Maybe a
Prelude.Nothing}

-- | The type of JSON. Valid values: Document, Lines.
jSONInput_type :: Lens.Lens' JSONInput (Prelude.Maybe JSONType)
jSONInput_type :: (Maybe JSONType -> f (Maybe JSONType)) -> JSONInput -> f JSONInput
jSONInput_type = (JSONInput -> Maybe JSONType)
-> (JSONInput -> Maybe JSONType -> JSONInput)
-> Lens JSONInput JSONInput (Maybe JSONType) (Maybe JSONType)
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

instance Prelude.NFData JSONInput

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