{-# 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.AlexaBusiness.CreateBusinessReportSchedule
-- 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 recurring schedule for usage reports to deliver to the
-- specified S3 location with a specified daily or weekly interval.
module Amazonka.AlexaBusiness.CreateBusinessReportSchedule
  ( -- * Creating a Request
    CreateBusinessReportSchedule (..),
    newCreateBusinessReportSchedule,

    -- * Request Lenses
    createBusinessReportSchedule_clientRequestToken,
    createBusinessReportSchedule_recurrence,
    createBusinessReportSchedule_s3BucketName,
    createBusinessReportSchedule_s3KeyPrefix,
    createBusinessReportSchedule_scheduleName,
    createBusinessReportSchedule_tags,
    createBusinessReportSchedule_format,
    createBusinessReportSchedule_contentRange,

    -- * Destructuring the Response
    CreateBusinessReportScheduleResponse (..),
    newCreateBusinessReportScheduleResponse,

    -- * Response Lenses
    createBusinessReportScheduleResponse_scheduleArn,
    createBusinessReportScheduleResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateBusinessReportSchedule' smart constructor.
data CreateBusinessReportSchedule = CreateBusinessReportSchedule'
  { -- | The client request token.
    CreateBusinessReportSchedule -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The recurrence of the reports. If this isn\'t specified, the report will
    -- only be delivered one time when the API is called.
    CreateBusinessReportSchedule -> Maybe BusinessReportRecurrence
recurrence :: Prelude.Maybe BusinessReportRecurrence,
    -- | The S3 bucket name of the output reports. If this isn\'t specified, the
    -- report can be retrieved from a download link by calling
    -- ListBusinessReportSchedule.
    CreateBusinessReportSchedule -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
    -- | The S3 key where the report is delivered.
    CreateBusinessReportSchedule -> Maybe Text
s3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | The name identifier of the schedule.
    CreateBusinessReportSchedule -> Maybe Text
scheduleName :: Prelude.Maybe Prelude.Text,
    -- | The tags for the business report schedule.
    CreateBusinessReportSchedule -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The format of the generated report (individual CSV files or zipped files
    -- of individual files).
    CreateBusinessReportSchedule -> BusinessReportFormat
format :: BusinessReportFormat,
    -- | The content range of the reports.
    CreateBusinessReportSchedule -> BusinessReportContentRange
contentRange :: BusinessReportContentRange
  }
  deriving (CreateBusinessReportSchedule
-> CreateBusinessReportSchedule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBusinessReportSchedule
-> CreateBusinessReportSchedule -> Bool
$c/= :: CreateBusinessReportSchedule
-> CreateBusinessReportSchedule -> Bool
== :: CreateBusinessReportSchedule
-> CreateBusinessReportSchedule -> Bool
$c== :: CreateBusinessReportSchedule
-> CreateBusinessReportSchedule -> Bool
Prelude.Eq, ReadPrec [CreateBusinessReportSchedule]
ReadPrec CreateBusinessReportSchedule
Int -> ReadS CreateBusinessReportSchedule
ReadS [CreateBusinessReportSchedule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBusinessReportSchedule]
$creadListPrec :: ReadPrec [CreateBusinessReportSchedule]
readPrec :: ReadPrec CreateBusinessReportSchedule
$creadPrec :: ReadPrec CreateBusinessReportSchedule
readList :: ReadS [CreateBusinessReportSchedule]
$creadList :: ReadS [CreateBusinessReportSchedule]
readsPrec :: Int -> ReadS CreateBusinessReportSchedule
$creadsPrec :: Int -> ReadS CreateBusinessReportSchedule
Prelude.Read, Int -> CreateBusinessReportSchedule -> ShowS
[CreateBusinessReportSchedule] -> ShowS
CreateBusinessReportSchedule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBusinessReportSchedule] -> ShowS
$cshowList :: [CreateBusinessReportSchedule] -> ShowS
show :: CreateBusinessReportSchedule -> String
$cshow :: CreateBusinessReportSchedule -> String
showsPrec :: Int -> CreateBusinessReportSchedule -> ShowS
$cshowsPrec :: Int -> CreateBusinessReportSchedule -> ShowS
Prelude.Show, forall x.
Rep CreateBusinessReportSchedule x -> CreateBusinessReportSchedule
forall x.
CreateBusinessReportSchedule -> Rep CreateBusinessReportSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBusinessReportSchedule x -> CreateBusinessReportSchedule
$cfrom :: forall x.
CreateBusinessReportSchedule -> Rep CreateBusinessReportSchedule x
Prelude.Generic)

-- |
-- Create a value of 'CreateBusinessReportSchedule' 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:
--
-- 'clientRequestToken', 'createBusinessReportSchedule_clientRequestToken' - The client request token.
--
-- 'recurrence', 'createBusinessReportSchedule_recurrence' - The recurrence of the reports. If this isn\'t specified, the report will
-- only be delivered one time when the API is called.
--
-- 's3BucketName', 'createBusinessReportSchedule_s3BucketName' - The S3 bucket name of the output reports. If this isn\'t specified, the
-- report can be retrieved from a download link by calling
-- ListBusinessReportSchedule.
--
-- 's3KeyPrefix', 'createBusinessReportSchedule_s3KeyPrefix' - The S3 key where the report is delivered.
--
-- 'scheduleName', 'createBusinessReportSchedule_scheduleName' - The name identifier of the schedule.
--
-- 'tags', 'createBusinessReportSchedule_tags' - The tags for the business report schedule.
--
-- 'format', 'createBusinessReportSchedule_format' - The format of the generated report (individual CSV files or zipped files
-- of individual files).
--
-- 'contentRange', 'createBusinessReportSchedule_contentRange' - The content range of the reports.
newCreateBusinessReportSchedule ::
  -- | 'format'
  BusinessReportFormat ->
  -- | 'contentRange'
  BusinessReportContentRange ->
  CreateBusinessReportSchedule
newCreateBusinessReportSchedule :: BusinessReportFormat
-> BusinessReportContentRange -> CreateBusinessReportSchedule
newCreateBusinessReportSchedule
  BusinessReportFormat
pFormat_
  BusinessReportContentRange
pContentRange_ =
    CreateBusinessReportSchedule'
      { $sel:clientRequestToken:CreateBusinessReportSchedule' :: Maybe Text
clientRequestToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:recurrence:CreateBusinessReportSchedule' :: Maybe BusinessReportRecurrence
recurrence = forall a. Maybe a
Prelude.Nothing,
        $sel:s3BucketName:CreateBusinessReportSchedule' :: Maybe Text
s3BucketName = forall a. Maybe a
Prelude.Nothing,
        $sel:s3KeyPrefix:CreateBusinessReportSchedule' :: Maybe Text
s3KeyPrefix = forall a. Maybe a
Prelude.Nothing,
        $sel:scheduleName:CreateBusinessReportSchedule' :: Maybe Text
scheduleName = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateBusinessReportSchedule' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:format:CreateBusinessReportSchedule' :: BusinessReportFormat
format = BusinessReportFormat
pFormat_,
        $sel:contentRange:CreateBusinessReportSchedule' :: BusinessReportContentRange
contentRange = BusinessReportContentRange
pContentRange_
      }

-- | The client request token.
createBusinessReportSchedule_clientRequestToken :: Lens.Lens' CreateBusinessReportSchedule (Prelude.Maybe Prelude.Text)
createBusinessReportSchedule_clientRequestToken :: Lens' CreateBusinessReportSchedule (Maybe Text)
createBusinessReportSchedule_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} Maybe Text
a -> CreateBusinessReportSchedule
s {$sel:clientRequestToken:CreateBusinessReportSchedule' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateBusinessReportSchedule)

-- | The recurrence of the reports. If this isn\'t specified, the report will
-- only be delivered one time when the API is called.
createBusinessReportSchedule_recurrence :: Lens.Lens' CreateBusinessReportSchedule (Prelude.Maybe BusinessReportRecurrence)
createBusinessReportSchedule_recurrence :: Lens' CreateBusinessReportSchedule (Maybe BusinessReportRecurrence)
createBusinessReportSchedule_recurrence = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {Maybe BusinessReportRecurrence
recurrence :: Maybe BusinessReportRecurrence
$sel:recurrence:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe BusinessReportRecurrence
recurrence} -> Maybe BusinessReportRecurrence
recurrence) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} Maybe BusinessReportRecurrence
a -> CreateBusinessReportSchedule
s {$sel:recurrence:CreateBusinessReportSchedule' :: Maybe BusinessReportRecurrence
recurrence = Maybe BusinessReportRecurrence
a} :: CreateBusinessReportSchedule)

-- | The S3 bucket name of the output reports. If this isn\'t specified, the
-- report can be retrieved from a download link by calling
-- ListBusinessReportSchedule.
createBusinessReportSchedule_s3BucketName :: Lens.Lens' CreateBusinessReportSchedule (Prelude.Maybe Prelude.Text)
createBusinessReportSchedule_s3BucketName :: Lens' CreateBusinessReportSchedule (Maybe Text)
createBusinessReportSchedule_s3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} Maybe Text
a -> CreateBusinessReportSchedule
s {$sel:s3BucketName:CreateBusinessReportSchedule' :: Maybe Text
s3BucketName = Maybe Text
a} :: CreateBusinessReportSchedule)

-- | The S3 key where the report is delivered.
createBusinessReportSchedule_s3KeyPrefix :: Lens.Lens' CreateBusinessReportSchedule (Prelude.Maybe Prelude.Text)
createBusinessReportSchedule_s3KeyPrefix :: Lens' CreateBusinessReportSchedule (Maybe Text)
createBusinessReportSchedule_s3KeyPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {Maybe Text
s3KeyPrefix :: Maybe Text
$sel:s3KeyPrefix:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
s3KeyPrefix} -> Maybe Text
s3KeyPrefix) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} Maybe Text
a -> CreateBusinessReportSchedule
s {$sel:s3KeyPrefix:CreateBusinessReportSchedule' :: Maybe Text
s3KeyPrefix = Maybe Text
a} :: CreateBusinessReportSchedule)

-- | The name identifier of the schedule.
createBusinessReportSchedule_scheduleName :: Lens.Lens' CreateBusinessReportSchedule (Prelude.Maybe Prelude.Text)
createBusinessReportSchedule_scheduleName :: Lens' CreateBusinessReportSchedule (Maybe Text)
createBusinessReportSchedule_scheduleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {Maybe Text
scheduleName :: Maybe Text
$sel:scheduleName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
scheduleName} -> Maybe Text
scheduleName) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} Maybe Text
a -> CreateBusinessReportSchedule
s {$sel:scheduleName:CreateBusinessReportSchedule' :: Maybe Text
scheduleName = Maybe Text
a} :: CreateBusinessReportSchedule)

-- | The tags for the business report schedule.
createBusinessReportSchedule_tags :: Lens.Lens' CreateBusinessReportSchedule (Prelude.Maybe [Tag])
createBusinessReportSchedule_tags :: Lens' CreateBusinessReportSchedule (Maybe [Tag])
createBusinessReportSchedule_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} Maybe [Tag]
a -> CreateBusinessReportSchedule
s {$sel:tags:CreateBusinessReportSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateBusinessReportSchedule) 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

-- | The format of the generated report (individual CSV files or zipped files
-- of individual files).
createBusinessReportSchedule_format :: Lens.Lens' CreateBusinessReportSchedule BusinessReportFormat
createBusinessReportSchedule_format :: Lens' CreateBusinessReportSchedule BusinessReportFormat
createBusinessReportSchedule_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {BusinessReportFormat
format :: BusinessReportFormat
$sel:format:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportFormat
format} -> BusinessReportFormat
format) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} BusinessReportFormat
a -> CreateBusinessReportSchedule
s {$sel:format:CreateBusinessReportSchedule' :: BusinessReportFormat
format = BusinessReportFormat
a} :: CreateBusinessReportSchedule)

-- | The content range of the reports.
createBusinessReportSchedule_contentRange :: Lens.Lens' CreateBusinessReportSchedule BusinessReportContentRange
createBusinessReportSchedule_contentRange :: Lens' CreateBusinessReportSchedule BusinessReportContentRange
createBusinessReportSchedule_contentRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportSchedule' {BusinessReportContentRange
contentRange :: BusinessReportContentRange
$sel:contentRange:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportContentRange
contentRange} -> BusinessReportContentRange
contentRange) (\s :: CreateBusinessReportSchedule
s@CreateBusinessReportSchedule' {} BusinessReportContentRange
a -> CreateBusinessReportSchedule
s {$sel:contentRange:CreateBusinessReportSchedule' :: BusinessReportContentRange
contentRange = BusinessReportContentRange
a} :: CreateBusinessReportSchedule)

instance Core.AWSRequest CreateBusinessReportSchedule where
  type
    AWSResponse CreateBusinessReportSchedule =
      CreateBusinessReportScheduleResponse
  request :: (Service -> Service)
-> CreateBusinessReportSchedule
-> Request CreateBusinessReportSchedule
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 CreateBusinessReportSchedule
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBusinessReportSchedule)))
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 -> CreateBusinessReportScheduleResponse
CreateBusinessReportScheduleResponse'
            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
"ScheduleArn")
            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
    CreateBusinessReportSchedule
  where
  hashWithSalt :: Int -> CreateBusinessReportSchedule -> Int
hashWithSalt Int
_salt CreateBusinessReportSchedule' {Maybe [Tag]
Maybe Text
Maybe BusinessReportRecurrence
BusinessReportFormat
BusinessReportContentRange
contentRange :: BusinessReportContentRange
format :: BusinessReportFormat
tags :: Maybe [Tag]
scheduleName :: Maybe Text
s3KeyPrefix :: Maybe Text
s3BucketName :: Maybe Text
recurrence :: Maybe BusinessReportRecurrence
clientRequestToken :: Maybe Text
$sel:contentRange:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportContentRange
$sel:format:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportFormat
$sel:tags:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe [Tag]
$sel:scheduleName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:s3KeyPrefix:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:s3BucketName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:recurrence:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe BusinessReportRecurrence
$sel:clientRequestToken:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BusinessReportRecurrence
recurrence
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3BucketName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3KeyPrefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BusinessReportFormat
format
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BusinessReportContentRange
contentRange

instance Prelude.NFData CreateBusinessReportSchedule where
  rnf :: CreateBusinessReportSchedule -> ()
rnf CreateBusinessReportSchedule' {Maybe [Tag]
Maybe Text
Maybe BusinessReportRecurrence
BusinessReportFormat
BusinessReportContentRange
contentRange :: BusinessReportContentRange
format :: BusinessReportFormat
tags :: Maybe [Tag]
scheduleName :: Maybe Text
s3KeyPrefix :: Maybe Text
s3BucketName :: Maybe Text
recurrence :: Maybe BusinessReportRecurrence
clientRequestToken :: Maybe Text
$sel:contentRange:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportContentRange
$sel:format:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportFormat
$sel:tags:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe [Tag]
$sel:scheduleName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:s3KeyPrefix:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:s3BucketName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:recurrence:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe BusinessReportRecurrence
$sel:clientRequestToken:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BusinessReportRecurrence
recurrence
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3BucketName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3KeyPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleName
      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 BusinessReportFormat
format
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BusinessReportContentRange
contentRange

instance Data.ToHeaders CreateBusinessReportSchedule where
  toHeaders :: CreateBusinessReportSchedule -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.CreateBusinessReportSchedule" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateBusinessReportSchedule where
  toJSON :: CreateBusinessReportSchedule -> Value
toJSON CreateBusinessReportSchedule' {Maybe [Tag]
Maybe Text
Maybe BusinessReportRecurrence
BusinessReportFormat
BusinessReportContentRange
contentRange :: BusinessReportContentRange
format :: BusinessReportFormat
tags :: Maybe [Tag]
scheduleName :: Maybe Text
s3KeyPrefix :: Maybe Text
s3BucketName :: Maybe Text
recurrence :: Maybe BusinessReportRecurrence
clientRequestToken :: Maybe Text
$sel:contentRange:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportContentRange
$sel:format:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> BusinessReportFormat
$sel:tags:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe [Tag]
$sel:scheduleName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:s3KeyPrefix:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:s3BucketName:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
$sel:recurrence:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe BusinessReportRecurrence
$sel:clientRequestToken:CreateBusinessReportSchedule' :: CreateBusinessReportSchedule -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientRequestToken" 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
clientRequestToken,
            (Key
"Recurrence" 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 BusinessReportRecurrence
recurrence,
            (Key
"S3BucketName" 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
s3BucketName,
            (Key
"S3KeyPrefix" 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
s3KeyPrefix,
            (Key
"ScheduleName" 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
scheduleName,
            (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
"Format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= BusinessReportFormat
format),
            forall a. a -> Maybe a
Prelude.Just (Key
"ContentRange" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= BusinessReportContentRange
contentRange)
          ]
      )

instance Data.ToPath CreateBusinessReportSchedule where
  toPath :: CreateBusinessReportSchedule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'CreateBusinessReportScheduleResponse' 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:
--
-- 'scheduleArn', 'createBusinessReportScheduleResponse_scheduleArn' - The ARN of the business report schedule.
--
-- 'httpStatus', 'createBusinessReportScheduleResponse_httpStatus' - The response's http status code.
newCreateBusinessReportScheduleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBusinessReportScheduleResponse
newCreateBusinessReportScheduleResponse :: Int -> CreateBusinessReportScheduleResponse
newCreateBusinessReportScheduleResponse Int
pHttpStatus_ =
  CreateBusinessReportScheduleResponse'
    { $sel:scheduleArn:CreateBusinessReportScheduleResponse' :: Maybe Text
scheduleArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateBusinessReportScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the business report schedule.
createBusinessReportScheduleResponse_scheduleArn :: Lens.Lens' CreateBusinessReportScheduleResponse (Prelude.Maybe Prelude.Text)
createBusinessReportScheduleResponse_scheduleArn :: Lens' CreateBusinessReportScheduleResponse (Maybe Text)
createBusinessReportScheduleResponse_scheduleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBusinessReportScheduleResponse' {Maybe Text
scheduleArn :: Maybe Text
$sel:scheduleArn:CreateBusinessReportScheduleResponse' :: CreateBusinessReportScheduleResponse -> Maybe Text
scheduleArn} -> Maybe Text
scheduleArn) (\s :: CreateBusinessReportScheduleResponse
s@CreateBusinessReportScheduleResponse' {} Maybe Text
a -> CreateBusinessReportScheduleResponse
s {$sel:scheduleArn:CreateBusinessReportScheduleResponse' :: Maybe Text
scheduleArn = Maybe Text
a} :: CreateBusinessReportScheduleResponse)

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

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