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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $sel:supportedRegions:SnowflakeMetadata' :: Maybe [Text]
supportedRegions =
        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 :: Lens' SnowflakeMetadata (Maybe [Text])
snowflakeMetadata_supportedRegions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON SnowflakeMetadata where
  parseJSON :: Value -> Parser SnowflakeMetadata
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SnowflakeMetadata"
      ( \Object
x ->
          Maybe [Text] -> SnowflakeMetadata
SnowflakeMetadata'
            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
"supportedRegions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable SnowflakeMetadata where
  hashWithSalt :: Int -> SnowflakeMetadata -> Int
hashWithSalt Int
_salt SnowflakeMetadata' {Maybe [Text]
supportedRegions :: Maybe [Text]
$sel:supportedRegions:SnowflakeMetadata' :: SnowflakeMetadata -> Maybe [Text]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
supportedRegions

instance Prelude.NFData SnowflakeMetadata where
  rnf :: SnowflakeMetadata -> ()
rnf SnowflakeMetadata' {Maybe [Text]
supportedRegions :: Maybe [Text]
$sel:supportedRegions:SnowflakeMetadata' :: SnowflakeMetadata -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
supportedRegions