{-# 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.CloudFront.CreateRealtimeLogConfig
-- 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)
--
-- Creates a real-time log configuration.
--
-- After you create a real-time log configuration, you can attach it to one
-- or more cache behaviors to send real-time log data to the specified
-- Amazon Kinesis data stream.
--
-- For more information about real-time log configurations, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html Real-time logs>
-- in the /Amazon CloudFront Developer Guide/.
module Amazonka.CloudFront.CreateRealtimeLogConfig
  ( -- * Creating a Request
    CreateRealtimeLogConfig (..),
    newCreateRealtimeLogConfig,

    -- * Request Lenses
    createRealtimeLogConfig_endPoints,
    createRealtimeLogConfig_fields,
    createRealtimeLogConfig_name,
    createRealtimeLogConfig_samplingRate,

    -- * Destructuring the Response
    CreateRealtimeLogConfigResponse (..),
    newCreateRealtimeLogConfigResponse,

    -- * Response Lenses
    createRealtimeLogConfigResponse_realtimeLogConfig,
    createRealtimeLogConfigResponse_httpStatus,
  )
where

import Amazonka.CloudFront.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:/ 'newCreateRealtimeLogConfig' smart constructor.
data CreateRealtimeLogConfig = CreateRealtimeLogConfig'
  { -- | Contains information about the Amazon Kinesis data stream where you are
    -- sending real-time log data.
    CreateRealtimeLogConfig -> [EndPoint]
endPoints :: [EndPoint],
    -- | A list of fields to include in each real-time log record.
    --
    -- For more information about fields, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields Real-time log configuration fields>
    -- in the /Amazon CloudFront Developer Guide/.
    CreateRealtimeLogConfig -> [Text]
fields :: [Prelude.Text],
    -- | A unique name to identify this real-time log configuration.
    CreateRealtimeLogConfig -> Text
name :: Prelude.Text,
    -- | The sampling rate for this real-time log configuration. The sampling
    -- rate determines the percentage of viewer requests that are represented
    -- in the real-time log data. You must provide an integer between 1 and
    -- 100, inclusive.
    CreateRealtimeLogConfig -> Integer
samplingRate :: Prelude.Integer
  }
  deriving (CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool
(CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool)
-> (CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool)
-> Eq CreateRealtimeLogConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool
$c/= :: CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool
== :: CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool
$c== :: CreateRealtimeLogConfig -> CreateRealtimeLogConfig -> Bool
Prelude.Eq, ReadPrec [CreateRealtimeLogConfig]
ReadPrec CreateRealtimeLogConfig
Int -> ReadS CreateRealtimeLogConfig
ReadS [CreateRealtimeLogConfig]
(Int -> ReadS CreateRealtimeLogConfig)
-> ReadS [CreateRealtimeLogConfig]
-> ReadPrec CreateRealtimeLogConfig
-> ReadPrec [CreateRealtimeLogConfig]
-> Read CreateRealtimeLogConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRealtimeLogConfig]
$creadListPrec :: ReadPrec [CreateRealtimeLogConfig]
readPrec :: ReadPrec CreateRealtimeLogConfig
$creadPrec :: ReadPrec CreateRealtimeLogConfig
readList :: ReadS [CreateRealtimeLogConfig]
$creadList :: ReadS [CreateRealtimeLogConfig]
readsPrec :: Int -> ReadS CreateRealtimeLogConfig
$creadsPrec :: Int -> ReadS CreateRealtimeLogConfig
Prelude.Read, Int -> CreateRealtimeLogConfig -> ShowS
[CreateRealtimeLogConfig] -> ShowS
CreateRealtimeLogConfig -> String
(Int -> CreateRealtimeLogConfig -> ShowS)
-> (CreateRealtimeLogConfig -> String)
-> ([CreateRealtimeLogConfig] -> ShowS)
-> Show CreateRealtimeLogConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRealtimeLogConfig] -> ShowS
$cshowList :: [CreateRealtimeLogConfig] -> ShowS
show :: CreateRealtimeLogConfig -> String
$cshow :: CreateRealtimeLogConfig -> String
showsPrec :: Int -> CreateRealtimeLogConfig -> ShowS
$cshowsPrec :: Int -> CreateRealtimeLogConfig -> ShowS
Prelude.Show, (forall x.
 CreateRealtimeLogConfig -> Rep CreateRealtimeLogConfig x)
-> (forall x.
    Rep CreateRealtimeLogConfig x -> CreateRealtimeLogConfig)
-> Generic CreateRealtimeLogConfig
forall x. Rep CreateRealtimeLogConfig x -> CreateRealtimeLogConfig
forall x. CreateRealtimeLogConfig -> Rep CreateRealtimeLogConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRealtimeLogConfig x -> CreateRealtimeLogConfig
$cfrom :: forall x. CreateRealtimeLogConfig -> Rep CreateRealtimeLogConfig x
Prelude.Generic)

-- |
-- Create a value of 'CreateRealtimeLogConfig' 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:
--
-- 'endPoints', 'createRealtimeLogConfig_endPoints' - Contains information about the Amazon Kinesis data stream where you are
-- sending real-time log data.
--
-- 'fields', 'createRealtimeLogConfig_fields' - A list of fields to include in each real-time log record.
--
-- For more information about fields, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields Real-time log configuration fields>
-- in the /Amazon CloudFront Developer Guide/.
--
-- 'name', 'createRealtimeLogConfig_name' - A unique name to identify this real-time log configuration.
--
-- 'samplingRate', 'createRealtimeLogConfig_samplingRate' - The sampling rate for this real-time log configuration. The sampling
-- rate determines the percentage of viewer requests that are represented
-- in the real-time log data. You must provide an integer between 1 and
-- 100, inclusive.
newCreateRealtimeLogConfig ::
  -- | 'name'
  Prelude.Text ->
  -- | 'samplingRate'
  Prelude.Integer ->
  CreateRealtimeLogConfig
newCreateRealtimeLogConfig :: Text -> Integer -> CreateRealtimeLogConfig
newCreateRealtimeLogConfig Text
pName_ Integer
pSamplingRate_ =
  CreateRealtimeLogConfig' :: [EndPoint] -> [Text] -> Text -> Integer -> CreateRealtimeLogConfig
CreateRealtimeLogConfig'
    { $sel:endPoints:CreateRealtimeLogConfig' :: [EndPoint]
endPoints =
        [EndPoint]
forall a. Monoid a => a
Prelude.mempty,
      $sel:fields:CreateRealtimeLogConfig' :: [Text]
fields = [Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:name:CreateRealtimeLogConfig' :: Text
name = Text
pName_,
      $sel:samplingRate:CreateRealtimeLogConfig' :: Integer
samplingRate = Integer
pSamplingRate_
    }

-- | Contains information about the Amazon Kinesis data stream where you are
-- sending real-time log data.
createRealtimeLogConfig_endPoints :: Lens.Lens' CreateRealtimeLogConfig [EndPoint]
createRealtimeLogConfig_endPoints :: ([EndPoint] -> f [EndPoint])
-> CreateRealtimeLogConfig -> f CreateRealtimeLogConfig
createRealtimeLogConfig_endPoints = (CreateRealtimeLogConfig -> [EndPoint])
-> (CreateRealtimeLogConfig
    -> [EndPoint] -> CreateRealtimeLogConfig)
-> Lens
     CreateRealtimeLogConfig
     CreateRealtimeLogConfig
     [EndPoint]
     [EndPoint]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRealtimeLogConfig' {[EndPoint]
endPoints :: [EndPoint]
$sel:endPoints:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> [EndPoint]
endPoints} -> [EndPoint]
endPoints) (\s :: CreateRealtimeLogConfig
s@CreateRealtimeLogConfig' {} [EndPoint]
a -> CreateRealtimeLogConfig
s {$sel:endPoints:CreateRealtimeLogConfig' :: [EndPoint]
endPoints = [EndPoint]
a} :: CreateRealtimeLogConfig) (([EndPoint] -> f [EndPoint])
 -> CreateRealtimeLogConfig -> f CreateRealtimeLogConfig)
-> (([EndPoint] -> f [EndPoint]) -> [EndPoint] -> f [EndPoint])
-> ([EndPoint] -> f [EndPoint])
-> CreateRealtimeLogConfig
-> f CreateRealtimeLogConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EndPoint] -> f [EndPoint]) -> [EndPoint] -> f [EndPoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of fields to include in each real-time log record.
--
-- For more information about fields, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields Real-time log configuration fields>
-- in the /Amazon CloudFront Developer Guide/.
createRealtimeLogConfig_fields :: Lens.Lens' CreateRealtimeLogConfig [Prelude.Text]
createRealtimeLogConfig_fields :: ([Text] -> f [Text])
-> CreateRealtimeLogConfig -> f CreateRealtimeLogConfig
createRealtimeLogConfig_fields = (CreateRealtimeLogConfig -> [Text])
-> (CreateRealtimeLogConfig -> [Text] -> CreateRealtimeLogConfig)
-> Lens
     CreateRealtimeLogConfig CreateRealtimeLogConfig [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRealtimeLogConfig' {[Text]
fields :: [Text]
$sel:fields:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> [Text]
fields} -> [Text]
fields) (\s :: CreateRealtimeLogConfig
s@CreateRealtimeLogConfig' {} [Text]
a -> CreateRealtimeLogConfig
s {$sel:fields:CreateRealtimeLogConfig' :: [Text]
fields = [Text]
a} :: CreateRealtimeLogConfig) (([Text] -> f [Text])
 -> CreateRealtimeLogConfig -> f CreateRealtimeLogConfig)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateRealtimeLogConfig
-> f CreateRealtimeLogConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique name to identify this real-time log configuration.
createRealtimeLogConfig_name :: Lens.Lens' CreateRealtimeLogConfig Prelude.Text
createRealtimeLogConfig_name :: (Text -> f Text)
-> CreateRealtimeLogConfig -> f CreateRealtimeLogConfig
createRealtimeLogConfig_name = (CreateRealtimeLogConfig -> Text)
-> (CreateRealtimeLogConfig -> Text -> CreateRealtimeLogConfig)
-> Lens CreateRealtimeLogConfig CreateRealtimeLogConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRealtimeLogConfig' {Text
name :: Text
$sel:name:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> Text
name} -> Text
name) (\s :: CreateRealtimeLogConfig
s@CreateRealtimeLogConfig' {} Text
a -> CreateRealtimeLogConfig
s {$sel:name:CreateRealtimeLogConfig' :: Text
name = Text
a} :: CreateRealtimeLogConfig)

-- | The sampling rate for this real-time log configuration. The sampling
-- rate determines the percentage of viewer requests that are represented
-- in the real-time log data. You must provide an integer between 1 and
-- 100, inclusive.
createRealtimeLogConfig_samplingRate :: Lens.Lens' CreateRealtimeLogConfig Prelude.Integer
createRealtimeLogConfig_samplingRate :: (Integer -> f Integer)
-> CreateRealtimeLogConfig -> f CreateRealtimeLogConfig
createRealtimeLogConfig_samplingRate = (CreateRealtimeLogConfig -> Integer)
-> (CreateRealtimeLogConfig -> Integer -> CreateRealtimeLogConfig)
-> Lens
     CreateRealtimeLogConfig CreateRealtimeLogConfig Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRealtimeLogConfig' {Integer
samplingRate :: Integer
$sel:samplingRate:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> Integer
samplingRate} -> Integer
samplingRate) (\s :: CreateRealtimeLogConfig
s@CreateRealtimeLogConfig' {} Integer
a -> CreateRealtimeLogConfig
s {$sel:samplingRate:CreateRealtimeLogConfig' :: Integer
samplingRate = Integer
a} :: CreateRealtimeLogConfig)

instance Core.AWSRequest CreateRealtimeLogConfig where
  type
    AWSResponse CreateRealtimeLogConfig =
      CreateRealtimeLogConfigResponse
  request :: CreateRealtimeLogConfig -> Request CreateRealtimeLogConfig
request = Service
-> CreateRealtimeLogConfig -> Request CreateRealtimeLogConfig
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateRealtimeLogConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateRealtimeLogConfig)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse CreateRealtimeLogConfig))
-> Logger
-> Service
-> Proxy CreateRealtimeLogConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateRealtimeLogConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe RealtimeLogConfig -> Int -> CreateRealtimeLogConfigResponse
CreateRealtimeLogConfigResponse'
            (Maybe RealtimeLogConfig -> Int -> CreateRealtimeLogConfigResponse)
-> Either String (Maybe RealtimeLogConfig)
-> Either String (Int -> CreateRealtimeLogConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe RealtimeLogConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RealtimeLogConfig")
            Either String (Int -> CreateRealtimeLogConfigResponse)
-> Either String Int
-> Either String CreateRealtimeLogConfigResponse
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 CreateRealtimeLogConfig

instance Prelude.NFData CreateRealtimeLogConfig

instance Core.ToElement CreateRealtimeLogConfig where
  toElement :: CreateRealtimeLogConfig -> Element
toElement =
    Name -> CreateRealtimeLogConfig -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://cloudfront.amazonaws.com/doc/2020-05-31/}CreateRealtimeLogConfigRequest"

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

instance Core.ToPath CreateRealtimeLogConfig where
  toPath :: CreateRealtimeLogConfig -> ByteString
toPath =
    ByteString -> CreateRealtimeLogConfig -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2020-05-31/realtime-log-config"

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

instance Core.ToXML CreateRealtimeLogConfig where
  toXML :: CreateRealtimeLogConfig -> XML
toXML CreateRealtimeLogConfig' {Integer
[Text]
[EndPoint]
Text
samplingRate :: Integer
name :: Text
fields :: [Text]
endPoints :: [EndPoint]
$sel:samplingRate:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> Integer
$sel:name:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> Text
$sel:fields:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> [Text]
$sel:endPoints:CreateRealtimeLogConfig' :: CreateRealtimeLogConfig -> [EndPoint]
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"EndPoints"
          Name -> XML -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Name -> [EndPoint] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"member" [EndPoint]
endPoints,
        Name
"Fields" Name -> XML -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Name -> [Text] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"Field" [Text]
fields,
        Name
"Name" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
name,
        Name
"SamplingRate" Name -> Integer -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Integer
samplingRate
      ]

-- | /See:/ 'newCreateRealtimeLogConfigResponse' smart constructor.
data CreateRealtimeLogConfigResponse = CreateRealtimeLogConfigResponse'
  { -- | A real-time log configuration.
    CreateRealtimeLogConfigResponse -> Maybe RealtimeLogConfig
realtimeLogConfig :: Prelude.Maybe RealtimeLogConfig,
    -- | The response's http status code.
    CreateRealtimeLogConfigResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateRealtimeLogConfigResponse
-> CreateRealtimeLogConfigResponse -> Bool
(CreateRealtimeLogConfigResponse
 -> CreateRealtimeLogConfigResponse -> Bool)
-> (CreateRealtimeLogConfigResponse
    -> CreateRealtimeLogConfigResponse -> Bool)
-> Eq CreateRealtimeLogConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRealtimeLogConfigResponse
-> CreateRealtimeLogConfigResponse -> Bool
$c/= :: CreateRealtimeLogConfigResponse
-> CreateRealtimeLogConfigResponse -> Bool
== :: CreateRealtimeLogConfigResponse
-> CreateRealtimeLogConfigResponse -> Bool
$c== :: CreateRealtimeLogConfigResponse
-> CreateRealtimeLogConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateRealtimeLogConfigResponse]
ReadPrec CreateRealtimeLogConfigResponse
Int -> ReadS CreateRealtimeLogConfigResponse
ReadS [CreateRealtimeLogConfigResponse]
(Int -> ReadS CreateRealtimeLogConfigResponse)
-> ReadS [CreateRealtimeLogConfigResponse]
-> ReadPrec CreateRealtimeLogConfigResponse
-> ReadPrec [CreateRealtimeLogConfigResponse]
-> Read CreateRealtimeLogConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRealtimeLogConfigResponse]
$creadListPrec :: ReadPrec [CreateRealtimeLogConfigResponse]
readPrec :: ReadPrec CreateRealtimeLogConfigResponse
$creadPrec :: ReadPrec CreateRealtimeLogConfigResponse
readList :: ReadS [CreateRealtimeLogConfigResponse]
$creadList :: ReadS [CreateRealtimeLogConfigResponse]
readsPrec :: Int -> ReadS CreateRealtimeLogConfigResponse
$creadsPrec :: Int -> ReadS CreateRealtimeLogConfigResponse
Prelude.Read, Int -> CreateRealtimeLogConfigResponse -> ShowS
[CreateRealtimeLogConfigResponse] -> ShowS
CreateRealtimeLogConfigResponse -> String
(Int -> CreateRealtimeLogConfigResponse -> ShowS)
-> (CreateRealtimeLogConfigResponse -> String)
-> ([CreateRealtimeLogConfigResponse] -> ShowS)
-> Show CreateRealtimeLogConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRealtimeLogConfigResponse] -> ShowS
$cshowList :: [CreateRealtimeLogConfigResponse] -> ShowS
show :: CreateRealtimeLogConfigResponse -> String
$cshow :: CreateRealtimeLogConfigResponse -> String
showsPrec :: Int -> CreateRealtimeLogConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateRealtimeLogConfigResponse -> ShowS
Prelude.Show, (forall x.
 CreateRealtimeLogConfigResponse
 -> Rep CreateRealtimeLogConfigResponse x)
-> (forall x.
    Rep CreateRealtimeLogConfigResponse x
    -> CreateRealtimeLogConfigResponse)
-> Generic CreateRealtimeLogConfigResponse
forall x.
Rep CreateRealtimeLogConfigResponse x
-> CreateRealtimeLogConfigResponse
forall x.
CreateRealtimeLogConfigResponse
-> Rep CreateRealtimeLogConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRealtimeLogConfigResponse x
-> CreateRealtimeLogConfigResponse
$cfrom :: forall x.
CreateRealtimeLogConfigResponse
-> Rep CreateRealtimeLogConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateRealtimeLogConfigResponse' 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:
--
-- 'realtimeLogConfig', 'createRealtimeLogConfigResponse_realtimeLogConfig' - A real-time log configuration.
--
-- 'httpStatus', 'createRealtimeLogConfigResponse_httpStatus' - The response's http status code.
newCreateRealtimeLogConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRealtimeLogConfigResponse
newCreateRealtimeLogConfigResponse :: Int -> CreateRealtimeLogConfigResponse
newCreateRealtimeLogConfigResponse Int
pHttpStatus_ =
  CreateRealtimeLogConfigResponse' :: Maybe RealtimeLogConfig -> Int -> CreateRealtimeLogConfigResponse
CreateRealtimeLogConfigResponse'
    { $sel:realtimeLogConfig:CreateRealtimeLogConfigResponse' :: Maybe RealtimeLogConfig
realtimeLogConfig =
        Maybe RealtimeLogConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRealtimeLogConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A real-time log configuration.
createRealtimeLogConfigResponse_realtimeLogConfig :: Lens.Lens' CreateRealtimeLogConfigResponse (Prelude.Maybe RealtimeLogConfig)
createRealtimeLogConfigResponse_realtimeLogConfig :: (Maybe RealtimeLogConfig -> f (Maybe RealtimeLogConfig))
-> CreateRealtimeLogConfigResponse
-> f CreateRealtimeLogConfigResponse
createRealtimeLogConfigResponse_realtimeLogConfig = (CreateRealtimeLogConfigResponse -> Maybe RealtimeLogConfig)
-> (CreateRealtimeLogConfigResponse
    -> Maybe RealtimeLogConfig -> CreateRealtimeLogConfigResponse)
-> Lens
     CreateRealtimeLogConfigResponse
     CreateRealtimeLogConfigResponse
     (Maybe RealtimeLogConfig)
     (Maybe RealtimeLogConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRealtimeLogConfigResponse' {Maybe RealtimeLogConfig
realtimeLogConfig :: Maybe RealtimeLogConfig
$sel:realtimeLogConfig:CreateRealtimeLogConfigResponse' :: CreateRealtimeLogConfigResponse -> Maybe RealtimeLogConfig
realtimeLogConfig} -> Maybe RealtimeLogConfig
realtimeLogConfig) (\s :: CreateRealtimeLogConfigResponse
s@CreateRealtimeLogConfigResponse' {} Maybe RealtimeLogConfig
a -> CreateRealtimeLogConfigResponse
s {$sel:realtimeLogConfig:CreateRealtimeLogConfigResponse' :: Maybe RealtimeLogConfig
realtimeLogConfig = Maybe RealtimeLogConfig
a} :: CreateRealtimeLogConfigResponse)

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

instance
  Prelude.NFData
    CreateRealtimeLogConfigResponse