{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Synthetics.CreateCanary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a canary. Canaries are scripts that monitor your endpoints and
-- APIs from the outside-in. Canaries help you check the availability and
-- latency of your web services and troubleshoot anomalies by investigating
-- load time data, screenshots of the UI, logs, and metrics. You can set up
-- a canary to run continuously or just once.
--
-- Do not use @CreateCanary@ to modify an existing canary. Use
-- <https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_UpdateCanary.html UpdateCanary>
-- instead.
--
-- To create canaries, you must have the @CloudWatchSyntheticsFullAccess@
-- policy. If you are creating a new IAM role for the canary, you also need
-- the the @iam:CreateRole@, @iam:CreatePolicy@ and @iam:AttachRolePolicy@
-- permissions. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Roles Necessary Roles and Permissions>.
--
-- Do not include secrets or proprietary information in your canary names.
-- The canary name makes up part of the Amazon Resource Name (ARN) for the
-- canary, and the ARN is included in outbound calls over the internet. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html Security Considerations for Synthetics Canaries>.
module Amazonka.Synthetics.CreateCanary
  ( -- * Creating a Request
    CreateCanary (..),
    newCreateCanary,

    -- * Request Lenses
    createCanary_successRetentionPeriodInDays,
    createCanary_runConfig,
    createCanary_failureRetentionPeriodInDays,
    createCanary_artifactConfig,
    createCanary_vpcConfig,
    createCanary_tags,
    createCanary_name,
    createCanary_code,
    createCanary_artifactS3Location,
    createCanary_executionRoleArn,
    createCanary_schedule,
    createCanary_runtimeVersion,

    -- * Destructuring the Response
    CreateCanaryResponse (..),
    newCreateCanaryResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newCreateCanary' smart constructor.
data CreateCanary = CreateCanary'
  { -- | The number of days to retain data about successful runs of this canary.
    -- If you omit this field, the default of 31 days is used. The valid range
    -- is 1 to 455 days.
    CreateCanary -> Maybe Natural
successRetentionPeriodInDays :: Prelude.Maybe Prelude.Natural,
    -- | A structure that contains the configuration for individual canary runs,
    -- such as timeout value.
    CreateCanary -> Maybe CanaryRunConfigInput
runConfig :: Prelude.Maybe CanaryRunConfigInput,
    -- | The number of days to retain data about failed runs of this canary. If
    -- you omit this field, the default of 31 days is used. The valid range is
    -- 1 to 455 days.
    CreateCanary -> Maybe Natural
failureRetentionPeriodInDays :: Prelude.Maybe Prelude.Natural,
    -- | A structure that contains the configuration for canary artifacts,
    -- including the encryption-at-rest settings for artifacts that the canary
    -- uploads to Amazon S3.
    CreateCanary -> Maybe ArtifactConfigInput
artifactConfig :: Prelude.Maybe ArtifactConfigInput,
    -- | If this canary is to test an endpoint in a VPC, this structure contains
    -- information about the subnet and security groups of the VPC endpoint.
    -- For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html Running a Canary in a VPC>.
    CreateCanary -> Maybe VpcConfigInput
vpcConfig :: Prelude.Maybe VpcConfigInput,
    -- | A list of key-value pairs to associate with the canary. You can
    -- associate as many as 50 tags with a canary.
    --
    -- Tags can help you organize and categorize your resources. You can also
    -- use them to scope user permissions, by granting a user permission to
    -- access or change only the resources that have certain tag values.
    CreateCanary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name for this canary. Be sure to give it a descriptive name that
    -- distinguishes it from other canaries in your account.
    --
    -- Do not include secrets or proprietary information in your canary names.
    -- The canary name makes up part of the canary ARN, and the ARN is included
    -- in outbound calls over the internet. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html Security Considerations for Synthetics Canaries>.
    CreateCanary -> Text
name :: Prelude.Text,
    -- | A structure that includes the entry point from which the canary should
    -- start running your script. If the script is stored in an S3 bucket, the
    -- bucket name, key, and version are also included.
    CreateCanary -> CanaryCodeInput
code :: CanaryCodeInput,
    -- | The location in Amazon S3 where Synthetics stores artifacts from the
    -- test runs of this canary. Artifacts include the log file, screenshots,
    -- and HAR files. The name of the S3 bucket can\'t include a period (.).
    CreateCanary -> Text
artifactS3Location :: Prelude.Text,
    -- | The ARN of the IAM role to be used to run the canary. This role must
    -- already exist, and must include @lambda.amazonaws.com@ as a principal in
    -- the trust policy. The role must also have the following permissions:
    --
    -- -   @s3:PutObject@
    --
    -- -   @s3:GetBucketLocation@
    --
    -- -   @s3:ListAllMyBuckets@
    --
    -- -   @cloudwatch:PutMetricData@
    --
    -- -   @logs:CreateLogGroup@
    --
    -- -   @logs:CreateLogStream@
    --
    -- -   @logs:PutLogEvents@
    CreateCanary -> Text
executionRoleArn :: Prelude.Text,
    -- | A structure that contains information about how often the canary is to
    -- run and when these test runs are to stop.
    CreateCanary -> CanaryScheduleInput
schedule :: CanaryScheduleInput,
    -- | Specifies the runtime version to use for the canary. For a list of valid
    -- runtime versions and more information about runtime versions, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html Canary Runtime Versions>.
    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)

-- |
-- Create a value of 'CreateCanary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'successRetentionPeriodInDays', 'createCanary_successRetentionPeriodInDays' - The number of days to retain data about successful runs of this canary.
-- If you omit this field, the default of 31 days is used. The valid range
-- is 1 to 455 days.
--
-- 'runConfig', 'createCanary_runConfig' - A structure that contains the configuration for individual canary runs,
-- such as timeout value.
--
-- 'failureRetentionPeriodInDays', 'createCanary_failureRetentionPeriodInDays' - The number of days to retain data about failed runs of this canary. If
-- you omit this field, the default of 31 days is used. The valid range is
-- 1 to 455 days.
--
-- 'artifactConfig', 'createCanary_artifactConfig' - A structure that contains the configuration for canary artifacts,
-- including the encryption-at-rest settings for artifacts that the canary
-- uploads to Amazon S3.
--
-- 'vpcConfig', 'createCanary_vpcConfig' - If this canary is to test an endpoint in a VPC, this structure contains
-- information about the subnet and security groups of the VPC endpoint.
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html Running a Canary in a VPC>.
--
-- 'tags', 'createCanary_tags' - A list of key-value pairs to associate with the canary. You can
-- associate as many as 50 tags with a canary.
--
-- Tags can help you organize and categorize your resources. You can also
-- use them to scope user permissions, by granting a user permission to
-- access or change only the resources that have certain tag values.
--
-- 'name', 'createCanary_name' - The name for this canary. Be sure to give it a descriptive name that
-- distinguishes it from other canaries in your account.
--
-- Do not include secrets or proprietary information in your canary names.
-- The canary name makes up part of the canary ARN, and the ARN is included
-- in outbound calls over the internet. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html Security Considerations for Synthetics Canaries>.
--
-- 'code', 'createCanary_code' - A structure that includes the entry point from which the canary should
-- start running your script. If the script is stored in an S3 bucket, the
-- bucket name, key, and version are also included.
--
-- 'artifactS3Location', 'createCanary_artifactS3Location' - The location in Amazon S3 where Synthetics stores artifacts from the
-- test runs of this canary. Artifacts include the log file, screenshots,
-- and HAR files. The name of the S3 bucket can\'t include a period (.).
--
-- 'executionRoleArn', 'createCanary_executionRoleArn' - The ARN of the IAM role to be used to run the canary. This role must
-- already exist, and must include @lambda.amazonaws.com@ as a principal in
-- the trust policy. The role must also have the following permissions:
--
-- -   @s3:PutObject@
--
-- -   @s3:GetBucketLocation@
--
-- -   @s3:ListAllMyBuckets@
--
-- -   @cloudwatch:PutMetricData@
--
-- -   @logs:CreateLogGroup@
--
-- -   @logs:CreateLogStream@
--
-- -   @logs:PutLogEvents@
--
-- 'schedule', 'createCanary_schedule' - A structure that contains information about how often the canary is to
-- run and when these test runs are to stop.
--
-- 'runtimeVersion', 'createCanary_runtimeVersion' - Specifies the runtime version to use for the canary. For a list of valid
-- runtime versions and more information about runtime versions, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html Canary Runtime Versions>.
newCreateCanary ::
  -- | 'name'
  Prelude.Text ->
  -- | 'code'
  CanaryCodeInput ->
  -- | 'artifactS3Location'
  Prelude.Text ->
  -- | 'executionRoleArn'
  Prelude.Text ->
  -- | 'schedule'
  CanaryScheduleInput ->
  -- | 'runtimeVersion'
  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_
      }

-- | The number of days to retain data about successful runs of this canary.
-- If you omit this field, the default of 31 days is used. The valid range
-- is 1 to 455 days.
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)

-- | A structure that contains the configuration for individual canary runs,
-- such as timeout value.
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)

-- | The number of days to retain data about failed runs of this canary. If
-- you omit this field, the default of 31 days is used. The valid range is
-- 1 to 455 days.
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)

-- | A structure that contains the configuration for canary artifacts,
-- including the encryption-at-rest settings for artifacts that the canary
-- uploads to Amazon S3.
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)

-- | If this canary is to test an endpoint in a VPC, this structure contains
-- information about the subnet and security groups of the VPC endpoint.
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html Running a Canary in a VPC>.
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)

-- | A list of key-value pairs to associate with the canary. You can
-- associate as many as 50 tags with a canary.
--
-- Tags can help you organize and categorize your resources. You can also
-- use them to scope user permissions, by granting a user permission to
-- access or change only the resources that have certain tag values.
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

-- | The name for this canary. Be sure to give it a descriptive name that
-- distinguishes it from other canaries in your account.
--
-- Do not include secrets or proprietary information in your canary names.
-- The canary name makes up part of the canary ARN, and the ARN is included
-- in outbound calls over the internet. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html Security Considerations for Synthetics Canaries>.
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)

-- | A structure that includes the entry point from which the canary should
-- start running your script. If the script is stored in an S3 bucket, the
-- bucket name, key, and version are also included.
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)

-- | The location in Amazon S3 where Synthetics stores artifacts from the
-- test runs of this canary. Artifacts include the log file, screenshots,
-- and HAR files. The name of the S3 bucket can\'t include a period (.).
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)

-- | The ARN of the IAM role to be used to run the canary. This role must
-- already exist, and must include @lambda.amazonaws.com@ as a principal in
-- the trust policy. The role must also have the following permissions:
--
-- -   @s3:PutObject@
--
-- -   @s3:GetBucketLocation@
--
-- -   @s3:ListAllMyBuckets@
--
-- -   @cloudwatch:PutMetricData@
--
-- -   @logs:CreateLogGroup@
--
-- -   @logs:CreateLogStream@
--
-- -   @logs:PutLogEvents@
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)

-- | A structure that contains information about how often the canary is to
-- run and when these test runs are to stop.
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)

-- | Specifies the runtime version to use for the canary. For a list of valid
-- runtime versions and more information about runtime versions, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html Canary Runtime Versions>.
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

-- | /See:/ 'newCreateCanaryResponse' smart constructor.
data CreateCanaryResponse = CreateCanaryResponse'
  { -- | The full details about the canary you have created.
    CreateCanaryResponse -> Maybe Canary
canary :: Prelude.Maybe Canary,
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'CreateCanaryResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'canary', 'createCanaryResponse_canary' - The full details about the canary you have created.
--
-- 'httpStatus', 'createCanaryResponse_httpStatus' - The response's http status code.
newCreateCanaryResponse ::
  -- | 'httpStatus'
  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_
    }

-- | The full details about the canary you have created.
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)

-- | The response's http status code.
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