{-# 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.StepFunctions.CreateActivity
-- 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 activity. An activity is a task that you write in any
-- programming language and host on any machine that has access to AWS Step
-- Functions. Activities must poll Step Functions using the
-- @GetActivityTask@ API action and respond using @SendTask*@ API actions.
-- This function lets Step Functions know the existence of your activity
-- and returns an identifier for use in a state machine and when polling
-- from the activity.
--
-- This operation is eventually consistent. The results are best effort and
-- may not reflect very recent updates and changes.
--
-- @CreateActivity@ is an idempotent API. Subsequent requests won’t create
-- a duplicate resource if it was already created. @CreateActivity@\'s
-- idempotency check is based on the activity @name@. If a following
-- request has different @tags@ values, Step Functions will ignore these
-- differences and treat it as an idempotent request of the previous. In
-- this case, @tags@ will not be updated, even if they are different.
module Amazonka.StepFunctions.CreateActivity
  ( -- * Creating a Request
    CreateActivity (..),
    newCreateActivity,

    -- * Request Lenses
    createActivity_tags,
    createActivity_name,

    -- * Destructuring the Response
    CreateActivityResponse (..),
    newCreateActivityResponse,

    -- * Response Lenses
    createActivityResponse_httpStatus,
    createActivityResponse_activityArn,
    createActivityResponse_creationDate,
  )
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.StepFunctions.Types

-- | /See:/ 'newCreateActivity' smart constructor.
data CreateActivity = CreateActivity'
  { -- | The list of tags to add to a resource.
    --
    -- An array of key-value pairs. For more information, see
    -- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html Using Cost Allocation Tags>
    -- in the /AWS Billing and Cost Management User Guide/, and
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html Controlling Access Using IAM Tags>.
    --
    -- Tags may only contain Unicode letters, digits, white space, or these
    -- symbols: @_ . : \/ = + - \@@.
    CreateActivity -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the activity to create. This name must be unique for your
    -- AWS account and region for 90 days. For more information, see
    -- <https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions Limits Related to State Machine Executions>
    -- in the /AWS Step Functions Developer Guide/.
    --
    -- A name must /not/ contain:
    --
    -- -   white space
    --
    -- -   brackets @\< > { } [ ]@
    --
    -- -   wildcard characters @? *@
    --
    -- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
    --
    -- -   control characters (@U+0000-001F@, @U+007F-009F@)
    --
    -- To enable logging with CloudWatch Logs, the name should only contain
    -- 0-9, A-Z, a-z, - and _.
    CreateActivity -> Text
name :: Prelude.Text
  }
  deriving (CreateActivity -> CreateActivity -> Bool
(CreateActivity -> CreateActivity -> Bool)
-> (CreateActivity -> CreateActivity -> Bool) -> Eq CreateActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateActivity -> CreateActivity -> Bool
$c/= :: CreateActivity -> CreateActivity -> Bool
== :: CreateActivity -> CreateActivity -> Bool
$c== :: CreateActivity -> CreateActivity -> Bool
Prelude.Eq, ReadPrec [CreateActivity]
ReadPrec CreateActivity
Int -> ReadS CreateActivity
ReadS [CreateActivity]
(Int -> ReadS CreateActivity)
-> ReadS [CreateActivity]
-> ReadPrec CreateActivity
-> ReadPrec [CreateActivity]
-> Read CreateActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateActivity]
$creadListPrec :: ReadPrec [CreateActivity]
readPrec :: ReadPrec CreateActivity
$creadPrec :: ReadPrec CreateActivity
readList :: ReadS [CreateActivity]
$creadList :: ReadS [CreateActivity]
readsPrec :: Int -> ReadS CreateActivity
$creadsPrec :: Int -> ReadS CreateActivity
Prelude.Read, Int -> CreateActivity -> ShowS
[CreateActivity] -> ShowS
CreateActivity -> String
(Int -> CreateActivity -> ShowS)
-> (CreateActivity -> String)
-> ([CreateActivity] -> ShowS)
-> Show CreateActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateActivity] -> ShowS
$cshowList :: [CreateActivity] -> ShowS
show :: CreateActivity -> String
$cshow :: CreateActivity -> String
showsPrec :: Int -> CreateActivity -> ShowS
$cshowsPrec :: Int -> CreateActivity -> ShowS
Prelude.Show, (forall x. CreateActivity -> Rep CreateActivity x)
-> (forall x. Rep CreateActivity x -> CreateActivity)
-> Generic CreateActivity
forall x. Rep CreateActivity x -> CreateActivity
forall x. CreateActivity -> Rep CreateActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateActivity x -> CreateActivity
$cfrom :: forall x. CreateActivity -> Rep CreateActivity x
Prelude.Generic)

-- |
-- Create a value of 'CreateActivity' 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:
--
-- 'tags', 'createActivity_tags' - The list of tags to add to a resource.
--
-- An array of key-value pairs. For more information, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html Using Cost Allocation Tags>
-- in the /AWS Billing and Cost Management User Guide/, and
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html Controlling Access Using IAM Tags>.
--
-- Tags may only contain Unicode letters, digits, white space, or these
-- symbols: @_ . : \/ = + - \@@.
--
-- 'name', 'createActivity_name' - The name of the activity to create. This name must be unique for your
-- AWS account and region for 90 days. For more information, see
-- <https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions Limits Related to State Machine Executions>
-- in the /AWS Step Functions Developer Guide/.
--
-- A name must /not/ contain:
--
-- -   white space
--
-- -   brackets @\< > { } [ ]@
--
-- -   wildcard characters @? *@
--
-- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
--
-- -   control characters (@U+0000-001F@, @U+007F-009F@)
--
-- To enable logging with CloudWatch Logs, the name should only contain
-- 0-9, A-Z, a-z, - and _.
newCreateActivity ::
  -- | 'name'
  Prelude.Text ->
  CreateActivity
newCreateActivity :: Text -> CreateActivity
newCreateActivity Text
pName_ =
  CreateActivity' :: Maybe [Tag] -> Text -> CreateActivity
CreateActivity'
    { $sel:tags:CreateActivity' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateActivity' :: Text
name = Text
pName_
    }

-- | The list of tags to add to a resource.
--
-- An array of key-value pairs. For more information, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html Using Cost Allocation Tags>
-- in the /AWS Billing and Cost Management User Guide/, and
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html Controlling Access Using IAM Tags>.
--
-- Tags may only contain Unicode letters, digits, white space, or these
-- symbols: @_ . : \/ = + - \@@.
createActivity_tags :: Lens.Lens' CreateActivity (Prelude.Maybe [Tag])
createActivity_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateActivity -> f CreateActivity
createActivity_tags = (CreateActivity -> Maybe [Tag])
-> (CreateActivity -> Maybe [Tag] -> CreateActivity)
-> Lens CreateActivity CreateActivity (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateActivity' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateActivity' :: CreateActivity -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateActivity
s@CreateActivity' {} Maybe [Tag]
a -> CreateActivity
s {$sel:tags:CreateActivity' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateActivity) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateActivity -> f CreateActivity)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateActivity
-> f CreateActivity
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

-- | The name of the activity to create. This name must be unique for your
-- AWS account and region for 90 days. For more information, see
-- <https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions Limits Related to State Machine Executions>
-- in the /AWS Step Functions Developer Guide/.
--
-- A name must /not/ contain:
--
-- -   white space
--
-- -   brackets @\< > { } [ ]@
--
-- -   wildcard characters @? *@
--
-- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
--
-- -   control characters (@U+0000-001F@, @U+007F-009F@)
--
-- To enable logging with CloudWatch Logs, the name should only contain
-- 0-9, A-Z, a-z, - and _.
createActivity_name :: Lens.Lens' CreateActivity Prelude.Text
createActivity_name :: (Text -> f Text) -> CreateActivity -> f CreateActivity
createActivity_name = (CreateActivity -> Text)
-> (CreateActivity -> Text -> CreateActivity)
-> Lens CreateActivity CreateActivity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateActivity' {Text
name :: Text
$sel:name:CreateActivity' :: CreateActivity -> Text
name} -> Text
name) (\s :: CreateActivity
s@CreateActivity' {} Text
a -> CreateActivity
s {$sel:name:CreateActivity' :: Text
name = Text
a} :: CreateActivity)

instance Core.AWSRequest CreateActivity where
  type
    AWSResponse CreateActivity =
      CreateActivityResponse
  request :: CreateActivity -> Request CreateActivity
request = Service -> CreateActivity -> Request CreateActivity
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateActivity
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateActivity)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateActivity))
-> Logger
-> Service
-> Proxy CreateActivity
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateActivity)))
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 ->
          Int -> Text -> POSIX -> CreateActivityResponse
CreateActivityResponse'
            (Int -> Text -> POSIX -> CreateActivityResponse)
-> Either String Int
-> Either String (Text -> POSIX -> CreateActivityResponse)
forall (f :: * -> *) a b. Functor 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 -> POSIX -> CreateActivityResponse)
-> Either String Text
-> Either String (POSIX -> CreateActivityResponse)
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
"activityArn")
            Either String (POSIX -> CreateActivityResponse)
-> Either String POSIX -> Either String CreateActivityResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"creationDate")
      )

instance Prelude.Hashable CreateActivity

instance Prelude.NFData CreateActivity

instance Core.ToHeaders CreateActivity where
  toHeaders :: CreateActivity -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateActivity -> 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
"AWSStepFunctions.CreateActivity" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateActivity where
  toJSON :: CreateActivity -> Value
toJSON CreateActivity' {Maybe [Tag]
Text
name :: Text
tags :: Maybe [Tag]
$sel:name:CreateActivity' :: CreateActivity -> Text
$sel:tags:CreateActivity' :: CreateActivity -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newCreateActivityResponse' smart constructor.
data CreateActivityResponse = CreateActivityResponse'
  { -- | The response's http status code.
    CreateActivityResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) that identifies the created activity.
    CreateActivityResponse -> Text
activityArn :: Prelude.Text,
    -- | The date the activity is created.
    CreateActivityResponse -> POSIX
creationDate :: Core.POSIX
  }
  deriving (CreateActivityResponse -> CreateActivityResponse -> Bool
(CreateActivityResponse -> CreateActivityResponse -> Bool)
-> (CreateActivityResponse -> CreateActivityResponse -> Bool)
-> Eq CreateActivityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateActivityResponse -> CreateActivityResponse -> Bool
$c/= :: CreateActivityResponse -> CreateActivityResponse -> Bool
== :: CreateActivityResponse -> CreateActivityResponse -> Bool
$c== :: CreateActivityResponse -> CreateActivityResponse -> Bool
Prelude.Eq, ReadPrec [CreateActivityResponse]
ReadPrec CreateActivityResponse
Int -> ReadS CreateActivityResponse
ReadS [CreateActivityResponse]
(Int -> ReadS CreateActivityResponse)
-> ReadS [CreateActivityResponse]
-> ReadPrec CreateActivityResponse
-> ReadPrec [CreateActivityResponse]
-> Read CreateActivityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateActivityResponse]
$creadListPrec :: ReadPrec [CreateActivityResponse]
readPrec :: ReadPrec CreateActivityResponse
$creadPrec :: ReadPrec CreateActivityResponse
readList :: ReadS [CreateActivityResponse]
$creadList :: ReadS [CreateActivityResponse]
readsPrec :: Int -> ReadS CreateActivityResponse
$creadsPrec :: Int -> ReadS CreateActivityResponse
Prelude.Read, Int -> CreateActivityResponse -> ShowS
[CreateActivityResponse] -> ShowS
CreateActivityResponse -> String
(Int -> CreateActivityResponse -> ShowS)
-> (CreateActivityResponse -> String)
-> ([CreateActivityResponse] -> ShowS)
-> Show CreateActivityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateActivityResponse] -> ShowS
$cshowList :: [CreateActivityResponse] -> ShowS
show :: CreateActivityResponse -> String
$cshow :: CreateActivityResponse -> String
showsPrec :: Int -> CreateActivityResponse -> ShowS
$cshowsPrec :: Int -> CreateActivityResponse -> ShowS
Prelude.Show, (forall x. CreateActivityResponse -> Rep CreateActivityResponse x)
-> (forall x.
    Rep CreateActivityResponse x -> CreateActivityResponse)
-> Generic CreateActivityResponse
forall x. Rep CreateActivityResponse x -> CreateActivityResponse
forall x. CreateActivityResponse -> Rep CreateActivityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateActivityResponse x -> CreateActivityResponse
$cfrom :: forall x. CreateActivityResponse -> Rep CreateActivityResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateActivityResponse' 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:
--
-- 'httpStatus', 'createActivityResponse_httpStatus' - The response's http status code.
--
-- 'activityArn', 'createActivityResponse_activityArn' - The Amazon Resource Name (ARN) that identifies the created activity.
--
-- 'creationDate', 'createActivityResponse_creationDate' - The date the activity is created.
newCreateActivityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'activityArn'
  Prelude.Text ->
  -- | 'creationDate'
  Prelude.UTCTime ->
  CreateActivityResponse
newCreateActivityResponse :: Int -> Text -> UTCTime -> CreateActivityResponse
newCreateActivityResponse
  Int
pHttpStatus_
  Text
pActivityArn_
  UTCTime
pCreationDate_ =
    CreateActivityResponse' :: Int -> Text -> POSIX -> CreateActivityResponse
CreateActivityResponse'
      { $sel:httpStatus:CreateActivityResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:activityArn:CreateActivityResponse' :: Text
activityArn = Text
pActivityArn_,
        $sel:creationDate:CreateActivityResponse' :: POSIX
creationDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_
      }

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

-- | The Amazon Resource Name (ARN) that identifies the created activity.
createActivityResponse_activityArn :: Lens.Lens' CreateActivityResponse Prelude.Text
createActivityResponse_activityArn :: (Text -> f Text)
-> CreateActivityResponse -> f CreateActivityResponse
createActivityResponse_activityArn = (CreateActivityResponse -> Text)
-> (CreateActivityResponse -> Text -> CreateActivityResponse)
-> Lens CreateActivityResponse CreateActivityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateActivityResponse' {Text
activityArn :: Text
$sel:activityArn:CreateActivityResponse' :: CreateActivityResponse -> Text
activityArn} -> Text
activityArn) (\s :: CreateActivityResponse
s@CreateActivityResponse' {} Text
a -> CreateActivityResponse
s {$sel:activityArn:CreateActivityResponse' :: Text
activityArn = Text
a} :: CreateActivityResponse)

-- | The date the activity is created.
createActivityResponse_creationDate :: Lens.Lens' CreateActivityResponse Prelude.UTCTime
createActivityResponse_creationDate :: (UTCTime -> f UTCTime)
-> CreateActivityResponse -> f CreateActivityResponse
createActivityResponse_creationDate = (CreateActivityResponse -> POSIX)
-> (CreateActivityResponse -> POSIX -> CreateActivityResponse)
-> Lens CreateActivityResponse CreateActivityResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateActivityResponse' {POSIX
creationDate :: POSIX
$sel:creationDate:CreateActivityResponse' :: CreateActivityResponse -> POSIX
creationDate} -> POSIX
creationDate) (\s :: CreateActivityResponse
s@CreateActivityResponse' {} POSIX
a -> CreateActivityResponse
s {$sel:creationDate:CreateActivityResponse' :: POSIX
creationDate = POSIX
a} :: CreateActivityResponse) ((POSIX -> f POSIX)
 -> CreateActivityResponse -> f CreateActivityResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateActivityResponse
-> f CreateActivityResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData CreateActivityResponse