{-# 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.Omics.Types.ReadSetFiles
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Omics.Types.ReadSetFiles where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Omics.Types.FileInformation
import qualified Amazonka.Prelude as Prelude

-- | Files in a read set.
--
-- /See:/ 'newReadSetFiles' smart constructor.
data ReadSetFiles = ReadSetFiles'
  { -- | The files\' index.
    ReadSetFiles -> Maybe FileInformation
index :: Prelude.Maybe FileInformation,
    -- | The location of the first file in Amazon S3.
    ReadSetFiles -> Maybe FileInformation
source1 :: Prelude.Maybe FileInformation,
    -- | The location of the second file in Amazon S3.
    ReadSetFiles -> Maybe FileInformation
source2 :: Prelude.Maybe FileInformation
  }
  deriving (ReadSetFiles -> ReadSetFiles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReadSetFiles -> ReadSetFiles -> Bool
$c/= :: ReadSetFiles -> ReadSetFiles -> Bool
== :: ReadSetFiles -> ReadSetFiles -> Bool
$c== :: ReadSetFiles -> ReadSetFiles -> Bool
Prelude.Eq, ReadPrec [ReadSetFiles]
ReadPrec ReadSetFiles
Int -> ReadS ReadSetFiles
ReadS [ReadSetFiles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReadSetFiles]
$creadListPrec :: ReadPrec [ReadSetFiles]
readPrec :: ReadPrec ReadSetFiles
$creadPrec :: ReadPrec ReadSetFiles
readList :: ReadS [ReadSetFiles]
$creadList :: ReadS [ReadSetFiles]
readsPrec :: Int -> ReadS ReadSetFiles
$creadsPrec :: Int -> ReadS ReadSetFiles
Prelude.Read, Int -> ReadSetFiles -> ShowS
[ReadSetFiles] -> ShowS
ReadSetFiles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReadSetFiles] -> ShowS
$cshowList :: [ReadSetFiles] -> ShowS
show :: ReadSetFiles -> String
$cshow :: ReadSetFiles -> String
showsPrec :: Int -> ReadSetFiles -> ShowS
$cshowsPrec :: Int -> ReadSetFiles -> ShowS
Prelude.Show, forall x. Rep ReadSetFiles x -> ReadSetFiles
forall x. ReadSetFiles -> Rep ReadSetFiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReadSetFiles x -> ReadSetFiles
$cfrom :: forall x. ReadSetFiles -> Rep ReadSetFiles x
Prelude.Generic)

-- |
-- Create a value of 'ReadSetFiles' 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:
--
-- 'index', 'readSetFiles_index' - The files\' index.
--
-- 'source1', 'readSetFiles_source1' - The location of the first file in Amazon S3.
--
-- 'source2', 'readSetFiles_source2' - The location of the second file in Amazon S3.
newReadSetFiles ::
  ReadSetFiles
newReadSetFiles :: ReadSetFiles
newReadSetFiles =
  ReadSetFiles'
    { $sel:index:ReadSetFiles' :: Maybe FileInformation
index = forall a. Maybe a
Prelude.Nothing,
      $sel:source1:ReadSetFiles' :: Maybe FileInformation
source1 = forall a. Maybe a
Prelude.Nothing,
      $sel:source2:ReadSetFiles' :: Maybe FileInformation
source2 = forall a. Maybe a
Prelude.Nothing
    }

-- | The files\' index.
readSetFiles_index :: Lens.Lens' ReadSetFiles (Prelude.Maybe FileInformation)
readSetFiles_index :: Lens' ReadSetFiles (Maybe FileInformation)
readSetFiles_index = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadSetFiles' {Maybe FileInformation
index :: Maybe FileInformation
$sel:index:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
index} -> Maybe FileInformation
index) (\s :: ReadSetFiles
s@ReadSetFiles' {} Maybe FileInformation
a -> ReadSetFiles
s {$sel:index:ReadSetFiles' :: Maybe FileInformation
index = Maybe FileInformation
a} :: ReadSetFiles)

-- | The location of the first file in Amazon S3.
readSetFiles_source1 :: Lens.Lens' ReadSetFiles (Prelude.Maybe FileInformation)
readSetFiles_source1 :: Lens' ReadSetFiles (Maybe FileInformation)
readSetFiles_source1 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadSetFiles' {Maybe FileInformation
source1 :: Maybe FileInformation
$sel:source1:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
source1} -> Maybe FileInformation
source1) (\s :: ReadSetFiles
s@ReadSetFiles' {} Maybe FileInformation
a -> ReadSetFiles
s {$sel:source1:ReadSetFiles' :: Maybe FileInformation
source1 = Maybe FileInformation
a} :: ReadSetFiles)

-- | The location of the second file in Amazon S3.
readSetFiles_source2 :: Lens.Lens' ReadSetFiles (Prelude.Maybe FileInformation)
readSetFiles_source2 :: Lens' ReadSetFiles (Maybe FileInformation)
readSetFiles_source2 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadSetFiles' {Maybe FileInformation
source2 :: Maybe FileInformation
$sel:source2:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
source2} -> Maybe FileInformation
source2) (\s :: ReadSetFiles
s@ReadSetFiles' {} Maybe FileInformation
a -> ReadSetFiles
s {$sel:source2:ReadSetFiles' :: Maybe FileInformation
source2 = Maybe FileInformation
a} :: ReadSetFiles)

instance Data.FromJSON ReadSetFiles where
  parseJSON :: Value -> Parser ReadSetFiles
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReadSetFiles"
      ( \Object
x ->
          Maybe FileInformation
-> Maybe FileInformation -> Maybe FileInformation -> ReadSetFiles
ReadSetFiles'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"index")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"source1")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"source2")
      )

instance Prelude.Hashable ReadSetFiles where
  hashWithSalt :: Int -> ReadSetFiles -> Int
hashWithSalt Int
_salt ReadSetFiles' {Maybe FileInformation
source2 :: Maybe FileInformation
source1 :: Maybe FileInformation
index :: Maybe FileInformation
$sel:source2:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
$sel:source1:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
$sel:index:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileInformation
index
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileInformation
source1
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileInformation
source2

instance Prelude.NFData ReadSetFiles where
  rnf :: ReadSetFiles -> ()
rnf ReadSetFiles' {Maybe FileInformation
source2 :: Maybe FileInformation
source1 :: Maybe FileInformation
index :: Maybe FileInformation
$sel:source2:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
$sel:source1:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
$sel:index:ReadSetFiles' :: ReadSetFiles -> Maybe FileInformation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FileInformation
index
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FileInformation
source1
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FileInformation
source2