{-# 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.Amplify.GenerateAccessLogs
-- 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)
--
-- Returns the website access logs for a specific time range using a
-- presigned URL.
module Amazonka.Amplify.GenerateAccessLogs
  ( -- * Creating a Request
    GenerateAccessLogs (..),
    newGenerateAccessLogs,

    -- * Request Lenses
    generateAccessLogs_startTime,
    generateAccessLogs_endTime,
    generateAccessLogs_domainName,
    generateAccessLogs_appId,

    -- * Destructuring the Response
    GenerateAccessLogsResponse (..),
    newGenerateAccessLogsResponse,

    -- * Response Lenses
    generateAccessLogsResponse_logUrl,
    generateAccessLogsResponse_httpStatus,
  )
where

import Amazonka.Amplify.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

-- | The request structure for the generate access logs request.
--
-- /See:/ 'newGenerateAccessLogs' smart constructor.
data GenerateAccessLogs = GenerateAccessLogs'
  { -- | The time at which the logs should start. The time range specified is
    -- inclusive of the start time.
    GenerateAccessLogs -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The time at which the logs should end. The time range specified is
    -- inclusive of the end time.
    GenerateAccessLogs -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the domain.
    GenerateAccessLogs -> Text
domainName :: Prelude.Text,
    -- | The unique ID for an Amplify app.
    GenerateAccessLogs -> Text
appId :: Prelude.Text
  }
  deriving (GenerateAccessLogs -> GenerateAccessLogs -> Bool
(GenerateAccessLogs -> GenerateAccessLogs -> Bool)
-> (GenerateAccessLogs -> GenerateAccessLogs -> Bool)
-> Eq GenerateAccessLogs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateAccessLogs -> GenerateAccessLogs -> Bool
$c/= :: GenerateAccessLogs -> GenerateAccessLogs -> Bool
== :: GenerateAccessLogs -> GenerateAccessLogs -> Bool
$c== :: GenerateAccessLogs -> GenerateAccessLogs -> Bool
Prelude.Eq, ReadPrec [GenerateAccessLogs]
ReadPrec GenerateAccessLogs
Int -> ReadS GenerateAccessLogs
ReadS [GenerateAccessLogs]
(Int -> ReadS GenerateAccessLogs)
-> ReadS [GenerateAccessLogs]
-> ReadPrec GenerateAccessLogs
-> ReadPrec [GenerateAccessLogs]
-> Read GenerateAccessLogs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenerateAccessLogs]
$creadListPrec :: ReadPrec [GenerateAccessLogs]
readPrec :: ReadPrec GenerateAccessLogs
$creadPrec :: ReadPrec GenerateAccessLogs
readList :: ReadS [GenerateAccessLogs]
$creadList :: ReadS [GenerateAccessLogs]
readsPrec :: Int -> ReadS GenerateAccessLogs
$creadsPrec :: Int -> ReadS GenerateAccessLogs
Prelude.Read, Int -> GenerateAccessLogs -> ShowS
[GenerateAccessLogs] -> ShowS
GenerateAccessLogs -> String
(Int -> GenerateAccessLogs -> ShowS)
-> (GenerateAccessLogs -> String)
-> ([GenerateAccessLogs] -> ShowS)
-> Show GenerateAccessLogs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateAccessLogs] -> ShowS
$cshowList :: [GenerateAccessLogs] -> ShowS
show :: GenerateAccessLogs -> String
$cshow :: GenerateAccessLogs -> String
showsPrec :: Int -> GenerateAccessLogs -> ShowS
$cshowsPrec :: Int -> GenerateAccessLogs -> ShowS
Prelude.Show, (forall x. GenerateAccessLogs -> Rep GenerateAccessLogs x)
-> (forall x. Rep GenerateAccessLogs x -> GenerateAccessLogs)
-> Generic GenerateAccessLogs
forall x. Rep GenerateAccessLogs x -> GenerateAccessLogs
forall x. GenerateAccessLogs -> Rep GenerateAccessLogs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GenerateAccessLogs x -> GenerateAccessLogs
$cfrom :: forall x. GenerateAccessLogs -> Rep GenerateAccessLogs x
Prelude.Generic)

-- |
-- Create a value of 'GenerateAccessLogs' 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:
--
-- 'startTime', 'generateAccessLogs_startTime' - The time at which the logs should start. The time range specified is
-- inclusive of the start time.
--
-- 'endTime', 'generateAccessLogs_endTime' - The time at which the logs should end. The time range specified is
-- inclusive of the end time.
--
-- 'domainName', 'generateAccessLogs_domainName' - The name of the domain.
--
-- 'appId', 'generateAccessLogs_appId' - The unique ID for an Amplify app.
newGenerateAccessLogs ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'appId'
  Prelude.Text ->
  GenerateAccessLogs
newGenerateAccessLogs :: Text -> Text -> GenerateAccessLogs
newGenerateAccessLogs Text
pDomainName_ Text
pAppId_ =
  GenerateAccessLogs' :: Maybe POSIX -> Maybe POSIX -> Text -> Text -> GenerateAccessLogs
GenerateAccessLogs'
    { $sel:startTime:GenerateAccessLogs' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:GenerateAccessLogs' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:GenerateAccessLogs' :: Text
domainName = Text
pDomainName_,
      $sel:appId:GenerateAccessLogs' :: Text
appId = Text
pAppId_
    }

-- | The time at which the logs should start. The time range specified is
-- inclusive of the start time.
generateAccessLogs_startTime :: Lens.Lens' GenerateAccessLogs (Prelude.Maybe Prelude.UTCTime)
generateAccessLogs_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GenerateAccessLogs -> f GenerateAccessLogs
generateAccessLogs_startTime = (GenerateAccessLogs -> Maybe POSIX)
-> (GenerateAccessLogs -> Maybe POSIX -> GenerateAccessLogs)
-> Lens
     GenerateAccessLogs GenerateAccessLogs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateAccessLogs' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:GenerateAccessLogs' :: GenerateAccessLogs -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: GenerateAccessLogs
s@GenerateAccessLogs' {} Maybe POSIX
a -> GenerateAccessLogs
s {$sel:startTime:GenerateAccessLogs' :: Maybe POSIX
startTime = Maybe POSIX
a} :: GenerateAccessLogs) ((Maybe POSIX -> f (Maybe POSIX))
 -> GenerateAccessLogs -> f GenerateAccessLogs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GenerateAccessLogs
-> f GenerateAccessLogs
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 time at which the logs should end. The time range specified is
-- inclusive of the end time.
generateAccessLogs_endTime :: Lens.Lens' GenerateAccessLogs (Prelude.Maybe Prelude.UTCTime)
generateAccessLogs_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GenerateAccessLogs -> f GenerateAccessLogs
generateAccessLogs_endTime = (GenerateAccessLogs -> Maybe POSIX)
-> (GenerateAccessLogs -> Maybe POSIX -> GenerateAccessLogs)
-> Lens
     GenerateAccessLogs GenerateAccessLogs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateAccessLogs' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:GenerateAccessLogs' :: GenerateAccessLogs -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: GenerateAccessLogs
s@GenerateAccessLogs' {} Maybe POSIX
a -> GenerateAccessLogs
s {$sel:endTime:GenerateAccessLogs' :: Maybe POSIX
endTime = Maybe POSIX
a} :: GenerateAccessLogs) ((Maybe POSIX -> f (Maybe POSIX))
 -> GenerateAccessLogs -> f GenerateAccessLogs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GenerateAccessLogs
-> f GenerateAccessLogs
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 name of the domain.
generateAccessLogs_domainName :: Lens.Lens' GenerateAccessLogs Prelude.Text
generateAccessLogs_domainName :: (Text -> f Text) -> GenerateAccessLogs -> f GenerateAccessLogs
generateAccessLogs_domainName = (GenerateAccessLogs -> Text)
-> (GenerateAccessLogs -> Text -> GenerateAccessLogs)
-> Lens GenerateAccessLogs GenerateAccessLogs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateAccessLogs' {Text
domainName :: Text
$sel:domainName:GenerateAccessLogs' :: GenerateAccessLogs -> Text
domainName} -> Text
domainName) (\s :: GenerateAccessLogs
s@GenerateAccessLogs' {} Text
a -> GenerateAccessLogs
s {$sel:domainName:GenerateAccessLogs' :: Text
domainName = Text
a} :: GenerateAccessLogs)

-- | The unique ID for an Amplify app.
generateAccessLogs_appId :: Lens.Lens' GenerateAccessLogs Prelude.Text
generateAccessLogs_appId :: (Text -> f Text) -> GenerateAccessLogs -> f GenerateAccessLogs
generateAccessLogs_appId = (GenerateAccessLogs -> Text)
-> (GenerateAccessLogs -> Text -> GenerateAccessLogs)
-> Lens GenerateAccessLogs GenerateAccessLogs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateAccessLogs' {Text
appId :: Text
$sel:appId:GenerateAccessLogs' :: GenerateAccessLogs -> Text
appId} -> Text
appId) (\s :: GenerateAccessLogs
s@GenerateAccessLogs' {} Text
a -> GenerateAccessLogs
s {$sel:appId:GenerateAccessLogs' :: Text
appId = Text
a} :: GenerateAccessLogs)

instance Core.AWSRequest GenerateAccessLogs where
  type
    AWSResponse GenerateAccessLogs =
      GenerateAccessLogsResponse
  request :: GenerateAccessLogs -> Request GenerateAccessLogs
request = Service -> GenerateAccessLogs -> Request GenerateAccessLogs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GenerateAccessLogs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GenerateAccessLogs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GenerateAccessLogs))
-> Logger
-> Service
-> Proxy GenerateAccessLogs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GenerateAccessLogs)))
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 -> GenerateAccessLogsResponse
GenerateAccessLogsResponse'
            (Maybe Text -> Int -> GenerateAccessLogsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GenerateAccessLogsResponse)
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
"logUrl")
            Either String (Int -> GenerateAccessLogsResponse)
-> Either String Int -> Either String GenerateAccessLogsResponse
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 GenerateAccessLogs

instance Prelude.NFData GenerateAccessLogs

instance Core.ToHeaders GenerateAccessLogs where
  toHeaders :: GenerateAccessLogs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GenerateAccessLogs -> 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 GenerateAccessLogs where
  toJSON :: GenerateAccessLogs -> Value
toJSON GenerateAccessLogs' {Maybe POSIX
Text
appId :: Text
domainName :: Text
endTime :: Maybe POSIX
startTime :: Maybe POSIX
$sel:appId:GenerateAccessLogs' :: GenerateAccessLogs -> Text
$sel:domainName:GenerateAccessLogs' :: GenerateAccessLogs -> Text
$sel:endTime:GenerateAccessLogs' :: GenerateAccessLogs -> Maybe POSIX
$sel:startTime:GenerateAccessLogs' :: GenerateAccessLogs -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"startTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
startTime,
            (Text
"endTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
endTime,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"domainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
          ]
      )

instance Core.ToPath GenerateAccessLogs where
  toPath :: GenerateAccessLogs -> ByteString
toPath GenerateAccessLogs' {Maybe POSIX
Text
appId :: Text
domainName :: Text
endTime :: Maybe POSIX
startTime :: Maybe POSIX
$sel:appId:GenerateAccessLogs' :: GenerateAccessLogs -> Text
$sel:domainName:GenerateAccessLogs' :: GenerateAccessLogs -> Text
$sel:endTime:GenerateAccessLogs' :: GenerateAccessLogs -> Maybe POSIX
$sel:startTime:GenerateAccessLogs' :: GenerateAccessLogs -> Maybe POSIX
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/apps/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId, ByteString
"/accesslogs"]

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

-- | The result structure for the generate access logs request.
--
-- /See:/ 'newGenerateAccessLogsResponse' smart constructor.
data GenerateAccessLogsResponse = GenerateAccessLogsResponse'
  { -- | The pre-signed URL for the requested access logs.
    GenerateAccessLogsResponse -> Maybe Text
logUrl :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GenerateAccessLogsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GenerateAccessLogsResponse -> GenerateAccessLogsResponse -> Bool
(GenerateAccessLogsResponse -> GenerateAccessLogsResponse -> Bool)
-> (GenerateAccessLogsResponse
    -> GenerateAccessLogsResponse -> Bool)
-> Eq GenerateAccessLogsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateAccessLogsResponse -> GenerateAccessLogsResponse -> Bool
$c/= :: GenerateAccessLogsResponse -> GenerateAccessLogsResponse -> Bool
== :: GenerateAccessLogsResponse -> GenerateAccessLogsResponse -> Bool
$c== :: GenerateAccessLogsResponse -> GenerateAccessLogsResponse -> Bool
Prelude.Eq, ReadPrec [GenerateAccessLogsResponse]
ReadPrec GenerateAccessLogsResponse
Int -> ReadS GenerateAccessLogsResponse
ReadS [GenerateAccessLogsResponse]
(Int -> ReadS GenerateAccessLogsResponse)
-> ReadS [GenerateAccessLogsResponse]
-> ReadPrec GenerateAccessLogsResponse
-> ReadPrec [GenerateAccessLogsResponse]
-> Read GenerateAccessLogsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenerateAccessLogsResponse]
$creadListPrec :: ReadPrec [GenerateAccessLogsResponse]
readPrec :: ReadPrec GenerateAccessLogsResponse
$creadPrec :: ReadPrec GenerateAccessLogsResponse
readList :: ReadS [GenerateAccessLogsResponse]
$creadList :: ReadS [GenerateAccessLogsResponse]
readsPrec :: Int -> ReadS GenerateAccessLogsResponse
$creadsPrec :: Int -> ReadS GenerateAccessLogsResponse
Prelude.Read, Int -> GenerateAccessLogsResponse -> ShowS
[GenerateAccessLogsResponse] -> ShowS
GenerateAccessLogsResponse -> String
(Int -> GenerateAccessLogsResponse -> ShowS)
-> (GenerateAccessLogsResponse -> String)
-> ([GenerateAccessLogsResponse] -> ShowS)
-> Show GenerateAccessLogsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateAccessLogsResponse] -> ShowS
$cshowList :: [GenerateAccessLogsResponse] -> ShowS
show :: GenerateAccessLogsResponse -> String
$cshow :: GenerateAccessLogsResponse -> String
showsPrec :: Int -> GenerateAccessLogsResponse -> ShowS
$cshowsPrec :: Int -> GenerateAccessLogsResponse -> ShowS
Prelude.Show, (forall x.
 GenerateAccessLogsResponse -> Rep GenerateAccessLogsResponse x)
-> (forall x.
    Rep GenerateAccessLogsResponse x -> GenerateAccessLogsResponse)
-> Generic GenerateAccessLogsResponse
forall x.
Rep GenerateAccessLogsResponse x -> GenerateAccessLogsResponse
forall x.
GenerateAccessLogsResponse -> Rep GenerateAccessLogsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateAccessLogsResponse x -> GenerateAccessLogsResponse
$cfrom :: forall x.
GenerateAccessLogsResponse -> Rep GenerateAccessLogsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GenerateAccessLogsResponse' 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:
--
-- 'logUrl', 'generateAccessLogsResponse_logUrl' - The pre-signed URL for the requested access logs.
--
-- 'httpStatus', 'generateAccessLogsResponse_httpStatus' - The response's http status code.
newGenerateAccessLogsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GenerateAccessLogsResponse
newGenerateAccessLogsResponse :: Int -> GenerateAccessLogsResponse
newGenerateAccessLogsResponse Int
pHttpStatus_ =
  GenerateAccessLogsResponse' :: Maybe Text -> Int -> GenerateAccessLogsResponse
GenerateAccessLogsResponse'
    { $sel:logUrl:GenerateAccessLogsResponse' :: Maybe Text
logUrl =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GenerateAccessLogsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pre-signed URL for the requested access logs.
generateAccessLogsResponse_logUrl :: Lens.Lens' GenerateAccessLogsResponse (Prelude.Maybe Prelude.Text)
generateAccessLogsResponse_logUrl :: (Maybe Text -> f (Maybe Text))
-> GenerateAccessLogsResponse -> f GenerateAccessLogsResponse
generateAccessLogsResponse_logUrl = (GenerateAccessLogsResponse -> Maybe Text)
-> (GenerateAccessLogsResponse
    -> Maybe Text -> GenerateAccessLogsResponse)
-> Lens
     GenerateAccessLogsResponse
     GenerateAccessLogsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateAccessLogsResponse' {Maybe Text
logUrl :: Maybe Text
$sel:logUrl:GenerateAccessLogsResponse' :: GenerateAccessLogsResponse -> Maybe Text
logUrl} -> Maybe Text
logUrl) (\s :: GenerateAccessLogsResponse
s@GenerateAccessLogsResponse' {} Maybe Text
a -> GenerateAccessLogsResponse
s {$sel:logUrl:GenerateAccessLogsResponse' :: Maybe Text
logUrl = Maybe Text
a} :: GenerateAccessLogsResponse)

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

instance Prelude.NFData GenerateAccessLogsResponse