{-# 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_artifactConfig,
createCanary_failureRetentionPeriodInDays,
createCanary_runConfig,
createCanary_successRetentionPeriodInDays,
createCanary_tags,
createCanary_vpcConfig,
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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 ArtifactConfigInput
artifactConfig :: Prelude.Maybe ArtifactConfigInput,
CreateCanary -> Maybe Natural
failureRetentionPeriodInDays :: Prelude.Maybe Prelude.Natural,
CreateCanary -> Maybe CanaryRunConfigInput
runConfig :: Prelude.Maybe CanaryRunConfigInput,
CreateCanary -> Maybe Natural
successRetentionPeriodInDays :: Prelude.Maybe Prelude.Natural,
CreateCanary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateCanary -> Maybe VpcConfigInput
vpcConfig :: Prelude.Maybe VpcConfigInput,
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
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]
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
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. 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'
{ $sel:artifactConfig:CreateCanary' :: Maybe ArtifactConfigInput
artifactConfig = forall a. Maybe a
Prelude.Nothing,
$sel:failureRetentionPeriodInDays:CreateCanary' :: Maybe Natural
failureRetentionPeriodInDays = forall a. Maybe a
Prelude.Nothing,
$sel:runConfig:CreateCanary' :: Maybe CanaryRunConfigInput
runConfig = forall a. Maybe a
Prelude.Nothing,
$sel:successRetentionPeriodInDays:CreateCanary' :: Maybe Natural
successRetentionPeriodInDays = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateCanary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:vpcConfig:CreateCanary' :: Maybe VpcConfigInput
vpcConfig = 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_artifactConfig :: Lens.Lens' CreateCanary (Prelude.Maybe ArtifactConfigInput)
createCanary_artifactConfig :: Lens' CreateCanary (Maybe ArtifactConfigInput)
createCanary_artifactConfig = 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_failureRetentionPeriodInDays :: Lens.Lens' CreateCanary (Prelude.Maybe Prelude.Natural)
createCanary_failureRetentionPeriodInDays :: Lens' CreateCanary (Maybe Natural)
createCanary_failureRetentionPeriodInDays = 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_runConfig :: Lens.Lens' CreateCanary (Prelude.Maybe CanaryRunConfigInput)
createCanary_runConfig :: Lens' CreateCanary (Maybe CanaryRunConfigInput)
createCanary_runConfig = 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_successRetentionPeriodInDays :: Lens.Lens' CreateCanary (Prelude.Maybe Prelude.Natural)
createCanary_successRetentionPeriodInDays :: Lens' CreateCanary (Maybe Natural)
createCanary_successRetentionPeriodInDays = 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_tags :: Lens.Lens' CreateCanary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createCanary_tags :: Lens' CreateCanary (Maybe (HashMap Text Text))
createCanary_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createCanary_vpcConfig :: Lens.Lens' CreateCanary (Prelude.Maybe VpcConfigInput)
createCanary_vpcConfig :: Lens' CreateCanary (Maybe VpcConfigInput)
createCanary_vpcConfig = 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_name :: Lens.Lens' CreateCanary Prelude.Text
createCanary_name :: Lens' CreateCanary Text
createCanary_name = 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 :: Lens' CreateCanary CanaryCodeInput
createCanary_code = 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 :: Lens' CreateCanary Text
createCanary_artifactS3Location = 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 :: Lens' CreateCanary Text
createCanary_executionRoleArn = 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 :: Lens' CreateCanary CanaryScheduleInput
createCanary_schedule = 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 :: Lens' CreateCanary Text
createCanary_runtimeVersion = 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 :: (Service -> Service) -> CreateCanary -> Request CreateCanary
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCanary)))
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 ->
Maybe Canary -> Int -> CreateCanaryResponse
CreateCanaryResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Canary")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable CreateCanary where
hashWithSalt :: Int -> CreateCanary -> Int
hashWithSalt Int
_salt 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
vpcConfig :: Maybe VpcConfigInput
tags :: Maybe (HashMap Text Text)
successRetentionPeriodInDays :: Maybe Natural
runConfig :: Maybe CanaryRunConfigInput
failureRetentionPeriodInDays :: Maybe Natural
artifactConfig :: Maybe ArtifactConfigInput
$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:vpcConfig:CreateCanary' :: CreateCanary -> Maybe VpcConfigInput
$sel:tags:CreateCanary' :: CreateCanary -> Maybe (HashMap Text Text)
$sel:successRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:runConfig:CreateCanary' :: CreateCanary -> Maybe CanaryRunConfigInput
$sel:failureRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:artifactConfig:CreateCanary' :: CreateCanary -> Maybe ArtifactConfigInput
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ArtifactConfigInput
artifactConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
failureRetentionPeriodInDays
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CanaryRunConfigInput
runConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
successRetentionPeriodInDays
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcConfigInput
vpcConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CanaryCodeInput
code
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
artifactS3Location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
executionRoleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CanaryScheduleInput
schedule
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
runtimeVersion
instance Prelude.NFData CreateCanary where
rnf :: CreateCanary -> ()
rnf 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
vpcConfig :: Maybe VpcConfigInput
tags :: Maybe (HashMap Text Text)
successRetentionPeriodInDays :: Maybe Natural
runConfig :: Maybe CanaryRunConfigInput
failureRetentionPeriodInDays :: Maybe Natural
artifactConfig :: Maybe ArtifactConfigInput
$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:vpcConfig:CreateCanary' :: CreateCanary -> Maybe VpcConfigInput
$sel:tags:CreateCanary' :: CreateCanary -> Maybe (HashMap Text Text)
$sel:successRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:runConfig:CreateCanary' :: CreateCanary -> Maybe CanaryRunConfigInput
$sel:failureRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:artifactConfig:CreateCanary' :: CreateCanary -> Maybe ArtifactConfigInput
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ArtifactConfigInput
artifactConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
failureRetentionPeriodInDays
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CanaryRunConfigInput
runConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
successRetentionPeriodInDays
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcConfigInput
vpcConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CanaryCodeInput
code
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
artifactS3Location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
executionRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CanaryScheduleInput
schedule
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
runtimeVersion
instance Data.ToHeaders CreateCanary where
toHeaders :: CreateCanary -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
vpcConfig :: Maybe VpcConfigInput
tags :: Maybe (HashMap Text Text)
successRetentionPeriodInDays :: Maybe Natural
runConfig :: Maybe CanaryRunConfigInput
failureRetentionPeriodInDays :: Maybe Natural
artifactConfig :: Maybe ArtifactConfigInput
$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:vpcConfig:CreateCanary' :: CreateCanary -> Maybe VpcConfigInput
$sel:tags:CreateCanary' :: CreateCanary -> Maybe (HashMap Text Text)
$sel:successRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:runConfig:CreateCanary' :: CreateCanary -> Maybe CanaryRunConfigInput
$sel:failureRetentionPeriodInDays:CreateCanary' :: CreateCanary -> Maybe Natural
$sel:artifactConfig:CreateCanary' :: CreateCanary -> Maybe ArtifactConfigInput
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ArtifactConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArtifactConfigInput
artifactConfig,
(Key
"FailureRetentionPeriodInDays" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
failureRetentionPeriodInDays,
(Key
"RunConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CanaryRunConfigInput
runConfig,
(Key
"SuccessRetentionPeriodInDays" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
successRetentionPeriodInDays,
(Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
(Key
"VpcConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfigInput
vpcConfig,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Code" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CanaryCodeInput
code),
forall a. a -> Maybe a
Prelude.Just
(Key
"ArtifactS3Location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
artifactS3Location),
forall a. a -> Maybe a
Prelude.Just
(Key
"ExecutionRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
executionRoleArn),
forall a. a -> Maybe a
Prelude.Just (Key
"Schedule" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CanaryScheduleInput
schedule),
forall a. a -> Maybe a
Prelude.Just
(Key
"RuntimeVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
runtimeVersion)
]
)
instance Data.ToPath CreateCanary where
toPath :: CreateCanary -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/canary"
instance Data.ToQuery CreateCanary where
toQuery :: CreateCanary -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
{ $sel:canary:CreateCanaryResponse' :: Maybe Canary
canary = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateCanaryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createCanaryResponse_canary :: Lens.Lens' CreateCanaryResponse (Prelude.Maybe Canary)
createCanaryResponse_canary :: Lens' CreateCanaryResponse (Maybe Canary)
createCanaryResponse_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 :: Lens' CreateCanaryResponse Int
createCanaryResponse_httpStatus = 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 where
rnf :: CreateCanaryResponse -> ()
rnf CreateCanaryResponse' {Int
Maybe Canary
httpStatus :: Int
canary :: Maybe Canary
$sel:httpStatus:CreateCanaryResponse' :: CreateCanaryResponse -> Int
$sel:canary:CreateCanaryResponse' :: CreateCanaryResponse -> Maybe Canary
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Canary
canary
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus