{-# 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.ImportBackendAuth
-- 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)
--
-- Imports an existing backend authentication resource.
module Amazonka.AmplifyBackend.ImportBackendAuth
  ( -- * Creating a Request
    ImportBackendAuth (..),
    newImportBackendAuth,

    -- * Request Lenses
    importBackendAuth_identityPoolId,
    importBackendAuth_appId,
    importBackendAuth_backendEnvironmentName,
    importBackendAuth_userPoolId,
    importBackendAuth_nativeClientId,
    importBackendAuth_webClientId,

    -- * Destructuring the Response
    ImportBackendAuthResponse (..),
    newImportBackendAuthResponse,

    -- * Response Lenses
    importBackendAuthResponse_status,
    importBackendAuthResponse_jobId,
    importBackendAuthResponse_operation,
    importBackendAuthResponse_error,
    importBackendAuthResponse_appId,
    importBackendAuthResponse_backendEnvironmentName,
    importBackendAuthResponse_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 ImportBackendAuth.
--
-- /See:/ 'newImportBackendAuth' smart constructor.
data ImportBackendAuth = ImportBackendAuth'
  { -- | The ID of the Amazon Cognito identity pool.
    ImportBackendAuth -> Maybe Text
identityPoolId :: Prelude.Maybe Prelude.Text,
    -- | The app ID.
    ImportBackendAuth -> Text
appId :: Prelude.Text,
    -- | The name of the backend environment.
    ImportBackendAuth -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The ID of the Amazon Cognito user pool.
    ImportBackendAuth -> Text
userPoolId :: Prelude.Text,
    -- | The ID of the Amazon Cognito native client.
    ImportBackendAuth -> Text
nativeClientId :: Prelude.Text,
    -- | The ID of the Amazon Cognito web client.
    ImportBackendAuth -> Text
webClientId :: Prelude.Text
  }
  deriving (ImportBackendAuth -> ImportBackendAuth -> Bool
(ImportBackendAuth -> ImportBackendAuth -> Bool)
-> (ImportBackendAuth -> ImportBackendAuth -> Bool)
-> Eq ImportBackendAuth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportBackendAuth -> ImportBackendAuth -> Bool
$c/= :: ImportBackendAuth -> ImportBackendAuth -> Bool
== :: ImportBackendAuth -> ImportBackendAuth -> Bool
$c== :: ImportBackendAuth -> ImportBackendAuth -> Bool
Prelude.Eq, ReadPrec [ImportBackendAuth]
ReadPrec ImportBackendAuth
Int -> ReadS ImportBackendAuth
ReadS [ImportBackendAuth]
(Int -> ReadS ImportBackendAuth)
-> ReadS [ImportBackendAuth]
-> ReadPrec ImportBackendAuth
-> ReadPrec [ImportBackendAuth]
-> Read ImportBackendAuth
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportBackendAuth]
$creadListPrec :: ReadPrec [ImportBackendAuth]
readPrec :: ReadPrec ImportBackendAuth
$creadPrec :: ReadPrec ImportBackendAuth
readList :: ReadS [ImportBackendAuth]
$creadList :: ReadS [ImportBackendAuth]
readsPrec :: Int -> ReadS ImportBackendAuth
$creadsPrec :: Int -> ReadS ImportBackendAuth
Prelude.Read, Int -> ImportBackendAuth -> ShowS
[ImportBackendAuth] -> ShowS
ImportBackendAuth -> String
(Int -> ImportBackendAuth -> ShowS)
-> (ImportBackendAuth -> String)
-> ([ImportBackendAuth] -> ShowS)
-> Show ImportBackendAuth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportBackendAuth] -> ShowS
$cshowList :: [ImportBackendAuth] -> ShowS
show :: ImportBackendAuth -> String
$cshow :: ImportBackendAuth -> String
showsPrec :: Int -> ImportBackendAuth -> ShowS
$cshowsPrec :: Int -> ImportBackendAuth -> ShowS
Prelude.Show, (forall x. ImportBackendAuth -> Rep ImportBackendAuth x)
-> (forall x. Rep ImportBackendAuth x -> ImportBackendAuth)
-> Generic ImportBackendAuth
forall x. Rep ImportBackendAuth x -> ImportBackendAuth
forall x. ImportBackendAuth -> Rep ImportBackendAuth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportBackendAuth x -> ImportBackendAuth
$cfrom :: forall x. ImportBackendAuth -> Rep ImportBackendAuth x
Prelude.Generic)

-- |
-- Create a value of 'ImportBackendAuth' 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:
--
-- 'identityPoolId', 'importBackendAuth_identityPoolId' - The ID of the Amazon Cognito identity pool.
--
-- 'appId', 'importBackendAuth_appId' - The app ID.
--
-- 'backendEnvironmentName', 'importBackendAuth_backendEnvironmentName' - The name of the backend environment.
--
-- 'userPoolId', 'importBackendAuth_userPoolId' - The ID of the Amazon Cognito user pool.
--
-- 'nativeClientId', 'importBackendAuth_nativeClientId' - The ID of the Amazon Cognito native client.
--
-- 'webClientId', 'importBackendAuth_webClientId' - The ID of the Amazon Cognito web client.
newImportBackendAuth ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'nativeClientId'
  Prelude.Text ->
  -- | 'webClientId'
  Prelude.Text ->
  ImportBackendAuth
newImportBackendAuth :: Text -> Text -> Text -> Text -> Text -> ImportBackendAuth
newImportBackendAuth
  Text
pAppId_
  Text
pBackendEnvironmentName_
  Text
pUserPoolId_
  Text
pNativeClientId_
  Text
pWebClientId_ =
    ImportBackendAuth' :: Maybe Text
-> Text -> Text -> Text -> Text -> Text -> ImportBackendAuth
ImportBackendAuth'
      { $sel:identityPoolId:ImportBackendAuth' :: Maybe Text
identityPoolId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:appId:ImportBackendAuth' :: Text
appId = Text
pAppId_,
        $sel:backendEnvironmentName:ImportBackendAuth' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:userPoolId:ImportBackendAuth' :: Text
userPoolId = Text
pUserPoolId_,
        $sel:nativeClientId:ImportBackendAuth' :: Text
nativeClientId = Text
pNativeClientId_,
        $sel:webClientId:ImportBackendAuth' :: Text
webClientId = Text
pWebClientId_
      }

-- | The ID of the Amazon Cognito identity pool.
importBackendAuth_identityPoolId :: Lens.Lens' ImportBackendAuth (Prelude.Maybe Prelude.Text)
importBackendAuth_identityPoolId :: (Maybe Text -> f (Maybe Text))
-> ImportBackendAuth -> f ImportBackendAuth
importBackendAuth_identityPoolId = (ImportBackendAuth -> Maybe Text)
-> (ImportBackendAuth -> Maybe Text -> ImportBackendAuth)
-> Lens
     ImportBackendAuth ImportBackendAuth (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuth' {Maybe Text
identityPoolId :: Maybe Text
$sel:identityPoolId:ImportBackendAuth' :: ImportBackendAuth -> Maybe Text
identityPoolId} -> Maybe Text
identityPoolId) (\s :: ImportBackendAuth
s@ImportBackendAuth' {} Maybe Text
a -> ImportBackendAuth
s {$sel:identityPoolId:ImportBackendAuth' :: Maybe Text
identityPoolId = Maybe Text
a} :: ImportBackendAuth)

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

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

-- | The ID of the Amazon Cognito user pool.
importBackendAuth_userPoolId :: Lens.Lens' ImportBackendAuth Prelude.Text
importBackendAuth_userPoolId :: (Text -> f Text) -> ImportBackendAuth -> f ImportBackendAuth
importBackendAuth_userPoolId = (ImportBackendAuth -> Text)
-> (ImportBackendAuth -> Text -> ImportBackendAuth)
-> Lens ImportBackendAuth ImportBackendAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuth' {Text
userPoolId :: Text
$sel:userPoolId:ImportBackendAuth' :: ImportBackendAuth -> Text
userPoolId} -> Text
userPoolId) (\s :: ImportBackendAuth
s@ImportBackendAuth' {} Text
a -> ImportBackendAuth
s {$sel:userPoolId:ImportBackendAuth' :: Text
userPoolId = Text
a} :: ImportBackendAuth)

-- | The ID of the Amazon Cognito native client.
importBackendAuth_nativeClientId :: Lens.Lens' ImportBackendAuth Prelude.Text
importBackendAuth_nativeClientId :: (Text -> f Text) -> ImportBackendAuth -> f ImportBackendAuth
importBackendAuth_nativeClientId = (ImportBackendAuth -> Text)
-> (ImportBackendAuth -> Text -> ImportBackendAuth)
-> Lens ImportBackendAuth ImportBackendAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuth' {Text
nativeClientId :: Text
$sel:nativeClientId:ImportBackendAuth' :: ImportBackendAuth -> Text
nativeClientId} -> Text
nativeClientId) (\s :: ImportBackendAuth
s@ImportBackendAuth' {} Text
a -> ImportBackendAuth
s {$sel:nativeClientId:ImportBackendAuth' :: Text
nativeClientId = Text
a} :: ImportBackendAuth)

-- | The ID of the Amazon Cognito web client.
importBackendAuth_webClientId :: Lens.Lens' ImportBackendAuth Prelude.Text
importBackendAuth_webClientId :: (Text -> f Text) -> ImportBackendAuth -> f ImportBackendAuth
importBackendAuth_webClientId = (ImportBackendAuth -> Text)
-> (ImportBackendAuth -> Text -> ImportBackendAuth)
-> Lens ImportBackendAuth ImportBackendAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuth' {Text
webClientId :: Text
$sel:webClientId:ImportBackendAuth' :: ImportBackendAuth -> Text
webClientId} -> Text
webClientId) (\s :: ImportBackendAuth
s@ImportBackendAuth' {} Text
a -> ImportBackendAuth
s {$sel:webClientId:ImportBackendAuth' :: Text
webClientId = Text
a} :: ImportBackendAuth)

instance Core.AWSRequest ImportBackendAuth where
  type
    AWSResponse ImportBackendAuth =
      ImportBackendAuthResponse
  request :: ImportBackendAuth -> Request ImportBackendAuth
request = Service -> ImportBackendAuth -> Request ImportBackendAuth
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ImportBackendAuth
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportBackendAuth)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ImportBackendAuth))
-> Logger
-> Service
-> Proxy ImportBackendAuth
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportBackendAuth)))
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 Text
-> Maybe Text
-> Maybe Text
-> Int
-> ImportBackendAuthResponse
ImportBackendAuthResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> ImportBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> ImportBackendAuthResponse)
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
"status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> ImportBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> ImportBackendAuthResponse)
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
"jobId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> ImportBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> ImportBackendAuthResponse)
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
"operation")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> ImportBackendAuthResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> ImportBackendAuthResponse)
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 Text -> Int -> ImportBackendAuthResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> ImportBackendAuthResponse)
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 Text -> Int -> ImportBackendAuthResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ImportBackendAuthResponse)
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 -> ImportBackendAuthResponse)
-> Either String Int -> Either String ImportBackendAuthResponse
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 ImportBackendAuth

instance Prelude.NFData ImportBackendAuth

instance Core.ToHeaders ImportBackendAuth where
  toHeaders :: ImportBackendAuth -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ImportBackendAuth -> 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 ImportBackendAuth where
  toJSON :: ImportBackendAuth -> Value
toJSON ImportBackendAuth' {Maybe Text
Text
webClientId :: Text
nativeClientId :: Text
userPoolId :: Text
backendEnvironmentName :: Text
appId :: Text
identityPoolId :: Maybe Text
$sel:webClientId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:nativeClientId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:userPoolId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:backendEnvironmentName:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:appId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:identityPoolId:ImportBackendAuth' :: ImportBackendAuth -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"identityPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identityPoolId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"userPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"nativeClientId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
nativeClientId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"webClientId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
webClientId)
          ]
      )

instance Core.ToPath ImportBackendAuth where
  toPath :: ImportBackendAuth -> ByteString
toPath ImportBackendAuth' {Maybe Text
Text
webClientId :: Text
nativeClientId :: Text
userPoolId :: Text
backendEnvironmentName :: Text
appId :: Text
identityPoolId :: Maybe Text
$sel:webClientId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:nativeClientId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:userPoolId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:backendEnvironmentName:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:appId:ImportBackendAuth' :: ImportBackendAuth -> Text
$sel:identityPoolId:ImportBackendAuth' :: ImportBackendAuth -> Maybe 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
"/import"
      ]

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

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

-- |
-- Create a value of 'ImportBackendAuthResponse' 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:
--
-- 'status', 'importBackendAuthResponse_status' - The current status of the request.
--
-- 'jobId', 'importBackendAuthResponse_jobId' - The ID for the job.
--
-- 'operation', 'importBackendAuthResponse_operation' - The name of the operation.
--
-- 'error', 'importBackendAuthResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'importBackendAuthResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'importBackendAuthResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'importBackendAuthResponse_httpStatus' - The response's http status code.
newImportBackendAuthResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ImportBackendAuthResponse
newImportBackendAuthResponse :: Int -> ImportBackendAuthResponse
newImportBackendAuthResponse Int
pHttpStatus_ =
  ImportBackendAuthResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ImportBackendAuthResponse
ImportBackendAuthResponse'
    { $sel:status:ImportBackendAuthResponse' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:ImportBackendAuthResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:ImportBackendAuthResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:ImportBackendAuthResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:ImportBackendAuthResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:ImportBackendAuthResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ImportBackendAuthResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current status of the request.
importBackendAuthResponse_status :: Lens.Lens' ImportBackendAuthResponse (Prelude.Maybe Prelude.Text)
importBackendAuthResponse_status :: (Maybe Text -> f (Maybe Text))
-> ImportBackendAuthResponse -> f ImportBackendAuthResponse
importBackendAuthResponse_status = (ImportBackendAuthResponse -> Maybe Text)
-> (ImportBackendAuthResponse
    -> Maybe Text -> ImportBackendAuthResponse)
-> Lens
     ImportBackendAuthResponse
     ImportBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuthResponse' {Maybe Text
status :: Maybe Text
$sel:status:ImportBackendAuthResponse' :: ImportBackendAuthResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: ImportBackendAuthResponse
s@ImportBackendAuthResponse' {} Maybe Text
a -> ImportBackendAuthResponse
s {$sel:status:ImportBackendAuthResponse' :: Maybe Text
status = Maybe Text
a} :: ImportBackendAuthResponse)

-- | The ID for the job.
importBackendAuthResponse_jobId :: Lens.Lens' ImportBackendAuthResponse (Prelude.Maybe Prelude.Text)
importBackendAuthResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> ImportBackendAuthResponse -> f ImportBackendAuthResponse
importBackendAuthResponse_jobId = (ImportBackendAuthResponse -> Maybe Text)
-> (ImportBackendAuthResponse
    -> Maybe Text -> ImportBackendAuthResponse)
-> Lens
     ImportBackendAuthResponse
     ImportBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuthResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:ImportBackendAuthResponse' :: ImportBackendAuthResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: ImportBackendAuthResponse
s@ImportBackendAuthResponse' {} Maybe Text
a -> ImportBackendAuthResponse
s {$sel:jobId:ImportBackendAuthResponse' :: Maybe Text
jobId = Maybe Text
a} :: ImportBackendAuthResponse)

-- | The name of the operation.
importBackendAuthResponse_operation :: Lens.Lens' ImportBackendAuthResponse (Prelude.Maybe Prelude.Text)
importBackendAuthResponse_operation :: (Maybe Text -> f (Maybe Text))
-> ImportBackendAuthResponse -> f ImportBackendAuthResponse
importBackendAuthResponse_operation = (ImportBackendAuthResponse -> Maybe Text)
-> (ImportBackendAuthResponse
    -> Maybe Text -> ImportBackendAuthResponse)
-> Lens
     ImportBackendAuthResponse
     ImportBackendAuthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportBackendAuthResponse' {Maybe Text
operation :: Maybe Text
$sel:operation:ImportBackendAuthResponse' :: ImportBackendAuthResponse -> Maybe Text
operation} -> Maybe Text
operation) (\s :: ImportBackendAuthResponse
s@ImportBackendAuthResponse' {} Maybe Text
a -> ImportBackendAuthResponse
s {$sel:operation:ImportBackendAuthResponse' :: Maybe Text
operation = Maybe Text
a} :: ImportBackendAuthResponse)

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

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

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

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

instance Prelude.NFData ImportBackendAuthResponse