{-# 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.CreateBackendAuth
-- 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)
--
-- Creates a new backend authentication resource.
module Amazonka.AmplifyBackend.CreateBackendAuth
  ( -- * Creating a Request
    CreateBackendAuth (..),
    newCreateBackendAuth,

    -- * Request Lenses
    createBackendAuth_appId,
    createBackendAuth_resourceName,
    createBackendAuth_backendEnvironmentName,
    createBackendAuth_resourceConfig,

    -- * Destructuring the Response
    CreateBackendAuthResponse (..),
    newCreateBackendAuthResponse,

    -- * Response Lenses
    createBackendAuthResponse_status,
    createBackendAuthResponse_jobId,
    createBackendAuthResponse_operation,
    createBackendAuthResponse_error,
    createBackendAuthResponse_appId,
    createBackendAuthResponse_backendEnvironmentName,
    createBackendAuthResponse_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 CreateBackendAuth.
--
-- /See:/ 'newCreateBackendAuth' smart constructor.
data CreateBackendAuth = CreateBackendAuth'
  { -- | The app ID.
    CreateBackendAuth -> Text
appId :: Prelude.Text,
    -- | The name of this resource.
    CreateBackendAuth -> Text
resourceName :: Prelude.Text,
    -- | The name of the backend environment.
    CreateBackendAuth -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The resource configuration for this request object.
    CreateBackendAuth -> CreateBackendAuthResourceConfig
resourceConfig :: CreateBackendAuthResourceConfig
  }
  deriving (CreateBackendAuth -> CreateBackendAuth -> Bool
(CreateBackendAuth -> CreateBackendAuth -> Bool)
-> (CreateBackendAuth -> CreateBackendAuth -> Bool)
-> Eq CreateBackendAuth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBackendAuth -> CreateBackendAuth -> Bool
$c/= :: CreateBackendAuth -> CreateBackendAuth -> Bool
== :: CreateBackendAuth -> CreateBackendAuth -> Bool
$c== :: CreateBackendAuth -> CreateBackendAuth -> Bool
Prelude.Eq, ReadPrec [CreateBackendAuth]
ReadPrec CreateBackendAuth
Int -> ReadS CreateBackendAuth
ReadS [CreateBackendAuth]
(Int -> ReadS CreateBackendAuth)
-> ReadS [CreateBackendAuth]
-> ReadPrec CreateBackendAuth
-> ReadPrec [CreateBackendAuth]
-> Read CreateBackendAuth
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBackendAuth]
$creadListPrec :: ReadPrec [CreateBackendAuth]
readPrec :: ReadPrec CreateBackendAuth
$creadPrec :: ReadPrec CreateBackendAuth
readList :: ReadS [CreateBackendAuth]
$creadList :: ReadS [CreateBackendAuth]
readsPrec :: Int -> ReadS CreateBackendAuth
$creadsPrec :: Int -> ReadS CreateBackendAuth
Prelude.Read, Int -> CreateBackendAuth -> ShowS
[CreateBackendAuth] -> ShowS
CreateBackendAuth -> String
(Int -> CreateBackendAuth -> ShowS)
-> (CreateBackendAuth -> String)
-> ([CreateBackendAuth] -> ShowS)
-> Show CreateBackendAuth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBackendAuth] -> ShowS
$cshowList :: [CreateBackendAuth] -> ShowS
show :: CreateBackendAuth -> String
$cshow :: CreateBackendAuth -> String
showsPrec :: Int -> CreateBackendAuth -> ShowS
$cshowsPrec :: Int -> CreateBackendAuth -> ShowS
Prelude.Show, (forall x. CreateBackendAuth -> Rep CreateBackendAuth x)
-> (forall x. Rep CreateBackendAuth x -> CreateBackendAuth)
-> Generic CreateBackendAuth
forall x. Rep CreateBackendAuth x -> CreateBackendAuth
forall x. CreateBackendAuth -> Rep CreateBackendAuth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBackendAuth x -> CreateBackendAuth
$cfrom :: forall x. CreateBackendAuth -> Rep CreateBackendAuth x
Prelude.Generic)

-- |
-- Create a value of 'CreateBackendAuth' 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', 'createBackendAuth_appId' - The app ID.
--
-- 'resourceName', 'createBackendAuth_resourceName' - The name of this resource.
--
-- 'backendEnvironmentName', 'createBackendAuth_backendEnvironmentName' - The name of the backend environment.
--
-- 'resourceConfig', 'createBackendAuth_resourceConfig' - The resource configuration for this request object.
newCreateBackendAuth ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'resourceName'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'resourceConfig'
  CreateBackendAuthResourceConfig ->
  CreateBackendAuth
newCreateBackendAuth :: Text
-> Text
-> Text
-> CreateBackendAuthResourceConfig
-> CreateBackendAuth
newCreateBackendAuth
  Text
pAppId_
  Text
pResourceName_
  Text
pBackendEnvironmentName_
  CreateBackendAuthResourceConfig
pResourceConfig_ =
    CreateBackendAuth' :: Text
-> Text
-> Text
-> CreateBackendAuthResourceConfig
-> CreateBackendAuth
CreateBackendAuth'
      { $sel:appId:CreateBackendAuth' :: Text
appId = Text
pAppId_,
        $sel:resourceName:CreateBackendAuth' :: Text
resourceName = Text
pResourceName_,
        $sel:backendEnvironmentName:CreateBackendAuth' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:resourceConfig:CreateBackendAuth' :: CreateBackendAuthResourceConfig
resourceConfig = CreateBackendAuthResourceConfig
pResourceConfig_
      }

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

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

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

-- | The resource configuration for this request object.
createBackendAuth_resourceConfig :: Lens.Lens' CreateBackendAuth CreateBackendAuthResourceConfig
createBackendAuth_resourceConfig :: (CreateBackendAuthResourceConfig
 -> f CreateBackendAuthResourceConfig)
-> CreateBackendAuth -> f CreateBackendAuth
createBackendAuth_resourceConfig = (CreateBackendAuth -> CreateBackendAuthResourceConfig)
-> (CreateBackendAuth
    -> CreateBackendAuthResourceConfig -> CreateBackendAuth)
-> Lens
     CreateBackendAuth
     CreateBackendAuth
     CreateBackendAuthResourceConfig
     CreateBackendAuthResourceConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuth' {CreateBackendAuthResourceConfig
resourceConfig :: CreateBackendAuthResourceConfig
$sel:resourceConfig:CreateBackendAuth' :: CreateBackendAuth -> CreateBackendAuthResourceConfig
resourceConfig} -> CreateBackendAuthResourceConfig
resourceConfig) (\s :: CreateBackendAuth
s@CreateBackendAuth' {} CreateBackendAuthResourceConfig
a -> CreateBackendAuth
s {$sel:resourceConfig:CreateBackendAuth' :: CreateBackendAuthResourceConfig
resourceConfig = CreateBackendAuthResourceConfig
a} :: CreateBackendAuth)

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

instance Prelude.NFData CreateBackendAuth

instance Core.ToHeaders CreateBackendAuth where
  toHeaders :: CreateBackendAuth -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateBackendAuth -> 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 CreateBackendAuth where
  toJSON :: CreateBackendAuth -> Value
toJSON CreateBackendAuth' {Text
CreateBackendAuthResourceConfig
resourceConfig :: CreateBackendAuthResourceConfig
backendEnvironmentName :: Text
resourceName :: Text
appId :: Text
$sel:resourceConfig:CreateBackendAuth' :: CreateBackendAuth -> CreateBackendAuthResourceConfig
$sel:backendEnvironmentName:CreateBackendAuth' :: CreateBackendAuth -> Text
$sel:resourceName:CreateBackendAuth' :: CreateBackendAuth -> Text
$sel:appId:CreateBackendAuth' :: CreateBackendAuth -> 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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"backendEnvironmentName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
backendEnvironmentName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"resourceConfig" Text -> CreateBackendAuthResourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CreateBackendAuthResourceConfig
resourceConfig)
          ]
      )

instance Core.ToPath CreateBackendAuth where
  toPath :: CreateBackendAuth -> ByteString
toPath CreateBackendAuth' {Text
CreateBackendAuthResourceConfig
resourceConfig :: CreateBackendAuthResourceConfig
backendEnvironmentName :: Text
resourceName :: Text
appId :: Text
$sel:resourceConfig:CreateBackendAuth' :: CreateBackendAuth -> CreateBackendAuthResourceConfig
$sel:backendEnvironmentName:CreateBackendAuth' :: CreateBackendAuth -> Text
$sel:resourceName:CreateBackendAuth' :: CreateBackendAuth -> Text
$sel:appId:CreateBackendAuth' :: CreateBackendAuth -> 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"]

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

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

-- |
-- Create a value of 'CreateBackendAuthResponse' 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', 'createBackendAuthResponse_status' - The current status of the request.
--
-- 'jobId', 'createBackendAuthResponse_jobId' - The ID for the job.
--
-- 'operation', 'createBackendAuthResponse_operation' - The name of the operation.
--
-- 'error', 'createBackendAuthResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'createBackendAuthResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'createBackendAuthResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'createBackendAuthResponse_httpStatus' - The response's http status code.
newCreateBackendAuthResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBackendAuthResponse
newCreateBackendAuthResponse :: Int -> CreateBackendAuthResponse
newCreateBackendAuthResponse Int
pHttpStatus_ =
  CreateBackendAuthResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateBackendAuthResponse
CreateBackendAuthResponse'
    { $sel:status:CreateBackendAuthResponse' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:CreateBackendAuthResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:CreateBackendAuthResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:CreateBackendAuthResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:CreateBackendAuthResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:CreateBackendAuthResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateBackendAuthResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance Prelude.NFData CreateBackendAuthResponse