{-# 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.AppSync.Types.GraphqlApi
-- 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.AppSync.Types.GraphqlApi where

import Amazonka.AppSync.Types.AdditionalAuthenticationProvider
import Amazonka.AppSync.Types.AuthenticationType
import Amazonka.AppSync.Types.LambdaAuthorizerConfig
import Amazonka.AppSync.Types.LogConfig
import Amazonka.AppSync.Types.OpenIDConnectConfig
import Amazonka.AppSync.Types.UserPoolConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a GraphQL API.
--
-- /See:/ 'newGraphqlApi' smart constructor.
data GraphqlApi = GraphqlApi'
  { -- | A flag representing whether X-Ray tracing is enabled for this
    -- @GraphqlApi@.
    GraphqlApi -> Maybe Bool
xrayEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN.
    GraphqlApi -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The API ID.
    GraphqlApi -> Maybe Text
apiId :: Prelude.Maybe Prelude.Text,
    -- | The URIs.
    GraphqlApi -> Maybe (HashMap Text Text)
uris :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The OpenID Connect configuration.
    GraphqlApi -> Maybe OpenIDConnectConfig
openIDConnectConfig :: Prelude.Maybe OpenIDConnectConfig,
    -- | The ARN of the WAF ACL associated with this @GraphqlApi@, if one exists.
    GraphqlApi -> Maybe Text
wafWebAclArn :: Prelude.Maybe Prelude.Text,
    -- | A list of additional authentication providers for the @GraphqlApi@ API.
    GraphqlApi -> Maybe [AdditionalAuthenticationProvider]
additionalAuthenticationProviders :: Prelude.Maybe [AdditionalAuthenticationProvider],
    -- | Configuration for Amazon Web Services Lambda function authorization.
    GraphqlApi -> Maybe LambdaAuthorizerConfig
lambdaAuthorizerConfig :: Prelude.Maybe LambdaAuthorizerConfig,
    -- | The API name.
    GraphqlApi -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Cognito user pool configuration.
    GraphqlApi -> Maybe UserPoolConfig
userPoolConfig :: Prelude.Maybe UserPoolConfig,
    -- | The authentication type.
    GraphqlApi -> Maybe AuthenticationType
authenticationType :: Prelude.Maybe AuthenticationType,
    -- | The Amazon CloudWatch Logs configuration.
    GraphqlApi -> Maybe LogConfig
logConfig :: Prelude.Maybe LogConfig,
    -- | The tags.
    GraphqlApi -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (GraphqlApi -> GraphqlApi -> Bool
(GraphqlApi -> GraphqlApi -> Bool)
-> (GraphqlApi -> GraphqlApi -> Bool) -> Eq GraphqlApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphqlApi -> GraphqlApi -> Bool
$c/= :: GraphqlApi -> GraphqlApi -> Bool
== :: GraphqlApi -> GraphqlApi -> Bool
$c== :: GraphqlApi -> GraphqlApi -> Bool
Prelude.Eq, ReadPrec [GraphqlApi]
ReadPrec GraphqlApi
Int -> ReadS GraphqlApi
ReadS [GraphqlApi]
(Int -> ReadS GraphqlApi)
-> ReadS [GraphqlApi]
-> ReadPrec GraphqlApi
-> ReadPrec [GraphqlApi]
-> Read GraphqlApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GraphqlApi]
$creadListPrec :: ReadPrec [GraphqlApi]
readPrec :: ReadPrec GraphqlApi
$creadPrec :: ReadPrec GraphqlApi
readList :: ReadS [GraphqlApi]
$creadList :: ReadS [GraphqlApi]
readsPrec :: Int -> ReadS GraphqlApi
$creadsPrec :: Int -> ReadS GraphqlApi
Prelude.Read, Int -> GraphqlApi -> ShowS
[GraphqlApi] -> ShowS
GraphqlApi -> String
(Int -> GraphqlApi -> ShowS)
-> (GraphqlApi -> String)
-> ([GraphqlApi] -> ShowS)
-> Show GraphqlApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GraphqlApi] -> ShowS
$cshowList :: [GraphqlApi] -> ShowS
show :: GraphqlApi -> String
$cshow :: GraphqlApi -> String
showsPrec :: Int -> GraphqlApi -> ShowS
$cshowsPrec :: Int -> GraphqlApi -> ShowS
Prelude.Show, (forall x. GraphqlApi -> Rep GraphqlApi x)
-> (forall x. Rep GraphqlApi x -> GraphqlApi) -> Generic GraphqlApi
forall x. Rep GraphqlApi x -> GraphqlApi
forall x. GraphqlApi -> Rep GraphqlApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GraphqlApi x -> GraphqlApi
$cfrom :: forall x. GraphqlApi -> Rep GraphqlApi x
Prelude.Generic)

-- |
-- Create a value of 'GraphqlApi' 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:
--
-- 'xrayEnabled', 'graphqlApi_xrayEnabled' - A flag representing whether X-Ray tracing is enabled for this
-- @GraphqlApi@.
--
-- 'arn', 'graphqlApi_arn' - The ARN.
--
-- 'apiId', 'graphqlApi_apiId' - The API ID.
--
-- 'uris', 'graphqlApi_uris' - The URIs.
--
-- 'openIDConnectConfig', 'graphqlApi_openIDConnectConfig' - The OpenID Connect configuration.
--
-- 'wafWebAclArn', 'graphqlApi_wafWebAclArn' - The ARN of the WAF ACL associated with this @GraphqlApi@, if one exists.
--
-- 'additionalAuthenticationProviders', 'graphqlApi_additionalAuthenticationProviders' - A list of additional authentication providers for the @GraphqlApi@ API.
--
-- 'lambdaAuthorizerConfig', 'graphqlApi_lambdaAuthorizerConfig' - Configuration for Amazon Web Services Lambda function authorization.
--
-- 'name', 'graphqlApi_name' - The API name.
--
-- 'userPoolConfig', 'graphqlApi_userPoolConfig' - The Amazon Cognito user pool configuration.
--
-- 'authenticationType', 'graphqlApi_authenticationType' - The authentication type.
--
-- 'logConfig', 'graphqlApi_logConfig' - The Amazon CloudWatch Logs configuration.
--
-- 'tags', 'graphqlApi_tags' - The tags.
newGraphqlApi ::
  GraphqlApi
newGraphqlApi :: GraphqlApi
newGraphqlApi =
  GraphqlApi' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe OpenIDConnectConfig
-> Maybe Text
-> Maybe [AdditionalAuthenticationProvider]
-> Maybe LambdaAuthorizerConfig
-> Maybe Text
-> Maybe UserPoolConfig
-> Maybe AuthenticationType
-> Maybe LogConfig
-> Maybe (HashMap Text Text)
-> GraphqlApi
GraphqlApi'
    { $sel:xrayEnabled:GraphqlApi' :: Maybe Bool
xrayEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GraphqlApi' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:GraphqlApi' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:uris:GraphqlApi' :: Maybe (HashMap Text Text)
uris = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:openIDConnectConfig:GraphqlApi' :: Maybe OpenIDConnectConfig
openIDConnectConfig = Maybe OpenIDConnectConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:wafWebAclArn:GraphqlApi' :: Maybe Text
wafWebAclArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalAuthenticationProviders:GraphqlApi' :: Maybe [AdditionalAuthenticationProvider]
additionalAuthenticationProviders = Maybe [AdditionalAuthenticationProvider]
forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaAuthorizerConfig:GraphqlApi' :: Maybe LambdaAuthorizerConfig
lambdaAuthorizerConfig = Maybe LambdaAuthorizerConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GraphqlApi' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolConfig:GraphqlApi' :: Maybe UserPoolConfig
userPoolConfig = Maybe UserPoolConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationType:GraphqlApi' :: Maybe AuthenticationType
authenticationType = Maybe AuthenticationType
forall a. Maybe a
Prelude.Nothing,
      $sel:logConfig:GraphqlApi' :: Maybe LogConfig
logConfig = Maybe LogConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GraphqlApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | A flag representing whether X-Ray tracing is enabled for this
-- @GraphqlApi@.
graphqlApi_xrayEnabled :: Lens.Lens' GraphqlApi (Prelude.Maybe Prelude.Bool)
graphqlApi_xrayEnabled :: (Maybe Bool -> f (Maybe Bool)) -> GraphqlApi -> f GraphqlApi
graphqlApi_xrayEnabled = (GraphqlApi -> Maybe Bool)
-> (GraphqlApi -> Maybe Bool -> GraphqlApi)
-> Lens GraphqlApi GraphqlApi (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe Bool
xrayEnabled :: Maybe Bool
$sel:xrayEnabled:GraphqlApi' :: GraphqlApi -> Maybe Bool
xrayEnabled} -> Maybe Bool
xrayEnabled) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe Bool
a -> GraphqlApi
s {$sel:xrayEnabled:GraphqlApi' :: Maybe Bool
xrayEnabled = Maybe Bool
a} :: GraphqlApi)

-- | The ARN.
graphqlApi_arn :: Lens.Lens' GraphqlApi (Prelude.Maybe Prelude.Text)
graphqlApi_arn :: (Maybe Text -> f (Maybe Text)) -> GraphqlApi -> f GraphqlApi
graphqlApi_arn = (GraphqlApi -> Maybe Text)
-> (GraphqlApi -> Maybe Text -> GraphqlApi)
-> Lens GraphqlApi GraphqlApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe Text
arn :: Maybe Text
$sel:arn:GraphqlApi' :: GraphqlApi -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe Text
a -> GraphqlApi
s {$sel:arn:GraphqlApi' :: Maybe Text
arn = Maybe Text
a} :: GraphqlApi)

-- | The API ID.
graphqlApi_apiId :: Lens.Lens' GraphqlApi (Prelude.Maybe Prelude.Text)
graphqlApi_apiId :: (Maybe Text -> f (Maybe Text)) -> GraphqlApi -> f GraphqlApi
graphqlApi_apiId = (GraphqlApi -> Maybe Text)
-> (GraphqlApi -> Maybe Text -> GraphqlApi)
-> Lens GraphqlApi GraphqlApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe Text
apiId :: Maybe Text
$sel:apiId:GraphqlApi' :: GraphqlApi -> Maybe Text
apiId} -> Maybe Text
apiId) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe Text
a -> GraphqlApi
s {$sel:apiId:GraphqlApi' :: Maybe Text
apiId = Maybe Text
a} :: GraphqlApi)

-- | The URIs.
graphqlApi_uris :: Lens.Lens' GraphqlApi (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
graphqlApi_uris :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GraphqlApi -> f GraphqlApi
graphqlApi_uris = (GraphqlApi -> Maybe (HashMap Text Text))
-> (GraphqlApi -> Maybe (HashMap Text Text) -> GraphqlApi)
-> Lens
     GraphqlApi
     GraphqlApi
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe (HashMap Text Text)
uris :: Maybe (HashMap Text Text)
$sel:uris:GraphqlApi' :: GraphqlApi -> Maybe (HashMap Text Text)
uris} -> Maybe (HashMap Text Text)
uris) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe (HashMap Text Text)
a -> GraphqlApi
s {$sel:uris:GraphqlApi' :: Maybe (HashMap Text Text)
uris = Maybe (HashMap Text Text)
a} :: GraphqlApi) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GraphqlApi -> f GraphqlApi)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GraphqlApi
-> f GraphqlApi
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The OpenID Connect configuration.
graphqlApi_openIDConnectConfig :: Lens.Lens' GraphqlApi (Prelude.Maybe OpenIDConnectConfig)
graphqlApi_openIDConnectConfig :: (Maybe OpenIDConnectConfig -> f (Maybe OpenIDConnectConfig))
-> GraphqlApi -> f GraphqlApi
graphqlApi_openIDConnectConfig = (GraphqlApi -> Maybe OpenIDConnectConfig)
-> (GraphqlApi -> Maybe OpenIDConnectConfig -> GraphqlApi)
-> Lens
     GraphqlApi
     GraphqlApi
     (Maybe OpenIDConnectConfig)
     (Maybe OpenIDConnectConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe OpenIDConnectConfig
openIDConnectConfig :: Maybe OpenIDConnectConfig
$sel:openIDConnectConfig:GraphqlApi' :: GraphqlApi -> Maybe OpenIDConnectConfig
openIDConnectConfig} -> Maybe OpenIDConnectConfig
openIDConnectConfig) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe OpenIDConnectConfig
a -> GraphqlApi
s {$sel:openIDConnectConfig:GraphqlApi' :: Maybe OpenIDConnectConfig
openIDConnectConfig = Maybe OpenIDConnectConfig
a} :: GraphqlApi)

-- | The ARN of the WAF ACL associated with this @GraphqlApi@, if one exists.
graphqlApi_wafWebAclArn :: Lens.Lens' GraphqlApi (Prelude.Maybe Prelude.Text)
graphqlApi_wafWebAclArn :: (Maybe Text -> f (Maybe Text)) -> GraphqlApi -> f GraphqlApi
graphqlApi_wafWebAclArn = (GraphqlApi -> Maybe Text)
-> (GraphqlApi -> Maybe Text -> GraphqlApi)
-> Lens GraphqlApi GraphqlApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe Text
wafWebAclArn :: Maybe Text
$sel:wafWebAclArn:GraphqlApi' :: GraphqlApi -> Maybe Text
wafWebAclArn} -> Maybe Text
wafWebAclArn) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe Text
a -> GraphqlApi
s {$sel:wafWebAclArn:GraphqlApi' :: Maybe Text
wafWebAclArn = Maybe Text
a} :: GraphqlApi)

-- | A list of additional authentication providers for the @GraphqlApi@ API.
graphqlApi_additionalAuthenticationProviders :: Lens.Lens' GraphqlApi (Prelude.Maybe [AdditionalAuthenticationProvider])
graphqlApi_additionalAuthenticationProviders :: (Maybe [AdditionalAuthenticationProvider]
 -> f (Maybe [AdditionalAuthenticationProvider]))
-> GraphqlApi -> f GraphqlApi
graphqlApi_additionalAuthenticationProviders = (GraphqlApi -> Maybe [AdditionalAuthenticationProvider])
-> (GraphqlApi
    -> Maybe [AdditionalAuthenticationProvider] -> GraphqlApi)
-> Lens
     GraphqlApi
     GraphqlApi
     (Maybe [AdditionalAuthenticationProvider])
     (Maybe [AdditionalAuthenticationProvider])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe [AdditionalAuthenticationProvider]
additionalAuthenticationProviders :: Maybe [AdditionalAuthenticationProvider]
$sel:additionalAuthenticationProviders:GraphqlApi' :: GraphqlApi -> Maybe [AdditionalAuthenticationProvider]
additionalAuthenticationProviders} -> Maybe [AdditionalAuthenticationProvider]
additionalAuthenticationProviders) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe [AdditionalAuthenticationProvider]
a -> GraphqlApi
s {$sel:additionalAuthenticationProviders:GraphqlApi' :: Maybe [AdditionalAuthenticationProvider]
additionalAuthenticationProviders = Maybe [AdditionalAuthenticationProvider]
a} :: GraphqlApi) ((Maybe [AdditionalAuthenticationProvider]
  -> f (Maybe [AdditionalAuthenticationProvider]))
 -> GraphqlApi -> f GraphqlApi)
-> ((Maybe [AdditionalAuthenticationProvider]
     -> f (Maybe [AdditionalAuthenticationProvider]))
    -> Maybe [AdditionalAuthenticationProvider]
    -> f (Maybe [AdditionalAuthenticationProvider]))
-> (Maybe [AdditionalAuthenticationProvider]
    -> f (Maybe [AdditionalAuthenticationProvider]))
-> GraphqlApi
-> f GraphqlApi
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AdditionalAuthenticationProvider]
  [AdditionalAuthenticationProvider]
  [AdditionalAuthenticationProvider]
  [AdditionalAuthenticationProvider]
-> Iso
     (Maybe [AdditionalAuthenticationProvider])
     (Maybe [AdditionalAuthenticationProvider])
     (Maybe [AdditionalAuthenticationProvider])
     (Maybe [AdditionalAuthenticationProvider])
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
  [AdditionalAuthenticationProvider]
  [AdditionalAuthenticationProvider]
  [AdditionalAuthenticationProvider]
  [AdditionalAuthenticationProvider]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Configuration for Amazon Web Services Lambda function authorization.
graphqlApi_lambdaAuthorizerConfig :: Lens.Lens' GraphqlApi (Prelude.Maybe LambdaAuthorizerConfig)
graphqlApi_lambdaAuthorizerConfig :: (Maybe LambdaAuthorizerConfig -> f (Maybe LambdaAuthorizerConfig))
-> GraphqlApi -> f GraphqlApi
graphqlApi_lambdaAuthorizerConfig = (GraphqlApi -> Maybe LambdaAuthorizerConfig)
-> (GraphqlApi -> Maybe LambdaAuthorizerConfig -> GraphqlApi)
-> Lens
     GraphqlApi
     GraphqlApi
     (Maybe LambdaAuthorizerConfig)
     (Maybe LambdaAuthorizerConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe LambdaAuthorizerConfig
lambdaAuthorizerConfig :: Maybe LambdaAuthorizerConfig
$sel:lambdaAuthorizerConfig:GraphqlApi' :: GraphqlApi -> Maybe LambdaAuthorizerConfig
lambdaAuthorizerConfig} -> Maybe LambdaAuthorizerConfig
lambdaAuthorizerConfig) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe LambdaAuthorizerConfig
a -> GraphqlApi
s {$sel:lambdaAuthorizerConfig:GraphqlApi' :: Maybe LambdaAuthorizerConfig
lambdaAuthorizerConfig = Maybe LambdaAuthorizerConfig
a} :: GraphqlApi)

-- | The API name.
graphqlApi_name :: Lens.Lens' GraphqlApi (Prelude.Maybe Prelude.Text)
graphqlApi_name :: (Maybe Text -> f (Maybe Text)) -> GraphqlApi -> f GraphqlApi
graphqlApi_name = (GraphqlApi -> Maybe Text)
-> (GraphqlApi -> Maybe Text -> GraphqlApi)
-> Lens GraphqlApi GraphqlApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe Text
name :: Maybe Text
$sel:name:GraphqlApi' :: GraphqlApi -> Maybe Text
name} -> Maybe Text
name) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe Text
a -> GraphqlApi
s {$sel:name:GraphqlApi' :: Maybe Text
name = Maybe Text
a} :: GraphqlApi)

-- | The Amazon Cognito user pool configuration.
graphqlApi_userPoolConfig :: Lens.Lens' GraphqlApi (Prelude.Maybe UserPoolConfig)
graphqlApi_userPoolConfig :: (Maybe UserPoolConfig -> f (Maybe UserPoolConfig))
-> GraphqlApi -> f GraphqlApi
graphqlApi_userPoolConfig = (GraphqlApi -> Maybe UserPoolConfig)
-> (GraphqlApi -> Maybe UserPoolConfig -> GraphqlApi)
-> Lens
     GraphqlApi GraphqlApi (Maybe UserPoolConfig) (Maybe UserPoolConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe UserPoolConfig
userPoolConfig :: Maybe UserPoolConfig
$sel:userPoolConfig:GraphqlApi' :: GraphqlApi -> Maybe UserPoolConfig
userPoolConfig} -> Maybe UserPoolConfig
userPoolConfig) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe UserPoolConfig
a -> GraphqlApi
s {$sel:userPoolConfig:GraphqlApi' :: Maybe UserPoolConfig
userPoolConfig = Maybe UserPoolConfig
a} :: GraphqlApi)

-- | The authentication type.
graphqlApi_authenticationType :: Lens.Lens' GraphqlApi (Prelude.Maybe AuthenticationType)
graphqlApi_authenticationType :: (Maybe AuthenticationType -> f (Maybe AuthenticationType))
-> GraphqlApi -> f GraphqlApi
graphqlApi_authenticationType = (GraphqlApi -> Maybe AuthenticationType)
-> (GraphqlApi -> Maybe AuthenticationType -> GraphqlApi)
-> Lens
     GraphqlApi
     GraphqlApi
     (Maybe AuthenticationType)
     (Maybe AuthenticationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe AuthenticationType
authenticationType :: Maybe AuthenticationType
$sel:authenticationType:GraphqlApi' :: GraphqlApi -> Maybe AuthenticationType
authenticationType} -> Maybe AuthenticationType
authenticationType) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe AuthenticationType
a -> GraphqlApi
s {$sel:authenticationType:GraphqlApi' :: Maybe AuthenticationType
authenticationType = Maybe AuthenticationType
a} :: GraphqlApi)

-- | The Amazon CloudWatch Logs configuration.
graphqlApi_logConfig :: Lens.Lens' GraphqlApi (Prelude.Maybe LogConfig)
graphqlApi_logConfig :: (Maybe LogConfig -> f (Maybe LogConfig))
-> GraphqlApi -> f GraphqlApi
graphqlApi_logConfig = (GraphqlApi -> Maybe LogConfig)
-> (GraphqlApi -> Maybe LogConfig -> GraphqlApi)
-> Lens GraphqlApi GraphqlApi (Maybe LogConfig) (Maybe LogConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe LogConfig
logConfig :: Maybe LogConfig
$sel:logConfig:GraphqlApi' :: GraphqlApi -> Maybe LogConfig
logConfig} -> Maybe LogConfig
logConfig) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe LogConfig
a -> GraphqlApi
s {$sel:logConfig:GraphqlApi' :: Maybe LogConfig
logConfig = Maybe LogConfig
a} :: GraphqlApi)

-- | The tags.
graphqlApi_tags :: Lens.Lens' GraphqlApi (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
graphqlApi_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GraphqlApi -> f GraphqlApi
graphqlApi_tags = (GraphqlApi -> Maybe (HashMap Text Text))
-> (GraphqlApi -> Maybe (HashMap Text Text) -> GraphqlApi)
-> Lens
     GraphqlApi
     GraphqlApi
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GraphqlApi' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GraphqlApi' :: GraphqlApi -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GraphqlApi
s@GraphqlApi' {} Maybe (HashMap Text Text)
a -> GraphqlApi
s {$sel:tags:GraphqlApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GraphqlApi) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GraphqlApi -> f GraphqlApi)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GraphqlApi
-> f GraphqlApi
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON GraphqlApi where
  parseJSON :: Value -> Parser GraphqlApi
parseJSON =
    String
-> (Object -> Parser GraphqlApi) -> Value -> Parser GraphqlApi
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GraphqlApi"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe OpenIDConnectConfig
-> Maybe Text
-> Maybe [AdditionalAuthenticationProvider]
-> Maybe LambdaAuthorizerConfig
-> Maybe Text
-> Maybe UserPoolConfig
-> Maybe AuthenticationType
-> Maybe LogConfig
-> Maybe (HashMap Text Text)
-> GraphqlApi
GraphqlApi'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe OpenIDConnectConfig
 -> Maybe Text
 -> Maybe [AdditionalAuthenticationProvider]
 -> Maybe LambdaAuthorizerConfig
 -> Maybe Text
 -> Maybe UserPoolConfig
 -> Maybe AuthenticationType
 -> Maybe LogConfig
 -> Maybe (HashMap Text Text)
 -> GraphqlApi)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe OpenIDConnectConfig
      -> Maybe Text
      -> Maybe [AdditionalAuthenticationProvider]
      -> Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"xrayEnabled")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe OpenIDConnectConfig
   -> Maybe Text
   -> Maybe [AdditionalAuthenticationProvider]
   -> Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe OpenIDConnectConfig
      -> Maybe Text
      -> Maybe [AdditionalAuthenticationProvider]
      -> Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe OpenIDConnectConfig
   -> Maybe Text
   -> Maybe [AdditionalAuthenticationProvider]
   -> Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe OpenIDConnectConfig
      -> Maybe Text
      -> Maybe [AdditionalAuthenticationProvider]
      -> Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"apiId")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe OpenIDConnectConfig
   -> Maybe Text
   -> Maybe [AdditionalAuthenticationProvider]
   -> Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe OpenIDConnectConfig
      -> Maybe Text
      -> Maybe [AdditionalAuthenticationProvider]
      -> Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"uris" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe OpenIDConnectConfig
   -> Maybe Text
   -> Maybe [AdditionalAuthenticationProvider]
   -> Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe OpenIDConnectConfig)
-> Parser
     (Maybe Text
      -> Maybe [AdditionalAuthenticationProvider]
      -> Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OpenIDConnectConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"openIDConnectConfig")
            Parser
  (Maybe Text
   -> Maybe [AdditionalAuthenticationProvider]
   -> Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AdditionalAuthenticationProvider]
      -> Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"wafWebAclArn")
            Parser
  (Maybe [AdditionalAuthenticationProvider]
   -> Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe [AdditionalAuthenticationProvider])
-> Parser
     (Maybe LambdaAuthorizerConfig
      -> Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [AdditionalAuthenticationProvider]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"additionalAuthenticationProviders"
                            Parser (Maybe (Maybe [AdditionalAuthenticationProvider]))
-> Maybe [AdditionalAuthenticationProvider]
-> Parser (Maybe [AdditionalAuthenticationProvider])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AdditionalAuthenticationProvider]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe LambdaAuthorizerConfig
   -> Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe LambdaAuthorizerConfig)
-> Parser
     (Maybe Text
      -> Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LambdaAuthorizerConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lambdaAuthorizerConfig")
            Parser
  (Maybe Text
   -> Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe Text)
-> Parser
     (Maybe UserPoolConfig
      -> Maybe AuthenticationType
      -> Maybe LogConfig
      -> Maybe (HashMap Text Text)
      -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe UserPoolConfig
   -> Maybe AuthenticationType
   -> Maybe LogConfig
   -> Maybe (HashMap Text Text)
   -> GraphqlApi)
-> Parser (Maybe UserPoolConfig)
-> Parser
     (Maybe AuthenticationType
      -> Maybe LogConfig -> Maybe (HashMap Text Text) -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserPoolConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userPoolConfig")
            Parser
  (Maybe AuthenticationType
   -> Maybe LogConfig -> Maybe (HashMap Text Text) -> GraphqlApi)
-> Parser (Maybe AuthenticationType)
-> Parser
     (Maybe LogConfig -> Maybe (HashMap Text Text) -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuthenticationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authenticationType")
            Parser (Maybe LogConfig -> Maybe (HashMap Text Text) -> GraphqlApi)
-> Parser (Maybe LogConfig)
-> Parser (Maybe (HashMap Text Text) -> GraphqlApi)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LogConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"logConfig")
            Parser (Maybe (HashMap Text Text) -> GraphqlApi)
-> Parser (Maybe (HashMap Text Text)) -> Parser GraphqlApi
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable GraphqlApi

instance Prelude.NFData GraphqlApi