{-# 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.IAM.UploadSigningCertificate
(
UploadSigningCertificate (..),
newUploadSigningCertificate,
uploadSigningCertificate_userName,
uploadSigningCertificate_certificateBody,
UploadSigningCertificateResponse (..),
newUploadSigningCertificateResponse,
uploadSigningCertificateResponse_httpStatus,
uploadSigningCertificateResponse_certificate,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IAM.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 UploadSigningCertificate = UploadSigningCertificate'
{
UploadSigningCertificate -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
UploadSigningCertificate -> Text
certificateBody :: Prelude.Text
}
deriving (UploadSigningCertificate -> UploadSigningCertificate -> Bool
(UploadSigningCertificate -> UploadSigningCertificate -> Bool)
-> (UploadSigningCertificate -> UploadSigningCertificate -> Bool)
-> Eq UploadSigningCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadSigningCertificate -> UploadSigningCertificate -> Bool
$c/= :: UploadSigningCertificate -> UploadSigningCertificate -> Bool
== :: UploadSigningCertificate -> UploadSigningCertificate -> Bool
$c== :: UploadSigningCertificate -> UploadSigningCertificate -> Bool
Prelude.Eq, ReadPrec [UploadSigningCertificate]
ReadPrec UploadSigningCertificate
Int -> ReadS UploadSigningCertificate
ReadS [UploadSigningCertificate]
(Int -> ReadS UploadSigningCertificate)
-> ReadS [UploadSigningCertificate]
-> ReadPrec UploadSigningCertificate
-> ReadPrec [UploadSigningCertificate]
-> Read UploadSigningCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadSigningCertificate]
$creadListPrec :: ReadPrec [UploadSigningCertificate]
readPrec :: ReadPrec UploadSigningCertificate
$creadPrec :: ReadPrec UploadSigningCertificate
readList :: ReadS [UploadSigningCertificate]
$creadList :: ReadS [UploadSigningCertificate]
readsPrec :: Int -> ReadS UploadSigningCertificate
$creadsPrec :: Int -> ReadS UploadSigningCertificate
Prelude.Read, Int -> UploadSigningCertificate -> ShowS
[UploadSigningCertificate] -> ShowS
UploadSigningCertificate -> String
(Int -> UploadSigningCertificate -> ShowS)
-> (UploadSigningCertificate -> String)
-> ([UploadSigningCertificate] -> ShowS)
-> Show UploadSigningCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadSigningCertificate] -> ShowS
$cshowList :: [UploadSigningCertificate] -> ShowS
show :: UploadSigningCertificate -> String
$cshow :: UploadSigningCertificate -> String
showsPrec :: Int -> UploadSigningCertificate -> ShowS
$cshowsPrec :: Int -> UploadSigningCertificate -> ShowS
Prelude.Show, (forall x.
UploadSigningCertificate -> Rep UploadSigningCertificate x)
-> (forall x.
Rep UploadSigningCertificate x -> UploadSigningCertificate)
-> Generic UploadSigningCertificate
forall x.
Rep UploadSigningCertificate x -> UploadSigningCertificate
forall x.
UploadSigningCertificate -> Rep UploadSigningCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UploadSigningCertificate x -> UploadSigningCertificate
$cfrom :: forall x.
UploadSigningCertificate -> Rep UploadSigningCertificate x
Prelude.Generic)
newUploadSigningCertificate ::
Prelude.Text ->
UploadSigningCertificate
newUploadSigningCertificate :: Text -> UploadSigningCertificate
newUploadSigningCertificate Text
pCertificateBody_ =
UploadSigningCertificate' :: Maybe Text -> Text -> UploadSigningCertificate
UploadSigningCertificate'
{ $sel:userName:UploadSigningCertificate' :: Maybe Text
userName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificateBody:UploadSigningCertificate' :: Text
certificateBody = Text
pCertificateBody_
}
uploadSigningCertificate_userName :: Lens.Lens' UploadSigningCertificate (Prelude.Maybe Prelude.Text)
uploadSigningCertificate_userName :: (Maybe Text -> f (Maybe Text))
-> UploadSigningCertificate -> f UploadSigningCertificate
uploadSigningCertificate_userName = (UploadSigningCertificate -> Maybe Text)
-> (UploadSigningCertificate
-> Maybe Text -> UploadSigningCertificate)
-> Lens
UploadSigningCertificate
UploadSigningCertificate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadSigningCertificate' {Maybe Text
userName :: Maybe Text
$sel:userName:UploadSigningCertificate' :: UploadSigningCertificate -> Maybe Text
userName} -> Maybe Text
userName) (\s :: UploadSigningCertificate
s@UploadSigningCertificate' {} Maybe Text
a -> UploadSigningCertificate
s {$sel:userName:UploadSigningCertificate' :: Maybe Text
userName = Maybe Text
a} :: UploadSigningCertificate)
uploadSigningCertificate_certificateBody :: Lens.Lens' UploadSigningCertificate Prelude.Text
uploadSigningCertificate_certificateBody :: (Text -> f Text)
-> UploadSigningCertificate -> f UploadSigningCertificate
uploadSigningCertificate_certificateBody = (UploadSigningCertificate -> Text)
-> (UploadSigningCertificate -> Text -> UploadSigningCertificate)
-> Lens UploadSigningCertificate UploadSigningCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadSigningCertificate' {Text
certificateBody :: Text
$sel:certificateBody:UploadSigningCertificate' :: UploadSigningCertificate -> Text
certificateBody} -> Text
certificateBody) (\s :: UploadSigningCertificate
s@UploadSigningCertificate' {} Text
a -> UploadSigningCertificate
s {$sel:certificateBody:UploadSigningCertificate' :: Text
certificateBody = Text
a} :: UploadSigningCertificate)
instance Core.AWSRequest UploadSigningCertificate where
type
AWSResponse UploadSigningCertificate =
UploadSigningCertificateResponse
request :: UploadSigningCertificate -> Request UploadSigningCertificate
request = Service
-> UploadSigningCertificate -> Request UploadSigningCertificate
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UploadSigningCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UploadSigningCertificate)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UploadSigningCertificate))
-> Logger
-> Service
-> Proxy UploadSigningCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UploadSigningCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"UploadSigningCertificateResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> SigningCertificate -> UploadSigningCertificateResponse
UploadSigningCertificateResponse'
(Int -> SigningCertificate -> UploadSigningCertificateResponse)
-> Either String Int
-> Either
String (SigningCertificate -> UploadSigningCertificateResponse)
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 (SigningCertificate -> UploadSigningCertificateResponse)
-> Either String SigningCertificate
-> Either String UploadSigningCertificateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String SigningCertificate
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Certificate")
)
instance Prelude.Hashable UploadSigningCertificate
instance Prelude.NFData UploadSigningCertificate
instance Core.ToHeaders UploadSigningCertificate where
toHeaders :: UploadSigningCertificate -> ResponseHeaders
toHeaders = ResponseHeaders -> UploadSigningCertificate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UploadSigningCertificate where
toPath :: UploadSigningCertificate -> ByteString
toPath = ByteString -> UploadSigningCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UploadSigningCertificate where
toQuery :: UploadSigningCertificate -> QueryString
toQuery UploadSigningCertificate' {Maybe Text
Text
certificateBody :: Text
userName :: Maybe Text
$sel:certificateBody:UploadSigningCertificate' :: UploadSigningCertificate -> Text
$sel:userName:UploadSigningCertificate' :: UploadSigningCertificate -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"UploadSigningCertificate" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
ByteString
"CertificateBody" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
certificateBody
]
data UploadSigningCertificateResponse = UploadSigningCertificateResponse'
{
UploadSigningCertificateResponse -> Int
httpStatus :: Prelude.Int,
UploadSigningCertificateResponse -> SigningCertificate
certificate :: SigningCertificate
}
deriving (UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool
(UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool)
-> (UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool)
-> Eq UploadSigningCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool
$c/= :: UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool
== :: UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool
$c== :: UploadSigningCertificateResponse
-> UploadSigningCertificateResponse -> Bool
Prelude.Eq, ReadPrec [UploadSigningCertificateResponse]
ReadPrec UploadSigningCertificateResponse
Int -> ReadS UploadSigningCertificateResponse
ReadS [UploadSigningCertificateResponse]
(Int -> ReadS UploadSigningCertificateResponse)
-> ReadS [UploadSigningCertificateResponse]
-> ReadPrec UploadSigningCertificateResponse
-> ReadPrec [UploadSigningCertificateResponse]
-> Read UploadSigningCertificateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadSigningCertificateResponse]
$creadListPrec :: ReadPrec [UploadSigningCertificateResponse]
readPrec :: ReadPrec UploadSigningCertificateResponse
$creadPrec :: ReadPrec UploadSigningCertificateResponse
readList :: ReadS [UploadSigningCertificateResponse]
$creadList :: ReadS [UploadSigningCertificateResponse]
readsPrec :: Int -> ReadS UploadSigningCertificateResponse
$creadsPrec :: Int -> ReadS UploadSigningCertificateResponse
Prelude.Read, Int -> UploadSigningCertificateResponse -> ShowS
[UploadSigningCertificateResponse] -> ShowS
UploadSigningCertificateResponse -> String
(Int -> UploadSigningCertificateResponse -> ShowS)
-> (UploadSigningCertificateResponse -> String)
-> ([UploadSigningCertificateResponse] -> ShowS)
-> Show UploadSigningCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadSigningCertificateResponse] -> ShowS
$cshowList :: [UploadSigningCertificateResponse] -> ShowS
show :: UploadSigningCertificateResponse -> String
$cshow :: UploadSigningCertificateResponse -> String
showsPrec :: Int -> UploadSigningCertificateResponse -> ShowS
$cshowsPrec :: Int -> UploadSigningCertificateResponse -> ShowS
Prelude.Show, (forall x.
UploadSigningCertificateResponse
-> Rep UploadSigningCertificateResponse x)
-> (forall x.
Rep UploadSigningCertificateResponse x
-> UploadSigningCertificateResponse)
-> Generic UploadSigningCertificateResponse
forall x.
Rep UploadSigningCertificateResponse x
-> UploadSigningCertificateResponse
forall x.
UploadSigningCertificateResponse
-> Rep UploadSigningCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UploadSigningCertificateResponse x
-> UploadSigningCertificateResponse
$cfrom :: forall x.
UploadSigningCertificateResponse
-> Rep UploadSigningCertificateResponse x
Prelude.Generic)
newUploadSigningCertificateResponse ::
Prelude.Int ->
SigningCertificate ->
UploadSigningCertificateResponse
newUploadSigningCertificateResponse :: Int -> SigningCertificate -> UploadSigningCertificateResponse
newUploadSigningCertificateResponse
Int
pHttpStatus_
SigningCertificate
pCertificate_ =
UploadSigningCertificateResponse' :: Int -> SigningCertificate -> UploadSigningCertificateResponse
UploadSigningCertificateResponse'
{ $sel:httpStatus:UploadSigningCertificateResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:certificate:UploadSigningCertificateResponse' :: SigningCertificate
certificate = SigningCertificate
pCertificate_
}
uploadSigningCertificateResponse_httpStatus :: Lens.Lens' UploadSigningCertificateResponse Prelude.Int
uploadSigningCertificateResponse_httpStatus :: (Int -> f Int)
-> UploadSigningCertificateResponse
-> f UploadSigningCertificateResponse
uploadSigningCertificateResponse_httpStatus = (UploadSigningCertificateResponse -> Int)
-> (UploadSigningCertificateResponse
-> Int -> UploadSigningCertificateResponse)
-> Lens
UploadSigningCertificateResponse
UploadSigningCertificateResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadSigningCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:UploadSigningCertificateResponse' :: UploadSigningCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UploadSigningCertificateResponse
s@UploadSigningCertificateResponse' {} Int
a -> UploadSigningCertificateResponse
s {$sel:httpStatus:UploadSigningCertificateResponse' :: Int
httpStatus = Int
a} :: UploadSigningCertificateResponse)
uploadSigningCertificateResponse_certificate :: Lens.Lens' UploadSigningCertificateResponse SigningCertificate
uploadSigningCertificateResponse_certificate :: (SigningCertificate -> f SigningCertificate)
-> UploadSigningCertificateResponse
-> f UploadSigningCertificateResponse
uploadSigningCertificateResponse_certificate = (UploadSigningCertificateResponse -> SigningCertificate)
-> (UploadSigningCertificateResponse
-> SigningCertificate -> UploadSigningCertificateResponse)
-> Lens
UploadSigningCertificateResponse
UploadSigningCertificateResponse
SigningCertificate
SigningCertificate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadSigningCertificateResponse' {SigningCertificate
certificate :: SigningCertificate
$sel:certificate:UploadSigningCertificateResponse' :: UploadSigningCertificateResponse -> SigningCertificate
certificate} -> SigningCertificate
certificate) (\s :: UploadSigningCertificateResponse
s@UploadSigningCertificateResponse' {} SigningCertificate
a -> UploadSigningCertificateResponse
s {$sel:certificate:UploadSigningCertificateResponse' :: SigningCertificate
certificate = SigningCertificate
a} :: UploadSigningCertificateResponse)
instance
Prelude.NFData
UploadSigningCertificateResponse