{-# 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.SnowflakeMetadata
-- 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.SnowflakeMetadata where

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

-- | The connector metadata specific to Snowflake.
--
-- /See:/ 'newSnowflakeMetadata' smart constructor.
data SnowflakeMetadata = SnowflakeMetadata'
  { -- | Specifies the supported Amazon Web Services Regions when using
    -- Snowflake.
    SnowflakeMetadata -> Maybe [Text]
supportedRegions :: Prelude.Maybe [Prelude.Text]
  }
  deriving (SnowflakeMetadata -> SnowflakeMetadata -> Bool
(SnowflakeMetadata -> SnowflakeMetadata -> Bool)
-> (SnowflakeMetadata -> SnowflakeMetadata -> Bool)
-> Eq SnowflakeMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnowflakeMetadata -> SnowflakeMetadata -> Bool
$c/= :: SnowflakeMetadata -> SnowflakeMetadata -> Bool
== :: SnowflakeMetadata -> SnowflakeMetadata -> Bool
$c== :: SnowflakeMetadata -> SnowflakeMetadata -> Bool
Prelude.Eq, ReadPrec [SnowflakeMetadata]
ReadPrec SnowflakeMetadata
Int -> ReadS SnowflakeMetadata
ReadS [SnowflakeMetadata]
(Int -> ReadS SnowflakeMetadata)
-> ReadS [SnowflakeMetadata]
-> ReadPrec SnowflakeMetadata
-> ReadPrec [SnowflakeMetadata]
-> Read SnowflakeMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnowflakeMetadata]
$creadListPrec :: ReadPrec [SnowflakeMetadata]
readPrec :: ReadPrec SnowflakeMetadata
$creadPrec :: ReadPrec SnowflakeMetadata
readList :: ReadS [SnowflakeMetadata]
$creadList :: ReadS [SnowflakeMetadata]
readsPrec :: Int -> ReadS SnowflakeMetadata
$creadsPrec :: Int -> ReadS SnowflakeMetadata
Prelude.Read, Int -> SnowflakeMetadata -> ShowS
[SnowflakeMetadata] -> ShowS
SnowflakeMetadata -> String
(Int -> SnowflakeMetadata -> ShowS)
-> (SnowflakeMetadata -> String)
-> ([SnowflakeMetadata] -> ShowS)
-> Show SnowflakeMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnowflakeMetadata] -> ShowS
$cshowList :: [SnowflakeMetadata] -> ShowS
show :: SnowflakeMetadata -> String
$cshow :: SnowflakeMetadata -> String
showsPrec :: Int -> SnowflakeMetadata -> ShowS
$cshowsPrec :: Int -> SnowflakeMetadata -> ShowS
Prelude.Show, (forall x. SnowflakeMetadata -> Rep SnowflakeMetadata x)
-> (forall x. Rep SnowflakeMetadata x -> SnowflakeMetadata)
-> Generic SnowflakeMetadata
forall x. Rep SnowflakeMetadata x -> SnowflakeMetadata
forall x. SnowflakeMetadata -> Rep SnowflakeMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SnowflakeMetadata x -> SnowflakeMetadata
$cfrom :: forall x. SnowflakeMetadata -> Rep SnowflakeMetadata x
Prelude.Generic)

-- |
-- Create a value of 'SnowflakeMetadata' 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:
--
-- 'supportedRegions', 'snowflakeMetadata_supportedRegions' - Specifies the supported Amazon Web Services Regions when using
-- Snowflake.
newSnowflakeMetadata ::
  SnowflakeMetadata
newSnowflakeMetadata :: SnowflakeMetadata
newSnowflakeMetadata =
  SnowflakeMetadata' :: Maybe [Text] -> SnowflakeMetadata
SnowflakeMetadata'
    { $sel:supportedRegions:SnowflakeMetadata' :: Maybe [Text]
supportedRegions =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the supported Amazon Web Services Regions when using
-- Snowflake.
snowflakeMetadata_supportedRegions :: Lens.Lens' SnowflakeMetadata (Prelude.Maybe [Prelude.Text])
snowflakeMetadata_supportedRegions :: (Maybe [Text] -> f (Maybe [Text]))
-> SnowflakeMetadata -> f SnowflakeMetadata
snowflakeMetadata_supportedRegions = (SnowflakeMetadata -> Maybe [Text])
-> (SnowflakeMetadata -> Maybe [Text] -> SnowflakeMetadata)
-> Lens
     SnowflakeMetadata SnowflakeMetadata (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnowflakeMetadata' {Maybe [Text]
supportedRegions :: Maybe [Text]
$sel:supportedRegions:SnowflakeMetadata' :: SnowflakeMetadata -> Maybe [Text]
supportedRegions} -> Maybe [Text]
supportedRegions) (\s :: SnowflakeMetadata
s@SnowflakeMetadata' {} Maybe [Text]
a -> SnowflakeMetadata
s {$sel:supportedRegions:SnowflakeMetadata' :: Maybe [Text]
supportedRegions = Maybe [Text]
a} :: SnowflakeMetadata) ((Maybe [Text] -> f (Maybe [Text]))
 -> SnowflakeMetadata -> f SnowflakeMetadata)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SnowflakeMetadata
-> f SnowflakeMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON SnowflakeMetadata where
  parseJSON :: Value -> Parser SnowflakeMetadata
parseJSON =
    String
-> (Object -> Parser SnowflakeMetadata)
-> Value
-> Parser SnowflakeMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SnowflakeMetadata"
      ( \Object
x ->
          Maybe [Text] -> SnowflakeMetadata
SnowflakeMetadata'
            (Maybe [Text] -> SnowflakeMetadata)
-> Parser (Maybe [Text]) -> Parser SnowflakeMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"supportedRegions"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable SnowflakeMetadata

instance Prelude.NFData SnowflakeMetadata