{-# 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 #-}
module Amazonka.DataSync.CreateTask
(
CreateTask (..),
newCreateTask,
createTask_schedule,
createTask_includes,
createTask_name,
createTask_excludes,
createTask_options,
createTask_cloudWatchLogGroupArn,
createTask_tags,
createTask_sourceLocationArn,
createTask_destinationLocationArn,
CreateTaskResponse (..),
newCreateTaskResponse,
createTaskResponse_taskArn,
createTaskResponse_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
data CreateTask = CreateTask'
{
CreateTask -> Maybe TaskSchedule
schedule :: Prelude.Maybe TaskSchedule,
CreateTask -> Maybe [FilterRule]
includes :: Prelude.Maybe [FilterRule],
CreateTask -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateTask -> Maybe [FilterRule]
excludes :: Prelude.Maybe [FilterRule],
CreateTask -> Maybe Options
options :: Prelude.Maybe Options,
CreateTask -> Maybe Text
cloudWatchLogGroupArn :: Prelude.Maybe Prelude.Text,
CreateTask -> Maybe [TagListEntry]
tags :: Prelude.Maybe [TagListEntry],
CreateTask -> Text
sourceLocationArn :: Prelude.Text,
CreateTask -> Text
destinationLocationArn :: Prelude.Text
}
deriving (CreateTask -> CreateTask -> Bool
(CreateTask -> CreateTask -> Bool)
-> (CreateTask -> CreateTask -> Bool) -> Eq CreateTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTask -> CreateTask -> Bool
$c/= :: CreateTask -> CreateTask -> Bool
== :: CreateTask -> CreateTask -> Bool
$c== :: CreateTask -> CreateTask -> Bool
Prelude.Eq, ReadPrec [CreateTask]
ReadPrec CreateTask
Int -> ReadS CreateTask
ReadS [CreateTask]
(Int -> ReadS CreateTask)
-> ReadS [CreateTask]
-> ReadPrec CreateTask
-> ReadPrec [CreateTask]
-> Read CreateTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTask]
$creadListPrec :: ReadPrec [CreateTask]
readPrec :: ReadPrec CreateTask
$creadPrec :: ReadPrec CreateTask
readList :: ReadS [CreateTask]
$creadList :: ReadS [CreateTask]
readsPrec :: Int -> ReadS CreateTask
$creadsPrec :: Int -> ReadS CreateTask
Prelude.Read, Int -> CreateTask -> ShowS
[CreateTask] -> ShowS
CreateTask -> String
(Int -> CreateTask -> ShowS)
-> (CreateTask -> String)
-> ([CreateTask] -> ShowS)
-> Show CreateTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTask] -> ShowS
$cshowList :: [CreateTask] -> ShowS
show :: CreateTask -> String
$cshow :: CreateTask -> String
showsPrec :: Int -> CreateTask -> ShowS
$cshowsPrec :: Int -> CreateTask -> ShowS
Prelude.Show, (forall x. CreateTask -> Rep CreateTask x)
-> (forall x. Rep CreateTask x -> CreateTask) -> Generic CreateTask
forall x. Rep CreateTask x -> CreateTask
forall x. CreateTask -> Rep CreateTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTask x -> CreateTask
$cfrom :: forall x. CreateTask -> Rep CreateTask x
Prelude.Generic)
newCreateTask ::
Prelude.Text ->
Prelude.Text ->
CreateTask
newCreateTask :: Text -> Text -> CreateTask
newCreateTask
Text
pSourceLocationArn_
Text
pDestinationLocationArn_ =
CreateTask' :: Maybe TaskSchedule
-> Maybe [FilterRule]
-> Maybe Text
-> Maybe [FilterRule]
-> Maybe Options
-> Maybe Text
-> Maybe [TagListEntry]
-> Text
-> Text
-> CreateTask
CreateTask'
{ $sel:schedule:CreateTask' :: Maybe TaskSchedule
schedule = Maybe TaskSchedule
forall a. Maybe a
Prelude.Nothing,
$sel:includes:CreateTask' :: Maybe [FilterRule]
includes = Maybe [FilterRule]
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateTask' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:excludes:CreateTask' :: Maybe [FilterRule]
excludes = Maybe [FilterRule]
forall a. Maybe a
Prelude.Nothing,
$sel:options:CreateTask' :: Maybe Options
options = Maybe Options
forall a. Maybe a
Prelude.Nothing,
$sel:cloudWatchLogGroupArn:CreateTask' :: Maybe Text
cloudWatchLogGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateTask' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
forall a. Maybe a
Prelude.Nothing,
$sel:sourceLocationArn:CreateTask' :: Text
sourceLocationArn = Text
pSourceLocationArn_,
$sel:destinationLocationArn:CreateTask' :: Text
destinationLocationArn = Text
pDestinationLocationArn_
}
createTask_schedule :: Lens.Lens' CreateTask (Prelude.Maybe TaskSchedule)
createTask_schedule :: (Maybe TaskSchedule -> f (Maybe TaskSchedule))
-> CreateTask -> f CreateTask
createTask_schedule = (CreateTask -> Maybe TaskSchedule)
-> (CreateTask -> Maybe TaskSchedule -> CreateTask)
-> Lens
CreateTask CreateTask (Maybe TaskSchedule) (Maybe TaskSchedule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe TaskSchedule
schedule :: Maybe TaskSchedule
$sel:schedule:CreateTask' :: CreateTask -> Maybe TaskSchedule
schedule} -> Maybe TaskSchedule
schedule) (\s :: CreateTask
s@CreateTask' {} Maybe TaskSchedule
a -> CreateTask
s {$sel:schedule:CreateTask' :: Maybe TaskSchedule
schedule = Maybe TaskSchedule
a} :: CreateTask)
createTask_includes :: Lens.Lens' CreateTask (Prelude.Maybe [FilterRule])
createTask_includes :: (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> CreateTask -> f CreateTask
createTask_includes = (CreateTask -> Maybe [FilterRule])
-> (CreateTask -> Maybe [FilterRule] -> CreateTask)
-> Lens
CreateTask CreateTask (Maybe [FilterRule]) (Maybe [FilterRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe [FilterRule]
includes :: Maybe [FilterRule]
$sel:includes:CreateTask' :: CreateTask -> Maybe [FilterRule]
includes} -> Maybe [FilterRule]
includes) (\s :: CreateTask
s@CreateTask' {} Maybe [FilterRule]
a -> CreateTask
s {$sel:includes:CreateTask' :: Maybe [FilterRule]
includes = Maybe [FilterRule]
a} :: CreateTask) ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> CreateTask -> f CreateTask)
-> ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> CreateTask
-> f CreateTask
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
createTask_name :: Lens.Lens' CreateTask (Prelude.Maybe Prelude.Text)
createTask_name :: (Maybe Text -> f (Maybe Text)) -> CreateTask -> f CreateTask
createTask_name = (CreateTask -> Maybe Text)
-> (CreateTask -> Maybe Text -> CreateTask)
-> Lens CreateTask CreateTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe Text
name :: Maybe Text
$sel:name:CreateTask' :: CreateTask -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateTask
s@CreateTask' {} Maybe Text
a -> CreateTask
s {$sel:name:CreateTask' :: Maybe Text
name = Maybe Text
a} :: CreateTask)
createTask_excludes :: Lens.Lens' CreateTask (Prelude.Maybe [FilterRule])
createTask_excludes :: (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> CreateTask -> f CreateTask
createTask_excludes = (CreateTask -> Maybe [FilterRule])
-> (CreateTask -> Maybe [FilterRule] -> CreateTask)
-> Lens
CreateTask CreateTask (Maybe [FilterRule]) (Maybe [FilterRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe [FilterRule]
excludes :: Maybe [FilterRule]
$sel:excludes:CreateTask' :: CreateTask -> Maybe [FilterRule]
excludes} -> Maybe [FilterRule]
excludes) (\s :: CreateTask
s@CreateTask' {} Maybe [FilterRule]
a -> CreateTask
s {$sel:excludes:CreateTask' :: Maybe [FilterRule]
excludes = Maybe [FilterRule]
a} :: CreateTask) ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> CreateTask -> f CreateTask)
-> ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> CreateTask
-> f CreateTask
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
createTask_options :: Lens.Lens' CreateTask (Prelude.Maybe Options)
createTask_options :: (Maybe Options -> f (Maybe Options)) -> CreateTask -> f CreateTask
createTask_options = (CreateTask -> Maybe Options)
-> (CreateTask -> Maybe Options -> CreateTask)
-> Lens CreateTask CreateTask (Maybe Options) (Maybe Options)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe Options
options :: Maybe Options
$sel:options:CreateTask' :: CreateTask -> Maybe Options
options} -> Maybe Options
options) (\s :: CreateTask
s@CreateTask' {} Maybe Options
a -> CreateTask
s {$sel:options:CreateTask' :: Maybe Options
options = Maybe Options
a} :: CreateTask)
createTask_cloudWatchLogGroupArn :: Lens.Lens' CreateTask (Prelude.Maybe Prelude.Text)
createTask_cloudWatchLogGroupArn :: (Maybe Text -> f (Maybe Text)) -> CreateTask -> f CreateTask
createTask_cloudWatchLogGroupArn = (CreateTask -> Maybe Text)
-> (CreateTask -> Maybe Text -> CreateTask)
-> Lens CreateTask CreateTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe Text
cloudWatchLogGroupArn :: Maybe Text
$sel:cloudWatchLogGroupArn:CreateTask' :: CreateTask -> Maybe Text
cloudWatchLogGroupArn} -> Maybe Text
cloudWatchLogGroupArn) (\s :: CreateTask
s@CreateTask' {} Maybe Text
a -> CreateTask
s {$sel:cloudWatchLogGroupArn:CreateTask' :: Maybe Text
cloudWatchLogGroupArn = Maybe Text
a} :: CreateTask)
createTask_tags :: Lens.Lens' CreateTask (Prelude.Maybe [TagListEntry])
createTask_tags :: (Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateTask -> f CreateTask
createTask_tags = (CreateTask -> Maybe [TagListEntry])
-> (CreateTask -> Maybe [TagListEntry] -> CreateTask)
-> Lens
CreateTask CreateTask (Maybe [TagListEntry]) (Maybe [TagListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Maybe [TagListEntry]
tags :: Maybe [TagListEntry]
$sel:tags:CreateTask' :: CreateTask -> Maybe [TagListEntry]
tags} -> Maybe [TagListEntry]
tags) (\s :: CreateTask
s@CreateTask' {} Maybe [TagListEntry]
a -> CreateTask
s {$sel:tags:CreateTask' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
a} :: CreateTask) ((Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateTask -> f CreateTask)
-> ((Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> (Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateTask
-> f CreateTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TagListEntry] [TagListEntry] [TagListEntry] [TagListEntry]
-> Iso
(Maybe [TagListEntry])
(Maybe [TagListEntry])
(Maybe [TagListEntry])
(Maybe [TagListEntry])
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 [TagListEntry] [TagListEntry] [TagListEntry] [TagListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createTask_sourceLocationArn :: Lens.Lens' CreateTask Prelude.Text
createTask_sourceLocationArn :: (Text -> f Text) -> CreateTask -> f CreateTask
createTask_sourceLocationArn = (CreateTask -> Text)
-> (CreateTask -> Text -> CreateTask)
-> Lens CreateTask CreateTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Text
sourceLocationArn :: Text
$sel:sourceLocationArn:CreateTask' :: CreateTask -> Text
sourceLocationArn} -> Text
sourceLocationArn) (\s :: CreateTask
s@CreateTask' {} Text
a -> CreateTask
s {$sel:sourceLocationArn:CreateTask' :: Text
sourceLocationArn = Text
a} :: CreateTask)
createTask_destinationLocationArn :: Lens.Lens' CreateTask Prelude.Text
createTask_destinationLocationArn :: (Text -> f Text) -> CreateTask -> f CreateTask
createTask_destinationLocationArn = (CreateTask -> Text)
-> (CreateTask -> Text -> CreateTask)
-> Lens CreateTask CreateTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTask' {Text
destinationLocationArn :: Text
$sel:destinationLocationArn:CreateTask' :: CreateTask -> Text
destinationLocationArn} -> Text
destinationLocationArn) (\s :: CreateTask
s@CreateTask' {} Text
a -> CreateTask
s {$sel:destinationLocationArn:CreateTask' :: Text
destinationLocationArn = Text
a} :: CreateTask)
instance Core.AWSRequest CreateTask where
type AWSResponse CreateTask = CreateTaskResponse
request :: CreateTask -> Request CreateTask
request = Service -> CreateTask -> Request CreateTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTask)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateTask))
-> Logger
-> Service
-> Proxy CreateTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTask)))
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 -> CreateTaskResponse
CreateTaskResponse'
(Maybe Text -> Int -> CreateTaskResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateTaskResponse)
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
"TaskArn")
Either String (Int -> CreateTaskResponse)
-> Either String Int -> Either String CreateTaskResponse
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 CreateTask
instance Prelude.NFData CreateTask
instance Core.ToHeaders CreateTask where
toHeaders :: CreateTask -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateTask -> 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.CreateTask" :: 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 CreateTask where
toJSON :: CreateTask -> Value
toJSON CreateTask' {Maybe [FilterRule]
Maybe [TagListEntry]
Maybe Text
Maybe TaskSchedule
Maybe Options
Text
destinationLocationArn :: Text
sourceLocationArn :: Text
tags :: Maybe [TagListEntry]
cloudWatchLogGroupArn :: Maybe Text
options :: Maybe Options
excludes :: Maybe [FilterRule]
name :: Maybe Text
includes :: Maybe [FilterRule]
schedule :: Maybe TaskSchedule
$sel:destinationLocationArn:CreateTask' :: CreateTask -> Text
$sel:sourceLocationArn:CreateTask' :: CreateTask -> Text
$sel:tags:CreateTask' :: CreateTask -> Maybe [TagListEntry]
$sel:cloudWatchLogGroupArn:CreateTask' :: CreateTask -> Maybe Text
$sel:options:CreateTask' :: CreateTask -> Maybe Options
$sel:excludes:CreateTask' :: CreateTask -> Maybe [FilterRule]
$sel:name:CreateTask' :: CreateTask -> Maybe Text
$sel:includes:CreateTask' :: CreateTask -> Maybe [FilterRule]
$sel:schedule:CreateTask' :: CreateTask -> 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,
(Text
"Tags" Text -> [TagListEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([TagListEntry] -> Pair) -> Maybe [TagListEntry] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagListEntry]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SourceLocationArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceLocationArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DestinationLocationArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationLocationArn
)
]
)
instance Core.ToPath CreateTask where
toPath :: CreateTask -> ByteString
toPath = ByteString -> CreateTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateTask where
toQuery :: CreateTask -> QueryString
toQuery = QueryString -> CreateTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateTaskResponse = CreateTaskResponse'
{
CreateTaskResponse -> Maybe Text
taskArn :: Prelude.Maybe Prelude.Text,
CreateTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateTaskResponse -> CreateTaskResponse -> Bool
(CreateTaskResponse -> CreateTaskResponse -> Bool)
-> (CreateTaskResponse -> CreateTaskResponse -> Bool)
-> Eq CreateTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTaskResponse -> CreateTaskResponse -> Bool
$c/= :: CreateTaskResponse -> CreateTaskResponse -> Bool
== :: CreateTaskResponse -> CreateTaskResponse -> Bool
$c== :: CreateTaskResponse -> CreateTaskResponse -> Bool
Prelude.Eq, ReadPrec [CreateTaskResponse]
ReadPrec CreateTaskResponse
Int -> ReadS CreateTaskResponse
ReadS [CreateTaskResponse]
(Int -> ReadS CreateTaskResponse)
-> ReadS [CreateTaskResponse]
-> ReadPrec CreateTaskResponse
-> ReadPrec [CreateTaskResponse]
-> Read CreateTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTaskResponse]
$creadListPrec :: ReadPrec [CreateTaskResponse]
readPrec :: ReadPrec CreateTaskResponse
$creadPrec :: ReadPrec CreateTaskResponse
readList :: ReadS [CreateTaskResponse]
$creadList :: ReadS [CreateTaskResponse]
readsPrec :: Int -> ReadS CreateTaskResponse
$creadsPrec :: Int -> ReadS CreateTaskResponse
Prelude.Read, Int -> CreateTaskResponse -> ShowS
[CreateTaskResponse] -> ShowS
CreateTaskResponse -> String
(Int -> CreateTaskResponse -> ShowS)
-> (CreateTaskResponse -> String)
-> ([CreateTaskResponse] -> ShowS)
-> Show CreateTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTaskResponse] -> ShowS
$cshowList :: [CreateTaskResponse] -> ShowS
show :: CreateTaskResponse -> String
$cshow :: CreateTaskResponse -> String
showsPrec :: Int -> CreateTaskResponse -> ShowS
$cshowsPrec :: Int -> CreateTaskResponse -> ShowS
Prelude.Show, (forall x. CreateTaskResponse -> Rep CreateTaskResponse x)
-> (forall x. Rep CreateTaskResponse x -> CreateTaskResponse)
-> Generic CreateTaskResponse
forall x. Rep CreateTaskResponse x -> CreateTaskResponse
forall x. CreateTaskResponse -> Rep CreateTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTaskResponse x -> CreateTaskResponse
$cfrom :: forall x. CreateTaskResponse -> Rep CreateTaskResponse x
Prelude.Generic)
newCreateTaskResponse ::
Prelude.Int ->
CreateTaskResponse
newCreateTaskResponse :: Int -> CreateTaskResponse
newCreateTaskResponse Int
pHttpStatus_ =
CreateTaskResponse' :: Maybe Text -> Int -> CreateTaskResponse
CreateTaskResponse'
{ $sel:taskArn:CreateTaskResponse' :: Maybe Text
taskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createTaskResponse_taskArn :: Lens.Lens' CreateTaskResponse (Prelude.Maybe Prelude.Text)
createTaskResponse_taskArn :: (Maybe Text -> f (Maybe Text))
-> CreateTaskResponse -> f CreateTaskResponse
createTaskResponse_taskArn = (CreateTaskResponse -> Maybe Text)
-> (CreateTaskResponse -> Maybe Text -> CreateTaskResponse)
-> Lens
CreateTaskResponse CreateTaskResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskResponse' {Maybe Text
taskArn :: Maybe Text
$sel:taskArn:CreateTaskResponse' :: CreateTaskResponse -> Maybe Text
taskArn} -> Maybe Text
taskArn) (\s :: CreateTaskResponse
s@CreateTaskResponse' {} Maybe Text
a -> CreateTaskResponse
s {$sel:taskArn:CreateTaskResponse' :: Maybe Text
taskArn = Maybe Text
a} :: CreateTaskResponse)
createTaskResponse_httpStatus :: Lens.Lens' CreateTaskResponse Prelude.Int
createTaskResponse_httpStatus :: (Int -> f Int) -> CreateTaskResponse -> f CreateTaskResponse
createTaskResponse_httpStatus = (CreateTaskResponse -> Int)
-> (CreateTaskResponse -> Int -> CreateTaskResponse)
-> Lens CreateTaskResponse CreateTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateTaskResponse' :: CreateTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateTaskResponse
s@CreateTaskResponse' {} Int
a -> CreateTaskResponse
s {$sel:httpStatus:CreateTaskResponse' :: Int
httpStatus = Int
a} :: CreateTaskResponse)
instance Prelude.NFData CreateTaskResponse