{-# 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.Signer.StartSigningJob
(
StartSigningJob (..),
newStartSigningJob,
startSigningJob_profileOwner,
startSigningJob_source,
startSigningJob_destination,
startSigningJob_profileName,
startSigningJob_clientRequestToken,
StartSigningJobResponse (..),
newStartSigningJobResponse,
startSigningJobResponse_jobId,
startSigningJobResponse_jobOwner,
startSigningJobResponse_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.Signer.Types
data StartSigningJob = StartSigningJob'
{
StartSigningJob -> Maybe Text
profileOwner :: Prelude.Maybe Prelude.Text,
StartSigningJob -> Source
source :: Source,
StartSigningJob -> Destination
destination :: Destination,
StartSigningJob -> Text
profileName :: Prelude.Text,
StartSigningJob -> Text
clientRequestToken :: Prelude.Text
}
deriving (StartSigningJob -> StartSigningJob -> Bool
(StartSigningJob -> StartSigningJob -> Bool)
-> (StartSigningJob -> StartSigningJob -> Bool)
-> Eq StartSigningJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSigningJob -> StartSigningJob -> Bool
$c/= :: StartSigningJob -> StartSigningJob -> Bool
== :: StartSigningJob -> StartSigningJob -> Bool
$c== :: StartSigningJob -> StartSigningJob -> Bool
Prelude.Eq, ReadPrec [StartSigningJob]
ReadPrec StartSigningJob
Int -> ReadS StartSigningJob
ReadS [StartSigningJob]
(Int -> ReadS StartSigningJob)
-> ReadS [StartSigningJob]
-> ReadPrec StartSigningJob
-> ReadPrec [StartSigningJob]
-> Read StartSigningJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSigningJob]
$creadListPrec :: ReadPrec [StartSigningJob]
readPrec :: ReadPrec StartSigningJob
$creadPrec :: ReadPrec StartSigningJob
readList :: ReadS [StartSigningJob]
$creadList :: ReadS [StartSigningJob]
readsPrec :: Int -> ReadS StartSigningJob
$creadsPrec :: Int -> ReadS StartSigningJob
Prelude.Read, Int -> StartSigningJob -> ShowS
[StartSigningJob] -> ShowS
StartSigningJob -> String
(Int -> StartSigningJob -> ShowS)
-> (StartSigningJob -> String)
-> ([StartSigningJob] -> ShowS)
-> Show StartSigningJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSigningJob] -> ShowS
$cshowList :: [StartSigningJob] -> ShowS
show :: StartSigningJob -> String
$cshow :: StartSigningJob -> String
showsPrec :: Int -> StartSigningJob -> ShowS
$cshowsPrec :: Int -> StartSigningJob -> ShowS
Prelude.Show, (forall x. StartSigningJob -> Rep StartSigningJob x)
-> (forall x. Rep StartSigningJob x -> StartSigningJob)
-> Generic StartSigningJob
forall x. Rep StartSigningJob x -> StartSigningJob
forall x. StartSigningJob -> Rep StartSigningJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSigningJob x -> StartSigningJob
$cfrom :: forall x. StartSigningJob -> Rep StartSigningJob x
Prelude.Generic)
newStartSigningJob ::
Source ->
Destination ->
Prelude.Text ->
Prelude.Text ->
StartSigningJob
newStartSigningJob :: Source -> Destination -> Text -> Text -> StartSigningJob
newStartSigningJob
Source
pSource_
Destination
pDestination_
Text
pProfileName_
Text
pClientRequestToken_ =
StartSigningJob' :: Maybe Text
-> Source -> Destination -> Text -> Text -> StartSigningJob
StartSigningJob'
{ $sel:profileOwner:StartSigningJob' :: Maybe Text
profileOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:source:StartSigningJob' :: Source
source = Source
pSource_,
$sel:destination:StartSigningJob' :: Destination
destination = Destination
pDestination_,
$sel:profileName:StartSigningJob' :: Text
profileName = Text
pProfileName_,
$sel:clientRequestToken:StartSigningJob' :: Text
clientRequestToken = Text
pClientRequestToken_
}
startSigningJob_profileOwner :: Lens.Lens' StartSigningJob (Prelude.Maybe Prelude.Text)
startSigningJob_profileOwner :: (Maybe Text -> f (Maybe Text))
-> StartSigningJob -> f StartSigningJob
startSigningJob_profileOwner = (StartSigningJob -> Maybe Text)
-> (StartSigningJob -> Maybe Text -> StartSigningJob)
-> Lens StartSigningJob StartSigningJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJob' {Maybe Text
profileOwner :: Maybe Text
$sel:profileOwner:StartSigningJob' :: StartSigningJob -> Maybe Text
profileOwner} -> Maybe Text
profileOwner) (\s :: StartSigningJob
s@StartSigningJob' {} Maybe Text
a -> StartSigningJob
s {$sel:profileOwner:StartSigningJob' :: Maybe Text
profileOwner = Maybe Text
a} :: StartSigningJob)
startSigningJob_source :: Lens.Lens' StartSigningJob Source
startSigningJob_source :: (Source -> f Source) -> StartSigningJob -> f StartSigningJob
startSigningJob_source = (StartSigningJob -> Source)
-> (StartSigningJob -> Source -> StartSigningJob)
-> Lens StartSigningJob StartSigningJob Source Source
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJob' {Source
source :: Source
$sel:source:StartSigningJob' :: StartSigningJob -> Source
source} -> Source
source) (\s :: StartSigningJob
s@StartSigningJob' {} Source
a -> StartSigningJob
s {$sel:source:StartSigningJob' :: Source
source = Source
a} :: StartSigningJob)
startSigningJob_destination :: Lens.Lens' StartSigningJob Destination
startSigningJob_destination :: (Destination -> f Destination)
-> StartSigningJob -> f StartSigningJob
startSigningJob_destination = (StartSigningJob -> Destination)
-> (StartSigningJob -> Destination -> StartSigningJob)
-> Lens StartSigningJob StartSigningJob Destination Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJob' {Destination
destination :: Destination
$sel:destination:StartSigningJob' :: StartSigningJob -> Destination
destination} -> Destination
destination) (\s :: StartSigningJob
s@StartSigningJob' {} Destination
a -> StartSigningJob
s {$sel:destination:StartSigningJob' :: Destination
destination = Destination
a} :: StartSigningJob)
startSigningJob_profileName :: Lens.Lens' StartSigningJob Prelude.Text
startSigningJob_profileName :: (Text -> f Text) -> StartSigningJob -> f StartSigningJob
startSigningJob_profileName = (StartSigningJob -> Text)
-> (StartSigningJob -> Text -> StartSigningJob)
-> Lens StartSigningJob StartSigningJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJob' {Text
profileName :: Text
$sel:profileName:StartSigningJob' :: StartSigningJob -> Text
profileName} -> Text
profileName) (\s :: StartSigningJob
s@StartSigningJob' {} Text
a -> StartSigningJob
s {$sel:profileName:StartSigningJob' :: Text
profileName = Text
a} :: StartSigningJob)
startSigningJob_clientRequestToken :: Lens.Lens' StartSigningJob Prelude.Text
startSigningJob_clientRequestToken :: (Text -> f Text) -> StartSigningJob -> f StartSigningJob
startSigningJob_clientRequestToken = (StartSigningJob -> Text)
-> (StartSigningJob -> Text -> StartSigningJob)
-> Lens StartSigningJob StartSigningJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJob' {Text
clientRequestToken :: Text
$sel:clientRequestToken:StartSigningJob' :: StartSigningJob -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: StartSigningJob
s@StartSigningJob' {} Text
a -> StartSigningJob
s {$sel:clientRequestToken:StartSigningJob' :: Text
clientRequestToken = Text
a} :: StartSigningJob)
instance Core.AWSRequest StartSigningJob where
type
AWSResponse StartSigningJob =
StartSigningJobResponse
request :: StartSigningJob -> Request StartSigningJob
request = Service -> StartSigningJob -> Request StartSigningJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartSigningJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSigningJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartSigningJob))
-> Logger
-> Service
-> Proxy StartSigningJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSigningJob)))
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 -> Maybe Text -> Int -> StartSigningJobResponse
StartSigningJobResponse'
(Maybe Text -> Maybe Text -> Int -> StartSigningJobResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> StartSigningJobResponse)
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
"jobId")
Either String (Maybe Text -> Int -> StartSigningJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartSigningJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"jobOwner")
Either String (Int -> StartSigningJobResponse)
-> Either String Int -> Either String StartSigningJobResponse
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 StartSigningJob
instance Prelude.NFData StartSigningJob
instance Core.ToHeaders StartSigningJob where
toHeaders :: StartSigningJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartSigningJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 StartSigningJob where
toJSON :: StartSigningJob -> Value
toJSON StartSigningJob' {Maybe Text
Text
Destination
Source
clientRequestToken :: Text
profileName :: Text
destination :: Destination
source :: Source
profileOwner :: Maybe Text
$sel:clientRequestToken:StartSigningJob' :: StartSigningJob -> Text
$sel:profileName:StartSigningJob' :: StartSigningJob -> Text
$sel:destination:StartSigningJob' :: StartSigningJob -> Destination
$sel:source:StartSigningJob' :: StartSigningJob -> Source
$sel:profileOwner:StartSigningJob' :: StartSigningJob -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"profileOwner" 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
profileOwner,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"source" Text -> Source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Source
source),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"destination" Text -> Destination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Destination
destination),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"profileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
profileName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"clientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientRequestToken)
]
)
instance Core.ToPath StartSigningJob where
toPath :: StartSigningJob -> ByteString
toPath = ByteString -> StartSigningJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/signing-jobs"
instance Core.ToQuery StartSigningJob where
toQuery :: StartSigningJob -> QueryString
toQuery = QueryString -> StartSigningJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartSigningJobResponse = StartSigningJobResponse'
{
StartSigningJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StartSigningJobResponse -> Maybe Text
jobOwner :: Prelude.Maybe Prelude.Text,
StartSigningJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartSigningJobResponse -> StartSigningJobResponse -> Bool
(StartSigningJobResponse -> StartSigningJobResponse -> Bool)
-> (StartSigningJobResponse -> StartSigningJobResponse -> Bool)
-> Eq StartSigningJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSigningJobResponse -> StartSigningJobResponse -> Bool
$c/= :: StartSigningJobResponse -> StartSigningJobResponse -> Bool
== :: StartSigningJobResponse -> StartSigningJobResponse -> Bool
$c== :: StartSigningJobResponse -> StartSigningJobResponse -> Bool
Prelude.Eq, ReadPrec [StartSigningJobResponse]
ReadPrec StartSigningJobResponse
Int -> ReadS StartSigningJobResponse
ReadS [StartSigningJobResponse]
(Int -> ReadS StartSigningJobResponse)
-> ReadS [StartSigningJobResponse]
-> ReadPrec StartSigningJobResponse
-> ReadPrec [StartSigningJobResponse]
-> Read StartSigningJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSigningJobResponse]
$creadListPrec :: ReadPrec [StartSigningJobResponse]
readPrec :: ReadPrec StartSigningJobResponse
$creadPrec :: ReadPrec StartSigningJobResponse
readList :: ReadS [StartSigningJobResponse]
$creadList :: ReadS [StartSigningJobResponse]
readsPrec :: Int -> ReadS StartSigningJobResponse
$creadsPrec :: Int -> ReadS StartSigningJobResponse
Prelude.Read, Int -> StartSigningJobResponse -> ShowS
[StartSigningJobResponse] -> ShowS
StartSigningJobResponse -> String
(Int -> StartSigningJobResponse -> ShowS)
-> (StartSigningJobResponse -> String)
-> ([StartSigningJobResponse] -> ShowS)
-> Show StartSigningJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSigningJobResponse] -> ShowS
$cshowList :: [StartSigningJobResponse] -> ShowS
show :: StartSigningJobResponse -> String
$cshow :: StartSigningJobResponse -> String
showsPrec :: Int -> StartSigningJobResponse -> ShowS
$cshowsPrec :: Int -> StartSigningJobResponse -> ShowS
Prelude.Show, (forall x.
StartSigningJobResponse -> Rep StartSigningJobResponse x)
-> (forall x.
Rep StartSigningJobResponse x -> StartSigningJobResponse)
-> Generic StartSigningJobResponse
forall x. Rep StartSigningJobResponse x -> StartSigningJobResponse
forall x. StartSigningJobResponse -> Rep StartSigningJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSigningJobResponse x -> StartSigningJobResponse
$cfrom :: forall x. StartSigningJobResponse -> Rep StartSigningJobResponse x
Prelude.Generic)
newStartSigningJobResponse ::
Prelude.Int ->
StartSigningJobResponse
newStartSigningJobResponse :: Int -> StartSigningJobResponse
newStartSigningJobResponse Int
pHttpStatus_ =
StartSigningJobResponse' :: Maybe Text -> Maybe Text -> Int -> StartSigningJobResponse
StartSigningJobResponse'
{ $sel:jobId:StartSigningJobResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobOwner:StartSigningJobResponse' :: Maybe Text
jobOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartSigningJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startSigningJobResponse_jobId :: Lens.Lens' StartSigningJobResponse (Prelude.Maybe Prelude.Text)
startSigningJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> StartSigningJobResponse -> f StartSigningJobResponse
startSigningJobResponse_jobId = (StartSigningJobResponse -> Maybe Text)
-> (StartSigningJobResponse
-> Maybe Text -> StartSigningJobResponse)
-> Lens
StartSigningJobResponse
StartSigningJobResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartSigningJobResponse' :: StartSigningJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartSigningJobResponse
s@StartSigningJobResponse' {} Maybe Text
a -> StartSigningJobResponse
s {$sel:jobId:StartSigningJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: StartSigningJobResponse)
startSigningJobResponse_jobOwner :: Lens.Lens' StartSigningJobResponse (Prelude.Maybe Prelude.Text)
startSigningJobResponse_jobOwner :: (Maybe Text -> f (Maybe Text))
-> StartSigningJobResponse -> f StartSigningJobResponse
startSigningJobResponse_jobOwner = (StartSigningJobResponse -> Maybe Text)
-> (StartSigningJobResponse
-> Maybe Text -> StartSigningJobResponse)
-> Lens
StartSigningJobResponse
StartSigningJobResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJobResponse' {Maybe Text
jobOwner :: Maybe Text
$sel:jobOwner:StartSigningJobResponse' :: StartSigningJobResponse -> Maybe Text
jobOwner} -> Maybe Text
jobOwner) (\s :: StartSigningJobResponse
s@StartSigningJobResponse' {} Maybe Text
a -> StartSigningJobResponse
s {$sel:jobOwner:StartSigningJobResponse' :: Maybe Text
jobOwner = Maybe Text
a} :: StartSigningJobResponse)
startSigningJobResponse_httpStatus :: Lens.Lens' StartSigningJobResponse Prelude.Int
startSigningJobResponse_httpStatus :: (Int -> f Int)
-> StartSigningJobResponse -> f StartSigningJobResponse
startSigningJobResponse_httpStatus = (StartSigningJobResponse -> Int)
-> (StartSigningJobResponse -> Int -> StartSigningJobResponse)
-> Lens StartSigningJobResponse StartSigningJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSigningJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartSigningJobResponse' :: StartSigningJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartSigningJobResponse
s@StartSigningJobResponse' {} Int
a -> StartSigningJobResponse
s {$sel:httpStatus:StartSigningJobResponse' :: Int
httpStatus = Int
a} :: StartSigningJobResponse)
instance Prelude.NFData StartSigningJobResponse