{-# 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.Translate.Types.TerminologyData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Translate.Types.TerminologyDataFormat
data TerminologyData = TerminologyData'
{
TerminologyData -> Sensitive Base64
file :: Core.Sensitive Core.Base64,
TerminologyData -> TerminologyDataFormat
format :: TerminologyDataFormat
}
deriving (TerminologyData -> TerminologyData -> Bool
(TerminologyData -> TerminologyData -> Bool)
-> (TerminologyData -> TerminologyData -> Bool)
-> Eq TerminologyData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminologyData -> TerminologyData -> Bool
$c/= :: TerminologyData -> TerminologyData -> Bool
== :: TerminologyData -> TerminologyData -> Bool
$c== :: TerminologyData -> TerminologyData -> Bool
Prelude.Eq, Int -> TerminologyData -> ShowS
[TerminologyData] -> ShowS
TerminologyData -> String
(Int -> TerminologyData -> ShowS)
-> (TerminologyData -> String)
-> ([TerminologyData] -> ShowS)
-> Show TerminologyData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminologyData] -> ShowS
$cshowList :: [TerminologyData] -> ShowS
show :: TerminologyData -> String
$cshow :: TerminologyData -> String
showsPrec :: Int -> TerminologyData -> ShowS
$cshowsPrec :: Int -> TerminologyData -> ShowS
Prelude.Show, (forall x. TerminologyData -> Rep TerminologyData x)
-> (forall x. Rep TerminologyData x -> TerminologyData)
-> Generic TerminologyData
forall x. Rep TerminologyData x -> TerminologyData
forall x. TerminologyData -> Rep TerminologyData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TerminologyData x -> TerminologyData
$cfrom :: forall x. TerminologyData -> Rep TerminologyData x
Prelude.Generic)
newTerminologyData ::
Prelude.ByteString ->
TerminologyDataFormat ->
TerminologyData
newTerminologyData :: ByteString -> TerminologyDataFormat -> TerminologyData
newTerminologyData ByteString
pFile_ TerminologyDataFormat
pFormat_ =
TerminologyData' :: Sensitive Base64 -> TerminologyDataFormat -> TerminologyData
TerminologyData'
{ $sel:file:TerminologyData' :: Sensitive Base64
file =
Tagged Base64 (Identity Base64)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Base64 (Identity Base64)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64)))
-> (Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64))
-> Tagged ByteString (Identity ByteString)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64 (Tagged ByteString (Identity ByteString)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64)))
-> ByteString -> Sensitive Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pFile_,
$sel:format:TerminologyData' :: TerminologyDataFormat
format = TerminologyDataFormat
pFormat_
}
terminologyData_file :: Lens.Lens' TerminologyData Prelude.ByteString
terminologyData_file :: (ByteString -> f ByteString)
-> TerminologyData -> f TerminologyData
terminologyData_file = (TerminologyData -> Sensitive Base64)
-> (TerminologyData -> Sensitive Base64 -> TerminologyData)
-> Lens
TerminologyData
TerminologyData
(Sensitive Base64)
(Sensitive Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminologyData' {Sensitive Base64
file :: Sensitive Base64
$sel:file:TerminologyData' :: TerminologyData -> Sensitive Base64
file} -> Sensitive Base64
file) (\s :: TerminologyData
s@TerminologyData' {} Sensitive Base64
a -> TerminologyData
s {$sel:file:TerminologyData' :: Sensitive Base64
file = Sensitive Base64
a} :: TerminologyData) ((Sensitive Base64 -> f (Sensitive Base64))
-> TerminologyData -> f TerminologyData)
-> ((ByteString -> f ByteString)
-> Sensitive Base64 -> f (Sensitive Base64))
-> (ByteString -> f ByteString)
-> TerminologyData
-> f TerminologyData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Base64 -> f Base64) -> Sensitive Base64 -> f (Sensitive Base64)
forall a. Iso' (Sensitive a) a
Core._Sensitive ((Base64 -> f Base64) -> Sensitive Base64 -> f (Sensitive Base64))
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> Sensitive Base64
-> f (Sensitive Base64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64
terminologyData_format :: Lens.Lens' TerminologyData TerminologyDataFormat
terminologyData_format :: (TerminologyDataFormat -> f TerminologyDataFormat)
-> TerminologyData -> f TerminologyData
terminologyData_format = (TerminologyData -> TerminologyDataFormat)
-> (TerminologyData -> TerminologyDataFormat -> TerminologyData)
-> Lens
TerminologyData
TerminologyData
TerminologyDataFormat
TerminologyDataFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminologyData' {TerminologyDataFormat
format :: TerminologyDataFormat
$sel:format:TerminologyData' :: TerminologyData -> TerminologyDataFormat
format} -> TerminologyDataFormat
format) (\s :: TerminologyData
s@TerminologyData' {} TerminologyDataFormat
a -> TerminologyData
s {$sel:format:TerminologyData' :: TerminologyDataFormat
format = TerminologyDataFormat
a} :: TerminologyData)
instance Prelude.Hashable TerminologyData
instance Prelude.NFData TerminologyData
instance Core.ToJSON TerminologyData where
toJSON :: TerminologyData -> Value
toJSON TerminologyData' {Sensitive Base64
TerminologyDataFormat
format :: TerminologyDataFormat
file :: Sensitive Base64
$sel:format:TerminologyData' :: TerminologyData -> TerminologyDataFormat
$sel:file:TerminologyData' :: TerminologyData -> Sensitive Base64
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"File" Text -> Sensitive Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Base64
file),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Format" Text -> TerminologyDataFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TerminologyDataFormat
format)
]
)