{-# 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.Synthetics.CreateCanary
(
CreateCanary (..),
newCreateCanary,
createCanary_successRetentionPeriodInDays,
createCanary_runConfig,
createCanary_failureRetentionPeriodInDays,
createCanary_artifactConfig,
createCanary_vpcConfig,
createCanary_tags,
createCanary_name,
createCanary_code,
createCanary_artifactS3Location,
createCanary_executionRoleArn,
createCanary_schedule,
createCanary_runtimeVersion,
CreateCanaryResponse (..),
newCreateCanaryResponse,
createCanaryResponse_canary,
createCanaryResponse_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.Synthetics.Types
data CreateCanary = CreateCanary'
{
CreateCanary -> Maybe Natural
successRetentionPeriodInDays :: Prelude.Maybe Prelude.Natural,
CreateCanary -> Maybe CanaryRunConfigInput
runConfig :: Prelude.Maybe CanaryRunConfigInput,
CreateCanary -> Maybe Natural
failureRetentionPeriodInDays :: Prelude.Maybe Prelude.Natural,
CreateCanary -> Maybe ArtifactConfigInput
artifactConfig :: Prelude.Maybe ArtifactConfigInput,
CreateCanary -> Maybe VpcConfigInput
vpcConfig :: Prelude.Maybe VpcConfigInput,
CreateCanary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateCanary -> Text
name :: Prelude.Text,
CreateCanary -> CanaryCodeInput
code :: CanaryCodeInput,
CreateCanary -> Text
artifactS3Location :: Prelude.Text,
CreateCanary -> Text
executionRoleArn :: Prelude.Text,
CreateCanary -> CanaryScheduleInput
schedule :: CanaryScheduleInput,
CreateCanary -> Text
runtimeVersion :: Prelude.Text
}
deriving (CreateCanary -> CreateCanary -> Bool
(CreateCanary -> CreateCanary -> Bool)
-> (CreateCanary -> CreateCanary -> Bool) -> Eq CreateCanary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCanary -> CreateCanary -> Bool
$c/= :: CreateCanary -> CreateCanary -> Bool
== :: CreateCanary -> CreateCanary -> Bool
$c== :: CreateCanary -> CreateCanary -> Bool
Prelude.Eq, ReadPrec [CreateCanary]
ReadPrec CreateCanary
Int -> ReadS CreateCanary
ReadS [CreateCanary]
(Int -> ReadS CreateCanary)
-> ReadS [CreateCanary]
-> ReadPrec CreateCanary
-> ReadPrec [CreateCanary]
-> Read CreateCanary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCanary]
$creadListPrec :: ReadPrec [CreateCanary]
readPrec :: ReadPrec CreateCanary
$creadPrec :: ReadPrec CreateCanary
readList :: ReadS [CreateCanary]
$creadList :: ReadS [CreateCanary]
readsPrec :: Int -> ReadS CreateCanary
$creadsPrec :: Int -> ReadS CreateCanary
Prelude.Read, Int -> CreateCanary -> ShowS
[CreateCanary] -> ShowS
CreateCanary -> String
(Int -> CreateCanary -> ShowS)
-> (CreateCanary -> String)
-> ([CreateCanary] -> ShowS)
-> Show CreateCanary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCanary] -> ShowS
$cshowList :: [CreateCanary] -> ShowS
show :: CreateCanary -> String
$cshow :: CreateCanary -> String
showsPrec :: Int -> CreateCanary -> ShowS
$cshowsPrec :: Int -> CreateCanary -> ShowS
Prelude.Show, (forall x. CreateCanary -> Rep CreateCanary x)
-> (forall x. Rep CreateCanary x -> CreateCanary)
-> Generic CreateCanary
forall x. Rep CreateCanary x -> CreateCanary
forall x. CreateCanary -> Rep CreateCanary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCanary x -> CreateCanary
$cfrom :: forall x. CreateCanary -> Rep CreateCanary x
Prelude.Generic)
newCreateCanary ::
Prelude.Text ->
CanaryCodeInput ->
Prelude.Text ->
Prelude.Text ->
CanaryScheduleInput ->
Prelude.Text ->
CreateCanary
newCreateCanary :: Text
-> CanaryCodeInput
-> Text
-> Text
-> CanaryScheduleInput
-> Text
-> CreateCanary
newCreateCanary
Text
pName_
CanaryCodeInput
pCode_
Text
pArtifactS3Location_
Text
pExecutionRoleArn_
CanaryScheduleInput
pSchedule_
Text
pRuntimeVersion_ =
CreateCanary' :: Maybe Natural
-> Maybe CanaryRunConfigInput
-> Maybe Natural
-> Maybe ArtifactConfigInput
-> Maybe VpcConfigInput
-> Maybe (HashMap Text Text)
-> Text
-> CanaryCodeInput
-> Text
-> Text
-> CanaryScheduleInput
-> Text
-> CreateCanary
CreateCanary'
{ $sel:successRetentionPeriodInDays:CreateCanary' :: Maybe Natural
successRetentionPeriodInDays =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:runConfig:CreateCanary' :: Maybe CanaryRunConfigInput
runConfig = Maybe CanaryRunConfigInput
forall a. Maybe a
Prelude.Nothing,
$sel:failureRetentionPeriodInDays:CreateCanary' :: Maybe Natural
failureRetentionPeriodInDays = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:artifactConfig:CreateCanary' :: Maybe ArtifactConfigInput
artifactConfig = Maybe ArtifactConfigInput
forall a. Maybe a
Prelude.Nothing,
$sel:vpcConfig:CreateCanary' :: Maybe VpcConfigInput
vpcConfig = Maybe VpcConfigInput
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateCanary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateCanary' :: Text
name = Text
pName_,
$sel:code:CreateCanary' :: CanaryCodeInput
code = CanaryCodeInput
pCode_,
$sel:artifactS3Location:CreateCanary' :: Text
artifactS3Location = Text
pArtifactS3Location_,
$sel:executionRoleArn:CreateCanary' :: Text
executionRoleArn = Text
pExecutionRoleArn_,
$sel:schedule:CreateCanary' :: CanaryScheduleInput
schedule = CanaryScheduleInput
pSchedule_,
$sel:runtimeVersion:CreateCanary' :: Text
runtimeVersion = Text
pRuntimeVersion_
}
createCanary_successRetentionPeriodInDays :: Lens.Lens' CreateCanary (Prelude.Maybe Prelude.Natural)
createCanary_successRetentionPeriodInDays :: (Maybe Natural -> f (Maybe Natural))
-> CreateCanary -> f CreateCanary
createCanary_successRetentionPeriodInDays = (CreateCanary -> Maybe Natural)
-> (CreateCanary -> Maybe Natural -> CreateCanary)
-> Lens CreateCanary CreateCanary (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Maybe Natural
successRetentionPeriodInDays :: Maybe Natural
$sel:successRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
successRetentionPeriodInDays} -> Maybe Natural
successRetentionPeriodInDays) (\s :: CreateCanary
s@CreateCanary' {} Maybe Natural
a -> CreateCanary
s {$sel:successRetentionPeriodInDays:CreateCanary' :: Maybe Natural
successRetentionPeriodInDays = Maybe Natural
a} :: CreateCanary)
createCanary_runConfig :: Lens.Lens' CreateCanary (Prelude.Maybe CanaryRunConfigInput)
createCanary_runConfig :: (Maybe CanaryRunConfigInput -> f (Maybe CanaryRunConfigInput))
-> CreateCanary -> f CreateCanary
createCanary_runConfig = (CreateCanary -> Maybe CanaryRunConfigInput)
-> (CreateCanary -> Maybe CanaryRunConfigInput -> CreateCanary)
-> Lens
CreateCanary
CreateCanary
(Maybe CanaryRunConfigInput)
(Maybe CanaryRunConfigInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Maybe CanaryRunConfigInput
runConfig :: Maybe CanaryRunConfigInput
$sel:runConfig:CreateCanary' :: CreateCanary -> Maybe CanaryRunConfigInput
runConfig} -> Maybe CanaryRunConfigInput
runConfig) (\s :: CreateCanary
s@CreateCanary' {} Maybe CanaryRunConfigInput
a -> CreateCanary
s {$sel:runConfig:CreateCanary' :: Maybe CanaryRunConfigInput
runConfig = Maybe CanaryRunConfigInput
a} :: CreateCanary)
createCanary_failureRetentionPeriodInDays :: Lens.Lens' CreateCanary (Prelude.Maybe Prelude.Natural)
createCanary_failureRetentionPeriodInDays :: (Maybe Natural -> f (Maybe Natural))
-> CreateCanary -> f CreateCanary
createCanary_failureRetentionPeriodInDays = (CreateCanary -> Maybe Natural)
-> (CreateCanary -> Maybe Natural -> CreateCanary)
-> Lens CreateCanary CreateCanary (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Maybe Natural
failureRetentionPeriodInDays :: Maybe Natural
$sel:failureRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
failureRetentionPeriodInDays} -> Maybe Natural
failureRetentionPeriodInDays) (\s :: CreateCanary
s@CreateCanary' {} Maybe Natural
a -> CreateCanary
s {$sel:failureRetentionPeriodInDays:CreateCanary' :: Maybe Natural
failureRetentionPeriodInDays = Maybe Natural
a} :: CreateCanary)
createCanary_artifactConfig :: Lens.Lens' CreateCanary (Prelude.Maybe ArtifactConfigInput)
createCanary_artifactConfig :: (Maybe ArtifactConfigInput -> f (Maybe ArtifactConfigInput))
-> CreateCanary -> f CreateCanary
createCanary_artifactConfig = (CreateCanary -> Maybe ArtifactConfigInput)
-> (CreateCanary -> Maybe ArtifactConfigInput -> CreateCanary)
-> Lens
CreateCanary
CreateCanary
(Maybe ArtifactConfigInput)
(Maybe ArtifactConfigInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Maybe ArtifactConfigInput
artifactConfig :: Maybe ArtifactConfigInput
$sel:artifactConfig:CreateCanary' :: CreateCanary -> Maybe ArtifactConfigInput
artifactConfig} -> Maybe ArtifactConfigInput
artifactConfig) (\s :: CreateCanary
s@CreateCanary' {} Maybe ArtifactConfigInput
a -> CreateCanary
s {$sel:artifactConfig:CreateCanary' :: Maybe ArtifactConfigInput
artifactConfig = Maybe ArtifactConfigInput
a} :: CreateCanary)
createCanary_vpcConfig :: Lens.Lens' CreateCanary (Prelude.Maybe VpcConfigInput)
createCanary_vpcConfig :: (Maybe VpcConfigInput -> f (Maybe VpcConfigInput))
-> CreateCanary -> f CreateCanary
createCanary_vpcConfig = (CreateCanary -> Maybe VpcConfigInput)
-> (CreateCanary -> Maybe VpcConfigInput -> CreateCanary)
-> Lens
CreateCanary
CreateCanary
(Maybe VpcConfigInput)
(Maybe VpcConfigInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Maybe VpcConfigInput
vpcConfig :: Maybe VpcConfigInput
$sel:vpcConfig:CreateCanary' :: CreateCanary -> Maybe VpcConfigInput
vpcConfig} -> Maybe VpcConfigInput
vpcConfig) (\s :: CreateCanary
s@CreateCanary' {} Maybe VpcConfigInput
a -> CreateCanary
s {$sel:vpcConfig:CreateCanary' :: Maybe VpcConfigInput
vpcConfig = Maybe VpcConfigInput
a} :: CreateCanary)
createCanary_tags :: Lens.Lens' CreateCanary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createCanary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateCanary -> f CreateCanary
createCanary_tags = (CreateCanary -> Maybe (HashMap Text Text))
-> (CreateCanary -> Maybe (HashMap Text Text) -> CreateCanary)
-> Lens
CreateCanary
CreateCanary
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateCanary' :: CreateCanary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateCanary
s@CreateCanary' {} Maybe (HashMap Text Text)
a -> CreateCanary
s {$sel:tags:CreateCanary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateCanary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateCanary -> f CreateCanary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateCanary
-> f CreateCanary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createCanary_name :: Lens.Lens' CreateCanary Prelude.Text
createCanary_name :: (Text -> f Text) -> CreateCanary -> f CreateCanary
createCanary_name = (CreateCanary -> Text)
-> (CreateCanary -> Text -> CreateCanary)
-> Lens CreateCanary CreateCanary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Text
name :: Text
$sel:name:CreateCanary' :: CreateCanary -> Text
name} -> Text
name) (\s :: CreateCanary
s@CreateCanary' {} Text
a -> CreateCanary
s {$sel:name:CreateCanary' :: Text
name = Text
a} :: CreateCanary)
createCanary_code :: Lens.Lens' CreateCanary CanaryCodeInput
createCanary_code :: (CanaryCodeInput -> f CanaryCodeInput)
-> CreateCanary -> f CreateCanary
createCanary_code = (CreateCanary -> CanaryCodeInput)
-> (CreateCanary -> CanaryCodeInput -> CreateCanary)
-> Lens CreateCanary CreateCanary CanaryCodeInput CanaryCodeInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {CanaryCodeInput
code :: CanaryCodeInput
$sel:code:CreateCanary' :: CreateCanary -> CanaryCodeInput
code} -> CanaryCodeInput
code) (\s :: CreateCanary
s@CreateCanary' {} CanaryCodeInput
a -> CreateCanary
s {$sel:code:CreateCanary' :: CanaryCodeInput
code = CanaryCodeInput
a} :: CreateCanary)
createCanary_artifactS3Location :: Lens.Lens' CreateCanary Prelude.Text
createCanary_artifactS3Location :: (Text -> f Text) -> CreateCanary -> f CreateCanary
createCanary_artifactS3Location = (CreateCanary -> Text)
-> (CreateCanary -> Text -> CreateCanary)
-> Lens CreateCanary CreateCanary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Text
artifactS3Location :: Text
$sel:artifactS3Location:CreateCanary' :: CreateCanary -> Text
artifactS3Location} -> Text
artifactS3Location) (\s :: CreateCanary
s@CreateCanary' {} Text
a -> CreateCanary
s {$sel:artifactS3Location:CreateCanary' :: Text
artifactS3Location = Text
a} :: CreateCanary)
createCanary_executionRoleArn :: Lens.Lens' CreateCanary Prelude.Text
createCanary_executionRoleArn :: (Text -> f Text) -> CreateCanary -> f CreateCanary
createCanary_executionRoleArn = (CreateCanary -> Text)
-> (CreateCanary -> Text -> CreateCanary)
-> Lens CreateCanary CreateCanary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Text
executionRoleArn :: Text
$sel:executionRoleArn:CreateCanary' :: CreateCanary -> Text
executionRoleArn} -> Text
executionRoleArn) (\s :: CreateCanary
s@CreateCanary' {} Text
a -> CreateCanary
s {$sel:executionRoleArn:CreateCanary' :: Text
executionRoleArn = Text
a} :: CreateCanary)
createCanary_schedule :: Lens.Lens' CreateCanary CanaryScheduleInput
createCanary_schedule :: (CanaryScheduleInput -> f CanaryScheduleInput)
-> CreateCanary -> f CreateCanary
createCanary_schedule = (CreateCanary -> CanaryScheduleInput)
-> (CreateCanary -> CanaryScheduleInput -> CreateCanary)
-> Lens
CreateCanary CreateCanary CanaryScheduleInput CanaryScheduleInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {CanaryScheduleInput
schedule :: CanaryScheduleInput
$sel:schedule:CreateCanary' :: CreateCanary -> CanaryScheduleInput
schedule} -> CanaryScheduleInput
schedule) (\s :: CreateCanary
s@CreateCanary' {} CanaryScheduleInput
a -> CreateCanary
s {$sel:schedule:CreateCanary' :: CanaryScheduleInput
schedule = CanaryScheduleInput
a} :: CreateCanary)
createCanary_runtimeVersion :: Lens.Lens' CreateCanary Prelude.Text
createCanary_runtimeVersion :: (Text -> f Text) -> CreateCanary -> f CreateCanary
createCanary_runtimeVersion = (CreateCanary -> Text)
-> (CreateCanary -> Text -> CreateCanary)
-> Lens CreateCanary CreateCanary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanary' {Text
runtimeVersion :: Text
$sel:runtimeVersion:CreateCanary' :: CreateCanary -> Text
runtimeVersion} -> Text
runtimeVersion) (\s :: CreateCanary
s@CreateCanary' {} Text
a -> CreateCanary
s {$sel:runtimeVersion:CreateCanary' :: Text
runtimeVersion = Text
a} :: CreateCanary)
instance Core.AWSRequest CreateCanary where
type AWSResponse CreateCanary = CreateCanaryResponse
request :: CreateCanary -> Request CreateCanary
request = Service -> CreateCanary -> Request CreateCanary
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCanary)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateCanary))
-> Logger
-> Service
-> Proxy CreateCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCanary)))
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 Canary -> Int -> CreateCanaryResponse
CreateCanaryResponse'
(Maybe Canary -> Int -> CreateCanaryResponse)
-> Either String (Maybe Canary)
-> Either String (Int -> CreateCanaryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Canary)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Canary")
Either String (Int -> CreateCanaryResponse)
-> Either String Int -> Either String CreateCanaryResponse
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 CreateCanary
instance Prelude.NFData CreateCanary
instance Core.ToHeaders CreateCanary where
toHeaders :: CreateCanary -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateCanary -> 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 CreateCanary where
toJSON :: CreateCanary -> Value
toJSON CreateCanary' {Maybe Natural
Maybe (HashMap Text Text)
Maybe CanaryRunConfigInput
Maybe ArtifactConfigInput
Maybe VpcConfigInput
Text
CanaryCodeInput
CanaryScheduleInput
runtimeVersion :: Text
schedule :: CanaryScheduleInput
executionRoleArn :: Text
artifactS3Location :: Text
code :: CanaryCodeInput
name :: Text
tags :: Maybe (HashMap Text Text)
vpcConfig :: Maybe VpcConfigInput
artifactConfig :: Maybe ArtifactConfigInput
failureRetentionPeriodInDays :: Maybe Natural
runConfig :: Maybe CanaryRunConfigInput
successRetentionPeriodInDays :: Maybe Natural
$sel:runtimeVersion:CreateCanary' :: CreateCanary -> Text
$sel:schedule:CreateCanary' :: CreateCanary -> CanaryScheduleInput
$sel:executionRoleArn:CreateCanary' :: CreateCanary -> Text
$sel:artifactS3Location:CreateCanary' :: CreateCanary -> Text
$sel:code:CreateCanary' :: CreateCanary -> CanaryCodeInput
$sel:name:CreateCanary' :: CreateCanary -> Text
$sel:tags:CreateCanary' :: CreateCanary -> Maybe (HashMap Text Text)
$sel:vpcConfig:CreateCanary' :: CreateCanary -> Maybe VpcConfigInput
$sel:artifactConfig:CreateCanary' :: CreateCanary -> Maybe ArtifactConfigInput
$sel:failureRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:runConfig:CreateCanary' :: CreateCanary -> Maybe CanaryRunConfigInput
$sel:successRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SuccessRetentionPeriodInDays" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
successRetentionPeriodInDays,
(Text
"RunConfig" Text -> CanaryRunConfigInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CanaryRunConfigInput -> Pair)
-> Maybe CanaryRunConfigInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CanaryRunConfigInput
runConfig,
(Text
"FailureRetentionPeriodInDays" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
failureRetentionPeriodInDays,
(Text
"ArtifactConfig" Text -> ArtifactConfigInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ArtifactConfigInput -> Pair)
-> Maybe ArtifactConfigInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArtifactConfigInput
artifactConfig,
(Text
"VpcConfig" Text -> VpcConfigInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VpcConfigInput -> Pair) -> Maybe VpcConfigInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfigInput
vpcConfig,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Code" Text -> CanaryCodeInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CanaryCodeInput
code),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ArtifactS3Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
artifactS3Location),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ExecutionRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
executionRoleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Schedule" Text -> CanaryScheduleInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CanaryScheduleInput
schedule),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RuntimeVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
runtimeVersion)
]
)
instance Core.ToPath CreateCanary where
toPath :: CreateCanary -> ByteString
toPath = ByteString -> CreateCanary -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/canary"
instance Core.ToQuery CreateCanary where
toQuery :: CreateCanary -> QueryString
toQuery = QueryString -> CreateCanary -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateCanaryResponse = CreateCanaryResponse'
{
CreateCanaryResponse -> Maybe Canary
canary :: Prelude.Maybe Canary,
CreateCanaryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateCanaryResponse -> CreateCanaryResponse -> Bool
(CreateCanaryResponse -> CreateCanaryResponse -> Bool)
-> (CreateCanaryResponse -> CreateCanaryResponse -> Bool)
-> Eq CreateCanaryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCanaryResponse -> CreateCanaryResponse -> Bool
$c/= :: CreateCanaryResponse -> CreateCanaryResponse -> Bool
== :: CreateCanaryResponse -> CreateCanaryResponse -> Bool
$c== :: CreateCanaryResponse -> CreateCanaryResponse -> Bool
Prelude.Eq, ReadPrec [CreateCanaryResponse]
ReadPrec CreateCanaryResponse
Int -> ReadS CreateCanaryResponse
ReadS [CreateCanaryResponse]
(Int -> ReadS CreateCanaryResponse)
-> ReadS [CreateCanaryResponse]
-> ReadPrec CreateCanaryResponse
-> ReadPrec [CreateCanaryResponse]
-> Read CreateCanaryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCanaryResponse]
$creadListPrec :: ReadPrec [CreateCanaryResponse]
readPrec :: ReadPrec CreateCanaryResponse
$creadPrec :: ReadPrec CreateCanaryResponse
readList :: ReadS [CreateCanaryResponse]
$creadList :: ReadS [CreateCanaryResponse]
readsPrec :: Int -> ReadS CreateCanaryResponse
$creadsPrec :: Int -> ReadS CreateCanaryResponse
Prelude.Read, Int -> CreateCanaryResponse -> ShowS
[CreateCanaryResponse] -> ShowS
CreateCanaryResponse -> String
(Int -> CreateCanaryResponse -> ShowS)
-> (CreateCanaryResponse -> String)
-> ([CreateCanaryResponse] -> ShowS)
-> Show CreateCanaryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCanaryResponse] -> ShowS
$cshowList :: [CreateCanaryResponse] -> ShowS
show :: CreateCanaryResponse -> String
$cshow :: CreateCanaryResponse -> String
showsPrec :: Int -> CreateCanaryResponse -> ShowS
$cshowsPrec :: Int -> CreateCanaryResponse -> ShowS
Prelude.Show, (forall x. CreateCanaryResponse -> Rep CreateCanaryResponse x)
-> (forall x. Rep CreateCanaryResponse x -> CreateCanaryResponse)
-> Generic CreateCanaryResponse
forall x. Rep CreateCanaryResponse x -> CreateCanaryResponse
forall x. CreateCanaryResponse -> Rep CreateCanaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCanaryResponse x -> CreateCanaryResponse
$cfrom :: forall x. CreateCanaryResponse -> Rep CreateCanaryResponse x
Prelude.Generic)
newCreateCanaryResponse ::
Prelude.Int ->
CreateCanaryResponse
newCreateCanaryResponse :: Int -> CreateCanaryResponse
newCreateCanaryResponse Int
pHttpStatus_ =
CreateCanaryResponse' :: Maybe Canary -> Int -> CreateCanaryResponse
CreateCanaryResponse'
{ $sel:canary:CreateCanaryResponse' :: Maybe Canary
canary = Maybe Canary
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateCanaryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createCanaryResponse_canary :: Lens.Lens' CreateCanaryResponse (Prelude.Maybe Canary)
createCanaryResponse_canary :: (Maybe Canary -> f (Maybe Canary))
-> CreateCanaryResponse -> f CreateCanaryResponse
createCanaryResponse_canary = (CreateCanaryResponse -> Maybe Canary)
-> (CreateCanaryResponse -> Maybe Canary -> CreateCanaryResponse)
-> Lens
CreateCanaryResponse
CreateCanaryResponse
(Maybe Canary)
(Maybe Canary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanaryResponse' {Maybe Canary
canary :: Maybe Canary
$sel:canary:CreateCanaryResponse' :: CreateCanaryResponse -> Maybe Canary
canary} -> Maybe Canary
canary) (\s :: CreateCanaryResponse
s@CreateCanaryResponse' {} Maybe Canary
a -> CreateCanaryResponse
s {$sel:canary:CreateCanaryResponse' :: Maybe Canary
canary = Maybe Canary
a} :: CreateCanaryResponse)
createCanaryResponse_httpStatus :: Lens.Lens' CreateCanaryResponse Prelude.Int
createCanaryResponse_httpStatus :: (Int -> f Int) -> CreateCanaryResponse -> f CreateCanaryResponse
createCanaryResponse_httpStatus = (CreateCanaryResponse -> Int)
-> (CreateCanaryResponse -> Int -> CreateCanaryResponse)
-> Lens CreateCanaryResponse CreateCanaryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCanaryResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCanaryResponse' :: CreateCanaryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateCanaryResponse
s@CreateCanaryResponse' {} Int
a -> CreateCanaryResponse
s {$sel:httpStatus:CreateCanaryResponse' :: Int
httpStatus = Int
a} :: CreateCanaryResponse)
instance Prelude.NFData CreateCanaryResponse