{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AmplifyBackend.GetBackendAuth
-- 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)
--
-- Gets a backend auth details.
module Amazonka.AmplifyBackend.GetBackendAuth
  ( -- * Creating a Request
    GetBackendAuth (..),
    newGetBackendAuth,

    -- * Request Lenses
    getBackendAuth_appId,
    getBackendAuth_backendEnvironmentName,
    getBackendAuth_resourceName,

    -- * Destructuring the Response
    GetBackendAuthResponse (..),
    newGetBackendAuthResponse,

    -- * Response Lenses
    getBackendAuthResponse_resourceName,
    getBackendAuthResponse_error,
    getBackendAuthResponse_appId,
    getBackendAuthResponse_resourceConfig,
    getBackendAuthResponse_backendEnvironmentName,
    getBackendAuthResponse_httpStatus,
  )
where

import Amazonka.AmplifyBackend.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The request body for GetBackendAuth.
--
-- /See:/ 'newGetBackendAuth' smart constructor.
data GetBackendAuth = GetBackendAuth'
  { -- | The app ID.
    GetBackendAuth -> Text
appId :: Prelude.Text,
    -- | The name of the backend environment.
    GetBackendAuth -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The name of this resource.
    GetBackendAuth -> Text
resourceName :: Prelude.Text
  }
  deriving (GetBackendAuth -> GetBackendAuth -> Bool
(GetBackendAuth -> GetBackendAuth -> Bool)
-> (GetBackendAuth -> GetBackendAuth -> Bool) -> Eq GetBackendAuth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBackendAuth -> GetBackendAuth -> Bool
$c/= :: GetBackendAuth -> GetBackendAuth -> Bool
== :: GetBackendAuth -> GetBackendAuth -> Bool
$c== :: GetBackendAuth -> GetBackendAuth -> Bool
Prelude.Eq, ReadPrec [GetBackendAuth]
ReadPrec GetBackendAuth
Int -> ReadS GetBackendAuth
ReadS [GetBackendAuth]
(Int -> ReadS GetBackendAuth)
-> ReadS [GetBackendAuth]
-> ReadPrec GetBackendAuth
-> ReadPrec [GetBackendAuth]
-> Read GetBackendAuth
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBackendAuth]
$creadListPrec :: ReadPrec [GetBackendAuth]
readPrec :: ReadPrec GetBackendAuth
$creadPrec :: ReadPrec GetBackendAuth
readList :: ReadS [GetBackendAuth]
$creadList :: ReadS [GetBackendAuth]
readsPrec :: Int -> ReadS GetBackendAuth
$creadsPrec :: Int -> ReadS GetBackendAuth
Prelude.Read, Int -> GetBackendAuth -> ShowS
[GetBackendAuth] -> ShowS
GetBackendAuth -> String
(Int -> GetBackendAuth -> ShowS)
-> (GetBackendAuth -> String)
-> ([GetBackendAuth] -> ShowS)
-> Show GetBackendAuth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBackendAuth] -> ShowS
$cshowList :: [GetBackendAuth] -> ShowS
show :: GetBackendAuth -> String
$cshow :: GetBackendAuth -> String
showsPrec :: Int -> GetBackendAuth -> ShowS
$cshowsPrec :: Int -> GetBackendAuth -> ShowS
Prelude.Show, (forall x. GetBackendAuth -> Rep GetBackendAuth x)
-> (forall x. Rep GetBackendAuth x -> GetBackendAuth)
-> Generic GetBackendAuth
forall x. Rep GetBackendAuth x -> GetBackendAuth
forall x. GetBackendAuth -> Rep GetBackendAuth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBackendAuth x -> GetBackendAuth
$cfrom :: forall x. GetBackendAuth -> Rep GetBackendAuth x
Prelude.Generic)

-- |
-- Create a value of 'GetBackendAuth' 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:
--
-- 'appId', 'getBackendAuth_appId' - The app ID.
--
-- 'backendEnvironmentName', 'getBackendAuth_backendEnvironmentName' - The name of the backend environment.
--
-- 'resourceName', 'getBackendAuth_resourceName' - The name of this resource.
newGetBackendAuth ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'resourceName'
  Prelude.Text ->
  GetBackendAuth
newGetBackendAuth :: Text -> Text -> Text -> GetBackendAuth
newGetBackendAuth
  Text
pAppId_
  Text
pBackendEnvironmentName_
  Text
pResourceName_ =
    GetBackendAuth' :: Text -> Text -> Text -> GetBackendAuth
GetBackendAuth'
      { $sel:appId:GetBackendAuth' :: Text
appId = Text
pAppId_,
        $sel:backendEnvironmentName:GetBackendAuth' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:resourceName:GetBackendAuth' :: Text
resourceName = Text
pResourceName_
      }

-- | The app ID.
getBackendAuth_appId :: Lens.Lens' GetBackendAuth Prelude.Text
getBackendAuth_appId :: (Text -> f Text) -> GetBackendAuth -> f GetBackendAuth
getBackendAuth_appId = (GetBackendAuth -> Text)
-> (GetBackendAuth -> Text -> GetBackendAuth)
-> Lens GetBackendAuth GetBackendAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuth' {Text
appId :: Text
$sel:appId:GetBackendAuth' :: GetBackendAuth -> Text
appId} -> Text
appId) (\s :: GetBackendAuth
s@GetBackendAuth' {} Text
a -> GetBackendAuth
s {$sel:appId:GetBackendAuth' :: Text
appId = Text
a} :: GetBackendAuth)

-- | The name of the backend environment.
getBackendAuth_backendEnvironmentName :: Lens.Lens' GetBackendAuth Prelude.Text
getBackendAuth_backendEnvironmentName :: (Text -> f Text) -> GetBackendAuth -> f GetBackendAuth
getBackendAuth_backendEnvironmentName = (GetBackendAuth -> Text)
-> (GetBackendAuth -> Text -> GetBackendAuth)
-> Lens GetBackendAuth GetBackendAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuth' {Text
backendEnvironmentName :: Text
$sel:backendEnvironmentName:GetBackendAuth' :: GetBackendAuth -> Text
backendEnvironmentName} -> Text
backendEnvironmentName) (\s :: GetBackendAuth
s@GetBackendAuth' {} Text
a -> GetBackendAuth
s {$sel:backendEnvironmentName:GetBackendAuth' :: Text
backendEnvironmentName = Text
a} :: GetBackendAuth)

-- | The name of this resource.
getBackendAuth_resourceName :: Lens.Lens' GetBackendAuth Prelude.Text
getBackendAuth_resourceName :: (Text -> f Text) -> GetBackendAuth -> f GetBackendAuth
getBackendAuth_resourceName = (GetBackendAuth -> Text)
-> (GetBackendAuth -> Text -> GetBackendAuth)
-> Lens GetBackendAuth GetBackendAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuth' {Text
resourceName :: Text
$sel:resourceName:GetBackendAuth' :: GetBackendAuth -> Text
resourceName} -> Text
resourceName) (\s :: GetBackendAuth
s@GetBackendAuth' {} Text
a -> GetBackendAuth
s {$sel:resourceName:GetBackendAuth' :: Text
resourceName = Text
a} :: GetBackendAuth)

instance Core.AWSRequest GetBackendAuth where
  type
    AWSResponse GetBackendAuth =
      GetBackendAuthResponse
  request :: GetBackendAuth -> Request GetBackendAuth
request = Service -> GetBackendAuth -> Request GetBackendAuth
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetBackendAuth
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBackendAuth)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetBackendAuth))
-> Logger
-> Service
-> Proxy GetBackendAuth
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBackendAuth)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CreateBackendAuthResourceConfig
-> Maybe Text
-> Int
-> GetBackendAuthResponse
GetBackendAuthResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe CreateBackendAuthResourceConfig
 -> Maybe Text
 -> Int
 -> GetBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe CreateBackendAuthResourceConfig
      -> Maybe Text
      -> Int
      -> GetBackendAuthResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resourceName")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe CreateBackendAuthResourceConfig
   -> Maybe Text
   -> Int
   -> GetBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe CreateBackendAuthResourceConfig
      -> Maybe Text
      -> Int
      -> GetBackendAuthResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"error")
            Either
  String
  (Maybe Text
   -> Maybe CreateBackendAuthResourceConfig
   -> Maybe Text
   -> Int
   -> GetBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe CreateBackendAuthResourceConfig
      -> Maybe Text -> Int -> GetBackendAuthResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"appId")
            Either
  String
  (Maybe CreateBackendAuthResourceConfig
   -> Maybe Text -> Int -> GetBackendAuthResponse)
-> Either String (Maybe CreateBackendAuthResourceConfig)
-> Either String (Maybe Text -> Int -> GetBackendAuthResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe CreateBackendAuthResourceConfig)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resourceConfig")
            Either String (Maybe Text -> Int -> GetBackendAuthResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetBackendAuthResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"backendEnvironmentName")
            Either String (Int -> GetBackendAuthResponse)
-> Either String Int -> Either String GetBackendAuthResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetBackendAuth

instance Prelude.NFData GetBackendAuth

instance Core.ToHeaders GetBackendAuth where
  toHeaders :: GetBackendAuth -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetBackendAuth -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetBackendAuth where
  toJSON :: GetBackendAuth -> Value
toJSON GetBackendAuth' {Text
resourceName :: Text
backendEnvironmentName :: Text
appId :: Text
$sel:resourceName:GetBackendAuth' :: GetBackendAuth -> Text
$sel:backendEnvironmentName:GetBackendAuth' :: GetBackendAuth -> Text
$sel:appId:GetBackendAuth' :: GetBackendAuth -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resourceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceName)]
      )

instance Core.ToPath GetBackendAuth where
  toPath :: GetBackendAuth -> ByteString
toPath GetBackendAuth' {Text
resourceName :: Text
backendEnvironmentName :: Text
appId :: Text
$sel:resourceName:GetBackendAuth' :: GetBackendAuth -> Text
$sel:backendEnvironmentName:GetBackendAuth' :: GetBackendAuth -> Text
$sel:appId:GetBackendAuth' :: GetBackendAuth -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/backend/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId,
        ByteString
"/auth/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backendEnvironmentName,
        ByteString
"/details"
      ]

instance Core.ToQuery GetBackendAuth where
  toQuery :: GetBackendAuth -> QueryString
toQuery = QueryString -> GetBackendAuth -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetBackendAuthResponse' smart constructor.
data GetBackendAuthResponse = GetBackendAuthResponse'
  { -- | The name of this resource.
    GetBackendAuthResponse -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
    -- | If the request fails, this error is returned.
    GetBackendAuthResponse -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
    -- | The app ID.
    GetBackendAuthResponse -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
    -- | The resource configuration for authorization requests to the backend of
    -- your Amplify project.
    GetBackendAuthResponse -> Maybe CreateBackendAuthResourceConfig
resourceConfig :: Prelude.Maybe CreateBackendAuthResourceConfig,
    -- | The name of the backend environment.
    GetBackendAuthResponse -> Maybe Text
backendEnvironmentName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetBackendAuthResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBackendAuthResponse -> GetBackendAuthResponse -> Bool
(GetBackendAuthResponse -> GetBackendAuthResponse -> Bool)
-> (GetBackendAuthResponse -> GetBackendAuthResponse -> Bool)
-> Eq GetBackendAuthResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBackendAuthResponse -> GetBackendAuthResponse -> Bool
$c/= :: GetBackendAuthResponse -> GetBackendAuthResponse -> Bool
== :: GetBackendAuthResponse -> GetBackendAuthResponse -> Bool
$c== :: GetBackendAuthResponse -> GetBackendAuthResponse -> Bool
Prelude.Eq, ReadPrec [GetBackendAuthResponse]
ReadPrec GetBackendAuthResponse
Int -> ReadS GetBackendAuthResponse
ReadS [GetBackendAuthResponse]
(Int -> ReadS GetBackendAuthResponse)
-> ReadS [GetBackendAuthResponse]
-> ReadPrec GetBackendAuthResponse
-> ReadPrec [GetBackendAuthResponse]
-> Read GetBackendAuthResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBackendAuthResponse]
$creadListPrec :: ReadPrec [GetBackendAuthResponse]
readPrec :: ReadPrec GetBackendAuthResponse
$creadPrec :: ReadPrec GetBackendAuthResponse
readList :: ReadS [GetBackendAuthResponse]
$creadList :: ReadS [GetBackendAuthResponse]
readsPrec :: Int -> ReadS GetBackendAuthResponse
$creadsPrec :: Int -> ReadS GetBackendAuthResponse
Prelude.Read, Int -> GetBackendAuthResponse -> ShowS
[GetBackendAuthResponse] -> ShowS
GetBackendAuthResponse -> String
(Int -> GetBackendAuthResponse -> ShowS)
-> (GetBackendAuthResponse -> String)
-> ([GetBackendAuthResponse] -> ShowS)
-> Show GetBackendAuthResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBackendAuthResponse] -> ShowS
$cshowList :: [GetBackendAuthResponse] -> ShowS
show :: GetBackendAuthResponse -> String
$cshow :: GetBackendAuthResponse -> String
showsPrec :: Int -> GetBackendAuthResponse -> ShowS
$cshowsPrec :: Int -> GetBackendAuthResponse -> ShowS
Prelude.Show, (forall x. GetBackendAuthResponse -> Rep GetBackendAuthResponse x)
-> (forall x.
    Rep GetBackendAuthResponse x -> GetBackendAuthResponse)
-> Generic GetBackendAuthResponse
forall x. Rep GetBackendAuthResponse x -> GetBackendAuthResponse
forall x. GetBackendAuthResponse -> Rep GetBackendAuthResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBackendAuthResponse x -> GetBackendAuthResponse
$cfrom :: forall x. GetBackendAuthResponse -> Rep GetBackendAuthResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBackendAuthResponse' 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:
--
-- 'resourceName', 'getBackendAuthResponse_resourceName' - The name of this resource.
--
-- 'error', 'getBackendAuthResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'getBackendAuthResponse_appId' - The app ID.
--
-- 'resourceConfig', 'getBackendAuthResponse_resourceConfig' - The resource configuration for authorization requests to the backend of
-- your Amplify project.
--
-- 'backendEnvironmentName', 'getBackendAuthResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'getBackendAuthResponse_httpStatus' - The response's http status code.
newGetBackendAuthResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBackendAuthResponse
newGetBackendAuthResponse :: Int -> GetBackendAuthResponse
newGetBackendAuthResponse Int
pHttpStatus_ =
  GetBackendAuthResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CreateBackendAuthResourceConfig
-> Maybe Text
-> Int
-> GetBackendAuthResponse
GetBackendAuthResponse'
    { $sel:resourceName:GetBackendAuthResponse' :: Maybe Text
resourceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:GetBackendAuthResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:GetBackendAuthResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceConfig:GetBackendAuthResponse' :: Maybe CreateBackendAuthResourceConfig
resourceConfig = Maybe CreateBackendAuthResourceConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:GetBackendAuthResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBackendAuthResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of this resource.
getBackendAuthResponse_resourceName :: Lens.Lens' GetBackendAuthResponse (Prelude.Maybe Prelude.Text)
getBackendAuthResponse_resourceName :: (Maybe Text -> f (Maybe Text))
-> GetBackendAuthResponse -> f GetBackendAuthResponse
getBackendAuthResponse_resourceName = (GetBackendAuthResponse -> Maybe Text)
-> (GetBackendAuthResponse -> Maybe Text -> GetBackendAuthResponse)
-> Lens
     GetBackendAuthResponse
     GetBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuthResponse' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:GetBackendAuthResponse' :: GetBackendAuthResponse -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: GetBackendAuthResponse
s@GetBackendAuthResponse' {} Maybe Text
a -> GetBackendAuthResponse
s {$sel:resourceName:GetBackendAuthResponse' :: Maybe Text
resourceName = Maybe Text
a} :: GetBackendAuthResponse)

-- | If the request fails, this error is returned.
getBackendAuthResponse_error :: Lens.Lens' GetBackendAuthResponse (Prelude.Maybe Prelude.Text)
getBackendAuthResponse_error :: (Maybe Text -> f (Maybe Text))
-> GetBackendAuthResponse -> f GetBackendAuthResponse
getBackendAuthResponse_error = (GetBackendAuthResponse -> Maybe Text)
-> (GetBackendAuthResponse -> Maybe Text -> GetBackendAuthResponse)
-> Lens
     GetBackendAuthResponse
     GetBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuthResponse' {Maybe Text
error :: Maybe Text
$sel:error:GetBackendAuthResponse' :: GetBackendAuthResponse -> Maybe Text
error} -> Maybe Text
error) (\s :: GetBackendAuthResponse
s@GetBackendAuthResponse' {} Maybe Text
a -> GetBackendAuthResponse
s {$sel:error:GetBackendAuthResponse' :: Maybe Text
error = Maybe Text
a} :: GetBackendAuthResponse)

-- | The app ID.
getBackendAuthResponse_appId :: Lens.Lens' GetBackendAuthResponse (Prelude.Maybe Prelude.Text)
getBackendAuthResponse_appId :: (Maybe Text -> f (Maybe Text))
-> GetBackendAuthResponse -> f GetBackendAuthResponse
getBackendAuthResponse_appId = (GetBackendAuthResponse -> Maybe Text)
-> (GetBackendAuthResponse -> Maybe Text -> GetBackendAuthResponse)
-> Lens
     GetBackendAuthResponse
     GetBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuthResponse' {Maybe Text
appId :: Maybe Text
$sel:appId:GetBackendAuthResponse' :: GetBackendAuthResponse -> Maybe Text
appId} -> Maybe Text
appId) (\s :: GetBackendAuthResponse
s@GetBackendAuthResponse' {} Maybe Text
a -> GetBackendAuthResponse
s {$sel:appId:GetBackendAuthResponse' :: Maybe Text
appId = Maybe Text
a} :: GetBackendAuthResponse)

-- | The resource configuration for authorization requests to the backend of
-- your Amplify project.
getBackendAuthResponse_resourceConfig :: Lens.Lens' GetBackendAuthResponse (Prelude.Maybe CreateBackendAuthResourceConfig)
getBackendAuthResponse_resourceConfig :: (Maybe CreateBackendAuthResourceConfig
 -> f (Maybe CreateBackendAuthResourceConfig))
-> GetBackendAuthResponse -> f GetBackendAuthResponse
getBackendAuthResponse_resourceConfig = (GetBackendAuthResponse -> Maybe CreateBackendAuthResourceConfig)
-> (GetBackendAuthResponse
    -> Maybe CreateBackendAuthResourceConfig -> GetBackendAuthResponse)
-> Lens
     GetBackendAuthResponse
     GetBackendAuthResponse
     (Maybe CreateBackendAuthResourceConfig)
     (Maybe CreateBackendAuthResourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuthResponse' {Maybe CreateBackendAuthResourceConfig
resourceConfig :: Maybe CreateBackendAuthResourceConfig
$sel:resourceConfig:GetBackendAuthResponse' :: GetBackendAuthResponse -> Maybe CreateBackendAuthResourceConfig
resourceConfig} -> Maybe CreateBackendAuthResourceConfig
resourceConfig) (\s :: GetBackendAuthResponse
s@GetBackendAuthResponse' {} Maybe CreateBackendAuthResourceConfig
a -> GetBackendAuthResponse
s {$sel:resourceConfig:GetBackendAuthResponse' :: Maybe CreateBackendAuthResourceConfig
resourceConfig = Maybe CreateBackendAuthResourceConfig
a} :: GetBackendAuthResponse)

-- | The name of the backend environment.
getBackendAuthResponse_backendEnvironmentName :: Lens.Lens' GetBackendAuthResponse (Prelude.Maybe Prelude.Text)
getBackendAuthResponse_backendEnvironmentName :: (Maybe Text -> f (Maybe Text))
-> GetBackendAuthResponse -> f GetBackendAuthResponse
getBackendAuthResponse_backendEnvironmentName = (GetBackendAuthResponse -> Maybe Text)
-> (GetBackendAuthResponse -> Maybe Text -> GetBackendAuthResponse)
-> Lens
     GetBackendAuthResponse
     GetBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuthResponse' {Maybe Text
backendEnvironmentName :: Maybe Text
$sel:backendEnvironmentName:GetBackendAuthResponse' :: GetBackendAuthResponse -> Maybe Text
backendEnvironmentName} -> Maybe Text
backendEnvironmentName) (\s :: GetBackendAuthResponse
s@GetBackendAuthResponse' {} Maybe Text
a -> GetBackendAuthResponse
s {$sel:backendEnvironmentName:GetBackendAuthResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
a} :: GetBackendAuthResponse)

-- | The response's http status code.
getBackendAuthResponse_httpStatus :: Lens.Lens' GetBackendAuthResponse Prelude.Int
getBackendAuthResponse_httpStatus :: (Int -> f Int)
-> GetBackendAuthResponse -> f GetBackendAuthResponse
getBackendAuthResponse_httpStatus = (GetBackendAuthResponse -> Int)
-> (GetBackendAuthResponse -> Int -> GetBackendAuthResponse)
-> Lens GetBackendAuthResponse GetBackendAuthResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendAuthResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBackendAuthResponse' :: GetBackendAuthResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBackendAuthResponse
s@GetBackendAuthResponse' {} Int
a -> GetBackendAuthResponse
s {$sel:httpStatus:GetBackendAuthResponse' :: Int
httpStatus = Int
a} :: GetBackendAuthResponse)

instance Prelude.NFData GetBackendAuthResponse