{-# 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.IoT.CreateScheduledAudit
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a scheduled audit that is run at a specified time interval.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions CreateScheduledAudit>
-- action.
module Amazonka.IoT.CreateScheduledAudit
  ( -- * Creating a Request
    CreateScheduledAudit (..),
    newCreateScheduledAudit,

    -- * Request Lenses
    createScheduledAudit_dayOfMonth,
    createScheduledAudit_dayOfWeek,
    createScheduledAudit_tags,
    createScheduledAudit_frequency,
    createScheduledAudit_targetCheckNames,
    createScheduledAudit_scheduledAuditName,

    -- * Destructuring the Response
    CreateScheduledAuditResponse (..),
    newCreateScheduledAuditResponse,

    -- * Response Lenses
    createScheduledAuditResponse_scheduledAuditArn,
    createScheduledAuditResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateScheduledAudit' smart constructor.
data CreateScheduledAudit = CreateScheduledAudit'
  { -- | The day of the month on which the scheduled audit takes place. This can
    -- be \"1\" through \"31\" or \"LAST\". This field is required if the
    -- \"frequency\" parameter is set to @MONTHLY@. If days 29 to 31 are
    -- specified, and the month doesn\'t have that many days, the audit takes
    -- place on the @LAST@ day of the month.
    CreateScheduledAudit -> Maybe Text
dayOfMonth :: Prelude.Maybe Prelude.Text,
    -- | The day of the week on which the scheduled audit takes place, either
    -- @SUN@, @MON@, @TUE@, @WED@, @THU@, @FRI@, or @SAT@. This field is
    -- required if the @frequency@ parameter is set to @WEEKLY@ or @BIWEEKLY@.
    CreateScheduledAudit -> Maybe DayOfWeek
dayOfWeek :: Prelude.Maybe DayOfWeek,
    -- | Metadata that can be used to manage the scheduled audit.
    CreateScheduledAudit -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | How often the scheduled audit takes place, either @DAILY@, @WEEKLY@,
    -- @BIWEEKLY@ or @MONTHLY@. The start time of each audit is determined by
    -- the system.
    CreateScheduledAudit -> AuditFrequency
frequency :: AuditFrequency,
    -- | Which checks are performed during the scheduled audit. Checks must be
    -- enabled for your account. (Use @DescribeAccountAuditConfiguration@ to
    -- see the list of all checks, including those that are enabled or use
    -- @UpdateAccountAuditConfiguration@ to select which checks are enabled.)
    CreateScheduledAudit -> [Text]
targetCheckNames :: [Prelude.Text],
    -- | The name you want to give to the scheduled audit. (Max. 128 chars)
    CreateScheduledAudit -> Text
scheduledAuditName :: Prelude.Text
  }
  deriving (CreateScheduledAudit -> CreateScheduledAudit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateScheduledAudit -> CreateScheduledAudit -> Bool
$c/= :: CreateScheduledAudit -> CreateScheduledAudit -> Bool
== :: CreateScheduledAudit -> CreateScheduledAudit -> Bool
$c== :: CreateScheduledAudit -> CreateScheduledAudit -> Bool
Prelude.Eq, ReadPrec [CreateScheduledAudit]
ReadPrec CreateScheduledAudit
Int -> ReadS CreateScheduledAudit
ReadS [CreateScheduledAudit]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateScheduledAudit]
$creadListPrec :: ReadPrec [CreateScheduledAudit]
readPrec :: ReadPrec CreateScheduledAudit
$creadPrec :: ReadPrec CreateScheduledAudit
readList :: ReadS [CreateScheduledAudit]
$creadList :: ReadS [CreateScheduledAudit]
readsPrec :: Int -> ReadS CreateScheduledAudit
$creadsPrec :: Int -> ReadS CreateScheduledAudit
Prelude.Read, Int -> CreateScheduledAudit -> ShowS
[CreateScheduledAudit] -> ShowS
CreateScheduledAudit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateScheduledAudit] -> ShowS
$cshowList :: [CreateScheduledAudit] -> ShowS
show :: CreateScheduledAudit -> String
$cshow :: CreateScheduledAudit -> String
showsPrec :: Int -> CreateScheduledAudit -> ShowS
$cshowsPrec :: Int -> CreateScheduledAudit -> ShowS
Prelude.Show, forall x. Rep CreateScheduledAudit x -> CreateScheduledAudit
forall x. CreateScheduledAudit -> Rep CreateScheduledAudit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateScheduledAudit x -> CreateScheduledAudit
$cfrom :: forall x. CreateScheduledAudit -> Rep CreateScheduledAudit x
Prelude.Generic)

-- |
-- Create a value of 'CreateScheduledAudit' 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:
--
-- 'dayOfMonth', 'createScheduledAudit_dayOfMonth' - The day of the month on which the scheduled audit takes place. This can
-- be \"1\" through \"31\" or \"LAST\". This field is required if the
-- \"frequency\" parameter is set to @MONTHLY@. If days 29 to 31 are
-- specified, and the month doesn\'t have that many days, the audit takes
-- place on the @LAST@ day of the month.
--
-- 'dayOfWeek', 'createScheduledAudit_dayOfWeek' - The day of the week on which the scheduled audit takes place, either
-- @SUN@, @MON@, @TUE@, @WED@, @THU@, @FRI@, or @SAT@. This field is
-- required if the @frequency@ parameter is set to @WEEKLY@ or @BIWEEKLY@.
--
-- 'tags', 'createScheduledAudit_tags' - Metadata that can be used to manage the scheduled audit.
--
-- 'frequency', 'createScheduledAudit_frequency' - How often the scheduled audit takes place, either @DAILY@, @WEEKLY@,
-- @BIWEEKLY@ or @MONTHLY@. The start time of each audit is determined by
-- the system.
--
-- 'targetCheckNames', 'createScheduledAudit_targetCheckNames' - Which checks are performed during the scheduled audit. Checks must be
-- enabled for your account. (Use @DescribeAccountAuditConfiguration@ to
-- see the list of all checks, including those that are enabled or use
-- @UpdateAccountAuditConfiguration@ to select which checks are enabled.)
--
-- 'scheduledAuditName', 'createScheduledAudit_scheduledAuditName' - The name you want to give to the scheduled audit. (Max. 128 chars)
newCreateScheduledAudit ::
  -- | 'frequency'
  AuditFrequency ->
  -- | 'scheduledAuditName'
  Prelude.Text ->
  CreateScheduledAudit
newCreateScheduledAudit :: AuditFrequency -> Text -> CreateScheduledAudit
newCreateScheduledAudit
  AuditFrequency
pFrequency_
  Text
pScheduledAuditName_ =
    CreateScheduledAudit'
      { $sel:dayOfMonth:CreateScheduledAudit' :: Maybe Text
dayOfMonth = forall a. Maybe a
Prelude.Nothing,
        $sel:dayOfWeek:CreateScheduledAudit' :: Maybe DayOfWeek
dayOfWeek = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateScheduledAudit' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:frequency:CreateScheduledAudit' :: AuditFrequency
frequency = AuditFrequency
pFrequency_,
        $sel:targetCheckNames:CreateScheduledAudit' :: [Text]
targetCheckNames = forall a. Monoid a => a
Prelude.mempty,
        $sel:scheduledAuditName:CreateScheduledAudit' :: Text
scheduledAuditName = Text
pScheduledAuditName_
      }

-- | The day of the month on which the scheduled audit takes place. This can
-- be \"1\" through \"31\" or \"LAST\". This field is required if the
-- \"frequency\" parameter is set to @MONTHLY@. If days 29 to 31 are
-- specified, and the month doesn\'t have that many days, the audit takes
-- place on the @LAST@ day of the month.
createScheduledAudit_dayOfMonth :: Lens.Lens' CreateScheduledAudit (Prelude.Maybe Prelude.Text)
createScheduledAudit_dayOfMonth :: Lens' CreateScheduledAudit (Maybe Text)
createScheduledAudit_dayOfMonth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAudit' {Maybe Text
dayOfMonth :: Maybe Text
$sel:dayOfMonth:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe Text
dayOfMonth} -> Maybe Text
dayOfMonth) (\s :: CreateScheduledAudit
s@CreateScheduledAudit' {} Maybe Text
a -> CreateScheduledAudit
s {$sel:dayOfMonth:CreateScheduledAudit' :: Maybe Text
dayOfMonth = Maybe Text
a} :: CreateScheduledAudit)

-- | The day of the week on which the scheduled audit takes place, either
-- @SUN@, @MON@, @TUE@, @WED@, @THU@, @FRI@, or @SAT@. This field is
-- required if the @frequency@ parameter is set to @WEEKLY@ or @BIWEEKLY@.
createScheduledAudit_dayOfWeek :: Lens.Lens' CreateScheduledAudit (Prelude.Maybe DayOfWeek)
createScheduledAudit_dayOfWeek :: Lens' CreateScheduledAudit (Maybe DayOfWeek)
createScheduledAudit_dayOfWeek = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAudit' {Maybe DayOfWeek
dayOfWeek :: Maybe DayOfWeek
$sel:dayOfWeek:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe DayOfWeek
dayOfWeek} -> Maybe DayOfWeek
dayOfWeek) (\s :: CreateScheduledAudit
s@CreateScheduledAudit' {} Maybe DayOfWeek
a -> CreateScheduledAudit
s {$sel:dayOfWeek:CreateScheduledAudit' :: Maybe DayOfWeek
dayOfWeek = Maybe DayOfWeek
a} :: CreateScheduledAudit)

-- | Metadata that can be used to manage the scheduled audit.
createScheduledAudit_tags :: Lens.Lens' CreateScheduledAudit (Prelude.Maybe [Tag])
createScheduledAudit_tags :: Lens' CreateScheduledAudit (Maybe [Tag])
createScheduledAudit_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAudit' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateScheduledAudit
s@CreateScheduledAudit' {} Maybe [Tag]
a -> CreateScheduledAudit
s {$sel:tags:CreateScheduledAudit' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateScheduledAudit) 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

-- | How often the scheduled audit takes place, either @DAILY@, @WEEKLY@,
-- @BIWEEKLY@ or @MONTHLY@. The start time of each audit is determined by
-- the system.
createScheduledAudit_frequency :: Lens.Lens' CreateScheduledAudit AuditFrequency
createScheduledAudit_frequency :: Lens' CreateScheduledAudit AuditFrequency
createScheduledAudit_frequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAudit' {AuditFrequency
frequency :: AuditFrequency
$sel:frequency:CreateScheduledAudit' :: CreateScheduledAudit -> AuditFrequency
frequency} -> AuditFrequency
frequency) (\s :: CreateScheduledAudit
s@CreateScheduledAudit' {} AuditFrequency
a -> CreateScheduledAudit
s {$sel:frequency:CreateScheduledAudit' :: AuditFrequency
frequency = AuditFrequency
a} :: CreateScheduledAudit)

-- | Which checks are performed during the scheduled audit. Checks must be
-- enabled for your account. (Use @DescribeAccountAuditConfiguration@ to
-- see the list of all checks, including those that are enabled or use
-- @UpdateAccountAuditConfiguration@ to select which checks are enabled.)
createScheduledAudit_targetCheckNames :: Lens.Lens' CreateScheduledAudit [Prelude.Text]
createScheduledAudit_targetCheckNames :: Lens' CreateScheduledAudit [Text]
createScheduledAudit_targetCheckNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAudit' {[Text]
targetCheckNames :: [Text]
$sel:targetCheckNames:CreateScheduledAudit' :: CreateScheduledAudit -> [Text]
targetCheckNames} -> [Text]
targetCheckNames) (\s :: CreateScheduledAudit
s@CreateScheduledAudit' {} [Text]
a -> CreateScheduledAudit
s {$sel:targetCheckNames:CreateScheduledAudit' :: [Text]
targetCheckNames = [Text]
a} :: CreateScheduledAudit) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name you want to give to the scheduled audit. (Max. 128 chars)
createScheduledAudit_scheduledAuditName :: Lens.Lens' CreateScheduledAudit Prelude.Text
createScheduledAudit_scheduledAuditName :: Lens' CreateScheduledAudit Text
createScheduledAudit_scheduledAuditName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAudit' {Text
scheduledAuditName :: Text
$sel:scheduledAuditName:CreateScheduledAudit' :: CreateScheduledAudit -> Text
scheduledAuditName} -> Text
scheduledAuditName) (\s :: CreateScheduledAudit
s@CreateScheduledAudit' {} Text
a -> CreateScheduledAudit
s {$sel:scheduledAuditName:CreateScheduledAudit' :: Text
scheduledAuditName = Text
a} :: CreateScheduledAudit)

instance Core.AWSRequest CreateScheduledAudit where
  type
    AWSResponse CreateScheduledAudit =
      CreateScheduledAuditResponse
  request :: (Service -> Service)
-> CreateScheduledAudit -> Request CreateScheduledAudit
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 CreateScheduledAudit
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateScheduledAudit)))
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 Text -> Int -> CreateScheduledAuditResponse
CreateScheduledAuditResponse'
            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
"scheduledAuditArn")
            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 CreateScheduledAudit where
  hashWithSalt :: Int -> CreateScheduledAudit -> Int
hashWithSalt Int
_salt CreateScheduledAudit' {[Text]
Maybe [Tag]
Maybe Text
Maybe DayOfWeek
Text
AuditFrequency
scheduledAuditName :: Text
targetCheckNames :: [Text]
frequency :: AuditFrequency
tags :: Maybe [Tag]
dayOfWeek :: Maybe DayOfWeek
dayOfMonth :: Maybe Text
$sel:scheduledAuditName:CreateScheduledAudit' :: CreateScheduledAudit -> Text
$sel:targetCheckNames:CreateScheduledAudit' :: CreateScheduledAudit -> [Text]
$sel:frequency:CreateScheduledAudit' :: CreateScheduledAudit -> AuditFrequency
$sel:tags:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe [Tag]
$sel:dayOfWeek:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe DayOfWeek
$sel:dayOfMonth:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dayOfMonth
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DayOfWeek
dayOfWeek
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AuditFrequency
frequency
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
targetCheckNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scheduledAuditName

instance Prelude.NFData CreateScheduledAudit where
  rnf :: CreateScheduledAudit -> ()
rnf CreateScheduledAudit' {[Text]
Maybe [Tag]
Maybe Text
Maybe DayOfWeek
Text
AuditFrequency
scheduledAuditName :: Text
targetCheckNames :: [Text]
frequency :: AuditFrequency
tags :: Maybe [Tag]
dayOfWeek :: Maybe DayOfWeek
dayOfMonth :: Maybe Text
$sel:scheduledAuditName:CreateScheduledAudit' :: CreateScheduledAudit -> Text
$sel:targetCheckNames:CreateScheduledAudit' :: CreateScheduledAudit -> [Text]
$sel:frequency:CreateScheduledAudit' :: CreateScheduledAudit -> AuditFrequency
$sel:tags:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe [Tag]
$sel:dayOfWeek:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe DayOfWeek
$sel:dayOfMonth:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dayOfMonth
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DayOfWeek
dayOfWeek
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AuditFrequency
frequency
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
targetCheckNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
scheduledAuditName

instance Data.ToHeaders CreateScheduledAudit where
  toHeaders :: CreateScheduledAudit -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON CreateScheduledAudit where
  toJSON :: CreateScheduledAudit -> Value
toJSON CreateScheduledAudit' {[Text]
Maybe [Tag]
Maybe Text
Maybe DayOfWeek
Text
AuditFrequency
scheduledAuditName :: Text
targetCheckNames :: [Text]
frequency :: AuditFrequency
tags :: Maybe [Tag]
dayOfWeek :: Maybe DayOfWeek
dayOfMonth :: Maybe Text
$sel:scheduledAuditName:CreateScheduledAudit' :: CreateScheduledAudit -> Text
$sel:targetCheckNames:CreateScheduledAudit' :: CreateScheduledAudit -> [Text]
$sel:frequency:CreateScheduledAudit' :: CreateScheduledAudit -> AuditFrequency
$sel:tags:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe [Tag]
$sel:dayOfWeek:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe DayOfWeek
$sel:dayOfMonth:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"dayOfMonth" 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 Text
dayOfMonth,
            (Key
"dayOfWeek" 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 DayOfWeek
dayOfWeek,
            (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 [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"frequency" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AuditFrequency
frequency),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"targetCheckNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
targetCheckNames)
          ]
      )

instance Data.ToPath CreateScheduledAudit where
  toPath :: CreateScheduledAudit -> ByteString
toPath CreateScheduledAudit' {[Text]
Maybe [Tag]
Maybe Text
Maybe DayOfWeek
Text
AuditFrequency
scheduledAuditName :: Text
targetCheckNames :: [Text]
frequency :: AuditFrequency
tags :: Maybe [Tag]
dayOfWeek :: Maybe DayOfWeek
dayOfMonth :: Maybe Text
$sel:scheduledAuditName:CreateScheduledAudit' :: CreateScheduledAudit -> Text
$sel:targetCheckNames:CreateScheduledAudit' :: CreateScheduledAudit -> [Text]
$sel:frequency:CreateScheduledAudit' :: CreateScheduledAudit -> AuditFrequency
$sel:tags:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe [Tag]
$sel:dayOfWeek:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe DayOfWeek
$sel:dayOfMonth:CreateScheduledAudit' :: CreateScheduledAudit -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/audit/scheduledaudits/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
scheduledAuditName
      ]

instance Data.ToQuery CreateScheduledAudit where
  toQuery :: CreateScheduledAudit -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateScheduledAuditResponse' smart constructor.
data CreateScheduledAuditResponse = CreateScheduledAuditResponse'
  { -- | The ARN of the scheduled audit.
    CreateScheduledAuditResponse -> Maybe Text
scheduledAuditArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateScheduledAuditResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateScheduledAuditResponse
-> CreateScheduledAuditResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateScheduledAuditResponse
-> CreateScheduledAuditResponse -> Bool
$c/= :: CreateScheduledAuditResponse
-> CreateScheduledAuditResponse -> Bool
== :: CreateScheduledAuditResponse
-> CreateScheduledAuditResponse -> Bool
$c== :: CreateScheduledAuditResponse
-> CreateScheduledAuditResponse -> Bool
Prelude.Eq, ReadPrec [CreateScheduledAuditResponse]
ReadPrec CreateScheduledAuditResponse
Int -> ReadS CreateScheduledAuditResponse
ReadS [CreateScheduledAuditResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateScheduledAuditResponse]
$creadListPrec :: ReadPrec [CreateScheduledAuditResponse]
readPrec :: ReadPrec CreateScheduledAuditResponse
$creadPrec :: ReadPrec CreateScheduledAuditResponse
readList :: ReadS [CreateScheduledAuditResponse]
$creadList :: ReadS [CreateScheduledAuditResponse]
readsPrec :: Int -> ReadS CreateScheduledAuditResponse
$creadsPrec :: Int -> ReadS CreateScheduledAuditResponse
Prelude.Read, Int -> CreateScheduledAuditResponse -> ShowS
[CreateScheduledAuditResponse] -> ShowS
CreateScheduledAuditResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateScheduledAuditResponse] -> ShowS
$cshowList :: [CreateScheduledAuditResponse] -> ShowS
show :: CreateScheduledAuditResponse -> String
$cshow :: CreateScheduledAuditResponse -> String
showsPrec :: Int -> CreateScheduledAuditResponse -> ShowS
$cshowsPrec :: Int -> CreateScheduledAuditResponse -> ShowS
Prelude.Show, forall x.
Rep CreateScheduledAuditResponse x -> CreateScheduledAuditResponse
forall x.
CreateScheduledAuditResponse -> Rep CreateScheduledAuditResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateScheduledAuditResponse x -> CreateScheduledAuditResponse
$cfrom :: forall x.
CreateScheduledAuditResponse -> Rep CreateScheduledAuditResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateScheduledAuditResponse' 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:
--
-- 'scheduledAuditArn', 'createScheduledAuditResponse_scheduledAuditArn' - The ARN of the scheduled audit.
--
-- 'httpStatus', 'createScheduledAuditResponse_httpStatus' - The response's http status code.
newCreateScheduledAuditResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateScheduledAuditResponse
newCreateScheduledAuditResponse :: Int -> CreateScheduledAuditResponse
newCreateScheduledAuditResponse Int
pHttpStatus_ =
  CreateScheduledAuditResponse'
    { $sel:scheduledAuditArn:CreateScheduledAuditResponse' :: Maybe Text
scheduledAuditArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateScheduledAuditResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the scheduled audit.
createScheduledAuditResponse_scheduledAuditArn :: Lens.Lens' CreateScheduledAuditResponse (Prelude.Maybe Prelude.Text)
createScheduledAuditResponse_scheduledAuditArn :: Lens' CreateScheduledAuditResponse (Maybe Text)
createScheduledAuditResponse_scheduledAuditArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAuditResponse' {Maybe Text
scheduledAuditArn :: Maybe Text
$sel:scheduledAuditArn:CreateScheduledAuditResponse' :: CreateScheduledAuditResponse -> Maybe Text
scheduledAuditArn} -> Maybe Text
scheduledAuditArn) (\s :: CreateScheduledAuditResponse
s@CreateScheduledAuditResponse' {} Maybe Text
a -> CreateScheduledAuditResponse
s {$sel:scheduledAuditArn:CreateScheduledAuditResponse' :: Maybe Text
scheduledAuditArn = Maybe Text
a} :: CreateScheduledAuditResponse)

-- | The response's http status code.
createScheduledAuditResponse_httpStatus :: Lens.Lens' CreateScheduledAuditResponse Prelude.Int
createScheduledAuditResponse_httpStatus :: Lens' CreateScheduledAuditResponse Int
createScheduledAuditResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduledAuditResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateScheduledAuditResponse' :: CreateScheduledAuditResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateScheduledAuditResponse
s@CreateScheduledAuditResponse' {} Int
a -> CreateScheduledAuditResponse
s {$sel:httpStatus:CreateScheduledAuditResponse' :: Int
httpStatus = Int
a} :: CreateScheduledAuditResponse)

instance Prelude.NFData CreateScheduledAuditResponse where
  rnf :: CreateScheduledAuditResponse -> ()
rnf CreateScheduledAuditResponse' {Int
Maybe Text
httpStatus :: Int
scheduledAuditArn :: Maybe Text
$sel:httpStatus:CreateScheduledAuditResponse' :: CreateScheduledAuditResponse -> Int
$sel:scheduledAuditArn:CreateScheduledAuditResponse' :: CreateScheduledAuditResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduledAuditArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus