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

    -- * Request Lenses
    createBackendAPI_appId,
    createBackendAPI_resourceName,
    createBackendAPI_backendEnvironmentName,
    createBackendAPI_resourceConfig,

    -- * Destructuring the Response
    CreateBackendAPIResponse (..),
    newCreateBackendAPIResponse,

    -- * Response Lenses
    createBackendAPIResponse_status,
    createBackendAPIResponse_jobId,
    createBackendAPIResponse_operation,
    createBackendAPIResponse_error,
    createBackendAPIResponse_appId,
    createBackendAPIResponse_backendEnvironmentName,
    createBackendAPIResponse_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 CreateBackendAPI.
--
-- /See:/ 'newCreateBackendAPI' smart constructor.
data CreateBackendAPI = CreateBackendAPI'
  { -- | The app ID.
    CreateBackendAPI -> Text
appId :: Prelude.Text,
    -- | The name of this resource.
    CreateBackendAPI -> Text
resourceName :: Prelude.Text,
    -- | The name of the backend environment.
    CreateBackendAPI -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The resource configuration for this request.
    CreateBackendAPI -> BackendAPIResourceConfig
resourceConfig :: BackendAPIResourceConfig
  }
  deriving (CreateBackendAPI -> CreateBackendAPI -> Bool
(CreateBackendAPI -> CreateBackendAPI -> Bool)
-> (CreateBackendAPI -> CreateBackendAPI -> Bool)
-> Eq CreateBackendAPI
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBackendAPI -> CreateBackendAPI -> Bool
$c/= :: CreateBackendAPI -> CreateBackendAPI -> Bool
== :: CreateBackendAPI -> CreateBackendAPI -> Bool
$c== :: CreateBackendAPI -> CreateBackendAPI -> Bool
Prelude.Eq, ReadPrec [CreateBackendAPI]
ReadPrec CreateBackendAPI
Int -> ReadS CreateBackendAPI
ReadS [CreateBackendAPI]
(Int -> ReadS CreateBackendAPI)
-> ReadS [CreateBackendAPI]
-> ReadPrec CreateBackendAPI
-> ReadPrec [CreateBackendAPI]
-> Read CreateBackendAPI
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBackendAPI]
$creadListPrec :: ReadPrec [CreateBackendAPI]
readPrec :: ReadPrec CreateBackendAPI
$creadPrec :: ReadPrec CreateBackendAPI
readList :: ReadS [CreateBackendAPI]
$creadList :: ReadS [CreateBackendAPI]
readsPrec :: Int -> ReadS CreateBackendAPI
$creadsPrec :: Int -> ReadS CreateBackendAPI
Prelude.Read, Int -> CreateBackendAPI -> ShowS
[CreateBackendAPI] -> ShowS
CreateBackendAPI -> String
(Int -> CreateBackendAPI -> ShowS)
-> (CreateBackendAPI -> String)
-> ([CreateBackendAPI] -> ShowS)
-> Show CreateBackendAPI
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBackendAPI] -> ShowS
$cshowList :: [CreateBackendAPI] -> ShowS
show :: CreateBackendAPI -> String
$cshow :: CreateBackendAPI -> String
showsPrec :: Int -> CreateBackendAPI -> ShowS
$cshowsPrec :: Int -> CreateBackendAPI -> ShowS
Prelude.Show, (forall x. CreateBackendAPI -> Rep CreateBackendAPI x)
-> (forall x. Rep CreateBackendAPI x -> CreateBackendAPI)
-> Generic CreateBackendAPI
forall x. Rep CreateBackendAPI x -> CreateBackendAPI
forall x. CreateBackendAPI -> Rep CreateBackendAPI x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBackendAPI x -> CreateBackendAPI
$cfrom :: forall x. CreateBackendAPI -> Rep CreateBackendAPI x
Prelude.Generic)

-- |
-- Create a value of 'CreateBackendAPI' 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', 'createBackendAPI_appId' - The app ID.
--
-- 'resourceName', 'createBackendAPI_resourceName' - The name of this resource.
--
-- 'backendEnvironmentName', 'createBackendAPI_backendEnvironmentName' - The name of the backend environment.
--
-- 'resourceConfig', 'createBackendAPI_resourceConfig' - The resource configuration for this request.
newCreateBackendAPI ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'resourceName'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'resourceConfig'
  BackendAPIResourceConfig ->
  CreateBackendAPI
newCreateBackendAPI :: Text
-> Text -> Text -> BackendAPIResourceConfig -> CreateBackendAPI
newCreateBackendAPI
  Text
pAppId_
  Text
pResourceName_
  Text
pBackendEnvironmentName_
  BackendAPIResourceConfig
pResourceConfig_ =
    CreateBackendAPI' :: Text
-> Text -> Text -> BackendAPIResourceConfig -> CreateBackendAPI
CreateBackendAPI'
      { $sel:appId:CreateBackendAPI' :: Text
appId = Text
pAppId_,
        $sel:resourceName:CreateBackendAPI' :: Text
resourceName = Text
pResourceName_,
        $sel:backendEnvironmentName:CreateBackendAPI' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:resourceConfig:CreateBackendAPI' :: BackendAPIResourceConfig
resourceConfig = BackendAPIResourceConfig
pResourceConfig_
      }

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

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

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

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

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

instance Prelude.NFData CreateBackendAPI

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

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

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

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

-- |
-- Create a value of 'CreateBackendAPIResponse' 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', 'createBackendAPIResponse_status' - The current status of the request.
--
-- 'jobId', 'createBackendAPIResponse_jobId' - The ID for the job.
--
-- 'operation', 'createBackendAPIResponse_operation' - The name of the operation.
--
-- 'error', 'createBackendAPIResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'createBackendAPIResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'createBackendAPIResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'createBackendAPIResponse_httpStatus' - The response's http status code.
newCreateBackendAPIResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBackendAPIResponse
newCreateBackendAPIResponse :: Int -> CreateBackendAPIResponse
newCreateBackendAPIResponse Int
pHttpStatus_ =
  CreateBackendAPIResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateBackendAPIResponse
CreateBackendAPIResponse'
    { $sel:status:CreateBackendAPIResponse' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:CreateBackendAPIResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:CreateBackendAPIResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:CreateBackendAPIResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:CreateBackendAPIResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:CreateBackendAPIResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateBackendAPIResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance Prelude.NFData CreateBackendAPIResponse