{-# 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.GenerateBackendAPIModels
-- 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)
--
-- Generates a model schema for an existing backend API resource.
module Amazonka.AmplifyBackend.GenerateBackendAPIModels
  ( -- * Creating a Request
    GenerateBackendAPIModels (..),
    newGenerateBackendAPIModels,

    -- * Request Lenses
    generateBackendAPIModels_appId,
    generateBackendAPIModels_backendEnvironmentName,
    generateBackendAPIModels_resourceName,

    -- * Destructuring the Response
    GenerateBackendAPIModelsResponse (..),
    newGenerateBackendAPIModelsResponse,

    -- * Response Lenses
    generateBackendAPIModelsResponse_status,
    generateBackendAPIModelsResponse_jobId,
    generateBackendAPIModelsResponse_operation,
    generateBackendAPIModelsResponse_error,
    generateBackendAPIModelsResponse_appId,
    generateBackendAPIModelsResponse_backendEnvironmentName,
    generateBackendAPIModelsResponse_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 GenerateBackendAPIModels.
--
-- /See:/ 'newGenerateBackendAPIModels' smart constructor.
data GenerateBackendAPIModels = GenerateBackendAPIModels'
  { -- | The app ID.
    GenerateBackendAPIModels -> Text
appId :: Prelude.Text,
    -- | The name of the backend environment.
    GenerateBackendAPIModels -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The name of this resource.
    GenerateBackendAPIModels -> Text
resourceName :: Prelude.Text
  }
  deriving (GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool
(GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool)
-> (GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool)
-> Eq GenerateBackendAPIModels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool
$c/= :: GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool
== :: GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool
$c== :: GenerateBackendAPIModels -> GenerateBackendAPIModels -> Bool
Prelude.Eq, ReadPrec [GenerateBackendAPIModels]
ReadPrec GenerateBackendAPIModels
Int -> ReadS GenerateBackendAPIModels
ReadS [GenerateBackendAPIModels]
(Int -> ReadS GenerateBackendAPIModels)
-> ReadS [GenerateBackendAPIModels]
-> ReadPrec GenerateBackendAPIModels
-> ReadPrec [GenerateBackendAPIModels]
-> Read GenerateBackendAPIModels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenerateBackendAPIModels]
$creadListPrec :: ReadPrec [GenerateBackendAPIModels]
readPrec :: ReadPrec GenerateBackendAPIModels
$creadPrec :: ReadPrec GenerateBackendAPIModels
readList :: ReadS [GenerateBackendAPIModels]
$creadList :: ReadS [GenerateBackendAPIModels]
readsPrec :: Int -> ReadS GenerateBackendAPIModels
$creadsPrec :: Int -> ReadS GenerateBackendAPIModels
Prelude.Read, Int -> GenerateBackendAPIModels -> ShowS
[GenerateBackendAPIModels] -> ShowS
GenerateBackendAPIModels -> String
(Int -> GenerateBackendAPIModels -> ShowS)
-> (GenerateBackendAPIModels -> String)
-> ([GenerateBackendAPIModels] -> ShowS)
-> Show GenerateBackendAPIModels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateBackendAPIModels] -> ShowS
$cshowList :: [GenerateBackendAPIModels] -> ShowS
show :: GenerateBackendAPIModels -> String
$cshow :: GenerateBackendAPIModels -> String
showsPrec :: Int -> GenerateBackendAPIModels -> ShowS
$cshowsPrec :: Int -> GenerateBackendAPIModels -> ShowS
Prelude.Show, (forall x.
 GenerateBackendAPIModels -> Rep GenerateBackendAPIModels x)
-> (forall x.
    Rep GenerateBackendAPIModels x -> GenerateBackendAPIModels)
-> Generic GenerateBackendAPIModels
forall x.
Rep GenerateBackendAPIModels x -> GenerateBackendAPIModels
forall x.
GenerateBackendAPIModels -> Rep GenerateBackendAPIModels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateBackendAPIModels x -> GenerateBackendAPIModels
$cfrom :: forall x.
GenerateBackendAPIModels -> Rep GenerateBackendAPIModels x
Prelude.Generic)

-- |
-- Create a value of 'GenerateBackendAPIModels' 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', 'generateBackendAPIModels_appId' - The app ID.
--
-- 'backendEnvironmentName', 'generateBackendAPIModels_backendEnvironmentName' - The name of the backend environment.
--
-- 'resourceName', 'generateBackendAPIModels_resourceName' - The name of this resource.
newGenerateBackendAPIModels ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'resourceName'
  Prelude.Text ->
  GenerateBackendAPIModels
newGenerateBackendAPIModels :: Text -> Text -> Text -> GenerateBackendAPIModels
newGenerateBackendAPIModels
  Text
pAppId_
  Text
pBackendEnvironmentName_
  Text
pResourceName_ =
    GenerateBackendAPIModels' :: Text -> Text -> Text -> GenerateBackendAPIModels
GenerateBackendAPIModels'
      { $sel:appId:GenerateBackendAPIModels' :: Text
appId = Text
pAppId_,
        $sel:backendEnvironmentName:GenerateBackendAPIModels' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:resourceName:GenerateBackendAPIModels' :: Text
resourceName = Text
pResourceName_
      }

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

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

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

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

instance Prelude.NFData GenerateBackendAPIModels

instance Core.ToHeaders GenerateBackendAPIModels where
  toHeaders :: GenerateBackendAPIModels -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GenerateBackendAPIModels -> 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 GenerateBackendAPIModels where
  toJSON :: GenerateBackendAPIModels -> Value
toJSON GenerateBackendAPIModels' {Text
resourceName :: Text
backendEnvironmentName :: Text
appId :: Text
$sel:resourceName:GenerateBackendAPIModels' :: GenerateBackendAPIModels -> Text
$sel:backendEnvironmentName:GenerateBackendAPIModels' :: GenerateBackendAPIModels -> Text
$sel:appId:GenerateBackendAPIModels' :: GenerateBackendAPIModels -> 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)]
      )

instance Core.ToPath GenerateBackendAPIModels where
  toPath :: GenerateBackendAPIModels -> ByteString
toPath GenerateBackendAPIModels' {Text
resourceName :: Text
backendEnvironmentName :: Text
appId :: Text
$sel:resourceName:GenerateBackendAPIModels' :: GenerateBackendAPIModels -> Text
$sel:backendEnvironmentName:GenerateBackendAPIModels' :: GenerateBackendAPIModels -> Text
$sel:appId:GenerateBackendAPIModels' :: GenerateBackendAPIModels -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backendEnvironmentName,
        ByteString
"/generateModels"
      ]

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

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

-- |
-- Create a value of 'GenerateBackendAPIModelsResponse' 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', 'generateBackendAPIModelsResponse_status' - The current status of the request.
--
-- 'jobId', 'generateBackendAPIModelsResponse_jobId' - The ID for the job.
--
-- 'operation', 'generateBackendAPIModelsResponse_operation' - The name of the operation.
--
-- 'error', 'generateBackendAPIModelsResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'generateBackendAPIModelsResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'generateBackendAPIModelsResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'generateBackendAPIModelsResponse_httpStatus' - The response's http status code.
newGenerateBackendAPIModelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GenerateBackendAPIModelsResponse
newGenerateBackendAPIModelsResponse :: Int -> GenerateBackendAPIModelsResponse
newGenerateBackendAPIModelsResponse Int
pHttpStatus_ =
  GenerateBackendAPIModelsResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GenerateBackendAPIModelsResponse
GenerateBackendAPIModelsResponse'
    { $sel:status:GenerateBackendAPIModelsResponse' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GenerateBackendAPIModelsResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:GenerateBackendAPIModelsResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:GenerateBackendAPIModelsResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:GenerateBackendAPIModelsResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:GenerateBackendAPIModelsResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GenerateBackendAPIModelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance
  Prelude.NFData
    GenerateBackendAPIModelsResponse