{-# 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.CloneBackend
-- 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)
--
-- This operation clones an existing backend.
module Amazonka.AmplifyBackend.CloneBackend
  ( -- * Creating a Request
    CloneBackend (..),
    newCloneBackend,

    -- * Request Lenses
    cloneBackend_appId,
    cloneBackend_backendEnvironmentName,
    cloneBackend_targetEnvironmentName,

    -- * Destructuring the Response
    CloneBackendResponse (..),
    newCloneBackendResponse,

    -- * Response Lenses
    cloneBackendResponse_status,
    cloneBackendResponse_jobId,
    cloneBackendResponse_operation,
    cloneBackendResponse_error,
    cloneBackendResponse_appId,
    cloneBackendResponse_backendEnvironmentName,
    cloneBackendResponse_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 CloneBackend.
--
-- /See:/ 'newCloneBackend' smart constructor.
data CloneBackend = CloneBackend'
  { -- | The app ID.
    CloneBackend -> Text
appId :: Prelude.Text,
    -- | The name of the backend environment.
    CloneBackend -> Text
backendEnvironmentName :: Prelude.Text,
    -- | The name of the destination backend environment to be created.
    CloneBackend -> Text
targetEnvironmentName :: Prelude.Text
  }
  deriving (CloneBackend -> CloneBackend -> Bool
(CloneBackend -> CloneBackend -> Bool)
-> (CloneBackend -> CloneBackend -> Bool) -> Eq CloneBackend
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloneBackend -> CloneBackend -> Bool
$c/= :: CloneBackend -> CloneBackend -> Bool
== :: CloneBackend -> CloneBackend -> Bool
$c== :: CloneBackend -> CloneBackend -> Bool
Prelude.Eq, ReadPrec [CloneBackend]
ReadPrec CloneBackend
Int -> ReadS CloneBackend
ReadS [CloneBackend]
(Int -> ReadS CloneBackend)
-> ReadS [CloneBackend]
-> ReadPrec CloneBackend
-> ReadPrec [CloneBackend]
-> Read CloneBackend
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloneBackend]
$creadListPrec :: ReadPrec [CloneBackend]
readPrec :: ReadPrec CloneBackend
$creadPrec :: ReadPrec CloneBackend
readList :: ReadS [CloneBackend]
$creadList :: ReadS [CloneBackend]
readsPrec :: Int -> ReadS CloneBackend
$creadsPrec :: Int -> ReadS CloneBackend
Prelude.Read, Int -> CloneBackend -> ShowS
[CloneBackend] -> ShowS
CloneBackend -> String
(Int -> CloneBackend -> ShowS)
-> (CloneBackend -> String)
-> ([CloneBackend] -> ShowS)
-> Show CloneBackend
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloneBackend] -> ShowS
$cshowList :: [CloneBackend] -> ShowS
show :: CloneBackend -> String
$cshow :: CloneBackend -> String
showsPrec :: Int -> CloneBackend -> ShowS
$cshowsPrec :: Int -> CloneBackend -> ShowS
Prelude.Show, (forall x. CloneBackend -> Rep CloneBackend x)
-> (forall x. Rep CloneBackend x -> CloneBackend)
-> Generic CloneBackend
forall x. Rep CloneBackend x -> CloneBackend
forall x. CloneBackend -> Rep CloneBackend x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloneBackend x -> CloneBackend
$cfrom :: forall x. CloneBackend -> Rep CloneBackend x
Prelude.Generic)

-- |
-- Create a value of 'CloneBackend' 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', 'cloneBackend_appId' - The app ID.
--
-- 'backendEnvironmentName', 'cloneBackend_backendEnvironmentName' - The name of the backend environment.
--
-- 'targetEnvironmentName', 'cloneBackend_targetEnvironmentName' - The name of the destination backend environment to be created.
newCloneBackend ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'backendEnvironmentName'
  Prelude.Text ->
  -- | 'targetEnvironmentName'
  Prelude.Text ->
  CloneBackend
newCloneBackend :: Text -> Text -> Text -> CloneBackend
newCloneBackend
  Text
pAppId_
  Text
pBackendEnvironmentName_
  Text
pTargetEnvironmentName_ =
    CloneBackend' :: Text -> Text -> Text -> CloneBackend
CloneBackend'
      { $sel:appId:CloneBackend' :: Text
appId = Text
pAppId_,
        $sel:backendEnvironmentName:CloneBackend' :: Text
backendEnvironmentName = Text
pBackendEnvironmentName_,
        $sel:targetEnvironmentName:CloneBackend' :: Text
targetEnvironmentName = Text
pTargetEnvironmentName_
      }

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

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

-- | The name of the destination backend environment to be created.
cloneBackend_targetEnvironmentName :: Lens.Lens' CloneBackend Prelude.Text
cloneBackend_targetEnvironmentName :: (Text -> f Text) -> CloneBackend -> f CloneBackend
cloneBackend_targetEnvironmentName = (CloneBackend -> Text)
-> (CloneBackend -> Text -> CloneBackend)
-> Lens CloneBackend CloneBackend Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneBackend' {Text
targetEnvironmentName :: Text
$sel:targetEnvironmentName:CloneBackend' :: CloneBackend -> Text
targetEnvironmentName} -> Text
targetEnvironmentName) (\s :: CloneBackend
s@CloneBackend' {} Text
a -> CloneBackend
s {$sel:targetEnvironmentName:CloneBackend' :: Text
targetEnvironmentName = Text
a} :: CloneBackend)

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

instance Prelude.NFData CloneBackend

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

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

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

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

-- |
-- Create a value of 'CloneBackendResponse' 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', 'cloneBackendResponse_status' - The current status of the request.
--
-- 'jobId', 'cloneBackendResponse_jobId' - The ID for the job.
--
-- 'operation', 'cloneBackendResponse_operation' - The name of the operation.
--
-- 'error', 'cloneBackendResponse_error' - If the request fails, this error is returned.
--
-- 'appId', 'cloneBackendResponse_appId' - The app ID.
--
-- 'backendEnvironmentName', 'cloneBackendResponse_backendEnvironmentName' - The name of the backend environment.
--
-- 'httpStatus', 'cloneBackendResponse_httpStatus' - The response's http status code.
newCloneBackendResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CloneBackendResponse
newCloneBackendResponse :: Int -> CloneBackendResponse
newCloneBackendResponse Int
pHttpStatus_ =
  CloneBackendResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CloneBackendResponse
CloneBackendResponse'
    { $sel:status:CloneBackendResponse' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:CloneBackendResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:CloneBackendResponse' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:CloneBackendResponse' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:CloneBackendResponse' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentName:CloneBackendResponse' :: Maybe Text
backendEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CloneBackendResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance Prelude.NFData CloneBackendResponse