{-# 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.SageMaker.Types.CaptureContentTypeHeader where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data =
{ :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
:: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
}
deriving (CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool
(CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool)
-> (CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool)
-> Eq CaptureContentTypeHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool
$c/= :: CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool
== :: CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool
$c== :: CaptureContentTypeHeader -> CaptureContentTypeHeader -> Bool
Prelude.Eq, ReadPrec [CaptureContentTypeHeader]
ReadPrec CaptureContentTypeHeader
Int -> ReadS CaptureContentTypeHeader
ReadS [CaptureContentTypeHeader]
(Int -> ReadS CaptureContentTypeHeader)
-> ReadS [CaptureContentTypeHeader]
-> ReadPrec CaptureContentTypeHeader
-> ReadPrec [CaptureContentTypeHeader]
-> Read CaptureContentTypeHeader
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptureContentTypeHeader]
$creadListPrec :: ReadPrec [CaptureContentTypeHeader]
readPrec :: ReadPrec CaptureContentTypeHeader
$creadPrec :: ReadPrec CaptureContentTypeHeader
readList :: ReadS [CaptureContentTypeHeader]
$creadList :: ReadS [CaptureContentTypeHeader]
readsPrec :: Int -> ReadS CaptureContentTypeHeader
$creadsPrec :: Int -> ReadS CaptureContentTypeHeader
Prelude.Read, Int -> CaptureContentTypeHeader -> ShowS
[CaptureContentTypeHeader] -> ShowS
CaptureContentTypeHeader -> String
(Int -> CaptureContentTypeHeader -> ShowS)
-> (CaptureContentTypeHeader -> String)
-> ([CaptureContentTypeHeader] -> ShowS)
-> Show CaptureContentTypeHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptureContentTypeHeader] -> ShowS
$cshowList :: [CaptureContentTypeHeader] -> ShowS
show :: CaptureContentTypeHeader -> String
$cshow :: CaptureContentTypeHeader -> String
showsPrec :: Int -> CaptureContentTypeHeader -> ShowS
$cshowsPrec :: Int -> CaptureContentTypeHeader -> ShowS
Prelude.Show, (forall x.
CaptureContentTypeHeader -> Rep CaptureContentTypeHeader x)
-> (forall x.
Rep CaptureContentTypeHeader x -> CaptureContentTypeHeader)
-> Generic CaptureContentTypeHeader
forall x.
Rep CaptureContentTypeHeader x -> CaptureContentTypeHeader
forall x.
CaptureContentTypeHeader -> Rep CaptureContentTypeHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CaptureContentTypeHeader x -> CaptureContentTypeHeader
$cfrom :: forall x.
CaptureContentTypeHeader -> Rep CaptureContentTypeHeader x
Prelude.Generic)
newCaptureContentTypeHeader ::
CaptureContentTypeHeader
=
CaptureContentTypeHeader' :: Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text) -> CaptureContentTypeHeader
CaptureContentTypeHeader'
{ $sel:csvContentTypes:CaptureContentTypeHeader' :: Maybe (NonEmpty Text)
csvContentTypes =
Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:jsonContentTypes:CaptureContentTypeHeader' :: Maybe (NonEmpty Text)
jsonContentTypes = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing
}
captureContentTypeHeader_csvContentTypes :: Lens.Lens' CaptureContentTypeHeader (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
= (CaptureContentTypeHeader -> Maybe (NonEmpty Text))
-> (CaptureContentTypeHeader
-> Maybe (NonEmpty Text) -> CaptureContentTypeHeader)
-> Lens
CaptureContentTypeHeader
CaptureContentTypeHeader
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptureContentTypeHeader' {Maybe (NonEmpty Text)
csvContentTypes :: Maybe (NonEmpty Text)
$sel:csvContentTypes:CaptureContentTypeHeader' :: CaptureContentTypeHeader -> Maybe (NonEmpty Text)
csvContentTypes} -> Maybe (NonEmpty Text)
csvContentTypes) (\s :: CaptureContentTypeHeader
s@CaptureContentTypeHeader' {} Maybe (NonEmpty Text)
a -> CaptureContentTypeHeader
s {$sel:csvContentTypes:CaptureContentTypeHeader' :: Maybe (NonEmpty Text)
csvContentTypes = Maybe (NonEmpty Text)
a} :: CaptureContentTypeHeader) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CaptureContentTypeHeader -> f CaptureContentTypeHeader)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CaptureContentTypeHeader
-> f CaptureContentTypeHeader
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
captureContentTypeHeader_jsonContentTypes :: Lens.Lens' CaptureContentTypeHeader (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
= (CaptureContentTypeHeader -> Maybe (NonEmpty Text))
-> (CaptureContentTypeHeader
-> Maybe (NonEmpty Text) -> CaptureContentTypeHeader)
-> Lens
CaptureContentTypeHeader
CaptureContentTypeHeader
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptureContentTypeHeader' {Maybe (NonEmpty Text)
jsonContentTypes :: Maybe (NonEmpty Text)
$sel:jsonContentTypes:CaptureContentTypeHeader' :: CaptureContentTypeHeader -> Maybe (NonEmpty Text)
jsonContentTypes} -> Maybe (NonEmpty Text)
jsonContentTypes) (\s :: CaptureContentTypeHeader
s@CaptureContentTypeHeader' {} Maybe (NonEmpty Text)
a -> CaptureContentTypeHeader
s {$sel:jsonContentTypes:CaptureContentTypeHeader' :: Maybe (NonEmpty Text)
jsonContentTypes = Maybe (NonEmpty Text)
a} :: CaptureContentTypeHeader) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CaptureContentTypeHeader -> f CaptureContentTypeHeader)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CaptureContentTypeHeader
-> f CaptureContentTypeHeader
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CaptureContentTypeHeader where
parseJSON :: Value -> Parser CaptureContentTypeHeader
parseJSON =
String
-> (Object -> Parser CaptureContentTypeHeader)
-> Value
-> Parser CaptureContentTypeHeader
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CaptureContentTypeHeader"
( \Object
x ->
Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text) -> CaptureContentTypeHeader
CaptureContentTypeHeader'
(Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text) -> CaptureContentTypeHeader)
-> Parser (Maybe (NonEmpty Text))
-> Parser (Maybe (NonEmpty Text) -> CaptureContentTypeHeader)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CsvContentTypes")
Parser (Maybe (NonEmpty Text) -> CaptureContentTypeHeader)
-> Parser (Maybe (NonEmpty Text))
-> Parser CaptureContentTypeHeader
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JsonContentTypes")
)
instance Prelude.Hashable CaptureContentTypeHeader
instance Prelude.NFData CaptureContentTypeHeader
instance Core.ToJSON CaptureContentTypeHeader where
toJSON :: CaptureContentTypeHeader -> Value
toJSON CaptureContentTypeHeader' {Maybe (NonEmpty Text)
jsonContentTypes :: Maybe (NonEmpty Text)
csvContentTypes :: Maybe (NonEmpty Text)
$sel:jsonContentTypes:CaptureContentTypeHeader' :: CaptureContentTypeHeader -> Maybe (NonEmpty Text)
$sel:csvContentTypes:CaptureContentTypeHeader' :: CaptureContentTypeHeader -> Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CsvContentTypes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
csvContentTypes,
(Text
"JsonContentTypes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
jsonContentTypes
]
)