{-# 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.MigrationHub.AssociateCreatedArtifact
(
AssociateCreatedArtifact (..),
newAssociateCreatedArtifact,
associateCreatedArtifact_dryRun,
associateCreatedArtifact_progressUpdateStream,
associateCreatedArtifact_migrationTaskName,
associateCreatedArtifact_createdArtifact,
AssociateCreatedArtifactResponse (..),
newAssociateCreatedArtifactResponse,
associateCreatedArtifactResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MigrationHub.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateCreatedArtifact = AssociateCreatedArtifact'
{
AssociateCreatedArtifact -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
AssociateCreatedArtifact -> Text
progressUpdateStream :: Prelude.Text,
AssociateCreatedArtifact -> Text
migrationTaskName :: Prelude.Text,
AssociateCreatedArtifact -> CreatedArtifact
createdArtifact :: CreatedArtifact
}
deriving (AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool
(AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool)
-> (AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool)
-> Eq AssociateCreatedArtifact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool
$c/= :: AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool
== :: AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool
$c== :: AssociateCreatedArtifact -> AssociateCreatedArtifact -> Bool
Prelude.Eq, ReadPrec [AssociateCreatedArtifact]
ReadPrec AssociateCreatedArtifact
Int -> ReadS AssociateCreatedArtifact
ReadS [AssociateCreatedArtifact]
(Int -> ReadS AssociateCreatedArtifact)
-> ReadS [AssociateCreatedArtifact]
-> ReadPrec AssociateCreatedArtifact
-> ReadPrec [AssociateCreatedArtifact]
-> Read AssociateCreatedArtifact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateCreatedArtifact]
$creadListPrec :: ReadPrec [AssociateCreatedArtifact]
readPrec :: ReadPrec AssociateCreatedArtifact
$creadPrec :: ReadPrec AssociateCreatedArtifact
readList :: ReadS [AssociateCreatedArtifact]
$creadList :: ReadS [AssociateCreatedArtifact]
readsPrec :: Int -> ReadS AssociateCreatedArtifact
$creadsPrec :: Int -> ReadS AssociateCreatedArtifact
Prelude.Read, Int -> AssociateCreatedArtifact -> ShowS
[AssociateCreatedArtifact] -> ShowS
AssociateCreatedArtifact -> String
(Int -> AssociateCreatedArtifact -> ShowS)
-> (AssociateCreatedArtifact -> String)
-> ([AssociateCreatedArtifact] -> ShowS)
-> Show AssociateCreatedArtifact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateCreatedArtifact] -> ShowS
$cshowList :: [AssociateCreatedArtifact] -> ShowS
show :: AssociateCreatedArtifact -> String
$cshow :: AssociateCreatedArtifact -> String
showsPrec :: Int -> AssociateCreatedArtifact -> ShowS
$cshowsPrec :: Int -> AssociateCreatedArtifact -> ShowS
Prelude.Show, (forall x.
AssociateCreatedArtifact -> Rep AssociateCreatedArtifact x)
-> (forall x.
Rep AssociateCreatedArtifact x -> AssociateCreatedArtifact)
-> Generic AssociateCreatedArtifact
forall x.
Rep AssociateCreatedArtifact x -> AssociateCreatedArtifact
forall x.
AssociateCreatedArtifact -> Rep AssociateCreatedArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateCreatedArtifact x -> AssociateCreatedArtifact
$cfrom :: forall x.
AssociateCreatedArtifact -> Rep AssociateCreatedArtifact x
Prelude.Generic)
newAssociateCreatedArtifact ::
Prelude.Text ->
Prelude.Text ->
CreatedArtifact ->
AssociateCreatedArtifact
newAssociateCreatedArtifact :: Text -> Text -> CreatedArtifact -> AssociateCreatedArtifact
newAssociateCreatedArtifact
Text
pProgressUpdateStream_
Text
pMigrationTaskName_
CreatedArtifact
pCreatedArtifact_ =
AssociateCreatedArtifact' :: Maybe Bool
-> Text -> Text -> CreatedArtifact -> AssociateCreatedArtifact
AssociateCreatedArtifact'
{ $sel:dryRun:AssociateCreatedArtifact' :: Maybe Bool
dryRun = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:progressUpdateStream:AssociateCreatedArtifact' :: Text
progressUpdateStream = Text
pProgressUpdateStream_,
$sel:migrationTaskName:AssociateCreatedArtifact' :: Text
migrationTaskName = Text
pMigrationTaskName_,
$sel:createdArtifact:AssociateCreatedArtifact' :: CreatedArtifact
createdArtifact = CreatedArtifact
pCreatedArtifact_
}
associateCreatedArtifact_dryRun :: Lens.Lens' AssociateCreatedArtifact (Prelude.Maybe Prelude.Bool)
associateCreatedArtifact_dryRun :: (Maybe Bool -> f (Maybe Bool))
-> AssociateCreatedArtifact -> f AssociateCreatedArtifact
associateCreatedArtifact_dryRun = (AssociateCreatedArtifact -> Maybe Bool)
-> (AssociateCreatedArtifact
-> Maybe Bool -> AssociateCreatedArtifact)
-> Lens
AssociateCreatedArtifact
AssociateCreatedArtifact
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateCreatedArtifact' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: AssociateCreatedArtifact
s@AssociateCreatedArtifact' {} Maybe Bool
a -> AssociateCreatedArtifact
s {$sel:dryRun:AssociateCreatedArtifact' :: Maybe Bool
dryRun = Maybe Bool
a} :: AssociateCreatedArtifact)
associateCreatedArtifact_progressUpdateStream :: Lens.Lens' AssociateCreatedArtifact Prelude.Text
associateCreatedArtifact_progressUpdateStream :: (Text -> f Text)
-> AssociateCreatedArtifact -> f AssociateCreatedArtifact
associateCreatedArtifact_progressUpdateStream = (AssociateCreatedArtifact -> Text)
-> (AssociateCreatedArtifact -> Text -> AssociateCreatedArtifact)
-> Lens AssociateCreatedArtifact AssociateCreatedArtifact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateCreatedArtifact' {Text
progressUpdateStream :: Text
$sel:progressUpdateStream:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> Text
progressUpdateStream} -> Text
progressUpdateStream) (\s :: AssociateCreatedArtifact
s@AssociateCreatedArtifact' {} Text
a -> AssociateCreatedArtifact
s {$sel:progressUpdateStream:AssociateCreatedArtifact' :: Text
progressUpdateStream = Text
a} :: AssociateCreatedArtifact)
associateCreatedArtifact_migrationTaskName :: Lens.Lens' AssociateCreatedArtifact Prelude.Text
associateCreatedArtifact_migrationTaskName :: (Text -> f Text)
-> AssociateCreatedArtifact -> f AssociateCreatedArtifact
associateCreatedArtifact_migrationTaskName = (AssociateCreatedArtifact -> Text)
-> (AssociateCreatedArtifact -> Text -> AssociateCreatedArtifact)
-> Lens AssociateCreatedArtifact AssociateCreatedArtifact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateCreatedArtifact' {Text
migrationTaskName :: Text
$sel:migrationTaskName:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> Text
migrationTaskName} -> Text
migrationTaskName) (\s :: AssociateCreatedArtifact
s@AssociateCreatedArtifact' {} Text
a -> AssociateCreatedArtifact
s {$sel:migrationTaskName:AssociateCreatedArtifact' :: Text
migrationTaskName = Text
a} :: AssociateCreatedArtifact)
associateCreatedArtifact_createdArtifact :: Lens.Lens' AssociateCreatedArtifact CreatedArtifact
associateCreatedArtifact_createdArtifact :: (CreatedArtifact -> f CreatedArtifact)
-> AssociateCreatedArtifact -> f AssociateCreatedArtifact
associateCreatedArtifact_createdArtifact = (AssociateCreatedArtifact -> CreatedArtifact)
-> (AssociateCreatedArtifact
-> CreatedArtifact -> AssociateCreatedArtifact)
-> Lens
AssociateCreatedArtifact
AssociateCreatedArtifact
CreatedArtifact
CreatedArtifact
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateCreatedArtifact' {CreatedArtifact
createdArtifact :: CreatedArtifact
$sel:createdArtifact:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> CreatedArtifact
createdArtifact} -> CreatedArtifact
createdArtifact) (\s :: AssociateCreatedArtifact
s@AssociateCreatedArtifact' {} CreatedArtifact
a -> AssociateCreatedArtifact
s {$sel:createdArtifact:AssociateCreatedArtifact' :: CreatedArtifact
createdArtifact = CreatedArtifact
a} :: AssociateCreatedArtifact)
instance Core.AWSRequest AssociateCreatedArtifact where
type
AWSResponse AssociateCreatedArtifact =
AssociateCreatedArtifactResponse
request :: AssociateCreatedArtifact -> Request AssociateCreatedArtifact
request = Service
-> AssociateCreatedArtifact -> Request AssociateCreatedArtifact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateCreatedArtifact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateCreatedArtifact)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AssociateCreatedArtifact))
-> Logger
-> Service
-> Proxy AssociateCreatedArtifact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateCreatedArtifact)))
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 -> AssociateCreatedArtifactResponse
AssociateCreatedArtifactResponse'
(Int -> AssociateCreatedArtifactResponse)
-> Either String Int
-> Either String AssociateCreatedArtifactResponse
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 AssociateCreatedArtifact
instance Prelude.NFData AssociateCreatedArtifact
instance Core.ToHeaders AssociateCreatedArtifact where
toHeaders :: AssociateCreatedArtifact -> ResponseHeaders
toHeaders =
ResponseHeaders -> AssociateCreatedArtifact -> 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
"AWSMigrationHub.AssociateCreatedArtifact" ::
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 AssociateCreatedArtifact where
toJSON :: AssociateCreatedArtifact -> Value
toJSON AssociateCreatedArtifact' {Maybe Bool
Text
CreatedArtifact
createdArtifact :: CreatedArtifact
migrationTaskName :: Text
progressUpdateStream :: Text
dryRun :: Maybe Bool
$sel:createdArtifact:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> CreatedArtifact
$sel:migrationTaskName:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> Text
$sel:progressUpdateStream:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> Text
$sel:dryRun:AssociateCreatedArtifact' :: AssociateCreatedArtifact -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DryRun" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
dryRun,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ProgressUpdateStream"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
progressUpdateStream
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"MigrationTaskName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
migrationTaskName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"CreatedArtifact" Text -> CreatedArtifact -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CreatedArtifact
createdArtifact)
]
)
instance Core.ToPath AssociateCreatedArtifact where
toPath :: AssociateCreatedArtifact -> ByteString
toPath = ByteString -> AssociateCreatedArtifact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AssociateCreatedArtifact where
toQuery :: AssociateCreatedArtifact -> QueryString
toQuery = QueryString -> AssociateCreatedArtifact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateCreatedArtifactResponse = AssociateCreatedArtifactResponse'
{
AssociateCreatedArtifactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool
(AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool)
-> (AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool)
-> Eq AssociateCreatedArtifactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool
$c/= :: AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool
== :: AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool
$c== :: AssociateCreatedArtifactResponse
-> AssociateCreatedArtifactResponse -> Bool
Prelude.Eq, ReadPrec [AssociateCreatedArtifactResponse]
ReadPrec AssociateCreatedArtifactResponse
Int -> ReadS AssociateCreatedArtifactResponse
ReadS [AssociateCreatedArtifactResponse]
(Int -> ReadS AssociateCreatedArtifactResponse)
-> ReadS [AssociateCreatedArtifactResponse]
-> ReadPrec AssociateCreatedArtifactResponse
-> ReadPrec [AssociateCreatedArtifactResponse]
-> Read AssociateCreatedArtifactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateCreatedArtifactResponse]
$creadListPrec :: ReadPrec [AssociateCreatedArtifactResponse]
readPrec :: ReadPrec AssociateCreatedArtifactResponse
$creadPrec :: ReadPrec AssociateCreatedArtifactResponse
readList :: ReadS [AssociateCreatedArtifactResponse]
$creadList :: ReadS [AssociateCreatedArtifactResponse]
readsPrec :: Int -> ReadS AssociateCreatedArtifactResponse
$creadsPrec :: Int -> ReadS AssociateCreatedArtifactResponse
Prelude.Read, Int -> AssociateCreatedArtifactResponse -> ShowS
[AssociateCreatedArtifactResponse] -> ShowS
AssociateCreatedArtifactResponse -> String
(Int -> AssociateCreatedArtifactResponse -> ShowS)
-> (AssociateCreatedArtifactResponse -> String)
-> ([AssociateCreatedArtifactResponse] -> ShowS)
-> Show AssociateCreatedArtifactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateCreatedArtifactResponse] -> ShowS
$cshowList :: [AssociateCreatedArtifactResponse] -> ShowS
show :: AssociateCreatedArtifactResponse -> String
$cshow :: AssociateCreatedArtifactResponse -> String
showsPrec :: Int -> AssociateCreatedArtifactResponse -> ShowS
$cshowsPrec :: Int -> AssociateCreatedArtifactResponse -> ShowS
Prelude.Show, (forall x.
AssociateCreatedArtifactResponse
-> Rep AssociateCreatedArtifactResponse x)
-> (forall x.
Rep AssociateCreatedArtifactResponse x
-> AssociateCreatedArtifactResponse)
-> Generic AssociateCreatedArtifactResponse
forall x.
Rep AssociateCreatedArtifactResponse x
-> AssociateCreatedArtifactResponse
forall x.
AssociateCreatedArtifactResponse
-> Rep AssociateCreatedArtifactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateCreatedArtifactResponse x
-> AssociateCreatedArtifactResponse
$cfrom :: forall x.
AssociateCreatedArtifactResponse
-> Rep AssociateCreatedArtifactResponse x
Prelude.Generic)
newAssociateCreatedArtifactResponse ::
Prelude.Int ->
AssociateCreatedArtifactResponse
newAssociateCreatedArtifactResponse :: Int -> AssociateCreatedArtifactResponse
newAssociateCreatedArtifactResponse Int
pHttpStatus_ =
AssociateCreatedArtifactResponse' :: Int -> AssociateCreatedArtifactResponse
AssociateCreatedArtifactResponse'
{ $sel:httpStatus:AssociateCreatedArtifactResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateCreatedArtifactResponse_httpStatus :: Lens.Lens' AssociateCreatedArtifactResponse Prelude.Int
associateCreatedArtifactResponse_httpStatus :: (Int -> f Int)
-> AssociateCreatedArtifactResponse
-> f AssociateCreatedArtifactResponse
associateCreatedArtifactResponse_httpStatus = (AssociateCreatedArtifactResponse -> Int)
-> (AssociateCreatedArtifactResponse
-> Int -> AssociateCreatedArtifactResponse)
-> Lens
AssociateCreatedArtifactResponse
AssociateCreatedArtifactResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateCreatedArtifactResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateCreatedArtifactResponse' :: AssociateCreatedArtifactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateCreatedArtifactResponse
s@AssociateCreatedArtifactResponse' {} Int
a -> AssociateCreatedArtifactResponse
s {$sel:httpStatus:AssociateCreatedArtifactResponse' :: Int
httpStatus = Int
a} :: AssociateCreatedArtifactResponse)
instance
Prelude.NFData
AssociateCreatedArtifactResponse