{-# 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.AppFlow.Types.SupportedFieldTypeDetails
-- 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.AppFlow.Types.SupportedFieldTypeDetails where

import Amazonka.AppFlow.Types.FieldTypeDetails
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains details regarding all the supported @FieldTypes@ and their
-- corresponding @filterOperators@ and @supportedValues@.
--
-- /See:/ 'newSupportedFieldTypeDetails' smart constructor.
data SupportedFieldTypeDetails = SupportedFieldTypeDetails'
  { -- | The initial supported version for @fieldType@. If this is later changed
    -- to a different version, v2 will be introduced.
    SupportedFieldTypeDetails -> FieldTypeDetails
v1 :: FieldTypeDetails
  }
  deriving (SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool
(SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool)
-> (SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool)
-> Eq SupportedFieldTypeDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool
$c/= :: SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool
== :: SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool
$c== :: SupportedFieldTypeDetails -> SupportedFieldTypeDetails -> Bool
Prelude.Eq, ReadPrec [SupportedFieldTypeDetails]
ReadPrec SupportedFieldTypeDetails
Int -> ReadS SupportedFieldTypeDetails
ReadS [SupportedFieldTypeDetails]
(Int -> ReadS SupportedFieldTypeDetails)
-> ReadS [SupportedFieldTypeDetails]
-> ReadPrec SupportedFieldTypeDetails
-> ReadPrec [SupportedFieldTypeDetails]
-> Read SupportedFieldTypeDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SupportedFieldTypeDetails]
$creadListPrec :: ReadPrec [SupportedFieldTypeDetails]
readPrec :: ReadPrec SupportedFieldTypeDetails
$creadPrec :: ReadPrec SupportedFieldTypeDetails
readList :: ReadS [SupportedFieldTypeDetails]
$creadList :: ReadS [SupportedFieldTypeDetails]
readsPrec :: Int -> ReadS SupportedFieldTypeDetails
$creadsPrec :: Int -> ReadS SupportedFieldTypeDetails
Prelude.Read, Int -> SupportedFieldTypeDetails -> ShowS
[SupportedFieldTypeDetails] -> ShowS
SupportedFieldTypeDetails -> String
(Int -> SupportedFieldTypeDetails -> ShowS)
-> (SupportedFieldTypeDetails -> String)
-> ([SupportedFieldTypeDetails] -> ShowS)
-> Show SupportedFieldTypeDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SupportedFieldTypeDetails] -> ShowS
$cshowList :: [SupportedFieldTypeDetails] -> ShowS
show :: SupportedFieldTypeDetails -> String
$cshow :: SupportedFieldTypeDetails -> String
showsPrec :: Int -> SupportedFieldTypeDetails -> ShowS
$cshowsPrec :: Int -> SupportedFieldTypeDetails -> ShowS
Prelude.Show, (forall x.
 SupportedFieldTypeDetails -> Rep SupportedFieldTypeDetails x)
-> (forall x.
    Rep SupportedFieldTypeDetails x -> SupportedFieldTypeDetails)
-> Generic SupportedFieldTypeDetails
forall x.
Rep SupportedFieldTypeDetails x -> SupportedFieldTypeDetails
forall x.
SupportedFieldTypeDetails -> Rep SupportedFieldTypeDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SupportedFieldTypeDetails x -> SupportedFieldTypeDetails
$cfrom :: forall x.
SupportedFieldTypeDetails -> Rep SupportedFieldTypeDetails x
Prelude.Generic)

-- |
-- Create a value of 'SupportedFieldTypeDetails' 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:
--
-- 'v1', 'supportedFieldTypeDetails_v1' - The initial supported version for @fieldType@. If this is later changed
-- to a different version, v2 will be introduced.
newSupportedFieldTypeDetails ::
  -- | 'v1'
  FieldTypeDetails ->
  SupportedFieldTypeDetails
newSupportedFieldTypeDetails :: FieldTypeDetails -> SupportedFieldTypeDetails
newSupportedFieldTypeDetails FieldTypeDetails
pV1_ =
  SupportedFieldTypeDetails' :: FieldTypeDetails -> SupportedFieldTypeDetails
SupportedFieldTypeDetails' {$sel:v1:SupportedFieldTypeDetails' :: FieldTypeDetails
v1 = FieldTypeDetails
pV1_}

-- | The initial supported version for @fieldType@. If this is later changed
-- to a different version, v2 will be introduced.
supportedFieldTypeDetails_v1 :: Lens.Lens' SupportedFieldTypeDetails FieldTypeDetails
supportedFieldTypeDetails_v1 :: (FieldTypeDetails -> f FieldTypeDetails)
-> SupportedFieldTypeDetails -> f SupportedFieldTypeDetails
supportedFieldTypeDetails_v1 = (SupportedFieldTypeDetails -> FieldTypeDetails)
-> (SupportedFieldTypeDetails
    -> FieldTypeDetails -> SupportedFieldTypeDetails)
-> Lens
     SupportedFieldTypeDetails
     SupportedFieldTypeDetails
     FieldTypeDetails
     FieldTypeDetails
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedFieldTypeDetails' {FieldTypeDetails
v1 :: FieldTypeDetails
$sel:v1:SupportedFieldTypeDetails' :: SupportedFieldTypeDetails -> FieldTypeDetails
v1} -> FieldTypeDetails
v1) (\s :: SupportedFieldTypeDetails
s@SupportedFieldTypeDetails' {} FieldTypeDetails
a -> SupportedFieldTypeDetails
s {$sel:v1:SupportedFieldTypeDetails' :: FieldTypeDetails
v1 = FieldTypeDetails
a} :: SupportedFieldTypeDetails)

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

instance Prelude.Hashable SupportedFieldTypeDetails

instance Prelude.NFData SupportedFieldTypeDetails