{-# 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.Translate.Types.ParallelDataDataLocation
-- 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.Translate.Types.ParallelDataDataLocation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The location of the most recent parallel data input file that was
-- successfully imported into Amazon Translate.
--
-- /See:/ 'newParallelDataDataLocation' smart constructor.
data ParallelDataDataLocation = ParallelDataDataLocation'
  { -- | Describes the repository that contains the parallel data input file.
    ParallelDataDataLocation -> Text
repositoryType :: Prelude.Text,
    -- | The Amazon S3 location of the parallel data input file. The location is
    -- returned as a presigned URL to that has a 30 minute expiration.
    ParallelDataDataLocation -> Text
location :: Prelude.Text
  }
  deriving (ParallelDataDataLocation -> ParallelDataDataLocation -> Bool
(ParallelDataDataLocation -> ParallelDataDataLocation -> Bool)
-> (ParallelDataDataLocation -> ParallelDataDataLocation -> Bool)
-> Eq ParallelDataDataLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParallelDataDataLocation -> ParallelDataDataLocation -> Bool
$c/= :: ParallelDataDataLocation -> ParallelDataDataLocation -> Bool
== :: ParallelDataDataLocation -> ParallelDataDataLocation -> Bool
$c== :: ParallelDataDataLocation -> ParallelDataDataLocation -> Bool
Prelude.Eq, ReadPrec [ParallelDataDataLocation]
ReadPrec ParallelDataDataLocation
Int -> ReadS ParallelDataDataLocation
ReadS [ParallelDataDataLocation]
(Int -> ReadS ParallelDataDataLocation)
-> ReadS [ParallelDataDataLocation]
-> ReadPrec ParallelDataDataLocation
-> ReadPrec [ParallelDataDataLocation]
-> Read ParallelDataDataLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParallelDataDataLocation]
$creadListPrec :: ReadPrec [ParallelDataDataLocation]
readPrec :: ReadPrec ParallelDataDataLocation
$creadPrec :: ReadPrec ParallelDataDataLocation
readList :: ReadS [ParallelDataDataLocation]
$creadList :: ReadS [ParallelDataDataLocation]
readsPrec :: Int -> ReadS ParallelDataDataLocation
$creadsPrec :: Int -> ReadS ParallelDataDataLocation
Prelude.Read, Int -> ParallelDataDataLocation -> ShowS
[ParallelDataDataLocation] -> ShowS
ParallelDataDataLocation -> String
(Int -> ParallelDataDataLocation -> ShowS)
-> (ParallelDataDataLocation -> String)
-> ([ParallelDataDataLocation] -> ShowS)
-> Show ParallelDataDataLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParallelDataDataLocation] -> ShowS
$cshowList :: [ParallelDataDataLocation] -> ShowS
show :: ParallelDataDataLocation -> String
$cshow :: ParallelDataDataLocation -> String
showsPrec :: Int -> ParallelDataDataLocation -> ShowS
$cshowsPrec :: Int -> ParallelDataDataLocation -> ShowS
Prelude.Show, (forall x.
 ParallelDataDataLocation -> Rep ParallelDataDataLocation x)
-> (forall x.
    Rep ParallelDataDataLocation x -> ParallelDataDataLocation)
-> Generic ParallelDataDataLocation
forall x.
Rep ParallelDataDataLocation x -> ParallelDataDataLocation
forall x.
ParallelDataDataLocation -> Rep ParallelDataDataLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ParallelDataDataLocation x -> ParallelDataDataLocation
$cfrom :: forall x.
ParallelDataDataLocation -> Rep ParallelDataDataLocation x
Prelude.Generic)

-- |
-- Create a value of 'ParallelDataDataLocation' 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:
--
-- 'repositoryType', 'parallelDataDataLocation_repositoryType' - Describes the repository that contains the parallel data input file.
--
-- 'location', 'parallelDataDataLocation_location' - The Amazon S3 location of the parallel data input file. The location is
-- returned as a presigned URL to that has a 30 minute expiration.
newParallelDataDataLocation ::
  -- | 'repositoryType'
  Prelude.Text ->
  -- | 'location'
  Prelude.Text ->
  ParallelDataDataLocation
newParallelDataDataLocation :: Text -> Text -> ParallelDataDataLocation
newParallelDataDataLocation
  Text
pRepositoryType_
  Text
pLocation_ =
    ParallelDataDataLocation' :: Text -> Text -> ParallelDataDataLocation
ParallelDataDataLocation'
      { $sel:repositoryType:ParallelDataDataLocation' :: Text
repositoryType =
          Text
pRepositoryType_,
        $sel:location:ParallelDataDataLocation' :: Text
location = Text
pLocation_
      }

-- | Describes the repository that contains the parallel data input file.
parallelDataDataLocation_repositoryType :: Lens.Lens' ParallelDataDataLocation Prelude.Text
parallelDataDataLocation_repositoryType :: (Text -> f Text)
-> ParallelDataDataLocation -> f ParallelDataDataLocation
parallelDataDataLocation_repositoryType = (ParallelDataDataLocation -> Text)
-> (ParallelDataDataLocation -> Text -> ParallelDataDataLocation)
-> Lens ParallelDataDataLocation ParallelDataDataLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelDataDataLocation' {Text
repositoryType :: Text
$sel:repositoryType:ParallelDataDataLocation' :: ParallelDataDataLocation -> Text
repositoryType} -> Text
repositoryType) (\s :: ParallelDataDataLocation
s@ParallelDataDataLocation' {} Text
a -> ParallelDataDataLocation
s {$sel:repositoryType:ParallelDataDataLocation' :: Text
repositoryType = Text
a} :: ParallelDataDataLocation)

-- | The Amazon S3 location of the parallel data input file. The location is
-- returned as a presigned URL to that has a 30 minute expiration.
parallelDataDataLocation_location :: Lens.Lens' ParallelDataDataLocation Prelude.Text
parallelDataDataLocation_location :: (Text -> f Text)
-> ParallelDataDataLocation -> f ParallelDataDataLocation
parallelDataDataLocation_location = (ParallelDataDataLocation -> Text)
-> (ParallelDataDataLocation -> Text -> ParallelDataDataLocation)
-> Lens ParallelDataDataLocation ParallelDataDataLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelDataDataLocation' {Text
location :: Text
$sel:location:ParallelDataDataLocation' :: ParallelDataDataLocation -> Text
location} -> Text
location) (\s :: ParallelDataDataLocation
s@ParallelDataDataLocation' {} Text
a -> ParallelDataDataLocation
s {$sel:location:ParallelDataDataLocation' :: Text
location = Text
a} :: ParallelDataDataLocation)

instance Core.FromJSON ParallelDataDataLocation where
  parseJSON :: Value -> Parser ParallelDataDataLocation
parseJSON =
    String
-> (Object -> Parser ParallelDataDataLocation)
-> Value
-> Parser ParallelDataDataLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ParallelDataDataLocation"
      ( \Object
x ->
          Text -> Text -> ParallelDataDataLocation
ParallelDataDataLocation'
            (Text -> Text -> ParallelDataDataLocation)
-> Parser Text -> Parser (Text -> ParallelDataDataLocation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RepositoryType")
            Parser (Text -> ParallelDataDataLocation)
-> Parser Text -> Parser ParallelDataDataLocation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Location")
      )

instance Prelude.Hashable ParallelDataDataLocation

instance Prelude.NFData ParallelDataDataLocation