{-# 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.UpdateBackendAPI
-- 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 API resource.
module Amazonka.AmplifyBackend.UpdateBackendAPI
  ( -- * Creating a Request
    UpdateBackendAPI (..),
    newUpdateBackendAPI,

    -- * Request Lenses
    updateBackendAPI_resourceConfig,
    updateBackendAPI_appId,
    updateBackendAPI_backendEnvironmentName,
    updateBackendAPI_resourceName,

    -- * Destructuring the Response
    UpdateBackendAPIResponse (..),
    newUpdateBackendAPIResponse,

    -- * Response Lenses
    updateBackendAPIResponse_status,
    updateBackendAPIResponse_jobId,
    updateBackendAPIResponse_operation,
    updateBackendAPIResponse_error,
    updateBackendAPIResponse_appId,
    updateBackendAPIResponse_backendEnvironmentName,
    updateBackendAPIResponse_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 UpdateBackendAPI.
--
-- /See:/ 'newUpdateBackendAPI' smart constructor.
data UpdateBackendAPI = UpdateBackendAPI'
  { -- | Defines the resource configuration for the data model in your Amplify
    -- project.
    UpdateBackendAPI -> Maybe BackendAPIResourceConfig
resourceConfig :: Prelude.Maybe BackendAPIResourceConfig,
    -- | The app ID.
    UpdateBackendAPI -> Text
appId :: Prelude.Text,
    -- | The name of the backend environment.
    UpdateBackendAPI -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The name of this resource.
    UpdateBackendAPI -> Text
resourceName :: Prelude.Text
  }
  deriving (UpdateBackendAPI -> UpdateBackendAPI -> Bool
(UpdateBackendAPI -> UpdateBackendAPI -> Bool)
-> (UpdateBackendAPI -> UpdateBackendAPI -> Bool)
-> Eq UpdateBackendAPI
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBackendAPI -> UpdateBackendAPI -> Bool
$c/= :: UpdateBackendAPI -> UpdateBackendAPI -> Bool
== :: UpdateBackendAPI -> UpdateBackendAPI -> Bool
$c== :: UpdateBackendAPI -> UpdateBackendAPI -> Bool
Prelude.Eq, ReadPrec [UpdateBackendAPI]
ReadPrec UpdateBackendAPI
Int -> ReadS UpdateBackendAPI
ReadS [UpdateBackendAPI]
(Int -> ReadS UpdateBackendAPI)
-> ReadS [UpdateBackendAPI]
-> ReadPrec UpdateBackendAPI
-> ReadPrec [UpdateBackendAPI]
-> Read UpdateBackendAPI
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBackendAPI]
$creadListPrec :: ReadPrec [UpdateBackendAPI]
readPrec :: ReadPrec UpdateBackendAPI
$creadPrec :: ReadPrec UpdateBackendAPI
readList :: ReadS [UpdateBackendAPI]
$creadList :: ReadS [UpdateBackendAPI]
readsPrec :: Int -> ReadS UpdateBackendAPI
$creadsPrec :: Int -> ReadS UpdateBackendAPI
Prelude.Read, Int -> UpdateBackendAPI -> ShowS
[UpdateBackendAPI] -> ShowS
UpdateBackendAPI -> String
(Int -> UpdateBackendAPI -> ShowS)
-> (UpdateBackendAPI -> String)
-> ([UpdateBackendAPI] -> ShowS)
-> Show UpdateBackendAPI
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBackendAPI] -> ShowS
$cshowList :: [UpdateBackendAPI] -> ShowS
show :: UpdateBackendAPI -> String
$cshow :: UpdateBackendAPI -> String
showsPrec :: Int -> UpdateBackendAPI -> ShowS
$cshowsPrec :: Int -> UpdateBackendAPI -> ShowS
Prelude.Show, (forall x. UpdateBackendAPI -> Rep UpdateBackendAPI x)
-> (forall x. Rep UpdateBackendAPI x -> UpdateBackendAPI)
-> Generic UpdateBackendAPI
forall x. Rep UpdateBackendAPI x -> UpdateBackendAPI
forall x. UpdateBackendAPI -> Rep UpdateBackendAPI x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBackendAPI x -> UpdateBackendAPI
$cfrom :: forall x. UpdateBackendAPI -> Rep UpdateBackendAPI x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBackendAPI' 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:
--
-- 'resourceConfig', 'updateBackendAPI_resourceConfig' - Defines the resource configuration for the data model in your Amplify
-- project.
--
-- 'appId', 'updateBackendAPI_appId' - The app ID.
--
-- 'backendEnvironmentName', 'updateBackendAPI_backendEnvironmentName' - The name of the backend environment.
--
-- 'resourceName', 'updateBackendAPI_resourceName' - The name of this resource.
newUpdateBackendAPI ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'resourceName'
  Prelude.Text ->
  UpdateBackendAPI
newUpdateBackendAPI :: Text -> Text -> Text -> UpdateBackendAPI
newUpdateBackendAPI
  Text
pAppId_
  Text
pBackendEnvironmentName_
  Text
pResourceName_ =
    UpdateBackendAPI' :: Maybe BackendAPIResourceConfig
-> Text -> Text -> Text -> UpdateBackendAPI
UpdateBackendAPI'
      { $sel:resourceConfig:UpdateBackendAPI' :: Maybe BackendAPIResourceConfig
resourceConfig = Maybe BackendAPIResourceConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:appId:UpdateBackendAPI' :: Text
appId = Text
pAppId_,
        $sel:backendEnvironmentName:UpdateBackendAPI' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:resourceName:UpdateBackendAPI' :: Text
resourceName = Text
pResourceName_
      }

-- | Defines the resource configuration for the data model in your Amplify
-- project.
updateBackendAPI_resourceConfig :: Lens.Lens' UpdateBackendAPI (Prelude.Maybe BackendAPIResourceConfig)
updateBackendAPI_resourceConfig :: (Maybe BackendAPIResourceConfig
 -> f (Maybe BackendAPIResourceConfig))
-> UpdateBackendAPI -> f UpdateBackendAPI
updateBackendAPI_resourceConfig = (UpdateBackendAPI -> Maybe BackendAPIResourceConfig)
-> (UpdateBackendAPI
    -> Maybe BackendAPIResourceConfig -> UpdateBackendAPI)
-> Lens
     UpdateBackendAPI
     UpdateBackendAPI
     (Maybe BackendAPIResourceConfig)
     (Maybe BackendAPIResourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAPI' {Maybe BackendAPIResourceConfig
resourceConfig :: Maybe BackendAPIResourceConfig
$sel:resourceConfig:UpdateBackendAPI' :: UpdateBackendAPI -> Maybe BackendAPIResourceConfig
resourceConfig} -> Maybe BackendAPIResourceConfig
resourceConfig) (\s :: UpdateBackendAPI
s@UpdateBackendAPI' {} Maybe BackendAPIResourceConfig
a -> UpdateBackendAPI
s {$sel:resourceConfig:UpdateBackendAPI' :: Maybe BackendAPIResourceConfig
resourceConfig = Maybe BackendAPIResourceConfig
a} :: UpdateBackendAPI)

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

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

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

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

instance Prelude.NFData UpdateBackendAPI

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

instance Core.ToPath UpdateBackendAPI where
  toPath :: UpdateBackendAPI -> ByteString
toPath UpdateBackendAPI' {Maybe BackendAPIResourceConfig
Text
resourceName :: Text
backendEnvironmentName :: Text
appId :: Text
resourceConfig :: Maybe BackendAPIResourceConfig
$sel:resourceName:UpdateBackendAPI' :: UpdateBackendAPI -> Text
$sel:backendEnvironmentName:UpdateBackendAPI' :: UpdateBackendAPI -> Text
$sel:appId:UpdateBackendAPI' :: UpdateBackendAPI -> Text
$sel:resourceConfig:UpdateBackendAPI' :: UpdateBackendAPI -> Maybe BackendAPIResourceConfig
..} =
    [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
"/api/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backendEnvironmentName
      ]

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

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

-- |
-- Create a value of 'UpdateBackendAPIResponse' 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', 'updateBackendAPIResponse_status' - The current status of the request.
--
-- 'jobId', 'updateBackendAPIResponse_jobId' - The ID for the job.
--
-- 'operation', 'updateBackendAPIResponse_operation' - The name of the operation.
--
-- 'error', 'updateBackendAPIResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'updateBackendAPIResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'updateBackendAPIResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'updateBackendAPIResponse_httpStatus' - The response's http status code.
newUpdateBackendAPIResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateBackendAPIResponse
newUpdateBackendAPIResponse :: Int -> UpdateBackendAPIResponse
newUpdateBackendAPIResponse Int
pHttpStatus_ =
  UpdateBackendAPIResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateBackendAPIResponse
UpdateBackendAPIResponse'
    { $sel:status:UpdateBackendAPIResponse' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:UpdateBackendAPIResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:UpdateBackendAPIResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:UpdateBackendAPIResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:UpdateBackendAPIResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:UpdateBackendAPIResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateBackendAPIResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance Prelude.NFData UpdateBackendAPIResponse