{-# 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.Backup.UpdateReportPlan
-- 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 an existing report plan identified by its @ReportPlanName@ with
-- the input document in JSON format.
module Amazonka.Backup.UpdateReportPlan
  ( -- * Creating a Request
    UpdateReportPlan (..),
    newUpdateReportPlan,

    -- * Request Lenses
    updateReportPlan_idempotencyToken,
    updateReportPlan_reportSetting,
    updateReportPlan_reportPlanDescription,
    updateReportPlan_reportDeliveryChannel,
    updateReportPlan_reportPlanName,

    -- * Destructuring the Response
    UpdateReportPlanResponse (..),
    newUpdateReportPlanResponse,

    -- * Response Lenses
    updateReportPlanResponse_creationTime,
    updateReportPlanResponse_reportPlanName,
    updateReportPlanResponse_reportPlanArn,
    updateReportPlanResponse_httpStatus,
  )
where

import Amazonka.Backup.Types
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

-- | /See:/ 'newUpdateReportPlan' smart constructor.
data UpdateReportPlan = UpdateReportPlan'
  { -- | A customer-chosen string that you can use to distinguish between
    -- otherwise identical calls to @UpdateReportPlanInput@. Retrying a
    -- successful request with the same idempotency token results in a success
    -- message with no action taken.
    UpdateReportPlan -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
    -- | Identifies the report template for the report. Reports are built using a
    -- report template. The report templates are:
    --
    -- @RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT@
    --
    -- If the report template is @RESOURCE_COMPLIANCE_REPORT@ or
    -- @CONTROL_COMPLIANCE_REPORT@, this API resource also describes the report
    -- coverage by Amazon Web Services Regions and frameworks.
    UpdateReportPlan -> Maybe ReportSetting
reportSetting :: Prelude.Maybe ReportSetting,
    -- | An optional description of the report plan with a maximum 1,024
    -- characters.
    UpdateReportPlan -> Maybe Text
reportPlanDescription :: Prelude.Maybe Prelude.Text,
    -- | A structure that contains information about where to deliver your
    -- reports, specifically your Amazon S3 bucket name, S3 key prefix, and the
    -- formats of your reports.
    UpdateReportPlan -> Maybe ReportDeliveryChannel
reportDeliveryChannel :: Prelude.Maybe ReportDeliveryChannel,
    -- | The unique name of the report plan. This name is between 1 and 256
    -- characters, starting with a letter, and consisting of letters (a-z,
    -- A-Z), numbers (0-9), and underscores (_).
    UpdateReportPlan -> Text
reportPlanName :: Prelude.Text
  }
  deriving (UpdateReportPlan -> UpdateReportPlan -> Bool
(UpdateReportPlan -> UpdateReportPlan -> Bool)
-> (UpdateReportPlan -> UpdateReportPlan -> Bool)
-> Eq UpdateReportPlan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReportPlan -> UpdateReportPlan -> Bool
$c/= :: UpdateReportPlan -> UpdateReportPlan -> Bool
== :: UpdateReportPlan -> UpdateReportPlan -> Bool
$c== :: UpdateReportPlan -> UpdateReportPlan -> Bool
Prelude.Eq, ReadPrec [UpdateReportPlan]
ReadPrec UpdateReportPlan
Int -> ReadS UpdateReportPlan
ReadS [UpdateReportPlan]
(Int -> ReadS UpdateReportPlan)
-> ReadS [UpdateReportPlan]
-> ReadPrec UpdateReportPlan
-> ReadPrec [UpdateReportPlan]
-> Read UpdateReportPlan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReportPlan]
$creadListPrec :: ReadPrec [UpdateReportPlan]
readPrec :: ReadPrec UpdateReportPlan
$creadPrec :: ReadPrec UpdateReportPlan
readList :: ReadS [UpdateReportPlan]
$creadList :: ReadS [UpdateReportPlan]
readsPrec :: Int -> ReadS UpdateReportPlan
$creadsPrec :: Int -> ReadS UpdateReportPlan
Prelude.Read, Int -> UpdateReportPlan -> ShowS
[UpdateReportPlan] -> ShowS
UpdateReportPlan -> String
(Int -> UpdateReportPlan -> ShowS)
-> (UpdateReportPlan -> String)
-> ([UpdateReportPlan] -> ShowS)
-> Show UpdateReportPlan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReportPlan] -> ShowS
$cshowList :: [UpdateReportPlan] -> ShowS
show :: UpdateReportPlan -> String
$cshow :: UpdateReportPlan -> String
showsPrec :: Int -> UpdateReportPlan -> ShowS
$cshowsPrec :: Int -> UpdateReportPlan -> ShowS
Prelude.Show, (forall x. UpdateReportPlan -> Rep UpdateReportPlan x)
-> (forall x. Rep UpdateReportPlan x -> UpdateReportPlan)
-> Generic UpdateReportPlan
forall x. Rep UpdateReportPlan x -> UpdateReportPlan
forall x. UpdateReportPlan -> Rep UpdateReportPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateReportPlan x -> UpdateReportPlan
$cfrom :: forall x. UpdateReportPlan -> Rep UpdateReportPlan x
Prelude.Generic)

-- |
-- Create a value of 'UpdateReportPlan' 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:
--
-- 'idempotencyToken', 'updateReportPlan_idempotencyToken' - A customer-chosen string that you can use to distinguish between
-- otherwise identical calls to @UpdateReportPlanInput@. Retrying a
-- successful request with the same idempotency token results in a success
-- message with no action taken.
--
-- 'reportSetting', 'updateReportPlan_reportSetting' - Identifies the report template for the report. Reports are built using a
-- report template. The report templates are:
--
-- @RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT@
--
-- If the report template is @RESOURCE_COMPLIANCE_REPORT@ or
-- @CONTROL_COMPLIANCE_REPORT@, this API resource also describes the report
-- coverage by Amazon Web Services Regions and frameworks.
--
-- 'reportPlanDescription', 'updateReportPlan_reportPlanDescription' - An optional description of the report plan with a maximum 1,024
-- characters.
--
-- 'reportDeliveryChannel', 'updateReportPlan_reportDeliveryChannel' - A structure that contains information about where to deliver your
-- reports, specifically your Amazon S3 bucket name, S3 key prefix, and the
-- formats of your reports.
--
-- 'reportPlanName', 'updateReportPlan_reportPlanName' - The unique name of the report plan. This name is between 1 and 256
-- characters, starting with a letter, and consisting of letters (a-z,
-- A-Z), numbers (0-9), and underscores (_).
newUpdateReportPlan ::
  -- | 'reportPlanName'
  Prelude.Text ->
  UpdateReportPlan
newUpdateReportPlan :: Text -> UpdateReportPlan
newUpdateReportPlan Text
pReportPlanName_ =
  UpdateReportPlan' :: Maybe Text
-> Maybe ReportSetting
-> Maybe Text
-> Maybe ReportDeliveryChannel
-> Text
-> UpdateReportPlan
UpdateReportPlan'
    { $sel:idempotencyToken:UpdateReportPlan' :: Maybe Text
idempotencyToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reportSetting:UpdateReportPlan' :: Maybe ReportSetting
reportSetting = Maybe ReportSetting
forall a. Maybe a
Prelude.Nothing,
      $sel:reportPlanDescription:UpdateReportPlan' :: Maybe Text
reportPlanDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reportDeliveryChannel:UpdateReportPlan' :: Maybe ReportDeliveryChannel
reportDeliveryChannel = Maybe ReportDeliveryChannel
forall a. Maybe a
Prelude.Nothing,
      $sel:reportPlanName:UpdateReportPlan' :: Text
reportPlanName = Text
pReportPlanName_
    }

-- | A customer-chosen string that you can use to distinguish between
-- otherwise identical calls to @UpdateReportPlanInput@. Retrying a
-- successful request with the same idempotency token results in a success
-- message with no action taken.
updateReportPlan_idempotencyToken :: Lens.Lens' UpdateReportPlan (Prelude.Maybe Prelude.Text)
updateReportPlan_idempotencyToken :: (Maybe Text -> f (Maybe Text))
-> UpdateReportPlan -> f UpdateReportPlan
updateReportPlan_idempotencyToken = (UpdateReportPlan -> Maybe Text)
-> (UpdateReportPlan -> Maybe Text -> UpdateReportPlan)
-> Lens UpdateReportPlan UpdateReportPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlan' {Maybe Text
idempotencyToken :: Maybe Text
$sel:idempotencyToken:UpdateReportPlan' :: UpdateReportPlan -> Maybe Text
idempotencyToken} -> Maybe Text
idempotencyToken) (\s :: UpdateReportPlan
s@UpdateReportPlan' {} Maybe Text
a -> UpdateReportPlan
s {$sel:idempotencyToken:UpdateReportPlan' :: Maybe Text
idempotencyToken = Maybe Text
a} :: UpdateReportPlan)

-- | Identifies the report template for the report. Reports are built using a
-- report template. The report templates are:
--
-- @RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT@
--
-- If the report template is @RESOURCE_COMPLIANCE_REPORT@ or
-- @CONTROL_COMPLIANCE_REPORT@, this API resource also describes the report
-- coverage by Amazon Web Services Regions and frameworks.
updateReportPlan_reportSetting :: Lens.Lens' UpdateReportPlan (Prelude.Maybe ReportSetting)
updateReportPlan_reportSetting :: (Maybe ReportSetting -> f (Maybe ReportSetting))
-> UpdateReportPlan -> f UpdateReportPlan
updateReportPlan_reportSetting = (UpdateReportPlan -> Maybe ReportSetting)
-> (UpdateReportPlan -> Maybe ReportSetting -> UpdateReportPlan)
-> Lens
     UpdateReportPlan
     UpdateReportPlan
     (Maybe ReportSetting)
     (Maybe ReportSetting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlan' {Maybe ReportSetting
reportSetting :: Maybe ReportSetting
$sel:reportSetting:UpdateReportPlan' :: UpdateReportPlan -> Maybe ReportSetting
reportSetting} -> Maybe ReportSetting
reportSetting) (\s :: UpdateReportPlan
s@UpdateReportPlan' {} Maybe ReportSetting
a -> UpdateReportPlan
s {$sel:reportSetting:UpdateReportPlan' :: Maybe ReportSetting
reportSetting = Maybe ReportSetting
a} :: UpdateReportPlan)

-- | An optional description of the report plan with a maximum 1,024
-- characters.
updateReportPlan_reportPlanDescription :: Lens.Lens' UpdateReportPlan (Prelude.Maybe Prelude.Text)
updateReportPlan_reportPlanDescription :: (Maybe Text -> f (Maybe Text))
-> UpdateReportPlan -> f UpdateReportPlan
updateReportPlan_reportPlanDescription = (UpdateReportPlan -> Maybe Text)
-> (UpdateReportPlan -> Maybe Text -> UpdateReportPlan)
-> Lens UpdateReportPlan UpdateReportPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlan' {Maybe Text
reportPlanDescription :: Maybe Text
$sel:reportPlanDescription:UpdateReportPlan' :: UpdateReportPlan -> Maybe Text
reportPlanDescription} -> Maybe Text
reportPlanDescription) (\s :: UpdateReportPlan
s@UpdateReportPlan' {} Maybe Text
a -> UpdateReportPlan
s {$sel:reportPlanDescription:UpdateReportPlan' :: Maybe Text
reportPlanDescription = Maybe Text
a} :: UpdateReportPlan)

-- | A structure that contains information about where to deliver your
-- reports, specifically your Amazon S3 bucket name, S3 key prefix, and the
-- formats of your reports.
updateReportPlan_reportDeliveryChannel :: Lens.Lens' UpdateReportPlan (Prelude.Maybe ReportDeliveryChannel)
updateReportPlan_reportDeliveryChannel :: (Maybe ReportDeliveryChannel -> f (Maybe ReportDeliveryChannel))
-> UpdateReportPlan -> f UpdateReportPlan
updateReportPlan_reportDeliveryChannel = (UpdateReportPlan -> Maybe ReportDeliveryChannel)
-> (UpdateReportPlan
    -> Maybe ReportDeliveryChannel -> UpdateReportPlan)
-> Lens
     UpdateReportPlan
     UpdateReportPlan
     (Maybe ReportDeliveryChannel)
     (Maybe ReportDeliveryChannel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlan' {Maybe ReportDeliveryChannel
reportDeliveryChannel :: Maybe ReportDeliveryChannel
$sel:reportDeliveryChannel:UpdateReportPlan' :: UpdateReportPlan -> Maybe ReportDeliveryChannel
reportDeliveryChannel} -> Maybe ReportDeliveryChannel
reportDeliveryChannel) (\s :: UpdateReportPlan
s@UpdateReportPlan' {} Maybe ReportDeliveryChannel
a -> UpdateReportPlan
s {$sel:reportDeliveryChannel:UpdateReportPlan' :: Maybe ReportDeliveryChannel
reportDeliveryChannel = Maybe ReportDeliveryChannel
a} :: UpdateReportPlan)

-- | The unique name of the report plan. This name is between 1 and 256
-- characters, starting with a letter, and consisting of letters (a-z,
-- A-Z), numbers (0-9), and underscores (_).
updateReportPlan_reportPlanName :: Lens.Lens' UpdateReportPlan Prelude.Text
updateReportPlan_reportPlanName :: (Text -> f Text) -> UpdateReportPlan -> f UpdateReportPlan
updateReportPlan_reportPlanName = (UpdateReportPlan -> Text)
-> (UpdateReportPlan -> Text -> UpdateReportPlan)
-> Lens UpdateReportPlan UpdateReportPlan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:UpdateReportPlan' :: UpdateReportPlan -> Text
reportPlanName} -> Text
reportPlanName) (\s :: UpdateReportPlan
s@UpdateReportPlan' {} Text
a -> UpdateReportPlan
s {$sel:reportPlanName:UpdateReportPlan' :: Text
reportPlanName = Text
a} :: UpdateReportPlan)

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

instance Prelude.NFData UpdateReportPlan

instance Core.ToHeaders UpdateReportPlan where
  toHeaders :: UpdateReportPlan -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateReportPlan -> 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 UpdateReportPlan where
  toJSON :: UpdateReportPlan -> Value
toJSON UpdateReportPlan' {Maybe Text
Maybe ReportDeliveryChannel
Maybe ReportSetting
Text
reportPlanName :: Text
reportDeliveryChannel :: Maybe ReportDeliveryChannel
reportPlanDescription :: Maybe Text
reportSetting :: Maybe ReportSetting
idempotencyToken :: Maybe Text
$sel:reportPlanName:UpdateReportPlan' :: UpdateReportPlan -> Text
$sel:reportDeliveryChannel:UpdateReportPlan' :: UpdateReportPlan -> Maybe ReportDeliveryChannel
$sel:reportPlanDescription:UpdateReportPlan' :: UpdateReportPlan -> Maybe Text
$sel:reportSetting:UpdateReportPlan' :: UpdateReportPlan -> Maybe ReportSetting
$sel:idempotencyToken:UpdateReportPlan' :: UpdateReportPlan -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IdempotencyToken" 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
idempotencyToken,
            (Text
"ReportSetting" Text -> ReportSetting -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ReportSetting -> Pair) -> Maybe ReportSetting -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportSetting
reportSetting,
            (Text
"ReportPlanDescription" 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
reportPlanDescription,
            (Text
"ReportDeliveryChannel" Text -> ReportDeliveryChannel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ReportDeliveryChannel -> Pair)
-> Maybe ReportDeliveryChannel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportDeliveryChannel
reportDeliveryChannel
          ]
      )

instance Core.ToPath UpdateReportPlan where
  toPath :: UpdateReportPlan -> ByteString
toPath UpdateReportPlan' {Maybe Text
Maybe ReportDeliveryChannel
Maybe ReportSetting
Text
reportPlanName :: Text
reportDeliveryChannel :: Maybe ReportDeliveryChannel
reportPlanDescription :: Maybe Text
reportSetting :: Maybe ReportSetting
idempotencyToken :: Maybe Text
$sel:reportPlanName:UpdateReportPlan' :: UpdateReportPlan -> Text
$sel:reportDeliveryChannel:UpdateReportPlan' :: UpdateReportPlan -> Maybe ReportDeliveryChannel
$sel:reportPlanDescription:UpdateReportPlan' :: UpdateReportPlan -> Maybe Text
$sel:reportSetting:UpdateReportPlan' :: UpdateReportPlan -> Maybe ReportSetting
$sel:idempotencyToken:UpdateReportPlan' :: UpdateReportPlan -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/audit/report-plans/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
reportPlanName]

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

-- | /See:/ 'newUpdateReportPlanResponse' smart constructor.
data UpdateReportPlanResponse = UpdateReportPlanResponse'
  { -- | The date and time that a report plan is created, in Unix format and
    -- Coordinated Universal Time (UTC). The value of @CreationTime@ is
    -- accurate to milliseconds. For example, the value 1516925490.087
    -- represents Friday, January 26, 2018 12:11:30.087 AM.
    UpdateReportPlanResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The unique name of the report plan.
    UpdateReportPlanResponse -> Maybe Text
reportPlanName :: Prelude.Maybe Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a resource. The
    -- format of the ARN depends on the resource type.
    UpdateReportPlanResponse -> Maybe Text
reportPlanArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateReportPlanResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool
(UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool)
-> (UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool)
-> Eq UpdateReportPlanResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool
$c/= :: UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool
== :: UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool
$c== :: UpdateReportPlanResponse -> UpdateReportPlanResponse -> Bool
Prelude.Eq, ReadPrec [UpdateReportPlanResponse]
ReadPrec UpdateReportPlanResponse
Int -> ReadS UpdateReportPlanResponse
ReadS [UpdateReportPlanResponse]
(Int -> ReadS UpdateReportPlanResponse)
-> ReadS [UpdateReportPlanResponse]
-> ReadPrec UpdateReportPlanResponse
-> ReadPrec [UpdateReportPlanResponse]
-> Read UpdateReportPlanResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReportPlanResponse]
$creadListPrec :: ReadPrec [UpdateReportPlanResponse]
readPrec :: ReadPrec UpdateReportPlanResponse
$creadPrec :: ReadPrec UpdateReportPlanResponse
readList :: ReadS [UpdateReportPlanResponse]
$creadList :: ReadS [UpdateReportPlanResponse]
readsPrec :: Int -> ReadS UpdateReportPlanResponse
$creadsPrec :: Int -> ReadS UpdateReportPlanResponse
Prelude.Read, Int -> UpdateReportPlanResponse -> ShowS
[UpdateReportPlanResponse] -> ShowS
UpdateReportPlanResponse -> String
(Int -> UpdateReportPlanResponse -> ShowS)
-> (UpdateReportPlanResponse -> String)
-> ([UpdateReportPlanResponse] -> ShowS)
-> Show UpdateReportPlanResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReportPlanResponse] -> ShowS
$cshowList :: [UpdateReportPlanResponse] -> ShowS
show :: UpdateReportPlanResponse -> String
$cshow :: UpdateReportPlanResponse -> String
showsPrec :: Int -> UpdateReportPlanResponse -> ShowS
$cshowsPrec :: Int -> UpdateReportPlanResponse -> ShowS
Prelude.Show, (forall x.
 UpdateReportPlanResponse -> Rep UpdateReportPlanResponse x)
-> (forall x.
    Rep UpdateReportPlanResponse x -> UpdateReportPlanResponse)
-> Generic UpdateReportPlanResponse
forall x.
Rep UpdateReportPlanResponse x -> UpdateReportPlanResponse
forall x.
UpdateReportPlanResponse -> Rep UpdateReportPlanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateReportPlanResponse x -> UpdateReportPlanResponse
$cfrom :: forall x.
UpdateReportPlanResponse -> Rep UpdateReportPlanResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateReportPlanResponse' 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:
--
-- 'creationTime', 'updateReportPlanResponse_creationTime' - The date and time that a report plan is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationTime@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'reportPlanName', 'updateReportPlanResponse_reportPlanName' - The unique name of the report plan.
--
-- 'reportPlanArn', 'updateReportPlanResponse_reportPlanArn' - An Amazon Resource Name (ARN) that uniquely identifies a resource. The
-- format of the ARN depends on the resource type.
--
-- 'httpStatus', 'updateReportPlanResponse_httpStatus' - The response's http status code.
newUpdateReportPlanResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateReportPlanResponse
newUpdateReportPlanResponse :: Int -> UpdateReportPlanResponse
newUpdateReportPlanResponse Int
pHttpStatus_ =
  UpdateReportPlanResponse' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> Int -> UpdateReportPlanResponse
UpdateReportPlanResponse'
    { $sel:creationTime:UpdateReportPlanResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:reportPlanName:UpdateReportPlanResponse' :: Maybe Text
reportPlanName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reportPlanArn:UpdateReportPlanResponse' :: Maybe Text
reportPlanArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateReportPlanResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date and time that a report plan is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationTime@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
updateReportPlanResponse_creationTime :: Lens.Lens' UpdateReportPlanResponse (Prelude.Maybe Prelude.UTCTime)
updateReportPlanResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateReportPlanResponse -> f UpdateReportPlanResponse
updateReportPlanResponse_creationTime = (UpdateReportPlanResponse -> Maybe POSIX)
-> (UpdateReportPlanResponse
    -> Maybe POSIX -> UpdateReportPlanResponse)
-> Lens
     UpdateReportPlanResponse
     UpdateReportPlanResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlanResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:UpdateReportPlanResponse' :: UpdateReportPlanResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: UpdateReportPlanResponse
s@UpdateReportPlanResponse' {} Maybe POSIX
a -> UpdateReportPlanResponse
s {$sel:creationTime:UpdateReportPlanResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: UpdateReportPlanResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateReportPlanResponse -> f UpdateReportPlanResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateReportPlanResponse
-> f UpdateReportPlanResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The unique name of the report plan.
updateReportPlanResponse_reportPlanName :: Lens.Lens' UpdateReportPlanResponse (Prelude.Maybe Prelude.Text)
updateReportPlanResponse_reportPlanName :: (Maybe Text -> f (Maybe Text))
-> UpdateReportPlanResponse -> f UpdateReportPlanResponse
updateReportPlanResponse_reportPlanName = (UpdateReportPlanResponse -> Maybe Text)
-> (UpdateReportPlanResponse
    -> Maybe Text -> UpdateReportPlanResponse)
-> Lens
     UpdateReportPlanResponse
     UpdateReportPlanResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlanResponse' {Maybe Text
reportPlanName :: Maybe Text
$sel:reportPlanName:UpdateReportPlanResponse' :: UpdateReportPlanResponse -> Maybe Text
reportPlanName} -> Maybe Text
reportPlanName) (\s :: UpdateReportPlanResponse
s@UpdateReportPlanResponse' {} Maybe Text
a -> UpdateReportPlanResponse
s {$sel:reportPlanName:UpdateReportPlanResponse' :: Maybe Text
reportPlanName = Maybe Text
a} :: UpdateReportPlanResponse)

-- | An Amazon Resource Name (ARN) that uniquely identifies a resource. The
-- format of the ARN depends on the resource type.
updateReportPlanResponse_reportPlanArn :: Lens.Lens' UpdateReportPlanResponse (Prelude.Maybe Prelude.Text)
updateReportPlanResponse_reportPlanArn :: (Maybe Text -> f (Maybe Text))
-> UpdateReportPlanResponse -> f UpdateReportPlanResponse
updateReportPlanResponse_reportPlanArn = (UpdateReportPlanResponse -> Maybe Text)
-> (UpdateReportPlanResponse
    -> Maybe Text -> UpdateReportPlanResponse)
-> Lens
     UpdateReportPlanResponse
     UpdateReportPlanResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportPlanResponse' {Maybe Text
reportPlanArn :: Maybe Text
$sel:reportPlanArn:UpdateReportPlanResponse' :: UpdateReportPlanResponse -> Maybe Text
reportPlanArn} -> Maybe Text
reportPlanArn) (\s :: UpdateReportPlanResponse
s@UpdateReportPlanResponse' {} Maybe Text
a -> UpdateReportPlanResponse
s {$sel:reportPlanArn:UpdateReportPlanResponse' :: Maybe Text
reportPlanArn = Maybe Text
a} :: UpdateReportPlanResponse)

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

instance Prelude.NFData UpdateReportPlanResponse