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

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

-- | The connector metadata specific to Amazon Honeycode.
--
-- /See:/ 'newHoneycodeMetadata' smart constructor.
data HoneycodeMetadata = HoneycodeMetadata'
  { -- | The desired authorization scope for the Amazon Honeycode account.
    HoneycodeMetadata -> Maybe [Text]
oAuthScopes :: Prelude.Maybe [Prelude.Text]
  }
  deriving (HoneycodeMetadata -> HoneycodeMetadata -> Bool
(HoneycodeMetadata -> HoneycodeMetadata -> Bool)
-> (HoneycodeMetadata -> HoneycodeMetadata -> Bool)
-> Eq HoneycodeMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HoneycodeMetadata -> HoneycodeMetadata -> Bool
$c/= :: HoneycodeMetadata -> HoneycodeMetadata -> Bool
== :: HoneycodeMetadata -> HoneycodeMetadata -> Bool
$c== :: HoneycodeMetadata -> HoneycodeMetadata -> Bool
Prelude.Eq, ReadPrec [HoneycodeMetadata]
ReadPrec HoneycodeMetadata
Int -> ReadS HoneycodeMetadata
ReadS [HoneycodeMetadata]
(Int -> ReadS HoneycodeMetadata)
-> ReadS [HoneycodeMetadata]
-> ReadPrec HoneycodeMetadata
-> ReadPrec [HoneycodeMetadata]
-> Read HoneycodeMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HoneycodeMetadata]
$creadListPrec :: ReadPrec [HoneycodeMetadata]
readPrec :: ReadPrec HoneycodeMetadata
$creadPrec :: ReadPrec HoneycodeMetadata
readList :: ReadS [HoneycodeMetadata]
$creadList :: ReadS [HoneycodeMetadata]
readsPrec :: Int -> ReadS HoneycodeMetadata
$creadsPrec :: Int -> ReadS HoneycodeMetadata
Prelude.Read, Int -> HoneycodeMetadata -> ShowS
[HoneycodeMetadata] -> ShowS
HoneycodeMetadata -> String
(Int -> HoneycodeMetadata -> ShowS)
-> (HoneycodeMetadata -> String)
-> ([HoneycodeMetadata] -> ShowS)
-> Show HoneycodeMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HoneycodeMetadata] -> ShowS
$cshowList :: [HoneycodeMetadata] -> ShowS
show :: HoneycodeMetadata -> String
$cshow :: HoneycodeMetadata -> String
showsPrec :: Int -> HoneycodeMetadata -> ShowS
$cshowsPrec :: Int -> HoneycodeMetadata -> ShowS
Prelude.Show, (forall x. HoneycodeMetadata -> Rep HoneycodeMetadata x)
-> (forall x. Rep HoneycodeMetadata x -> HoneycodeMetadata)
-> Generic HoneycodeMetadata
forall x. Rep HoneycodeMetadata x -> HoneycodeMetadata
forall x. HoneycodeMetadata -> Rep HoneycodeMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HoneycodeMetadata x -> HoneycodeMetadata
$cfrom :: forall x. HoneycodeMetadata -> Rep HoneycodeMetadata x
Prelude.Generic)

-- |
-- Create a value of 'HoneycodeMetadata' 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:
--
-- 'oAuthScopes', 'honeycodeMetadata_oAuthScopes' - The desired authorization scope for the Amazon Honeycode account.
newHoneycodeMetadata ::
  HoneycodeMetadata
newHoneycodeMetadata :: HoneycodeMetadata
newHoneycodeMetadata =
  HoneycodeMetadata' :: Maybe [Text] -> HoneycodeMetadata
HoneycodeMetadata' {$sel:oAuthScopes:HoneycodeMetadata' :: Maybe [Text]
oAuthScopes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing}

-- | The desired authorization scope for the Amazon Honeycode account.
honeycodeMetadata_oAuthScopes :: Lens.Lens' HoneycodeMetadata (Prelude.Maybe [Prelude.Text])
honeycodeMetadata_oAuthScopes :: (Maybe [Text] -> f (Maybe [Text]))
-> HoneycodeMetadata -> f HoneycodeMetadata
honeycodeMetadata_oAuthScopes = (HoneycodeMetadata -> Maybe [Text])
-> (HoneycodeMetadata -> Maybe [Text] -> HoneycodeMetadata)
-> Lens
     HoneycodeMetadata HoneycodeMetadata (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoneycodeMetadata' {Maybe [Text]
oAuthScopes :: Maybe [Text]
$sel:oAuthScopes:HoneycodeMetadata' :: HoneycodeMetadata -> Maybe [Text]
oAuthScopes} -> Maybe [Text]
oAuthScopes) (\s :: HoneycodeMetadata
s@HoneycodeMetadata' {} Maybe [Text]
a -> HoneycodeMetadata
s {$sel:oAuthScopes:HoneycodeMetadata' :: Maybe [Text]
oAuthScopes = Maybe [Text]
a} :: HoneycodeMetadata) ((Maybe [Text] -> f (Maybe [Text]))
 -> HoneycodeMetadata -> f HoneycodeMetadata)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> HoneycodeMetadata
-> f HoneycodeMetadata
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 HoneycodeMetadata where
  parseJSON :: Value -> Parser HoneycodeMetadata
parseJSON =
    String
-> (Object -> Parser HoneycodeMetadata)
-> Value
-> Parser HoneycodeMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HoneycodeMetadata"
      ( \Object
x ->
          Maybe [Text] -> HoneycodeMetadata
HoneycodeMetadata'
            (Maybe [Text] -> HoneycodeMetadata)
-> Parser (Maybe [Text]) -> Parser HoneycodeMetadata
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
"oAuthScopes" 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 HoneycodeMetadata

instance Prelude.NFData HoneycodeMetadata