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

    -- * Request Lenses
    updateBackendAuth_appId,
    updateBackendAuth_backendEnvironmentName,
    updateBackendAuth_resourceName,
    updateBackendAuth_resourceConfig,

    -- * Destructuring the Response
    UpdateBackendAuthResponse (..),
    newUpdateBackendAuthResponse,

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

-- |
-- Create a value of 'UpdateBackendAuth' 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', 'updateBackendAuth_appId' - The app ID.
--
-- 'backendEnvironmentName', 'updateBackendAuth_backendEnvironmentName' - The name of the backend environment.
--
-- 'resourceName', 'updateBackendAuth_resourceName' - The name of this resource.
--
-- 'resourceConfig', 'updateBackendAuth_resourceConfig' - The resource configuration for this request object.
newUpdateBackendAuth ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'resourceName'
  Prelude.Text ->
  -- | 'resourceConfig'
  UpdateBackendAuthResourceConfig ->
  UpdateBackendAuth
newUpdateBackendAuth :: Text
-> Text
-> Text
-> UpdateBackendAuthResourceConfig
-> UpdateBackendAuth
newUpdateBackendAuth
  Text
pAppId_
  Text
pBackendEnvironmentName_
  Text
pResourceName_
  UpdateBackendAuthResourceConfig
pResourceConfig_ =
    UpdateBackendAuth' :: Text
-> Text
-> Text
-> UpdateBackendAuthResourceConfig
-> UpdateBackendAuth
UpdateBackendAuth'
      { $sel:appId:UpdateBackendAuth' :: Text
appId = Text
pAppId_,
        $sel:backendEnvironmentName:UpdateBackendAuth' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:resourceName:UpdateBackendAuth' :: Text
resourceName = Text
pResourceName_,
        $sel:resourceConfig:UpdateBackendAuth' :: UpdateBackendAuthResourceConfig
resourceConfig = UpdateBackendAuthResourceConfig
pResourceConfig_
      }

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

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

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

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

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

instance Prelude.NFData UpdateBackendAuth

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

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

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

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

-- |
-- Create a value of 'UpdateBackendAuthResponse' 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', 'updateBackendAuthResponse_status' - The current status of the request.
--
-- 'jobId', 'updateBackendAuthResponse_jobId' - The ID for the job.
--
-- 'operation', 'updateBackendAuthResponse_operation' - The name of the operation.
--
-- 'error', 'updateBackendAuthResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'updateBackendAuthResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'updateBackendAuthResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'updateBackendAuthResponse_httpStatus' - The response's http status code.
newUpdateBackendAuthResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateBackendAuthResponse
newUpdateBackendAuthResponse :: Int -> UpdateBackendAuthResponse
newUpdateBackendAuthResponse Int
pHttpStatus_ =
  UpdateBackendAuthResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateBackendAuthResponse
UpdateBackendAuthResponse'
    { $sel:status:UpdateBackendAuthResponse' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:UpdateBackendAuthResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:UpdateBackendAuthResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:UpdateBackendAuthResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:UpdateBackendAuthResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:UpdateBackendAuthResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateBackendAuthResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance Prelude.NFData UpdateBackendAuthResponse