{-# 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.SageMaker.CreateAction
-- 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 an /action/. An action is a lineage tracking entity that
-- represents an action or activity. For example, a model deployment or an
-- HPO job. Generally, an action involves at least one input or output
-- artifact. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html Amazon SageMaker ML Lineage Tracking>.
module Amazonka.SageMaker.CreateAction
  ( -- * Creating a Request
    CreateAction (..),
    newCreateAction,

    -- * Request Lenses
    createAction_metadataProperties,
    createAction_status,
    createAction_description,
    createAction_tags,
    createAction_properties,
    createAction_actionName,
    createAction_source,
    createAction_actionType,

    -- * Destructuring the Response
    CreateActionResponse (..),
    newCreateActionResponse,

    -- * Response Lenses
    createActionResponse_actionArn,
    createActionResponse_httpStatus,
  )
where

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
import Amazonka.SageMaker.Types

-- | /See:/ 'newCreateAction' smart constructor.
data CreateAction = CreateAction'
  { CreateAction -> Maybe MetadataProperties
metadataProperties :: Prelude.Maybe MetadataProperties,
    -- | The status of the action.
    CreateAction -> Maybe ActionStatus
status :: Prelude.Maybe ActionStatus,
    -- | The description of the action.
    CreateAction -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A list of tags to apply to the action.
    CreateAction -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A list of properties to add to the action.
    CreateAction -> Maybe (HashMap Text Text)
properties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the action. Must be unique to your account in an Amazon Web
    -- Services Region.
    CreateAction -> Text
actionName :: Prelude.Text,
    -- | The source type, ID, and URI.
    CreateAction -> ActionSource
source :: ActionSource,
    -- | The action type.
    CreateAction -> Text
actionType :: Prelude.Text
  }
  deriving (CreateAction -> CreateAction -> Bool
(CreateAction -> CreateAction -> Bool)
-> (CreateAction -> CreateAction -> Bool) -> Eq CreateAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAction -> CreateAction -> Bool
$c/= :: CreateAction -> CreateAction -> Bool
== :: CreateAction -> CreateAction -> Bool
$c== :: CreateAction -> CreateAction -> Bool
Prelude.Eq, ReadPrec [CreateAction]
ReadPrec CreateAction
Int -> ReadS CreateAction
ReadS [CreateAction]
(Int -> ReadS CreateAction)
-> ReadS [CreateAction]
-> ReadPrec CreateAction
-> ReadPrec [CreateAction]
-> Read CreateAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAction]
$creadListPrec :: ReadPrec [CreateAction]
readPrec :: ReadPrec CreateAction
$creadPrec :: ReadPrec CreateAction
readList :: ReadS [CreateAction]
$creadList :: ReadS [CreateAction]
readsPrec :: Int -> ReadS CreateAction
$creadsPrec :: Int -> ReadS CreateAction
Prelude.Read, Int -> CreateAction -> ShowS
[CreateAction] -> ShowS
CreateAction -> String
(Int -> CreateAction -> ShowS)
-> (CreateAction -> String)
-> ([CreateAction] -> ShowS)
-> Show CreateAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAction] -> ShowS
$cshowList :: [CreateAction] -> ShowS
show :: CreateAction -> String
$cshow :: CreateAction -> String
showsPrec :: Int -> CreateAction -> ShowS
$cshowsPrec :: Int -> CreateAction -> ShowS
Prelude.Show, (forall x. CreateAction -> Rep CreateAction x)
-> (forall x. Rep CreateAction x -> CreateAction)
-> Generic CreateAction
forall x. Rep CreateAction x -> CreateAction
forall x. CreateAction -> Rep CreateAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAction x -> CreateAction
$cfrom :: forall x. CreateAction -> Rep CreateAction x
Prelude.Generic)

-- |
-- Create a value of 'CreateAction' 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:
--
-- 'metadataProperties', 'createAction_metadataProperties' - Undocumented member.
--
-- 'status', 'createAction_status' - The status of the action.
--
-- 'description', 'createAction_description' - The description of the action.
--
-- 'tags', 'createAction_tags' - A list of tags to apply to the action.
--
-- 'properties', 'createAction_properties' - A list of properties to add to the action.
--
-- 'actionName', 'createAction_actionName' - The name of the action. Must be unique to your account in an Amazon Web
-- Services Region.
--
-- 'source', 'createAction_source' - The source type, ID, and URI.
--
-- 'actionType', 'createAction_actionType' - The action type.
newCreateAction ::
  -- | 'actionName'
  Prelude.Text ->
  -- | 'source'
  ActionSource ->
  -- | 'actionType'
  Prelude.Text ->
  CreateAction
newCreateAction :: Text -> ActionSource -> Text -> CreateAction
newCreateAction Text
pActionName_ ActionSource
pSource_ Text
pActionType_ =
  CreateAction' :: Maybe MetadataProperties
-> Maybe ActionStatus
-> Maybe Text
-> Maybe [Tag]
-> Maybe (HashMap Text Text)
-> Text
-> ActionSource
-> Text
-> CreateAction
CreateAction'
    { $sel:metadataProperties:CreateAction' :: Maybe MetadataProperties
metadataProperties = Maybe MetadataProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateAction' :: Maybe ActionStatus
status = Maybe ActionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateAction' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateAction' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:properties:CreateAction' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:actionName:CreateAction' :: Text
actionName = Text
pActionName_,
      $sel:source:CreateAction' :: ActionSource
source = ActionSource
pSource_,
      $sel:actionType:CreateAction' :: Text
actionType = Text
pActionType_
    }

-- | Undocumented member.
createAction_metadataProperties :: Lens.Lens' CreateAction (Prelude.Maybe MetadataProperties)
createAction_metadataProperties :: (Maybe MetadataProperties -> f (Maybe MetadataProperties))
-> CreateAction -> f CreateAction
createAction_metadataProperties = (CreateAction -> Maybe MetadataProperties)
-> (CreateAction -> Maybe MetadataProperties -> CreateAction)
-> Lens
     CreateAction
     CreateAction
     (Maybe MetadataProperties)
     (Maybe MetadataProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Maybe MetadataProperties
metadataProperties :: Maybe MetadataProperties
$sel:metadataProperties:CreateAction' :: CreateAction -> Maybe MetadataProperties
metadataProperties} -> Maybe MetadataProperties
metadataProperties) (\s :: CreateAction
s@CreateAction' {} Maybe MetadataProperties
a -> CreateAction
s {$sel:metadataProperties:CreateAction' :: Maybe MetadataProperties
metadataProperties = Maybe MetadataProperties
a} :: CreateAction)

-- | The status of the action.
createAction_status :: Lens.Lens' CreateAction (Prelude.Maybe ActionStatus)
createAction_status :: (Maybe ActionStatus -> f (Maybe ActionStatus))
-> CreateAction -> f CreateAction
createAction_status = (CreateAction -> Maybe ActionStatus)
-> (CreateAction -> Maybe ActionStatus -> CreateAction)
-> Lens
     CreateAction CreateAction (Maybe ActionStatus) (Maybe ActionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Maybe ActionStatus
status :: Maybe ActionStatus
$sel:status:CreateAction' :: CreateAction -> Maybe ActionStatus
status} -> Maybe ActionStatus
status) (\s :: CreateAction
s@CreateAction' {} Maybe ActionStatus
a -> CreateAction
s {$sel:status:CreateAction' :: Maybe ActionStatus
status = Maybe ActionStatus
a} :: CreateAction)

-- | The description of the action.
createAction_description :: Lens.Lens' CreateAction (Prelude.Maybe Prelude.Text)
createAction_description :: (Maybe Text -> f (Maybe Text)) -> CreateAction -> f CreateAction
createAction_description = (CreateAction -> Maybe Text)
-> (CreateAction -> Maybe Text -> CreateAction)
-> Lens CreateAction CreateAction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Maybe Text
description :: Maybe Text
$sel:description:CreateAction' :: CreateAction -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateAction
s@CreateAction' {} Maybe Text
a -> CreateAction
s {$sel:description:CreateAction' :: Maybe Text
description = Maybe Text
a} :: CreateAction)

-- | A list of tags to apply to the action.
createAction_tags :: Lens.Lens' CreateAction (Prelude.Maybe [Tag])
createAction_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateAction -> f CreateAction
createAction_tags = (CreateAction -> Maybe [Tag])
-> (CreateAction -> Maybe [Tag] -> CreateAction)
-> Lens CreateAction CreateAction (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAction' :: CreateAction -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAction
s@CreateAction' {} Maybe [Tag]
a -> CreateAction
s {$sel:tags:CreateAction' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAction) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateAction -> f CreateAction)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAction
-> f CreateAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of properties to add to the action.
createAction_properties :: Lens.Lens' CreateAction (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAction_properties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAction -> f CreateAction
createAction_properties = (CreateAction -> Maybe (HashMap Text Text))
-> (CreateAction -> Maybe (HashMap Text Text) -> CreateAction)
-> Lens
     CreateAction
     CreateAction
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Maybe (HashMap Text Text)
properties :: Maybe (HashMap Text Text)
$sel:properties:CreateAction' :: CreateAction -> Maybe (HashMap Text Text)
properties} -> Maybe (HashMap Text Text)
properties) (\s :: CreateAction
s@CreateAction' {} Maybe (HashMap Text Text)
a -> CreateAction
s {$sel:properties:CreateAction' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
a} :: CreateAction) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateAction -> f CreateAction)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAction
-> f CreateAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the action. Must be unique to your account in an Amazon Web
-- Services Region.
createAction_actionName :: Lens.Lens' CreateAction Prelude.Text
createAction_actionName :: (Text -> f Text) -> CreateAction -> f CreateAction
createAction_actionName = (CreateAction -> Text)
-> (CreateAction -> Text -> CreateAction)
-> Lens CreateAction CreateAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Text
actionName :: Text
$sel:actionName:CreateAction' :: CreateAction -> Text
actionName} -> Text
actionName) (\s :: CreateAction
s@CreateAction' {} Text
a -> CreateAction
s {$sel:actionName:CreateAction' :: Text
actionName = Text
a} :: CreateAction)

-- | The source type, ID, and URI.
createAction_source :: Lens.Lens' CreateAction ActionSource
createAction_source :: (ActionSource -> f ActionSource) -> CreateAction -> f CreateAction
createAction_source = (CreateAction -> ActionSource)
-> (CreateAction -> ActionSource -> CreateAction)
-> Lens CreateAction CreateAction ActionSource ActionSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {ActionSource
source :: ActionSource
$sel:source:CreateAction' :: CreateAction -> ActionSource
source} -> ActionSource
source) (\s :: CreateAction
s@CreateAction' {} ActionSource
a -> CreateAction
s {$sel:source:CreateAction' :: ActionSource
source = ActionSource
a} :: CreateAction)

-- | The action type.
createAction_actionType :: Lens.Lens' CreateAction Prelude.Text
createAction_actionType :: (Text -> f Text) -> CreateAction -> f CreateAction
createAction_actionType = (CreateAction -> Text)
-> (CreateAction -> Text -> CreateAction)
-> Lens CreateAction CreateAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAction' {Text
actionType :: Text
$sel:actionType:CreateAction' :: CreateAction -> Text
actionType} -> Text
actionType) (\s :: CreateAction
s@CreateAction' {} Text
a -> CreateAction
s {$sel:actionType:CreateAction' :: Text
actionType = Text
a} :: CreateAction)

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

instance Prelude.NFData CreateAction

instance Core.ToHeaders CreateAction where
  toHeaders :: CreateAction -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.CreateAction" :: Prelude.ByteString),
            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 CreateAction where
  toJSON :: CreateAction -> Value
toJSON CreateAction' {Maybe [Tag]
Maybe Text
Maybe (HashMap Text Text)
Maybe ActionStatus
Maybe MetadataProperties
Text
ActionSource
actionType :: Text
source :: ActionSource
actionName :: Text
properties :: Maybe (HashMap Text Text)
tags :: Maybe [Tag]
description :: Maybe Text
status :: Maybe ActionStatus
metadataProperties :: Maybe MetadataProperties
$sel:actionType:CreateAction' :: CreateAction -> Text
$sel:source:CreateAction' :: CreateAction -> ActionSource
$sel:actionName:CreateAction' :: CreateAction -> Text
$sel:properties:CreateAction' :: CreateAction -> Maybe (HashMap Text Text)
$sel:tags:CreateAction' :: CreateAction -> Maybe [Tag]
$sel:description:CreateAction' :: CreateAction -> Maybe Text
$sel:status:CreateAction' :: CreateAction -> Maybe ActionStatus
$sel:metadataProperties:CreateAction' :: CreateAction -> Maybe MetadataProperties
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MetadataProperties" Text -> MetadataProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MetadataProperties -> Pair)
-> Maybe MetadataProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MetadataProperties
metadataProperties,
            (Text
"Status" Text -> ActionStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ActionStatus -> Pair) -> Maybe ActionStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ActionStatus
status,
            (Text
"Description" 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
description,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Text
"Properties" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
properties,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ActionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
actionName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Source" Text -> ActionSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionSource
source),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ActionType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
actionType)
          ]
      )

instance Core.ToPath CreateAction where
  toPath :: CreateAction -> ByteString
toPath = ByteString -> CreateAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCreateActionResponse' smart constructor.
data CreateActionResponse = CreateActionResponse'
  { -- | The Amazon Resource Name (ARN) of the action.
    CreateActionResponse -> Maybe Text
actionArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateActionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateActionResponse -> CreateActionResponse -> Bool
(CreateActionResponse -> CreateActionResponse -> Bool)
-> (CreateActionResponse -> CreateActionResponse -> Bool)
-> Eq CreateActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateActionResponse -> CreateActionResponse -> Bool
$c/= :: CreateActionResponse -> CreateActionResponse -> Bool
== :: CreateActionResponse -> CreateActionResponse -> Bool
$c== :: CreateActionResponse -> CreateActionResponse -> Bool
Prelude.Eq, ReadPrec [CreateActionResponse]
ReadPrec CreateActionResponse
Int -> ReadS CreateActionResponse
ReadS [CreateActionResponse]
(Int -> ReadS CreateActionResponse)
-> ReadS [CreateActionResponse]
-> ReadPrec CreateActionResponse
-> ReadPrec [CreateActionResponse]
-> Read CreateActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateActionResponse]
$creadListPrec :: ReadPrec [CreateActionResponse]
readPrec :: ReadPrec CreateActionResponse
$creadPrec :: ReadPrec CreateActionResponse
readList :: ReadS [CreateActionResponse]
$creadList :: ReadS [CreateActionResponse]
readsPrec :: Int -> ReadS CreateActionResponse
$creadsPrec :: Int -> ReadS CreateActionResponse
Prelude.Read, Int -> CreateActionResponse -> ShowS
[CreateActionResponse] -> ShowS
CreateActionResponse -> String
(Int -> CreateActionResponse -> ShowS)
-> (CreateActionResponse -> String)
-> ([CreateActionResponse] -> ShowS)
-> Show CreateActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateActionResponse] -> ShowS
$cshowList :: [CreateActionResponse] -> ShowS
show :: CreateActionResponse -> String
$cshow :: CreateActionResponse -> String
showsPrec :: Int -> CreateActionResponse -> ShowS
$cshowsPrec :: Int -> CreateActionResponse -> ShowS
Prelude.Show, (forall x. CreateActionResponse -> Rep CreateActionResponse x)
-> (forall x. Rep CreateActionResponse x -> CreateActionResponse)
-> Generic CreateActionResponse
forall x. Rep CreateActionResponse x -> CreateActionResponse
forall x. CreateActionResponse -> Rep CreateActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateActionResponse x -> CreateActionResponse
$cfrom :: forall x. CreateActionResponse -> Rep CreateActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateActionResponse' 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:
--
-- 'actionArn', 'createActionResponse_actionArn' - The Amazon Resource Name (ARN) of the action.
--
-- 'httpStatus', 'createActionResponse_httpStatus' - The response's http status code.
newCreateActionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateActionResponse
newCreateActionResponse :: Int -> CreateActionResponse
newCreateActionResponse Int
pHttpStatus_ =
  CreateActionResponse' :: Maybe Text -> Int -> CreateActionResponse
CreateActionResponse'
    { $sel:actionArn:CreateActionResponse' :: Maybe Text
actionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateActionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the action.
createActionResponse_actionArn :: Lens.Lens' CreateActionResponse (Prelude.Maybe Prelude.Text)
createActionResponse_actionArn :: (Maybe Text -> f (Maybe Text))
-> CreateActionResponse -> f CreateActionResponse
createActionResponse_actionArn = (CreateActionResponse -> Maybe Text)
-> (CreateActionResponse -> Maybe Text -> CreateActionResponse)
-> Lens
     CreateActionResponse CreateActionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateActionResponse' {Maybe Text
actionArn :: Maybe Text
$sel:actionArn:CreateActionResponse' :: CreateActionResponse -> Maybe Text
actionArn} -> Maybe Text
actionArn) (\s :: CreateActionResponse
s@CreateActionResponse' {} Maybe Text
a -> CreateActionResponse
s {$sel:actionArn:CreateActionResponse' :: Maybe Text
actionArn = Maybe Text
a} :: CreateActionResponse)

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

instance Prelude.NFData CreateActionResponse