{-# 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.StoreOptions
-- 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.StoreOptions 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.TsvStoreOptions
import qualified Amazonka.Prelude as Prelude

-- | Settings for a store.
--
-- /See:/ 'newStoreOptions' smart constructor.
data StoreOptions = StoreOptions'
  { -- | File settings for a TSV store.
    StoreOptions -> Maybe TsvStoreOptions
tsvStoreOptions :: Prelude.Maybe TsvStoreOptions
  }
  deriving (StoreOptions -> StoreOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StoreOptions -> StoreOptions -> Bool
$c/= :: StoreOptions -> StoreOptions -> Bool
== :: StoreOptions -> StoreOptions -> Bool
$c== :: StoreOptions -> StoreOptions -> Bool
Prelude.Eq, ReadPrec [StoreOptions]
ReadPrec StoreOptions
Int -> ReadS StoreOptions
ReadS [StoreOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StoreOptions]
$creadListPrec :: ReadPrec [StoreOptions]
readPrec :: ReadPrec StoreOptions
$creadPrec :: ReadPrec StoreOptions
readList :: ReadS [StoreOptions]
$creadList :: ReadS [StoreOptions]
readsPrec :: Int -> ReadS StoreOptions
$creadsPrec :: Int -> ReadS StoreOptions
Prelude.Read, Int -> StoreOptions -> ShowS
[StoreOptions] -> ShowS
StoreOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StoreOptions] -> ShowS
$cshowList :: [StoreOptions] -> ShowS
show :: StoreOptions -> String
$cshow :: StoreOptions -> String
showsPrec :: Int -> StoreOptions -> ShowS
$cshowsPrec :: Int -> StoreOptions -> ShowS
Prelude.Show, forall x. Rep StoreOptions x -> StoreOptions
forall x. StoreOptions -> Rep StoreOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StoreOptions x -> StoreOptions
$cfrom :: forall x. StoreOptions -> Rep StoreOptions x
Prelude.Generic)

-- |
-- Create a value of 'StoreOptions' 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:
--
-- 'tsvStoreOptions', 'storeOptions_tsvStoreOptions' - File settings for a TSV store.
newStoreOptions ::
  StoreOptions
newStoreOptions :: StoreOptions
newStoreOptions =
  StoreOptions' {$sel:tsvStoreOptions:StoreOptions' :: Maybe TsvStoreOptions
tsvStoreOptions = forall a. Maybe a
Prelude.Nothing}

-- | File settings for a TSV store.
storeOptions_tsvStoreOptions :: Lens.Lens' StoreOptions (Prelude.Maybe TsvStoreOptions)
storeOptions_tsvStoreOptions :: Lens' StoreOptions (Maybe TsvStoreOptions)
storeOptions_tsvStoreOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StoreOptions' {Maybe TsvStoreOptions
tsvStoreOptions :: Maybe TsvStoreOptions
$sel:tsvStoreOptions:StoreOptions' :: StoreOptions -> Maybe TsvStoreOptions
tsvStoreOptions} -> Maybe TsvStoreOptions
tsvStoreOptions) (\s :: StoreOptions
s@StoreOptions' {} Maybe TsvStoreOptions
a -> StoreOptions
s {$sel:tsvStoreOptions:StoreOptions' :: Maybe TsvStoreOptions
tsvStoreOptions = Maybe TsvStoreOptions
a} :: StoreOptions)

instance Data.FromJSON StoreOptions where
  parseJSON :: Value -> Parser StoreOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StoreOptions"
      ( \Object
x ->
          Maybe TsvStoreOptions -> StoreOptions
StoreOptions'
            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
"tsvStoreOptions")
      )

instance Prelude.Hashable StoreOptions where
  hashWithSalt :: Int -> StoreOptions -> Int
hashWithSalt Int
_salt StoreOptions' {Maybe TsvStoreOptions
tsvStoreOptions :: Maybe TsvStoreOptions
$sel:tsvStoreOptions:StoreOptions' :: StoreOptions -> Maybe TsvStoreOptions
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TsvStoreOptions
tsvStoreOptions

instance Prelude.NFData StoreOptions where
  rnf :: StoreOptions -> ()
rnf StoreOptions' {Maybe TsvStoreOptions
tsvStoreOptions :: Maybe TsvStoreOptions
$sel:tsvStoreOptions:StoreOptions' :: StoreOptions -> Maybe TsvStoreOptions
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe TsvStoreOptions
tsvStoreOptions

instance Data.ToJSON StoreOptions where
  toJSON :: StoreOptions -> Value
toJSON StoreOptions' {Maybe TsvStoreOptions
tsvStoreOptions :: Maybe TsvStoreOptions
$sel:tsvStoreOptions:StoreOptions' :: StoreOptions -> Maybe TsvStoreOptions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"tsvStoreOptions" 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 TsvStoreOptions
tsvStoreOptions
          ]
      )