{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Translate.Types.Directionality
import Amazonka.Translate.Types.TerminologyDataFormat
data TerminologyData = TerminologyData'
{
TerminologyData -> Maybe Directionality
directionality :: Prelude.Maybe Directionality,
TerminologyData -> Sensitive Base64
file :: Data.Sensitive Data.Base64,
TerminologyData -> TerminologyDataFormat
format :: TerminologyDataFormat
}
deriving (TerminologyData -> TerminologyData -> Bool
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
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. 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'
{ $sel:directionality:TerminologyData' :: Maybe Directionality
directionality = forall a. Maybe a
Prelude.Nothing,
$sel:file:TerminologyData' :: Sensitive Base64
file =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Iso' Base64 ByteString
Data._Base64 forall t b. AReview t b -> b -> t
Lens.# ByteString
pFile_,
$sel:format:TerminologyData' :: TerminologyDataFormat
format = TerminologyDataFormat
pFormat_
}
terminologyData_directionality :: Lens.Lens' TerminologyData (Prelude.Maybe Directionality)
terminologyData_directionality :: Lens' TerminologyData (Maybe Directionality)
terminologyData_directionality = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminologyData' {Maybe Directionality
directionality :: Maybe Directionality
$sel:directionality:TerminologyData' :: TerminologyData -> Maybe Directionality
directionality} -> Maybe Directionality
directionality) (\s :: TerminologyData
s@TerminologyData' {} Maybe Directionality
a -> TerminologyData
s {$sel:directionality:TerminologyData' :: Maybe Directionality
directionality = Maybe Directionality
a} :: TerminologyData)
terminologyData_file :: Lens.Lens' TerminologyData Prelude.ByteString
terminologyData_file :: Lens' TerminologyData ByteString
terminologyData_file = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Iso' Base64 ByteString
Data._Base64
terminologyData_format :: Lens.Lens' TerminologyData TerminologyDataFormat
terminologyData_format :: Lens' TerminologyData TerminologyDataFormat
terminologyData_format = 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 where
hashWithSalt :: Int -> TerminologyData -> Int
hashWithSalt Int
_salt TerminologyData' {Maybe Directionality
Sensitive Base64
TerminologyDataFormat
format :: TerminologyDataFormat
file :: Sensitive Base64
directionality :: Maybe Directionality
$sel:format:TerminologyData' :: TerminologyData -> TerminologyDataFormat
$sel:file:TerminologyData' :: TerminologyData -> Sensitive Base64
$sel:directionality:TerminologyData' :: TerminologyData -> Maybe Directionality
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Directionality
directionality
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Base64
file
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TerminologyDataFormat
format
instance Prelude.NFData TerminologyData where
rnf :: TerminologyData -> ()
rnf TerminologyData' {Maybe Directionality
Sensitive Base64
TerminologyDataFormat
format :: TerminologyDataFormat
file :: Sensitive Base64
directionality :: Maybe Directionality
$sel:format:TerminologyData' :: TerminologyData -> TerminologyDataFormat
$sel:file:TerminologyData' :: TerminologyData -> Sensitive Base64
$sel:directionality:TerminologyData' :: TerminologyData -> Maybe Directionality
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Directionality
directionality
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Base64
file
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TerminologyDataFormat
format
instance Data.ToJSON TerminologyData where
toJSON :: TerminologyData -> Value
toJSON TerminologyData' {Maybe Directionality
Sensitive Base64
TerminologyDataFormat
format :: TerminologyDataFormat
file :: Sensitive Base64
directionality :: Maybe Directionality
$sel:format:TerminologyData' :: TerminologyData -> TerminologyDataFormat
$sel:file:TerminologyData' :: TerminologyData -> Sensitive Base64
$sel:directionality:TerminologyData' :: TerminologyData -> Maybe Directionality
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Directionality" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Directionality
directionality,
forall a. a -> Maybe a
Prelude.Just (Key
"File" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Base64
file),
forall a. a -> Maybe a
Prelude.Just (Key
"Format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TerminologyDataFormat
format)
]
)