{-# 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.UpdateScheduledAudit
-- 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)
--
-- Updates a scheduled audit, including which checks are performed and how
-- often the audit takes place.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions UpdateScheduledAudit>
-- action.
module Amazonka.IoT.UpdateScheduledAudit
  ( -- * Creating a Request
    UpdateScheduledAudit (..),
    newUpdateScheduledAudit,

    -- * Request Lenses
    updateScheduledAudit_frequency,
    updateScheduledAudit_dayOfMonth,
    updateScheduledAudit_targetCheckNames,
    updateScheduledAudit_dayOfWeek,
    updateScheduledAudit_scheduledAuditName,

    -- * Destructuring the Response
    UpdateScheduledAuditResponse (..),
    newUpdateScheduledAuditResponse,

    -- * Response Lenses
    updateScheduledAuditResponse_scheduledAuditArn,
    updateScheduledAuditResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateScheduledAudit' smart constructor.
data UpdateScheduledAudit = UpdateScheduledAudit'
  { -- | How often the scheduled audit takes place, either @DAILY@, @WEEKLY@,
    -- @BIWEEKLY@, or @MONTHLY@. The start time of each audit is determined by
    -- the system.
    UpdateScheduledAudit -> Maybe AuditFrequency
frequency :: Prelude.Maybe AuditFrequency,
    -- | 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-31 are specified, and the
    -- month does not have that many days, the audit takes place on the
    -- \"LAST\" day of the month.
    UpdateScheduledAudit -> Maybe Text
dayOfMonth :: Prelude.Maybe Prelude.Text,
    -- | 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.)
    UpdateScheduledAudit -> Maybe [Text]
targetCheckNames :: Prelude.Maybe [Prelude.Text],
    -- | The day of the week on which the scheduled audit takes place. This can
    -- be one of @SUN@, @MON@, @TUE@, @WED@, @THU@, @FRI@, or @SAT@. This field
    -- is required if the \"frequency\" parameter is set to @WEEKLY@ or
    -- @BIWEEKLY@.
    UpdateScheduledAudit -> Maybe DayOfWeek
dayOfWeek :: Prelude.Maybe DayOfWeek,
    -- | The name of the scheduled audit. (Max. 128 chars)
    UpdateScheduledAudit -> Text
scheduledAuditName :: Prelude.Text
  }
  deriving (UpdateScheduledAudit -> UpdateScheduledAudit -> Bool
(UpdateScheduledAudit -> UpdateScheduledAudit -> Bool)
-> (UpdateScheduledAudit -> UpdateScheduledAudit -> Bool)
-> Eq UpdateScheduledAudit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateScheduledAudit -> UpdateScheduledAudit -> Bool
$c/= :: UpdateScheduledAudit -> UpdateScheduledAudit -> Bool
== :: UpdateScheduledAudit -> UpdateScheduledAudit -> Bool
$c== :: UpdateScheduledAudit -> UpdateScheduledAudit -> Bool
Prelude.Eq, ReadPrec [UpdateScheduledAudit]
ReadPrec UpdateScheduledAudit
Int -> ReadS UpdateScheduledAudit
ReadS [UpdateScheduledAudit]
(Int -> ReadS UpdateScheduledAudit)
-> ReadS [UpdateScheduledAudit]
-> ReadPrec UpdateScheduledAudit
-> ReadPrec [UpdateScheduledAudit]
-> Read UpdateScheduledAudit
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateScheduledAudit]
$creadListPrec :: ReadPrec [UpdateScheduledAudit]
readPrec :: ReadPrec UpdateScheduledAudit
$creadPrec :: ReadPrec UpdateScheduledAudit
readList :: ReadS [UpdateScheduledAudit]
$creadList :: ReadS [UpdateScheduledAudit]
readsPrec :: Int -> ReadS UpdateScheduledAudit
$creadsPrec :: Int -> ReadS UpdateScheduledAudit
Prelude.Read, Int -> UpdateScheduledAudit -> ShowS
[UpdateScheduledAudit] -> ShowS
UpdateScheduledAudit -> String
(Int -> UpdateScheduledAudit -> ShowS)
-> (UpdateScheduledAudit -> String)
-> ([UpdateScheduledAudit] -> ShowS)
-> Show UpdateScheduledAudit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateScheduledAudit] -> ShowS
$cshowList :: [UpdateScheduledAudit] -> ShowS
show :: UpdateScheduledAudit -> String
$cshow :: UpdateScheduledAudit -> String
showsPrec :: Int -> UpdateScheduledAudit -> ShowS
$cshowsPrec :: Int -> UpdateScheduledAudit -> ShowS
Prelude.Show, (forall x. UpdateScheduledAudit -> Rep UpdateScheduledAudit x)
-> (forall x. Rep UpdateScheduledAudit x -> UpdateScheduledAudit)
-> Generic UpdateScheduledAudit
forall x. Rep UpdateScheduledAudit x -> UpdateScheduledAudit
forall x. UpdateScheduledAudit -> Rep UpdateScheduledAudit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateScheduledAudit x -> UpdateScheduledAudit
$cfrom :: forall x. UpdateScheduledAudit -> Rep UpdateScheduledAudit x
Prelude.Generic)

-- |
-- Create a value of 'UpdateScheduledAudit' 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:
--
-- 'frequency', 'updateScheduledAudit_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.
--
-- 'dayOfMonth', 'updateScheduledAudit_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-31 are specified, and the
-- month does not have that many days, the audit takes place on the
-- \"LAST\" day of the month.
--
-- 'targetCheckNames', 'updateScheduledAudit_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.)
--
-- 'dayOfWeek', 'updateScheduledAudit_dayOfWeek' - The day of the week on which the scheduled audit takes place. This can
-- be one of @SUN@, @MON@, @TUE@, @WED@, @THU@, @FRI@, or @SAT@. This field
-- is required if the \"frequency\" parameter is set to @WEEKLY@ or
-- @BIWEEKLY@.
--
-- 'scheduledAuditName', 'updateScheduledAudit_scheduledAuditName' - The name of the scheduled audit. (Max. 128 chars)
newUpdateScheduledAudit ::
  -- | 'scheduledAuditName'
  Prelude.Text ->
  UpdateScheduledAudit
newUpdateScheduledAudit :: Text -> UpdateScheduledAudit
newUpdateScheduledAudit Text
pScheduledAuditName_ =
  UpdateScheduledAudit' :: Maybe AuditFrequency
-> Maybe Text
-> Maybe [Text]
-> Maybe DayOfWeek
-> Text
-> UpdateScheduledAudit
UpdateScheduledAudit'
    { $sel:frequency:UpdateScheduledAudit' :: Maybe AuditFrequency
frequency = Maybe AuditFrequency
forall a. Maybe a
Prelude.Nothing,
      $sel:dayOfMonth:UpdateScheduledAudit' :: Maybe Text
dayOfMonth = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetCheckNames:UpdateScheduledAudit' :: Maybe [Text]
targetCheckNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:dayOfWeek:UpdateScheduledAudit' :: Maybe DayOfWeek
dayOfWeek = Maybe DayOfWeek
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledAuditName:UpdateScheduledAudit' :: Text
scheduledAuditName = Text
pScheduledAuditName_
    }

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

-- | 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-31 are specified, and the
-- month does not have that many days, the audit takes place on the
-- \"LAST\" day of the month.
updateScheduledAudit_dayOfMonth :: Lens.Lens' UpdateScheduledAudit (Prelude.Maybe Prelude.Text)
updateScheduledAudit_dayOfMonth :: (Maybe Text -> f (Maybe Text))
-> UpdateScheduledAudit -> f UpdateScheduledAudit
updateScheduledAudit_dayOfMonth = (UpdateScheduledAudit -> Maybe Text)
-> (UpdateScheduledAudit -> Maybe Text -> UpdateScheduledAudit)
-> Lens
     UpdateScheduledAudit UpdateScheduledAudit (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScheduledAudit' {Maybe Text
dayOfMonth :: Maybe Text
$sel:dayOfMonth:UpdateScheduledAudit' :: UpdateScheduledAudit -> Maybe Text
dayOfMonth} -> Maybe Text
dayOfMonth) (\s :: UpdateScheduledAudit
s@UpdateScheduledAudit' {} Maybe Text
a -> UpdateScheduledAudit
s {$sel:dayOfMonth:UpdateScheduledAudit' :: Maybe Text
dayOfMonth = Maybe Text
a} :: UpdateScheduledAudit)

-- | 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.)
updateScheduledAudit_targetCheckNames :: Lens.Lens' UpdateScheduledAudit (Prelude.Maybe [Prelude.Text])
updateScheduledAudit_targetCheckNames :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateScheduledAudit -> f UpdateScheduledAudit
updateScheduledAudit_targetCheckNames = (UpdateScheduledAudit -> Maybe [Text])
-> (UpdateScheduledAudit -> Maybe [Text] -> UpdateScheduledAudit)
-> Lens
     UpdateScheduledAudit
     UpdateScheduledAudit
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScheduledAudit' {Maybe [Text]
targetCheckNames :: Maybe [Text]
$sel:targetCheckNames:UpdateScheduledAudit' :: UpdateScheduledAudit -> Maybe [Text]
targetCheckNames} -> Maybe [Text]
targetCheckNames) (\s :: UpdateScheduledAudit
s@UpdateScheduledAudit' {} Maybe [Text]
a -> UpdateScheduledAudit
s {$sel:targetCheckNames:UpdateScheduledAudit' :: Maybe [Text]
targetCheckNames = Maybe [Text]
a} :: UpdateScheduledAudit) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateScheduledAudit -> f UpdateScheduledAudit)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateScheduledAudit
-> f UpdateScheduledAudit
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The name of the scheduled audit. (Max. 128 chars)
updateScheduledAudit_scheduledAuditName :: Lens.Lens' UpdateScheduledAudit Prelude.Text
updateScheduledAudit_scheduledAuditName :: (Text -> f Text) -> UpdateScheduledAudit -> f UpdateScheduledAudit
updateScheduledAudit_scheduledAuditName = (UpdateScheduledAudit -> Text)
-> (UpdateScheduledAudit -> Text -> UpdateScheduledAudit)
-> Lens UpdateScheduledAudit UpdateScheduledAudit Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScheduledAudit' {Text
scheduledAuditName :: Text
$sel:scheduledAuditName:UpdateScheduledAudit' :: UpdateScheduledAudit -> Text
scheduledAuditName} -> Text
scheduledAuditName) (\s :: UpdateScheduledAudit
s@UpdateScheduledAudit' {} Text
a -> UpdateScheduledAudit
s {$sel:scheduledAuditName:UpdateScheduledAudit' :: Text
scheduledAuditName = Text
a} :: UpdateScheduledAudit)

instance Core.AWSRequest UpdateScheduledAudit where
  type
    AWSResponse UpdateScheduledAudit =
      UpdateScheduledAuditResponse
  request :: UpdateScheduledAudit -> Request UpdateScheduledAudit
request = Service -> UpdateScheduledAudit -> Request UpdateScheduledAudit
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateScheduledAudit
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateScheduledAudit)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateScheduledAudit))
-> Logger
-> Service
-> Proxy UpdateScheduledAudit
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateScheduledAudit)))
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 Text -> Int -> UpdateScheduledAuditResponse
UpdateScheduledAuditResponse'
            (Maybe Text -> Int -> UpdateScheduledAuditResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateScheduledAuditResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"scheduledAuditArn")
            Either String (Int -> UpdateScheduledAuditResponse)
-> Either String Int -> Either String UpdateScheduledAuditResponse
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 UpdateScheduledAudit

instance Prelude.NFData UpdateScheduledAudit

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

instance Core.ToJSON UpdateScheduledAudit where
  toJSON :: UpdateScheduledAudit -> Value
toJSON UpdateScheduledAudit' {Maybe [Text]
Maybe Text
Maybe AuditFrequency
Maybe DayOfWeek
Text
scheduledAuditName :: Text
dayOfWeek :: Maybe DayOfWeek
targetCheckNames :: Maybe [Text]
dayOfMonth :: Maybe Text
frequency :: Maybe AuditFrequency
$sel:scheduledAuditName:UpdateScheduledAudit' :: UpdateScheduledAudit -> Text
$sel:dayOfWeek:UpdateScheduledAudit' :: UpdateScheduledAudit -> Maybe DayOfWeek
$sel:targetCheckNames:UpdateScheduledAudit' :: UpdateScheduledAudit -> Maybe [Text]
$sel:dayOfMonth:UpdateScheduledAudit' :: UpdateScheduledAudit -> Maybe Text
$sel:frequency:UpdateScheduledAudit' :: UpdateScheduledAudit -> Maybe AuditFrequency
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"frequency" Text -> AuditFrequency -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AuditFrequency -> Pair) -> Maybe AuditFrequency -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuditFrequency
frequency,
            (Text
"dayOfMonth" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dayOfMonth,
            (Text
"targetCheckNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
targetCheckNames,
            (Text
"dayOfWeek" Text -> DayOfWeek -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DayOfWeek -> Pair) -> Maybe DayOfWeek -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DayOfWeek
dayOfWeek
          ]
      )

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

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

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

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

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

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

instance Prelude.NFData UpdateScheduledAuditResponse