{-# 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 #-}
module Amazonka.Glacier.Types.CSVOutput where
import qualified Amazonka.Core as Core
import Amazonka.Glacier.Types.QuoteFields
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CSVOutput = CSVOutput'
{
CSVOutput -> Maybe Text
quoteCharacter :: Prelude.Maybe Prelude.Text,
CSVOutput -> Maybe QuoteFields
quoteFields :: Prelude.Maybe QuoteFields,
CSVOutput -> Maybe Text
recordDelimiter :: Prelude.Maybe Prelude.Text,
CSVOutput -> Maybe Text
quoteEscapeCharacter :: Prelude.Maybe Prelude.Text,
CSVOutput -> Maybe Text
fieldDelimiter :: Prelude.Maybe Prelude.Text
}
deriving (CSVOutput -> CSVOutput -> Bool
(CSVOutput -> CSVOutput -> Bool)
-> (CSVOutput -> CSVOutput -> Bool) -> Eq CSVOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CSVOutput -> CSVOutput -> Bool
$c/= :: CSVOutput -> CSVOutput -> Bool
== :: CSVOutput -> CSVOutput -> Bool
$c== :: CSVOutput -> CSVOutput -> Bool
Prelude.Eq, ReadPrec [CSVOutput]
ReadPrec CSVOutput
Int -> ReadS CSVOutput
ReadS [CSVOutput]
(Int -> ReadS CSVOutput)
-> ReadS [CSVOutput]
-> ReadPrec CSVOutput
-> ReadPrec [CSVOutput]
-> Read CSVOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CSVOutput]
$creadListPrec :: ReadPrec [CSVOutput]
readPrec :: ReadPrec CSVOutput
$creadPrec :: ReadPrec CSVOutput
readList :: ReadS [CSVOutput]
$creadList :: ReadS [CSVOutput]
readsPrec :: Int -> ReadS CSVOutput
$creadsPrec :: Int -> ReadS CSVOutput
Prelude.Read, Int -> CSVOutput -> ShowS
[CSVOutput] -> ShowS
CSVOutput -> String
(Int -> CSVOutput -> ShowS)
-> (CSVOutput -> String)
-> ([CSVOutput] -> ShowS)
-> Show CSVOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CSVOutput] -> ShowS
$cshowList :: [CSVOutput] -> ShowS
show :: CSVOutput -> String
$cshow :: CSVOutput -> String
showsPrec :: Int -> CSVOutput -> ShowS
$cshowsPrec :: Int -> CSVOutput -> ShowS
Prelude.Show, (forall x. CSVOutput -> Rep CSVOutput x)
-> (forall x. Rep CSVOutput x -> CSVOutput) -> Generic CSVOutput
forall x. Rep CSVOutput x -> CSVOutput
forall x. CSVOutput -> Rep CSVOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CSVOutput x -> CSVOutput
$cfrom :: forall x. CSVOutput -> Rep CSVOutput x
Prelude.Generic)
newCSVOutput ::
CSVOutput
newCSVOutput :: CSVOutput
newCSVOutput =
CSVOutput' :: Maybe Text
-> Maybe QuoteFields
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CSVOutput
CSVOutput'
{ $sel:quoteCharacter:CSVOutput' :: Maybe Text
quoteCharacter = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:quoteFields:CSVOutput' :: Maybe QuoteFields
quoteFields = Maybe QuoteFields
forall a. Maybe a
Prelude.Nothing,
$sel:recordDelimiter:CSVOutput' :: Maybe Text
recordDelimiter = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:quoteEscapeCharacter:CSVOutput' :: Maybe Text
quoteEscapeCharacter = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fieldDelimiter:CSVOutput' :: Maybe Text
fieldDelimiter = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cSVOutput_quoteCharacter :: Lens.Lens' CSVOutput (Prelude.Maybe Prelude.Text)
cSVOutput_quoteCharacter :: (Maybe Text -> f (Maybe Text)) -> CSVOutput -> f CSVOutput
cSVOutput_quoteCharacter = (CSVOutput -> Maybe Text)
-> (CSVOutput -> Maybe Text -> CSVOutput)
-> Lens CSVOutput CSVOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CSVOutput' {Maybe Text
quoteCharacter :: Maybe Text
$sel:quoteCharacter:CSVOutput' :: CSVOutput -> Maybe Text
quoteCharacter} -> Maybe Text
quoteCharacter) (\s :: CSVOutput
s@CSVOutput' {} Maybe Text
a -> CSVOutput
s {$sel:quoteCharacter:CSVOutput' :: Maybe Text
quoteCharacter = Maybe Text
a} :: CSVOutput)
cSVOutput_quoteFields :: Lens.Lens' CSVOutput (Prelude.Maybe QuoteFields)
cSVOutput_quoteFields :: (Maybe QuoteFields -> f (Maybe QuoteFields))
-> CSVOutput -> f CSVOutput
cSVOutput_quoteFields = (CSVOutput -> Maybe QuoteFields)
-> (CSVOutput -> Maybe QuoteFields -> CSVOutput)
-> Lens CSVOutput CSVOutput (Maybe QuoteFields) (Maybe QuoteFields)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CSVOutput' {Maybe QuoteFields
quoteFields :: Maybe QuoteFields
$sel:quoteFields:CSVOutput' :: CSVOutput -> Maybe QuoteFields
quoteFields} -> Maybe QuoteFields
quoteFields) (\s :: CSVOutput
s@CSVOutput' {} Maybe QuoteFields
a -> CSVOutput
s {$sel:quoteFields:CSVOutput' :: Maybe QuoteFields
quoteFields = Maybe QuoteFields
a} :: CSVOutput)
cSVOutput_recordDelimiter :: Lens.Lens' CSVOutput (Prelude.Maybe Prelude.Text)
cSVOutput_recordDelimiter :: (Maybe Text -> f (Maybe Text)) -> CSVOutput -> f CSVOutput
cSVOutput_recordDelimiter = (CSVOutput -> Maybe Text)
-> (CSVOutput -> Maybe Text -> CSVOutput)
-> Lens CSVOutput CSVOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CSVOutput' {Maybe Text
recordDelimiter :: Maybe Text
$sel:recordDelimiter:CSVOutput' :: CSVOutput -> Maybe Text
recordDelimiter} -> Maybe Text
recordDelimiter) (\s :: CSVOutput
s@CSVOutput' {} Maybe Text
a -> CSVOutput
s {$sel:recordDelimiter:CSVOutput' :: Maybe Text
recordDelimiter = Maybe Text
a} :: CSVOutput)
cSVOutput_quoteEscapeCharacter :: Lens.Lens' CSVOutput (Prelude.Maybe Prelude.Text)
cSVOutput_quoteEscapeCharacter :: (Maybe Text -> f (Maybe Text)) -> CSVOutput -> f CSVOutput
cSVOutput_quoteEscapeCharacter = (CSVOutput -> Maybe Text)
-> (CSVOutput -> Maybe Text -> CSVOutput)
-> Lens CSVOutput CSVOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CSVOutput' {Maybe Text
quoteEscapeCharacter :: Maybe Text
$sel:quoteEscapeCharacter:CSVOutput' :: CSVOutput -> Maybe Text
quoteEscapeCharacter} -> Maybe Text
quoteEscapeCharacter) (\s :: CSVOutput
s@CSVOutput' {} Maybe Text
a -> CSVOutput
s {$sel:quoteEscapeCharacter:CSVOutput' :: Maybe Text
quoteEscapeCharacter = Maybe Text
a} :: CSVOutput)
cSVOutput_fieldDelimiter :: Lens.Lens' CSVOutput (Prelude.Maybe Prelude.Text)
cSVOutput_fieldDelimiter :: (Maybe Text -> f (Maybe Text)) -> CSVOutput -> f CSVOutput
cSVOutput_fieldDelimiter = (CSVOutput -> Maybe Text)
-> (CSVOutput -> Maybe Text -> CSVOutput)
-> Lens CSVOutput CSVOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CSVOutput' {Maybe Text
fieldDelimiter :: Maybe Text
$sel:fieldDelimiter:CSVOutput' :: CSVOutput -> Maybe Text
fieldDelimiter} -> Maybe Text
fieldDelimiter) (\s :: CSVOutput
s@CSVOutput' {} Maybe Text
a -> CSVOutput
s {$sel:fieldDelimiter:CSVOutput' :: Maybe Text
fieldDelimiter = Maybe Text
a} :: CSVOutput)
instance Core.FromJSON CSVOutput where
parseJSON :: Value -> Parser CSVOutput
parseJSON =
String -> (Object -> Parser CSVOutput) -> Value -> Parser CSVOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CSVOutput"
( \Object
x ->
Maybe Text
-> Maybe QuoteFields
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CSVOutput
CSVOutput'
(Maybe Text
-> Maybe QuoteFields
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CSVOutput)
-> Parser (Maybe Text)
-> Parser
(Maybe QuoteFields
-> Maybe Text -> Maybe Text -> Maybe Text -> CSVOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuoteCharacter")
Parser
(Maybe QuoteFields
-> Maybe Text -> Maybe Text -> Maybe Text -> CSVOutput)
-> Parser (Maybe QuoteFields)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> CSVOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QuoteFields)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuoteFields")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> CSVOutput)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> CSVOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RecordDelimiter")
Parser (Maybe Text -> Maybe Text -> CSVOutput)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CSVOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuoteEscapeCharacter")
Parser (Maybe Text -> CSVOutput)
-> Parser (Maybe Text) -> Parser CSVOutput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FieldDelimiter")
)
instance Prelude.Hashable CSVOutput
instance Prelude.NFData CSVOutput
instance Core.ToJSON CSVOutput where
toJSON :: CSVOutput -> Value
toJSON CSVOutput' {Maybe Text
Maybe QuoteFields
fieldDelimiter :: Maybe Text
quoteEscapeCharacter :: Maybe Text
recordDelimiter :: Maybe Text
quoteFields :: Maybe QuoteFields
quoteCharacter :: Maybe Text
$sel:fieldDelimiter:CSVOutput' :: CSVOutput -> Maybe Text
$sel:quoteEscapeCharacter:CSVOutput' :: CSVOutput -> Maybe Text
$sel:recordDelimiter:CSVOutput' :: CSVOutput -> Maybe Text
$sel:quoteFields:CSVOutput' :: CSVOutput -> Maybe QuoteFields
$sel:quoteCharacter:CSVOutput' :: CSVOutput -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"QuoteCharacter" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
quoteCharacter,
(Text
"QuoteFields" Text -> QuoteFields -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (QuoteFields -> Pair) -> Maybe QuoteFields -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe QuoteFields
quoteFields,
(Text
"RecordDelimiter" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
recordDelimiter,
(Text
"QuoteEscapeCharacter" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
quoteEscapeCharacter,
(Text
"FieldDelimiter" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fieldDelimiter
]
)