{-# 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.Lambda.PutFunctionCodeSigningConfig
(
PutFunctionCodeSigningConfig (..),
newPutFunctionCodeSigningConfig,
putFunctionCodeSigningConfig_codeSigningConfigArn,
putFunctionCodeSigningConfig_functionName,
PutFunctionCodeSigningConfigResponse (..),
newPutFunctionCodeSigningConfigResponse,
putFunctionCodeSigningConfigResponse_httpStatus,
putFunctionCodeSigningConfigResponse_codeSigningConfigArn,
putFunctionCodeSigningConfigResponse_functionName,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutFunctionCodeSigningConfig = PutFunctionCodeSigningConfig'
{
PutFunctionCodeSigningConfig -> Text
codeSigningConfigArn :: Prelude.Text,
PutFunctionCodeSigningConfig -> Text
functionName :: Prelude.Text
}
deriving (PutFunctionCodeSigningConfig
-> PutFunctionCodeSigningConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFunctionCodeSigningConfig
-> PutFunctionCodeSigningConfig -> Bool
$c/= :: PutFunctionCodeSigningConfig
-> PutFunctionCodeSigningConfig -> Bool
== :: PutFunctionCodeSigningConfig
-> PutFunctionCodeSigningConfig -> Bool
$c== :: PutFunctionCodeSigningConfig
-> PutFunctionCodeSigningConfig -> Bool
Prelude.Eq, ReadPrec [PutFunctionCodeSigningConfig]
ReadPrec PutFunctionCodeSigningConfig
Int -> ReadS PutFunctionCodeSigningConfig
ReadS [PutFunctionCodeSigningConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFunctionCodeSigningConfig]
$creadListPrec :: ReadPrec [PutFunctionCodeSigningConfig]
readPrec :: ReadPrec PutFunctionCodeSigningConfig
$creadPrec :: ReadPrec PutFunctionCodeSigningConfig
readList :: ReadS [PutFunctionCodeSigningConfig]
$creadList :: ReadS [PutFunctionCodeSigningConfig]
readsPrec :: Int -> ReadS PutFunctionCodeSigningConfig
$creadsPrec :: Int -> ReadS PutFunctionCodeSigningConfig
Prelude.Read, Int -> PutFunctionCodeSigningConfig -> ShowS
[PutFunctionCodeSigningConfig] -> ShowS
PutFunctionCodeSigningConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFunctionCodeSigningConfig] -> ShowS
$cshowList :: [PutFunctionCodeSigningConfig] -> ShowS
show :: PutFunctionCodeSigningConfig -> String
$cshow :: PutFunctionCodeSigningConfig -> String
showsPrec :: Int -> PutFunctionCodeSigningConfig -> ShowS
$cshowsPrec :: Int -> PutFunctionCodeSigningConfig -> ShowS
Prelude.Show, forall x.
Rep PutFunctionCodeSigningConfig x -> PutFunctionCodeSigningConfig
forall x.
PutFunctionCodeSigningConfig -> Rep PutFunctionCodeSigningConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutFunctionCodeSigningConfig x -> PutFunctionCodeSigningConfig
$cfrom :: forall x.
PutFunctionCodeSigningConfig -> Rep PutFunctionCodeSigningConfig x
Prelude.Generic)
newPutFunctionCodeSigningConfig ::
Prelude.Text ->
Prelude.Text ->
PutFunctionCodeSigningConfig
newPutFunctionCodeSigningConfig :: Text -> Text -> PutFunctionCodeSigningConfig
newPutFunctionCodeSigningConfig
Text
pCodeSigningConfigArn_
Text
pFunctionName_ =
PutFunctionCodeSigningConfig'
{ $sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: Text
codeSigningConfigArn =
Text
pCodeSigningConfigArn_,
$sel:functionName:PutFunctionCodeSigningConfig' :: Text
functionName = Text
pFunctionName_
}
putFunctionCodeSigningConfig_codeSigningConfigArn :: Lens.Lens' PutFunctionCodeSigningConfig Prelude.Text
putFunctionCodeSigningConfig_codeSigningConfigArn :: Lens' PutFunctionCodeSigningConfig Text
putFunctionCodeSigningConfig_codeSigningConfigArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionCodeSigningConfig' {Text
codeSigningConfigArn :: Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
codeSigningConfigArn} -> Text
codeSigningConfigArn) (\s :: PutFunctionCodeSigningConfig
s@PutFunctionCodeSigningConfig' {} Text
a -> PutFunctionCodeSigningConfig
s {$sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: Text
codeSigningConfigArn = Text
a} :: PutFunctionCodeSigningConfig)
putFunctionCodeSigningConfig_functionName :: Lens.Lens' PutFunctionCodeSigningConfig Prelude.Text
putFunctionCodeSigningConfig_functionName :: Lens' PutFunctionCodeSigningConfig Text
putFunctionCodeSigningConfig_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionCodeSigningConfig' {Text
functionName :: Text
$sel:functionName:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
functionName} -> Text
functionName) (\s :: PutFunctionCodeSigningConfig
s@PutFunctionCodeSigningConfig' {} Text
a -> PutFunctionCodeSigningConfig
s {$sel:functionName:PutFunctionCodeSigningConfig' :: Text
functionName = Text
a} :: PutFunctionCodeSigningConfig)
instance Core.AWSRequest PutFunctionCodeSigningConfig where
type
AWSResponse PutFunctionCodeSigningConfig =
PutFunctionCodeSigningConfigResponse
request :: (Service -> Service)
-> PutFunctionCodeSigningConfig
-> Request PutFunctionCodeSigningConfig
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutFunctionCodeSigningConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutFunctionCodeSigningConfig)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Text -> Text -> PutFunctionCodeSigningConfigResponse
PutFunctionCodeSigningConfigResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"CodeSigningConfigArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"FunctionName")
)
instance
Prelude.Hashable
PutFunctionCodeSigningConfig
where
hashWithSalt :: Int -> PutFunctionCodeSigningConfig -> Int
hashWithSalt Int
_salt PutFunctionCodeSigningConfig' {Text
functionName :: Text
codeSigningConfigArn :: Text
$sel:functionName:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
codeSigningConfigArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
instance Prelude.NFData PutFunctionCodeSigningConfig where
rnf :: PutFunctionCodeSigningConfig -> ()
rnf PutFunctionCodeSigningConfig' {Text
functionName :: Text
codeSigningConfigArn :: Text
$sel:functionName:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
codeSigningConfigArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
instance Data.ToHeaders PutFunctionCodeSigningConfig where
toHeaders :: PutFunctionCodeSigningConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON PutFunctionCodeSigningConfig where
toJSON :: PutFunctionCodeSigningConfig -> Value
toJSON PutFunctionCodeSigningConfig' {Text
functionName :: Text
codeSigningConfigArn :: Text
$sel:functionName:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"CodeSigningConfigArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
codeSigningConfigArn
)
]
)
instance Data.ToPath PutFunctionCodeSigningConfig where
toPath :: PutFunctionCodeSigningConfig -> ByteString
toPath PutFunctionCodeSigningConfig' {Text
functionName :: Text
codeSigningConfigArn :: Text
$sel:functionName:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfig' :: PutFunctionCodeSigningConfig -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-06-30/functions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
ByteString
"/code-signing-config"
]
instance Data.ToQuery PutFunctionCodeSigningConfig where
toQuery :: PutFunctionCodeSigningConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutFunctionCodeSigningConfigResponse = PutFunctionCodeSigningConfigResponse'
{
PutFunctionCodeSigningConfigResponse -> Int
httpStatus :: Prelude.Int,
PutFunctionCodeSigningConfigResponse -> Text
codeSigningConfigArn :: Prelude.Text,
PutFunctionCodeSigningConfigResponse -> Text
functionName :: Prelude.Text
}
deriving (PutFunctionCodeSigningConfigResponse
-> PutFunctionCodeSigningConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFunctionCodeSigningConfigResponse
-> PutFunctionCodeSigningConfigResponse -> Bool
$c/= :: PutFunctionCodeSigningConfigResponse
-> PutFunctionCodeSigningConfigResponse -> Bool
== :: PutFunctionCodeSigningConfigResponse
-> PutFunctionCodeSigningConfigResponse -> Bool
$c== :: PutFunctionCodeSigningConfigResponse
-> PutFunctionCodeSigningConfigResponse -> Bool
Prelude.Eq, ReadPrec [PutFunctionCodeSigningConfigResponse]
ReadPrec PutFunctionCodeSigningConfigResponse
Int -> ReadS PutFunctionCodeSigningConfigResponse
ReadS [PutFunctionCodeSigningConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFunctionCodeSigningConfigResponse]
$creadListPrec :: ReadPrec [PutFunctionCodeSigningConfigResponse]
readPrec :: ReadPrec PutFunctionCodeSigningConfigResponse
$creadPrec :: ReadPrec PutFunctionCodeSigningConfigResponse
readList :: ReadS [PutFunctionCodeSigningConfigResponse]
$creadList :: ReadS [PutFunctionCodeSigningConfigResponse]
readsPrec :: Int -> ReadS PutFunctionCodeSigningConfigResponse
$creadsPrec :: Int -> ReadS PutFunctionCodeSigningConfigResponse
Prelude.Read, Int -> PutFunctionCodeSigningConfigResponse -> ShowS
[PutFunctionCodeSigningConfigResponse] -> ShowS
PutFunctionCodeSigningConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFunctionCodeSigningConfigResponse] -> ShowS
$cshowList :: [PutFunctionCodeSigningConfigResponse] -> ShowS
show :: PutFunctionCodeSigningConfigResponse -> String
$cshow :: PutFunctionCodeSigningConfigResponse -> String
showsPrec :: Int -> PutFunctionCodeSigningConfigResponse -> ShowS
$cshowsPrec :: Int -> PutFunctionCodeSigningConfigResponse -> ShowS
Prelude.Show, forall x.
Rep PutFunctionCodeSigningConfigResponse x
-> PutFunctionCodeSigningConfigResponse
forall x.
PutFunctionCodeSigningConfigResponse
-> Rep PutFunctionCodeSigningConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutFunctionCodeSigningConfigResponse x
-> PutFunctionCodeSigningConfigResponse
$cfrom :: forall x.
PutFunctionCodeSigningConfigResponse
-> Rep PutFunctionCodeSigningConfigResponse x
Prelude.Generic)
newPutFunctionCodeSigningConfigResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
PutFunctionCodeSigningConfigResponse
newPutFunctionCodeSigningConfigResponse :: Int -> Text -> Text -> PutFunctionCodeSigningConfigResponse
newPutFunctionCodeSigningConfigResponse
Int
pHttpStatus_
Text
pCodeSigningConfigArn_
Text
pFunctionName_ =
PutFunctionCodeSigningConfigResponse'
{ $sel:httpStatus:PutFunctionCodeSigningConfigResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfigResponse' :: Text
codeSigningConfigArn =
Text
pCodeSigningConfigArn_,
$sel:functionName:PutFunctionCodeSigningConfigResponse' :: Text
functionName = Text
pFunctionName_
}
putFunctionCodeSigningConfigResponse_httpStatus :: Lens.Lens' PutFunctionCodeSigningConfigResponse Prelude.Int
putFunctionCodeSigningConfigResponse_httpStatus :: Lens' PutFunctionCodeSigningConfigResponse Int
putFunctionCodeSigningConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionCodeSigningConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutFunctionCodeSigningConfigResponse' :: PutFunctionCodeSigningConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutFunctionCodeSigningConfigResponse
s@PutFunctionCodeSigningConfigResponse' {} Int
a -> PutFunctionCodeSigningConfigResponse
s {$sel:httpStatus:PutFunctionCodeSigningConfigResponse' :: Int
httpStatus = Int
a} :: PutFunctionCodeSigningConfigResponse)
putFunctionCodeSigningConfigResponse_codeSigningConfigArn :: Lens.Lens' PutFunctionCodeSigningConfigResponse Prelude.Text
putFunctionCodeSigningConfigResponse_codeSigningConfigArn :: Lens' PutFunctionCodeSigningConfigResponse Text
putFunctionCodeSigningConfigResponse_codeSigningConfigArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionCodeSigningConfigResponse' {Text
codeSigningConfigArn :: Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfigResponse' :: PutFunctionCodeSigningConfigResponse -> Text
codeSigningConfigArn} -> Text
codeSigningConfigArn) (\s :: PutFunctionCodeSigningConfigResponse
s@PutFunctionCodeSigningConfigResponse' {} Text
a -> PutFunctionCodeSigningConfigResponse
s {$sel:codeSigningConfigArn:PutFunctionCodeSigningConfigResponse' :: Text
codeSigningConfigArn = Text
a} :: PutFunctionCodeSigningConfigResponse)
putFunctionCodeSigningConfigResponse_functionName :: Lens.Lens' PutFunctionCodeSigningConfigResponse Prelude.Text
putFunctionCodeSigningConfigResponse_functionName :: Lens' PutFunctionCodeSigningConfigResponse Text
putFunctionCodeSigningConfigResponse_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionCodeSigningConfigResponse' {Text
functionName :: Text
$sel:functionName:PutFunctionCodeSigningConfigResponse' :: PutFunctionCodeSigningConfigResponse -> Text
functionName} -> Text
functionName) (\s :: PutFunctionCodeSigningConfigResponse
s@PutFunctionCodeSigningConfigResponse' {} Text
a -> PutFunctionCodeSigningConfigResponse
s {$sel:functionName:PutFunctionCodeSigningConfigResponse' :: Text
functionName = Text
a} :: PutFunctionCodeSigningConfigResponse)
instance
Prelude.NFData
PutFunctionCodeSigningConfigResponse
where
rnf :: PutFunctionCodeSigningConfigResponse -> ()
rnf PutFunctionCodeSigningConfigResponse' {Int
Text
functionName :: Text
codeSigningConfigArn :: Text
httpStatus :: Int
$sel:functionName:PutFunctionCodeSigningConfigResponse' :: PutFunctionCodeSigningConfigResponse -> Text
$sel:codeSigningConfigArn:PutFunctionCodeSigningConfigResponse' :: PutFunctionCodeSigningConfigResponse -> Text
$sel:httpStatus:PutFunctionCodeSigningConfigResponse' :: PutFunctionCodeSigningConfigResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
codeSigningConfigArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName