{-# 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.DataSync.UpdateTask
-- 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)
--
-- Updates the metadata associated with a task.
module Amazonka.DataSync.UpdateTask
  ( -- * Creating a Request
    UpdateTask (..),
    newUpdateTask,

    -- * Request Lenses
    updateTask_schedule,
    updateTask_includes,
    updateTask_name,
    updateTask_excludes,
    updateTask_options,
    updateTask_cloudWatchLogGroupArn,
    updateTask_taskArn,

    -- * Destructuring the Response
    UpdateTaskResponse (..),
    newUpdateTaskResponse,

    -- * Response Lenses
    updateTaskResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataSync.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

-- | UpdateTaskResponse
--
-- /See:/ 'newUpdateTask' smart constructor.
data UpdateTask = UpdateTask'
  { -- | Specifies a schedule used to periodically transfer files from a source
    -- to a destination location. You can configure your task to execute
    -- hourly, daily, weekly or on specific days of the week. You control when
    -- in the day or hour you want the task to execute. The time you specify is
    -- UTC time. For more information, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html Scheduling your task>.
    UpdateTask -> Maybe TaskSchedule
schedule :: Prelude.Maybe TaskSchedule,
    -- | A list of filter rules that determines which files to include when
    -- running a task. The pattern should contain a single filter string that
    -- consists of the patterns to include. The patterns are delimited by \"|\"
    -- (that is, a pipe). For example: @\"\/folder1|\/folder2@\"
    UpdateTask -> Maybe [FilterRule]
includes :: Prelude.Maybe [FilterRule],
    -- | The name of the task to update.
    UpdateTask -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A list of filter rules that determines which files to exclude from a
    -- task. The list should contain a single filter string that consists of
    -- the patterns to exclude. The patterns are delimited by \"|\" (that is, a
    -- pipe), for example: @\"\/folder1|\/folder2\"@
    UpdateTask -> Maybe [FilterRule]
excludes :: Prelude.Maybe [FilterRule],
    UpdateTask -> Maybe Options
options :: Prelude.Maybe Options,
    -- | The Amazon Resource Name (ARN) of the resource name of the CloudWatch
    -- LogGroup.
    UpdateTask -> Maybe Text
cloudWatchLogGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the resource name of the task to
    -- update.
    UpdateTask -> Text
taskArn :: Prelude.Text
  }
  deriving (UpdateTask -> UpdateTask -> Bool
(UpdateTask -> UpdateTask -> Bool)
-> (UpdateTask -> UpdateTask -> Bool) -> Eq UpdateTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTask -> UpdateTask -> Bool
$c/= :: UpdateTask -> UpdateTask -> Bool
== :: UpdateTask -> UpdateTask -> Bool
$c== :: UpdateTask -> UpdateTask -> Bool
Prelude.Eq, ReadPrec [UpdateTask]
ReadPrec UpdateTask
Int -> ReadS UpdateTask
ReadS [UpdateTask]
(Int -> ReadS UpdateTask)
-> ReadS [UpdateTask]
-> ReadPrec UpdateTask
-> ReadPrec [UpdateTask]
-> Read UpdateTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTask]
$creadListPrec :: ReadPrec [UpdateTask]
readPrec :: ReadPrec UpdateTask
$creadPrec :: ReadPrec UpdateTask
readList :: ReadS [UpdateTask]
$creadList :: ReadS [UpdateTask]
readsPrec :: Int -> ReadS UpdateTask
$creadsPrec :: Int -> ReadS UpdateTask
Prelude.Read, Int -> UpdateTask -> ShowS
[UpdateTask] -> ShowS
UpdateTask -> String
(Int -> UpdateTask -> ShowS)
-> (UpdateTask -> String)
-> ([UpdateTask] -> ShowS)
-> Show UpdateTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTask] -> ShowS
$cshowList :: [UpdateTask] -> ShowS
show :: UpdateTask -> String
$cshow :: UpdateTask -> String
showsPrec :: Int -> UpdateTask -> ShowS
$cshowsPrec :: Int -> UpdateTask -> ShowS
Prelude.Show, (forall x. UpdateTask -> Rep UpdateTask x)
-> (forall x. Rep UpdateTask x -> UpdateTask) -> Generic UpdateTask
forall x. Rep UpdateTask x -> UpdateTask
forall x. UpdateTask -> Rep UpdateTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTask x -> UpdateTask
$cfrom :: forall x. UpdateTask -> Rep UpdateTask x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTask' 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:
--
-- 'schedule', 'updateTask_schedule' - Specifies a schedule used to periodically transfer files from a source
-- to a destination location. You can configure your task to execute
-- hourly, daily, weekly or on specific days of the week. You control when
-- in the day or hour you want the task to execute. The time you specify is
-- UTC time. For more information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html Scheduling your task>.
--
-- 'includes', 'updateTask_includes' - A list of filter rules that determines which files to include when
-- running a task. The pattern should contain a single filter string that
-- consists of the patterns to include. The patterns are delimited by \"|\"
-- (that is, a pipe). For example: @\"\/folder1|\/folder2@\"
--
-- 'name', 'updateTask_name' - The name of the task to update.
--
-- 'excludes', 'updateTask_excludes' - A list of filter rules that determines which files to exclude from a
-- task. The list should contain a single filter string that consists of
-- the patterns to exclude. The patterns are delimited by \"|\" (that is, a
-- pipe), for example: @\"\/folder1|\/folder2\"@
--
-- 'options', 'updateTask_options' - Undocumented member.
--
-- 'cloudWatchLogGroupArn', 'updateTask_cloudWatchLogGroupArn' - The Amazon Resource Name (ARN) of the resource name of the CloudWatch
-- LogGroup.
--
-- 'taskArn', 'updateTask_taskArn' - The Amazon Resource Name (ARN) of the resource name of the task to
-- update.
newUpdateTask ::
  -- | 'taskArn'
  Prelude.Text ->
  UpdateTask
newUpdateTask :: Text -> UpdateTask
newUpdateTask Text
pTaskArn_ =
  UpdateTask' :: Maybe TaskSchedule
-> Maybe [FilterRule]
-> Maybe Text
-> Maybe [FilterRule]
-> Maybe Options
-> Maybe Text
-> Text
-> UpdateTask
UpdateTask'
    { $sel:schedule:UpdateTask' :: Maybe TaskSchedule
schedule = Maybe TaskSchedule
forall a. Maybe a
Prelude.Nothing,
      $sel:includes:UpdateTask' :: Maybe [FilterRule]
includes = Maybe [FilterRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateTask' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:excludes:UpdateTask' :: Maybe [FilterRule]
excludes = Maybe [FilterRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:options:UpdateTask' :: Maybe Options
options = Maybe Options
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLogGroupArn:UpdateTask' :: Maybe Text
cloudWatchLogGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskArn:UpdateTask' :: Text
taskArn = Text
pTaskArn_
    }

-- | Specifies a schedule used to periodically transfer files from a source
-- to a destination location. You can configure your task to execute
-- hourly, daily, weekly or on specific days of the week. You control when
-- in the day or hour you want the task to execute. The time you specify is
-- UTC time. For more information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html Scheduling your task>.
updateTask_schedule :: Lens.Lens' UpdateTask (Prelude.Maybe TaskSchedule)
updateTask_schedule :: (Maybe TaskSchedule -> f (Maybe TaskSchedule))
-> UpdateTask -> f UpdateTask
updateTask_schedule = (UpdateTask -> Maybe TaskSchedule)
-> (UpdateTask -> Maybe TaskSchedule -> UpdateTask)
-> Lens
     UpdateTask UpdateTask (Maybe TaskSchedule) (Maybe TaskSchedule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Maybe TaskSchedule
schedule :: Maybe TaskSchedule
$sel:schedule:UpdateTask' :: UpdateTask -> Maybe TaskSchedule
schedule} -> Maybe TaskSchedule
schedule) (\s :: UpdateTask
s@UpdateTask' {} Maybe TaskSchedule
a -> UpdateTask
s {$sel:schedule:UpdateTask' :: Maybe TaskSchedule
schedule = Maybe TaskSchedule
a} :: UpdateTask)

-- | A list of filter rules that determines which files to include when
-- running a task. The pattern should contain a single filter string that
-- consists of the patterns to include. The patterns are delimited by \"|\"
-- (that is, a pipe). For example: @\"\/folder1|\/folder2@\"
updateTask_includes :: Lens.Lens' UpdateTask (Prelude.Maybe [FilterRule])
updateTask_includes :: (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> UpdateTask -> f UpdateTask
updateTask_includes = (UpdateTask -> Maybe [FilterRule])
-> (UpdateTask -> Maybe [FilterRule] -> UpdateTask)
-> Lens
     UpdateTask UpdateTask (Maybe [FilterRule]) (Maybe [FilterRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Maybe [FilterRule]
includes :: Maybe [FilterRule]
$sel:includes:UpdateTask' :: UpdateTask -> Maybe [FilterRule]
includes} -> Maybe [FilterRule]
includes) (\s :: UpdateTask
s@UpdateTask' {} Maybe [FilterRule]
a -> UpdateTask
s {$sel:includes:UpdateTask' :: Maybe [FilterRule]
includes = Maybe [FilterRule]
a} :: UpdateTask) ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
 -> UpdateTask -> f UpdateTask)
-> ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
    -> Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> UpdateTask
-> f UpdateTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FilterRule] [FilterRule] [FilterRule] [FilterRule]
-> Iso
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
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 [FilterRule] [FilterRule] [FilterRule] [FilterRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the task to update.
updateTask_name :: Lens.Lens' UpdateTask (Prelude.Maybe Prelude.Text)
updateTask_name :: (Maybe Text -> f (Maybe Text)) -> UpdateTask -> f UpdateTask
updateTask_name = (UpdateTask -> Maybe Text)
-> (UpdateTask -> Maybe Text -> UpdateTask)
-> Lens UpdateTask UpdateTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Maybe Text
name :: Maybe Text
$sel:name:UpdateTask' :: UpdateTask -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateTask
s@UpdateTask' {} Maybe Text
a -> UpdateTask
s {$sel:name:UpdateTask' :: Maybe Text
name = Maybe Text
a} :: UpdateTask)

-- | A list of filter rules that determines which files to exclude from a
-- task. The list should contain a single filter string that consists of
-- the patterns to exclude. The patterns are delimited by \"|\" (that is, a
-- pipe), for example: @\"\/folder1|\/folder2\"@
updateTask_excludes :: Lens.Lens' UpdateTask (Prelude.Maybe [FilterRule])
updateTask_excludes :: (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> UpdateTask -> f UpdateTask
updateTask_excludes = (UpdateTask -> Maybe [FilterRule])
-> (UpdateTask -> Maybe [FilterRule] -> UpdateTask)
-> Lens
     UpdateTask UpdateTask (Maybe [FilterRule]) (Maybe [FilterRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Maybe [FilterRule]
excludes :: Maybe [FilterRule]
$sel:excludes:UpdateTask' :: UpdateTask -> Maybe [FilterRule]
excludes} -> Maybe [FilterRule]
excludes) (\s :: UpdateTask
s@UpdateTask' {} Maybe [FilterRule]
a -> UpdateTask
s {$sel:excludes:UpdateTask' :: Maybe [FilterRule]
excludes = Maybe [FilterRule]
a} :: UpdateTask) ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
 -> UpdateTask -> f UpdateTask)
-> ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
    -> Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> UpdateTask
-> f UpdateTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FilterRule] [FilterRule] [FilterRule] [FilterRule]
-> Iso
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
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 [FilterRule] [FilterRule] [FilterRule] [FilterRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
updateTask_options :: Lens.Lens' UpdateTask (Prelude.Maybe Options)
updateTask_options :: (Maybe Options -> f (Maybe Options)) -> UpdateTask -> f UpdateTask
updateTask_options = (UpdateTask -> Maybe Options)
-> (UpdateTask -> Maybe Options -> UpdateTask)
-> Lens UpdateTask UpdateTask (Maybe Options) (Maybe Options)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Maybe Options
options :: Maybe Options
$sel:options:UpdateTask' :: UpdateTask -> Maybe Options
options} -> Maybe Options
options) (\s :: UpdateTask
s@UpdateTask' {} Maybe Options
a -> UpdateTask
s {$sel:options:UpdateTask' :: Maybe Options
options = Maybe Options
a} :: UpdateTask)

-- | The Amazon Resource Name (ARN) of the resource name of the CloudWatch
-- LogGroup.
updateTask_cloudWatchLogGroupArn :: Lens.Lens' UpdateTask (Prelude.Maybe Prelude.Text)
updateTask_cloudWatchLogGroupArn :: (Maybe Text -> f (Maybe Text)) -> UpdateTask -> f UpdateTask
updateTask_cloudWatchLogGroupArn = (UpdateTask -> Maybe Text)
-> (UpdateTask -> Maybe Text -> UpdateTask)
-> Lens UpdateTask UpdateTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Maybe Text
cloudWatchLogGroupArn :: Maybe Text
$sel:cloudWatchLogGroupArn:UpdateTask' :: UpdateTask -> Maybe Text
cloudWatchLogGroupArn} -> Maybe Text
cloudWatchLogGroupArn) (\s :: UpdateTask
s@UpdateTask' {} Maybe Text
a -> UpdateTask
s {$sel:cloudWatchLogGroupArn:UpdateTask' :: Maybe Text
cloudWatchLogGroupArn = Maybe Text
a} :: UpdateTask)

-- | The Amazon Resource Name (ARN) of the resource name of the task to
-- update.
updateTask_taskArn :: Lens.Lens' UpdateTask Prelude.Text
updateTask_taskArn :: (Text -> f Text) -> UpdateTask -> f UpdateTask
updateTask_taskArn = (UpdateTask -> Text)
-> (UpdateTask -> Text -> UpdateTask)
-> Lens UpdateTask UpdateTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTask' {Text
taskArn :: Text
$sel:taskArn:UpdateTask' :: UpdateTask -> Text
taskArn} -> Text
taskArn) (\s :: UpdateTask
s@UpdateTask' {} Text
a -> UpdateTask
s {$sel:taskArn:UpdateTask' :: Text
taskArn = Text
a} :: UpdateTask)

instance Core.AWSRequest UpdateTask where
  type AWSResponse UpdateTask = UpdateTaskResponse
  request :: UpdateTask -> Request UpdateTask
request = Service -> UpdateTask -> Request UpdateTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTask)))
response =
    (Int
 -> ResponseHeaders -> () -> Either String (AWSResponse UpdateTask))
-> Logger
-> Service
-> Proxy UpdateTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateTaskResponse
UpdateTaskResponse'
            (Int -> UpdateTaskResponse)
-> Either String Int -> Either String UpdateTaskResponse
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))
      )

instance Prelude.Hashable UpdateTask

instance Prelude.NFData UpdateTask

instance Core.ToHeaders UpdateTask where
  toHeaders :: UpdateTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateTask -> 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
"FmrsService.UpdateTask" :: 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 UpdateTask where
  toJSON :: UpdateTask -> Value
toJSON UpdateTask' {Maybe [FilterRule]
Maybe Text
Maybe TaskSchedule
Maybe Options
Text
taskArn :: Text
cloudWatchLogGroupArn :: Maybe Text
options :: Maybe Options
excludes :: Maybe [FilterRule]
name :: Maybe Text
includes :: Maybe [FilterRule]
schedule :: Maybe TaskSchedule
$sel:taskArn:UpdateTask' :: UpdateTask -> Text
$sel:cloudWatchLogGroupArn:UpdateTask' :: UpdateTask -> Maybe Text
$sel:options:UpdateTask' :: UpdateTask -> Maybe Options
$sel:excludes:UpdateTask' :: UpdateTask -> Maybe [FilterRule]
$sel:name:UpdateTask' :: UpdateTask -> Maybe Text
$sel:includes:UpdateTask' :: UpdateTask -> Maybe [FilterRule]
$sel:schedule:UpdateTask' :: UpdateTask -> Maybe TaskSchedule
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Schedule" Text -> TaskSchedule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskSchedule -> Pair) -> Maybe TaskSchedule -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskSchedule
schedule,
            (Text
"Includes" Text -> [FilterRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FilterRule] -> Pair) -> Maybe [FilterRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FilterRule]
includes,
            (Text
"Name" 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
name,
            (Text
"Excludes" Text -> [FilterRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FilterRule] -> Pair) -> Maybe [FilterRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FilterRule]
excludes,
            (Text
"Options" Text -> Options -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Options -> Pair) -> Maybe Options -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Options
options,
            (Text
"CloudWatchLogGroupArn" 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
cloudWatchLogGroupArn,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateTaskResponse' 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', 'updateTaskResponse_httpStatus' - The response's http status code.
newUpdateTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateTaskResponse
newUpdateTaskResponse :: Int -> UpdateTaskResponse
newUpdateTaskResponse Int
pHttpStatus_ =
  UpdateTaskResponse' :: Int -> UpdateTaskResponse
UpdateTaskResponse' {$sel:httpStatus:UpdateTaskResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData UpdateTaskResponse