{-# 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.DataBrew.SendProjectSessionAction
-- 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)
--
-- Performs a recipe step within an interactive DataBrew session that\'s
-- currently open.
module Amazonka.DataBrew.SendProjectSessionAction
  ( -- * Creating a Request
    SendProjectSessionAction (..),
    newSendProjectSessionAction,

    -- * Request Lenses
    sendProjectSessionAction_stepIndex,
    sendProjectSessionAction_preview,
    sendProjectSessionAction_clientSessionId,
    sendProjectSessionAction_recipeStep,
    sendProjectSessionAction_viewFrame,
    sendProjectSessionAction_name,

    -- * Destructuring the Response
    SendProjectSessionActionResponse (..),
    newSendProjectSessionActionResponse,

    -- * Response Lenses
    sendProjectSessionActionResponse_actionId,
    sendProjectSessionActionResponse_result,
    sendProjectSessionActionResponse_httpStatus,
    sendProjectSessionActionResponse_name,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataBrew.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSendProjectSessionAction' smart constructor.
data SendProjectSessionAction = SendProjectSessionAction'
  { -- | The index from which to preview a step. This index is used to preview
    -- the result of steps that have already been applied, so that the
    -- resulting view frame is from earlier in the view frame stack.
    SendProjectSessionAction -> Maybe Natural
stepIndex :: Prelude.Maybe Prelude.Natural,
    -- | If true, the result of the recipe step will be returned, but not
    -- applied.
    SendProjectSessionAction -> Maybe Bool
preview :: Prelude.Maybe Prelude.Bool,
    -- | A unique identifier for an interactive session that\'s currently open
    -- and ready for work. The action will be performed on this session.
    SendProjectSessionAction -> Maybe Text
clientSessionId :: Prelude.Maybe Prelude.Text,
    SendProjectSessionAction -> Maybe RecipeStep
recipeStep :: Prelude.Maybe RecipeStep,
    SendProjectSessionAction -> Maybe ViewFrame
viewFrame :: Prelude.Maybe ViewFrame,
    -- | The name of the project to apply the action to.
    SendProjectSessionAction -> Text
name :: Prelude.Text
  }
  deriving (SendProjectSessionAction -> SendProjectSessionAction -> Bool
(SendProjectSessionAction -> SendProjectSessionAction -> Bool)
-> (SendProjectSessionAction -> SendProjectSessionAction -> Bool)
-> Eq SendProjectSessionAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendProjectSessionAction -> SendProjectSessionAction -> Bool
$c/= :: SendProjectSessionAction -> SendProjectSessionAction -> Bool
== :: SendProjectSessionAction -> SendProjectSessionAction -> Bool
$c== :: SendProjectSessionAction -> SendProjectSessionAction -> Bool
Prelude.Eq, ReadPrec [SendProjectSessionAction]
ReadPrec SendProjectSessionAction
Int -> ReadS SendProjectSessionAction
ReadS [SendProjectSessionAction]
(Int -> ReadS SendProjectSessionAction)
-> ReadS [SendProjectSessionAction]
-> ReadPrec SendProjectSessionAction
-> ReadPrec [SendProjectSessionAction]
-> Read SendProjectSessionAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendProjectSessionAction]
$creadListPrec :: ReadPrec [SendProjectSessionAction]
readPrec :: ReadPrec SendProjectSessionAction
$creadPrec :: ReadPrec SendProjectSessionAction
readList :: ReadS [SendProjectSessionAction]
$creadList :: ReadS [SendProjectSessionAction]
readsPrec :: Int -> ReadS SendProjectSessionAction
$creadsPrec :: Int -> ReadS SendProjectSessionAction
Prelude.Read, Int -> SendProjectSessionAction -> ShowS
[SendProjectSessionAction] -> ShowS
SendProjectSessionAction -> String
(Int -> SendProjectSessionAction -> ShowS)
-> (SendProjectSessionAction -> String)
-> ([SendProjectSessionAction] -> ShowS)
-> Show SendProjectSessionAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendProjectSessionAction] -> ShowS
$cshowList :: [SendProjectSessionAction] -> ShowS
show :: SendProjectSessionAction -> String
$cshow :: SendProjectSessionAction -> String
showsPrec :: Int -> SendProjectSessionAction -> ShowS
$cshowsPrec :: Int -> SendProjectSessionAction -> ShowS
Prelude.Show, (forall x.
 SendProjectSessionAction -> Rep SendProjectSessionAction x)
-> (forall x.
    Rep SendProjectSessionAction x -> SendProjectSessionAction)
-> Generic SendProjectSessionAction
forall x.
Rep SendProjectSessionAction x -> SendProjectSessionAction
forall x.
SendProjectSessionAction -> Rep SendProjectSessionAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendProjectSessionAction x -> SendProjectSessionAction
$cfrom :: forall x.
SendProjectSessionAction -> Rep SendProjectSessionAction x
Prelude.Generic)

-- |
-- Create a value of 'SendProjectSessionAction' 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:
--
-- 'stepIndex', 'sendProjectSessionAction_stepIndex' - The index from which to preview a step. This index is used to preview
-- the result of steps that have already been applied, so that the
-- resulting view frame is from earlier in the view frame stack.
--
-- 'preview', 'sendProjectSessionAction_preview' - If true, the result of the recipe step will be returned, but not
-- applied.
--
-- 'clientSessionId', 'sendProjectSessionAction_clientSessionId' - A unique identifier for an interactive session that\'s currently open
-- and ready for work. The action will be performed on this session.
--
-- 'recipeStep', 'sendProjectSessionAction_recipeStep' - Undocumented member.
--
-- 'viewFrame', 'sendProjectSessionAction_viewFrame' - Undocumented member.
--
-- 'name', 'sendProjectSessionAction_name' - The name of the project to apply the action to.
newSendProjectSessionAction ::
  -- | 'name'
  Prelude.Text ->
  SendProjectSessionAction
newSendProjectSessionAction :: Text -> SendProjectSessionAction
newSendProjectSessionAction Text
pName_ =
  SendProjectSessionAction' :: Maybe Natural
-> Maybe Bool
-> Maybe Text
-> Maybe RecipeStep
-> Maybe ViewFrame
-> Text
-> SendProjectSessionAction
SendProjectSessionAction'
    { $sel:stepIndex:SendProjectSessionAction' :: Maybe Natural
stepIndex =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:preview:SendProjectSessionAction' :: Maybe Bool
preview = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:clientSessionId:SendProjectSessionAction' :: Maybe Text
clientSessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recipeStep:SendProjectSessionAction' :: Maybe RecipeStep
recipeStep = Maybe RecipeStep
forall a. Maybe a
Prelude.Nothing,
      $sel:viewFrame:SendProjectSessionAction' :: Maybe ViewFrame
viewFrame = Maybe ViewFrame
forall a. Maybe a
Prelude.Nothing,
      $sel:name:SendProjectSessionAction' :: Text
name = Text
pName_
    }

-- | The index from which to preview a step. This index is used to preview
-- the result of steps that have already been applied, so that the
-- resulting view frame is from earlier in the view frame stack.
sendProjectSessionAction_stepIndex :: Lens.Lens' SendProjectSessionAction (Prelude.Maybe Prelude.Natural)
sendProjectSessionAction_stepIndex :: (Maybe Natural -> f (Maybe Natural))
-> SendProjectSessionAction -> f SendProjectSessionAction
sendProjectSessionAction_stepIndex = (SendProjectSessionAction -> Maybe Natural)
-> (SendProjectSessionAction
    -> Maybe Natural -> SendProjectSessionAction)
-> Lens
     SendProjectSessionAction
     SendProjectSessionAction
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionAction' {Maybe Natural
stepIndex :: Maybe Natural
$sel:stepIndex:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Natural
stepIndex} -> Maybe Natural
stepIndex) (\s :: SendProjectSessionAction
s@SendProjectSessionAction' {} Maybe Natural
a -> SendProjectSessionAction
s {$sel:stepIndex:SendProjectSessionAction' :: Maybe Natural
stepIndex = Maybe Natural
a} :: SendProjectSessionAction)

-- | If true, the result of the recipe step will be returned, but not
-- applied.
sendProjectSessionAction_preview :: Lens.Lens' SendProjectSessionAction (Prelude.Maybe Prelude.Bool)
sendProjectSessionAction_preview :: (Maybe Bool -> f (Maybe Bool))
-> SendProjectSessionAction -> f SendProjectSessionAction
sendProjectSessionAction_preview = (SendProjectSessionAction -> Maybe Bool)
-> (SendProjectSessionAction
    -> Maybe Bool -> SendProjectSessionAction)
-> Lens
     SendProjectSessionAction
     SendProjectSessionAction
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionAction' {Maybe Bool
preview :: Maybe Bool
$sel:preview:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Bool
preview} -> Maybe Bool
preview) (\s :: SendProjectSessionAction
s@SendProjectSessionAction' {} Maybe Bool
a -> SendProjectSessionAction
s {$sel:preview:SendProjectSessionAction' :: Maybe Bool
preview = Maybe Bool
a} :: SendProjectSessionAction)

-- | A unique identifier for an interactive session that\'s currently open
-- and ready for work. The action will be performed on this session.
sendProjectSessionAction_clientSessionId :: Lens.Lens' SendProjectSessionAction (Prelude.Maybe Prelude.Text)
sendProjectSessionAction_clientSessionId :: (Maybe Text -> f (Maybe Text))
-> SendProjectSessionAction -> f SendProjectSessionAction
sendProjectSessionAction_clientSessionId = (SendProjectSessionAction -> Maybe Text)
-> (SendProjectSessionAction
    -> Maybe Text -> SendProjectSessionAction)
-> Lens
     SendProjectSessionAction
     SendProjectSessionAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionAction' {Maybe Text
clientSessionId :: Maybe Text
$sel:clientSessionId:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Text
clientSessionId} -> Maybe Text
clientSessionId) (\s :: SendProjectSessionAction
s@SendProjectSessionAction' {} Maybe Text
a -> SendProjectSessionAction
s {$sel:clientSessionId:SendProjectSessionAction' :: Maybe Text
clientSessionId = Maybe Text
a} :: SendProjectSessionAction)

-- | Undocumented member.
sendProjectSessionAction_recipeStep :: Lens.Lens' SendProjectSessionAction (Prelude.Maybe RecipeStep)
sendProjectSessionAction_recipeStep :: (Maybe RecipeStep -> f (Maybe RecipeStep))
-> SendProjectSessionAction -> f SendProjectSessionAction
sendProjectSessionAction_recipeStep = (SendProjectSessionAction -> Maybe RecipeStep)
-> (SendProjectSessionAction
    -> Maybe RecipeStep -> SendProjectSessionAction)
-> Lens
     SendProjectSessionAction
     SendProjectSessionAction
     (Maybe RecipeStep)
     (Maybe RecipeStep)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionAction' {Maybe RecipeStep
recipeStep :: Maybe RecipeStep
$sel:recipeStep:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe RecipeStep
recipeStep} -> Maybe RecipeStep
recipeStep) (\s :: SendProjectSessionAction
s@SendProjectSessionAction' {} Maybe RecipeStep
a -> SendProjectSessionAction
s {$sel:recipeStep:SendProjectSessionAction' :: Maybe RecipeStep
recipeStep = Maybe RecipeStep
a} :: SendProjectSessionAction)

-- | Undocumented member.
sendProjectSessionAction_viewFrame :: Lens.Lens' SendProjectSessionAction (Prelude.Maybe ViewFrame)
sendProjectSessionAction_viewFrame :: (Maybe ViewFrame -> f (Maybe ViewFrame))
-> SendProjectSessionAction -> f SendProjectSessionAction
sendProjectSessionAction_viewFrame = (SendProjectSessionAction -> Maybe ViewFrame)
-> (SendProjectSessionAction
    -> Maybe ViewFrame -> SendProjectSessionAction)
-> Lens
     SendProjectSessionAction
     SendProjectSessionAction
     (Maybe ViewFrame)
     (Maybe ViewFrame)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionAction' {Maybe ViewFrame
viewFrame :: Maybe ViewFrame
$sel:viewFrame:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe ViewFrame
viewFrame} -> Maybe ViewFrame
viewFrame) (\s :: SendProjectSessionAction
s@SendProjectSessionAction' {} Maybe ViewFrame
a -> SendProjectSessionAction
s {$sel:viewFrame:SendProjectSessionAction' :: Maybe ViewFrame
viewFrame = Maybe ViewFrame
a} :: SendProjectSessionAction)

-- | The name of the project to apply the action to.
sendProjectSessionAction_name :: Lens.Lens' SendProjectSessionAction Prelude.Text
sendProjectSessionAction_name :: (Text -> f Text)
-> SendProjectSessionAction -> f SendProjectSessionAction
sendProjectSessionAction_name = (SendProjectSessionAction -> Text)
-> (SendProjectSessionAction -> Text -> SendProjectSessionAction)
-> Lens SendProjectSessionAction SendProjectSessionAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionAction' {Text
name :: Text
$sel:name:SendProjectSessionAction' :: SendProjectSessionAction -> Text
name} -> Text
name) (\s :: SendProjectSessionAction
s@SendProjectSessionAction' {} Text
a -> SendProjectSessionAction
s {$sel:name:SendProjectSessionAction' :: Text
name = Text
a} :: SendProjectSessionAction)

instance Core.AWSRequest SendProjectSessionAction where
  type
    AWSResponse SendProjectSessionAction =
      SendProjectSessionActionResponse
  request :: SendProjectSessionAction -> Request SendProjectSessionAction
request = Service
-> SendProjectSessionAction -> Request SendProjectSessionAction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SendProjectSessionAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendProjectSessionAction)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SendProjectSessionAction))
-> Logger
-> Service
-> Proxy SendProjectSessionAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendProjectSessionAction)))
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 Int
-> Maybe Text -> Int -> Text -> SendProjectSessionActionResponse
SendProjectSessionActionResponse'
            (Maybe Int
 -> Maybe Text -> Int -> Text -> SendProjectSessionActionResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text -> Int -> Text -> SendProjectSessionActionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ActionId")
            Either
  String
  (Maybe Text -> Int -> Text -> SendProjectSessionActionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> Text -> SendProjectSessionActionResponse)
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
"Result")
            Either String (Int -> Text -> SendProjectSessionActionResponse)
-> Either String Int
-> Either String (Text -> SendProjectSessionActionResponse)
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))
            Either String (Text -> SendProjectSessionActionResponse)
-> Either String Text
-> Either String SendProjectSessionActionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Name")
      )

instance Prelude.Hashable SendProjectSessionAction

instance Prelude.NFData SendProjectSessionAction

instance Core.ToHeaders SendProjectSessionAction where
  toHeaders :: SendProjectSessionAction -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SendProjectSessionAction -> 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 SendProjectSessionAction where
  toJSON :: SendProjectSessionAction -> Value
toJSON SendProjectSessionAction' {Maybe Bool
Maybe Natural
Maybe Text
Maybe RecipeStep
Maybe ViewFrame
Text
name :: Text
viewFrame :: Maybe ViewFrame
recipeStep :: Maybe RecipeStep
clientSessionId :: Maybe Text
preview :: Maybe Bool
stepIndex :: Maybe Natural
$sel:name:SendProjectSessionAction' :: SendProjectSessionAction -> Text
$sel:viewFrame:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe ViewFrame
$sel:recipeStep:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe RecipeStep
$sel:clientSessionId:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Text
$sel:preview:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Bool
$sel:stepIndex:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"StepIndex" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
stepIndex,
            (Text
"Preview" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
preview,
            (Text
"ClientSessionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientSessionId,
            (Text
"RecipeStep" Text -> RecipeStep -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RecipeStep -> Pair) -> Maybe RecipeStep -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecipeStep
recipeStep,
            (Text
"ViewFrame" Text -> ViewFrame -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ViewFrame -> Pair) -> Maybe ViewFrame -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ViewFrame
viewFrame
          ]
      )

instance Core.ToPath SendProjectSessionAction where
  toPath :: SendProjectSessionAction -> ByteString
toPath SendProjectSessionAction' {Maybe Bool
Maybe Natural
Maybe Text
Maybe RecipeStep
Maybe ViewFrame
Text
name :: Text
viewFrame :: Maybe ViewFrame
recipeStep :: Maybe RecipeStep
clientSessionId :: Maybe Text
preview :: Maybe Bool
stepIndex :: Maybe Natural
$sel:name:SendProjectSessionAction' :: SendProjectSessionAction -> Text
$sel:viewFrame:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe ViewFrame
$sel:recipeStep:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe RecipeStep
$sel:clientSessionId:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Text
$sel:preview:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Bool
$sel:stepIndex:SendProjectSessionAction' :: SendProjectSessionAction -> Maybe Natural
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/projects/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name,
        ByteString
"/sendProjectSessionAction"
      ]

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

-- | /See:/ 'newSendProjectSessionActionResponse' smart constructor.
data SendProjectSessionActionResponse = SendProjectSessionActionResponse'
  { -- | A unique identifier for the action that was performed.
    SendProjectSessionActionResponse -> Maybe Int
actionId :: Prelude.Maybe Prelude.Int,
    -- | A message indicating the result of performing the action.
    SendProjectSessionActionResponse -> Maybe Text
result :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SendProjectSessionActionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The name of the project that was affected by the action.
    SendProjectSessionActionResponse -> Text
name :: Prelude.Text
  }
  deriving (SendProjectSessionActionResponse
-> SendProjectSessionActionResponse -> Bool
(SendProjectSessionActionResponse
 -> SendProjectSessionActionResponse -> Bool)
-> (SendProjectSessionActionResponse
    -> SendProjectSessionActionResponse -> Bool)
-> Eq SendProjectSessionActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendProjectSessionActionResponse
-> SendProjectSessionActionResponse -> Bool
$c/= :: SendProjectSessionActionResponse
-> SendProjectSessionActionResponse -> Bool
== :: SendProjectSessionActionResponse
-> SendProjectSessionActionResponse -> Bool
$c== :: SendProjectSessionActionResponse
-> SendProjectSessionActionResponse -> Bool
Prelude.Eq, ReadPrec [SendProjectSessionActionResponse]
ReadPrec SendProjectSessionActionResponse
Int -> ReadS SendProjectSessionActionResponse
ReadS [SendProjectSessionActionResponse]
(Int -> ReadS SendProjectSessionActionResponse)
-> ReadS [SendProjectSessionActionResponse]
-> ReadPrec SendProjectSessionActionResponse
-> ReadPrec [SendProjectSessionActionResponse]
-> Read SendProjectSessionActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendProjectSessionActionResponse]
$creadListPrec :: ReadPrec [SendProjectSessionActionResponse]
readPrec :: ReadPrec SendProjectSessionActionResponse
$creadPrec :: ReadPrec SendProjectSessionActionResponse
readList :: ReadS [SendProjectSessionActionResponse]
$creadList :: ReadS [SendProjectSessionActionResponse]
readsPrec :: Int -> ReadS SendProjectSessionActionResponse
$creadsPrec :: Int -> ReadS SendProjectSessionActionResponse
Prelude.Read, Int -> SendProjectSessionActionResponse -> ShowS
[SendProjectSessionActionResponse] -> ShowS
SendProjectSessionActionResponse -> String
(Int -> SendProjectSessionActionResponse -> ShowS)
-> (SendProjectSessionActionResponse -> String)
-> ([SendProjectSessionActionResponse] -> ShowS)
-> Show SendProjectSessionActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendProjectSessionActionResponse] -> ShowS
$cshowList :: [SendProjectSessionActionResponse] -> ShowS
show :: SendProjectSessionActionResponse -> String
$cshow :: SendProjectSessionActionResponse -> String
showsPrec :: Int -> SendProjectSessionActionResponse -> ShowS
$cshowsPrec :: Int -> SendProjectSessionActionResponse -> ShowS
Prelude.Show, (forall x.
 SendProjectSessionActionResponse
 -> Rep SendProjectSessionActionResponse x)
-> (forall x.
    Rep SendProjectSessionActionResponse x
    -> SendProjectSessionActionResponse)
-> Generic SendProjectSessionActionResponse
forall x.
Rep SendProjectSessionActionResponse x
-> SendProjectSessionActionResponse
forall x.
SendProjectSessionActionResponse
-> Rep SendProjectSessionActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendProjectSessionActionResponse x
-> SendProjectSessionActionResponse
$cfrom :: forall x.
SendProjectSessionActionResponse
-> Rep SendProjectSessionActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'SendProjectSessionActionResponse' 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:
--
-- 'actionId', 'sendProjectSessionActionResponse_actionId' - A unique identifier for the action that was performed.
--
-- 'result', 'sendProjectSessionActionResponse_result' - A message indicating the result of performing the action.
--
-- 'httpStatus', 'sendProjectSessionActionResponse_httpStatus' - The response's http status code.
--
-- 'name', 'sendProjectSessionActionResponse_name' - The name of the project that was affected by the action.
newSendProjectSessionActionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  SendProjectSessionActionResponse
newSendProjectSessionActionResponse :: Int -> Text -> SendProjectSessionActionResponse
newSendProjectSessionActionResponse
  Int
pHttpStatus_
  Text
pName_ =
    SendProjectSessionActionResponse' :: Maybe Int
-> Maybe Text -> Int -> Text -> SendProjectSessionActionResponse
SendProjectSessionActionResponse'
      { $sel:actionId:SendProjectSessionActionResponse' :: Maybe Int
actionId =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:result:SendProjectSessionActionResponse' :: Maybe Text
result = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:SendProjectSessionActionResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:name:SendProjectSessionActionResponse' :: Text
name = Text
pName_
      }

-- | A unique identifier for the action that was performed.
sendProjectSessionActionResponse_actionId :: Lens.Lens' SendProjectSessionActionResponse (Prelude.Maybe Prelude.Int)
sendProjectSessionActionResponse_actionId :: (Maybe Int -> f (Maybe Int))
-> SendProjectSessionActionResponse
-> f SendProjectSessionActionResponse
sendProjectSessionActionResponse_actionId = (SendProjectSessionActionResponse -> Maybe Int)
-> (SendProjectSessionActionResponse
    -> Maybe Int -> SendProjectSessionActionResponse)
-> Lens
     SendProjectSessionActionResponse
     SendProjectSessionActionResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionActionResponse' {Maybe Int
actionId :: Maybe Int
$sel:actionId:SendProjectSessionActionResponse' :: SendProjectSessionActionResponse -> Maybe Int
actionId} -> Maybe Int
actionId) (\s :: SendProjectSessionActionResponse
s@SendProjectSessionActionResponse' {} Maybe Int
a -> SendProjectSessionActionResponse
s {$sel:actionId:SendProjectSessionActionResponse' :: Maybe Int
actionId = Maybe Int
a} :: SendProjectSessionActionResponse)

-- | A message indicating the result of performing the action.
sendProjectSessionActionResponse_result :: Lens.Lens' SendProjectSessionActionResponse (Prelude.Maybe Prelude.Text)
sendProjectSessionActionResponse_result :: (Maybe Text -> f (Maybe Text))
-> SendProjectSessionActionResponse
-> f SendProjectSessionActionResponse
sendProjectSessionActionResponse_result = (SendProjectSessionActionResponse -> Maybe Text)
-> (SendProjectSessionActionResponse
    -> Maybe Text -> SendProjectSessionActionResponse)
-> Lens
     SendProjectSessionActionResponse
     SendProjectSessionActionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionActionResponse' {Maybe Text
result :: Maybe Text
$sel:result:SendProjectSessionActionResponse' :: SendProjectSessionActionResponse -> Maybe Text
result} -> Maybe Text
result) (\s :: SendProjectSessionActionResponse
s@SendProjectSessionActionResponse' {} Maybe Text
a -> SendProjectSessionActionResponse
s {$sel:result:SendProjectSessionActionResponse' :: Maybe Text
result = Maybe Text
a} :: SendProjectSessionActionResponse)

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

-- | The name of the project that was affected by the action.
sendProjectSessionActionResponse_name :: Lens.Lens' SendProjectSessionActionResponse Prelude.Text
sendProjectSessionActionResponse_name :: (Text -> f Text)
-> SendProjectSessionActionResponse
-> f SendProjectSessionActionResponse
sendProjectSessionActionResponse_name = (SendProjectSessionActionResponse -> Text)
-> (SendProjectSessionActionResponse
    -> Text -> SendProjectSessionActionResponse)
-> Lens
     SendProjectSessionActionResponse
     SendProjectSessionActionResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendProjectSessionActionResponse' {Text
name :: Text
$sel:name:SendProjectSessionActionResponse' :: SendProjectSessionActionResponse -> Text
name} -> Text
name) (\s :: SendProjectSessionActionResponse
s@SendProjectSessionActionResponse' {} Text
a -> SendProjectSessionActionResponse
s {$sel:name:SendProjectSessionActionResponse' :: Text
name = Text
a} :: SendProjectSessionActionResponse)

instance
  Prelude.NFData
    SendProjectSessionActionResponse