{-# 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.IVSChat.CreateLoggingConfiguration
-- 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 logging configuration that allows clients to store and record
-- sent messages.
module Amazonka.IVSChat.CreateLoggingConfiguration
  ( -- * Creating a Request
    CreateLoggingConfiguration (..),
    newCreateLoggingConfiguration,

    -- * Request Lenses
    createLoggingConfiguration_name,
    createLoggingConfiguration_tags,
    createLoggingConfiguration_destinationConfiguration,

    -- * Destructuring the Response
    CreateLoggingConfigurationResponse (..),
    newCreateLoggingConfigurationResponse,

    -- * Response Lenses
    createLoggingConfigurationResponse_arn,
    createLoggingConfigurationResponse_createTime,
    createLoggingConfigurationResponse_destinationConfiguration,
    createLoggingConfigurationResponse_id,
    createLoggingConfigurationResponse_name,
    createLoggingConfigurationResponse_state,
    createLoggingConfigurationResponse_tags,
    createLoggingConfigurationResponse_updateTime,
    createLoggingConfigurationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateLoggingConfiguration' smart constructor.
data CreateLoggingConfiguration = CreateLoggingConfiguration'
  { -- | Logging-configuration name. The value does not need to be unique.
    CreateLoggingConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Tags to attach to the resource. Array of maps, each of the form
    -- @string:string (key:value)@. See
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
    -- for details, including restrictions that apply to tags and \"Tag naming
    -- limits and requirements\"; Amazon IVS Chat has no constraints on tags
    -- beyond what is documented there.
    CreateLoggingConfiguration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A complex type that contains a destination configuration for where chat
    -- content will be logged. There can be only one type of destination
    -- (@cloudWatchLogs@, @firehose@, or @s3@) in a @destinationConfiguration@.
    CreateLoggingConfiguration -> DestinationConfiguration
destinationConfiguration :: DestinationConfiguration
  }
  deriving (CreateLoggingConfiguration -> CreateLoggingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoggingConfiguration -> CreateLoggingConfiguration -> Bool
$c/= :: CreateLoggingConfiguration -> CreateLoggingConfiguration -> Bool
== :: CreateLoggingConfiguration -> CreateLoggingConfiguration -> Bool
$c== :: CreateLoggingConfiguration -> CreateLoggingConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateLoggingConfiguration]
ReadPrec CreateLoggingConfiguration
Int -> ReadS CreateLoggingConfiguration
ReadS [CreateLoggingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoggingConfiguration]
$creadListPrec :: ReadPrec [CreateLoggingConfiguration]
readPrec :: ReadPrec CreateLoggingConfiguration
$creadPrec :: ReadPrec CreateLoggingConfiguration
readList :: ReadS [CreateLoggingConfiguration]
$creadList :: ReadS [CreateLoggingConfiguration]
readsPrec :: Int -> ReadS CreateLoggingConfiguration
$creadsPrec :: Int -> ReadS CreateLoggingConfiguration
Prelude.Read, Int -> CreateLoggingConfiguration -> ShowS
[CreateLoggingConfiguration] -> ShowS
CreateLoggingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoggingConfiguration] -> ShowS
$cshowList :: [CreateLoggingConfiguration] -> ShowS
show :: CreateLoggingConfiguration -> String
$cshow :: CreateLoggingConfiguration -> String
showsPrec :: Int -> CreateLoggingConfiguration -> ShowS
$cshowsPrec :: Int -> CreateLoggingConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreateLoggingConfiguration x -> CreateLoggingConfiguration
forall x.
CreateLoggingConfiguration -> Rep CreateLoggingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLoggingConfiguration x -> CreateLoggingConfiguration
$cfrom :: forall x.
CreateLoggingConfiguration -> Rep CreateLoggingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateLoggingConfiguration' 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:
--
-- 'name', 'createLoggingConfiguration_name' - Logging-configuration name. The value does not need to be unique.
--
-- 'tags', 'createLoggingConfiguration_tags' - Tags to attach to the resource. Array of maps, each of the form
-- @string:string (key:value)@. See
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- for details, including restrictions that apply to tags and \"Tag naming
-- limits and requirements\"; Amazon IVS Chat has no constraints on tags
-- beyond what is documented there.
--
-- 'destinationConfiguration', 'createLoggingConfiguration_destinationConfiguration' - A complex type that contains a destination configuration for where chat
-- content will be logged. There can be only one type of destination
-- (@cloudWatchLogs@, @firehose@, or @s3@) in a @destinationConfiguration@.
newCreateLoggingConfiguration ::
  -- | 'destinationConfiguration'
  DestinationConfiguration ->
  CreateLoggingConfiguration
newCreateLoggingConfiguration :: DestinationConfiguration -> CreateLoggingConfiguration
newCreateLoggingConfiguration
  DestinationConfiguration
pDestinationConfiguration_ =
    CreateLoggingConfiguration'
      { $sel:name:CreateLoggingConfiguration' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateLoggingConfiguration' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:destinationConfiguration:CreateLoggingConfiguration' :: DestinationConfiguration
destinationConfiguration =
          DestinationConfiguration
pDestinationConfiguration_
      }

-- | Logging-configuration name. The value does not need to be unique.
createLoggingConfiguration_name :: Lens.Lens' CreateLoggingConfiguration (Prelude.Maybe Prelude.Text)
createLoggingConfiguration_name :: Lens' CreateLoggingConfiguration (Maybe Text)
createLoggingConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateLoggingConfiguration
s@CreateLoggingConfiguration' {} Maybe Text
a -> CreateLoggingConfiguration
s {$sel:name:CreateLoggingConfiguration' :: Maybe Text
name = Maybe Text
a} :: CreateLoggingConfiguration)

-- | Tags to attach to the resource. Array of maps, each of the form
-- @string:string (key:value)@. See
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- for details, including restrictions that apply to tags and \"Tag naming
-- limits and requirements\"; Amazon IVS Chat has no constraints on tags
-- beyond what is documented there.
createLoggingConfiguration_tags :: Lens.Lens' CreateLoggingConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createLoggingConfiguration_tags :: Lens' CreateLoggingConfiguration (Maybe (HashMap Text Text))
createLoggingConfiguration_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfiguration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateLoggingConfiguration
s@CreateLoggingConfiguration' {} Maybe (HashMap Text Text)
a -> CreateLoggingConfiguration
s {$sel:tags:CreateLoggingConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateLoggingConfiguration) 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

-- | A complex type that contains a destination configuration for where chat
-- content will be logged. There can be only one type of destination
-- (@cloudWatchLogs@, @firehose@, or @s3@) in a @destinationConfiguration@.
createLoggingConfiguration_destinationConfiguration :: Lens.Lens' CreateLoggingConfiguration DestinationConfiguration
createLoggingConfiguration_destinationConfiguration :: Lens' CreateLoggingConfiguration DestinationConfiguration
createLoggingConfiguration_destinationConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfiguration' {DestinationConfiguration
destinationConfiguration :: DestinationConfiguration
$sel:destinationConfiguration:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> DestinationConfiguration
destinationConfiguration} -> DestinationConfiguration
destinationConfiguration) (\s :: CreateLoggingConfiguration
s@CreateLoggingConfiguration' {} DestinationConfiguration
a -> CreateLoggingConfiguration
s {$sel:destinationConfiguration:CreateLoggingConfiguration' :: DestinationConfiguration
destinationConfiguration = DestinationConfiguration
a} :: CreateLoggingConfiguration)

instance Core.AWSRequest CreateLoggingConfiguration where
  type
    AWSResponse CreateLoggingConfiguration =
      CreateLoggingConfigurationResponse
  request :: (Service -> Service)
-> CreateLoggingConfiguration -> Request CreateLoggingConfiguration
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 CreateLoggingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLoggingConfiguration)))
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
-> Maybe ISO8601
-> Maybe DestinationConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe CreateLoggingConfigurationState
-> Maybe (HashMap Text Text)
-> Maybe ISO8601
-> Int
-> CreateLoggingConfigurationResponse
CreateLoggingConfigurationResponse'
            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
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"createTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"destinationConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"state")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"updateTime")
            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 CreateLoggingConfiguration where
  hashWithSalt :: Int -> CreateLoggingConfiguration -> Int
hashWithSalt Int
_salt CreateLoggingConfiguration' {Maybe Text
Maybe (HashMap Text Text)
DestinationConfiguration
destinationConfiguration :: DestinationConfiguration
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
$sel:destinationConfiguration:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> DestinationConfiguration
$sel:tags:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe (HashMap Text Text)
$sel:name:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DestinationConfiguration
destinationConfiguration

instance Prelude.NFData CreateLoggingConfiguration where
  rnf :: CreateLoggingConfiguration -> ()
rnf CreateLoggingConfiguration' {Maybe Text
Maybe (HashMap Text Text)
DestinationConfiguration
destinationConfiguration :: DestinationConfiguration
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
$sel:destinationConfiguration:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> DestinationConfiguration
$sel:tags:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe (HashMap Text Text)
$sel:name:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DestinationConfiguration
destinationConfiguration

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

instance Data.ToJSON CreateLoggingConfiguration where
  toJSON :: CreateLoggingConfiguration -> Value
toJSON CreateLoggingConfiguration' {Maybe Text
Maybe (HashMap Text Text)
DestinationConfiguration
destinationConfiguration :: DestinationConfiguration
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
$sel:destinationConfiguration:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> DestinationConfiguration
$sel:tags:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe (HashMap Text Text)
$sel:name:CreateLoggingConfiguration' :: CreateLoggingConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"name" 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
name,
            (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 (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"destinationConfiguration"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DestinationConfiguration
destinationConfiguration
              )
          ]
      )

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

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

-- | /See:/ 'newCreateLoggingConfigurationResponse' smart constructor.
data CreateLoggingConfigurationResponse = CreateLoggingConfigurationResponse'
  { -- | Logging-configuration ARN, assigned by the system.
    CreateLoggingConfigurationResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Time when the logging configuration was created. This is an ISO 8601
    -- timestamp; /note that this is returned as a string/.
    CreateLoggingConfigurationResponse -> Maybe ISO8601
createTime :: Prelude.Maybe Data.ISO8601,
    -- | A complex type that contains a destination configuration for where chat
    -- content will be logged, from the request. There is only one type of
    -- destination (@cloudWatchLogs@, @firehose@, or @s3@) in a
    -- @destinationConfiguration@.
    CreateLoggingConfigurationResponse
-> Maybe DestinationConfiguration
destinationConfiguration :: Prelude.Maybe DestinationConfiguration,
    -- | Logging-configuration ID, generated by the system. This is a relative
    -- identifier, the part of the ARN that uniquely identifies the logging
    -- configuration.
    CreateLoggingConfigurationResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Logging-configuration name, from the request (if specified).
    CreateLoggingConfigurationResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The state of the logging configuration. When the state is @ACTIVE@, the
    -- configuration is ready to log chat content.
    CreateLoggingConfigurationResponse
-> Maybe CreateLoggingConfigurationState
state :: Prelude.Maybe CreateLoggingConfigurationState,
    -- | Tags attached to the resource, from the request (if specified). Array of
    -- maps, each of the form @string:string (key:value)@.
    CreateLoggingConfigurationResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Time of the logging configuration’s last update. This is an ISO 8601
    -- timestamp; /note that this is returned as a string/.
    CreateLoggingConfigurationResponse -> Maybe ISO8601
updateTime :: Prelude.Maybe Data.ISO8601,
    -- | The response's http status code.
    CreateLoggingConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLoggingConfigurationResponse
-> CreateLoggingConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLoggingConfigurationResponse
-> CreateLoggingConfigurationResponse -> Bool
$c/= :: CreateLoggingConfigurationResponse
-> CreateLoggingConfigurationResponse -> Bool
== :: CreateLoggingConfigurationResponse
-> CreateLoggingConfigurationResponse -> Bool
$c== :: CreateLoggingConfigurationResponse
-> CreateLoggingConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateLoggingConfigurationResponse]
ReadPrec CreateLoggingConfigurationResponse
Int -> ReadS CreateLoggingConfigurationResponse
ReadS [CreateLoggingConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLoggingConfigurationResponse]
$creadListPrec :: ReadPrec [CreateLoggingConfigurationResponse]
readPrec :: ReadPrec CreateLoggingConfigurationResponse
$creadPrec :: ReadPrec CreateLoggingConfigurationResponse
readList :: ReadS [CreateLoggingConfigurationResponse]
$creadList :: ReadS [CreateLoggingConfigurationResponse]
readsPrec :: Int -> ReadS CreateLoggingConfigurationResponse
$creadsPrec :: Int -> ReadS CreateLoggingConfigurationResponse
Prelude.Read, Int -> CreateLoggingConfigurationResponse -> ShowS
[CreateLoggingConfigurationResponse] -> ShowS
CreateLoggingConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLoggingConfigurationResponse] -> ShowS
$cshowList :: [CreateLoggingConfigurationResponse] -> ShowS
show :: CreateLoggingConfigurationResponse -> String
$cshow :: CreateLoggingConfigurationResponse -> String
showsPrec :: Int -> CreateLoggingConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateLoggingConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLoggingConfigurationResponse x
-> CreateLoggingConfigurationResponse
forall x.
CreateLoggingConfigurationResponse
-> Rep CreateLoggingConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLoggingConfigurationResponse x
-> CreateLoggingConfigurationResponse
$cfrom :: forall x.
CreateLoggingConfigurationResponse
-> Rep CreateLoggingConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLoggingConfigurationResponse' 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:
--
-- 'arn', 'createLoggingConfigurationResponse_arn' - Logging-configuration ARN, assigned by the system.
--
-- 'createTime', 'createLoggingConfigurationResponse_createTime' - Time when the logging configuration was created. This is an ISO 8601
-- timestamp; /note that this is returned as a string/.
--
-- 'destinationConfiguration', 'createLoggingConfigurationResponse_destinationConfiguration' - A complex type that contains a destination configuration for where chat
-- content will be logged, from the request. There is only one type of
-- destination (@cloudWatchLogs@, @firehose@, or @s3@) in a
-- @destinationConfiguration@.
--
-- 'id', 'createLoggingConfigurationResponse_id' - Logging-configuration ID, generated by the system. This is a relative
-- identifier, the part of the ARN that uniquely identifies the logging
-- configuration.
--
-- 'name', 'createLoggingConfigurationResponse_name' - Logging-configuration name, from the request (if specified).
--
-- 'state', 'createLoggingConfigurationResponse_state' - The state of the logging configuration. When the state is @ACTIVE@, the
-- configuration is ready to log chat content.
--
-- 'tags', 'createLoggingConfigurationResponse_tags' - Tags attached to the resource, from the request (if specified). Array of
-- maps, each of the form @string:string (key:value)@.
--
-- 'updateTime', 'createLoggingConfigurationResponse_updateTime' - Time of the logging configuration’s last update. This is an ISO 8601
-- timestamp; /note that this is returned as a string/.
--
-- 'httpStatus', 'createLoggingConfigurationResponse_httpStatus' - The response's http status code.
newCreateLoggingConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLoggingConfigurationResponse
newCreateLoggingConfigurationResponse :: Int -> CreateLoggingConfigurationResponse
newCreateLoggingConfigurationResponse Int
pHttpStatus_ =
  CreateLoggingConfigurationResponse'
    { $sel:arn:CreateLoggingConfigurationResponse' :: Maybe Text
arn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createTime:CreateLoggingConfigurationResponse' :: Maybe ISO8601
createTime = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationConfiguration:CreateLoggingConfigurationResponse' :: Maybe DestinationConfiguration
destinationConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateLoggingConfigurationResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateLoggingConfigurationResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:CreateLoggingConfigurationResponse' :: Maybe CreateLoggingConfigurationState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateLoggingConfigurationResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:updateTime:CreateLoggingConfigurationResponse' :: Maybe ISO8601
updateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLoggingConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Logging-configuration ARN, assigned by the system.
createLoggingConfigurationResponse_arn :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe Prelude.Text)
createLoggingConfigurationResponse_arn :: Lens' CreateLoggingConfigurationResponse (Maybe Text)
createLoggingConfigurationResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe Text
a -> CreateLoggingConfigurationResponse
s {$sel:arn:CreateLoggingConfigurationResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateLoggingConfigurationResponse)

-- | Time when the logging configuration was created. This is an ISO 8601
-- timestamp; /note that this is returned as a string/.
createLoggingConfigurationResponse_createTime :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe Prelude.UTCTime)
createLoggingConfigurationResponse_createTime :: Lens' CreateLoggingConfigurationResponse (Maybe UTCTime)
createLoggingConfigurationResponse_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe ISO8601
createTime :: Maybe ISO8601
$sel:createTime:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe ISO8601
createTime} -> Maybe ISO8601
createTime) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe ISO8601
a -> CreateLoggingConfigurationResponse
s {$sel:createTime:CreateLoggingConfigurationResponse' :: Maybe ISO8601
createTime = Maybe ISO8601
a} :: CreateLoggingConfigurationResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A complex type that contains a destination configuration for where chat
-- content will be logged, from the request. There is only one type of
-- destination (@cloudWatchLogs@, @firehose@, or @s3@) in a
-- @destinationConfiguration@.
createLoggingConfigurationResponse_destinationConfiguration :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe DestinationConfiguration)
createLoggingConfigurationResponse_destinationConfiguration :: Lens'
  CreateLoggingConfigurationResponse (Maybe DestinationConfiguration)
createLoggingConfigurationResponse_destinationConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe DestinationConfiguration
destinationConfiguration :: Maybe DestinationConfiguration
$sel:destinationConfiguration:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse
-> Maybe DestinationConfiguration
destinationConfiguration} -> Maybe DestinationConfiguration
destinationConfiguration) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe DestinationConfiguration
a -> CreateLoggingConfigurationResponse
s {$sel:destinationConfiguration:CreateLoggingConfigurationResponse' :: Maybe DestinationConfiguration
destinationConfiguration = Maybe DestinationConfiguration
a} :: CreateLoggingConfigurationResponse)

-- | Logging-configuration ID, generated by the system. This is a relative
-- identifier, the part of the ARN that uniquely identifies the logging
-- configuration.
createLoggingConfigurationResponse_id :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe Prelude.Text)
createLoggingConfigurationResponse_id :: Lens' CreateLoggingConfigurationResponse (Maybe Text)
createLoggingConfigurationResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe Text
a -> CreateLoggingConfigurationResponse
s {$sel:id:CreateLoggingConfigurationResponse' :: Maybe Text
id = Maybe Text
a} :: CreateLoggingConfigurationResponse)

-- | Logging-configuration name, from the request (if specified).
createLoggingConfigurationResponse_name :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe Prelude.Text)
createLoggingConfigurationResponse_name :: Lens' CreateLoggingConfigurationResponse (Maybe Text)
createLoggingConfigurationResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe Text
a -> CreateLoggingConfigurationResponse
s {$sel:name:CreateLoggingConfigurationResponse' :: Maybe Text
name = Maybe Text
a} :: CreateLoggingConfigurationResponse)

-- | The state of the logging configuration. When the state is @ACTIVE@, the
-- configuration is ready to log chat content.
createLoggingConfigurationResponse_state :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe CreateLoggingConfigurationState)
createLoggingConfigurationResponse_state :: Lens'
  CreateLoggingConfigurationResponse
  (Maybe CreateLoggingConfigurationState)
createLoggingConfigurationResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe CreateLoggingConfigurationState
state :: Maybe CreateLoggingConfigurationState
$sel:state:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse
-> Maybe CreateLoggingConfigurationState
state} -> Maybe CreateLoggingConfigurationState
state) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe CreateLoggingConfigurationState
a -> CreateLoggingConfigurationResponse
s {$sel:state:CreateLoggingConfigurationResponse' :: Maybe CreateLoggingConfigurationState
state = Maybe CreateLoggingConfigurationState
a} :: CreateLoggingConfigurationResponse)

-- | Tags attached to the resource, from the request (if specified). Array of
-- maps, each of the form @string:string (key:value)@.
createLoggingConfigurationResponse_tags :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createLoggingConfigurationResponse_tags :: Lens'
  CreateLoggingConfigurationResponse (Maybe (HashMap Text Text))
createLoggingConfigurationResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe (HashMap Text Text)
a -> CreateLoggingConfigurationResponse
s {$sel:tags:CreateLoggingConfigurationResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateLoggingConfigurationResponse) 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

-- | Time of the logging configuration’s last update. This is an ISO 8601
-- timestamp; /note that this is returned as a string/.
createLoggingConfigurationResponse_updateTime :: Lens.Lens' CreateLoggingConfigurationResponse (Prelude.Maybe Prelude.UTCTime)
createLoggingConfigurationResponse_updateTime :: Lens' CreateLoggingConfigurationResponse (Maybe UTCTime)
createLoggingConfigurationResponse_updateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLoggingConfigurationResponse' {Maybe ISO8601
updateTime :: Maybe ISO8601
$sel:updateTime:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe ISO8601
updateTime} -> Maybe ISO8601
updateTime) (\s :: CreateLoggingConfigurationResponse
s@CreateLoggingConfigurationResponse' {} Maybe ISO8601
a -> CreateLoggingConfigurationResponse
s {$sel:updateTime:CreateLoggingConfigurationResponse' :: Maybe ISO8601
updateTime = Maybe ISO8601
a} :: CreateLoggingConfigurationResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance
  Prelude.NFData
    CreateLoggingConfigurationResponse
  where
  rnf :: CreateLoggingConfigurationResponse -> ()
rnf CreateLoggingConfigurationResponse' {Int
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe CreateLoggingConfigurationState
Maybe DestinationConfiguration
httpStatus :: Int
updateTime :: Maybe ISO8601
tags :: Maybe (HashMap Text Text)
state :: Maybe CreateLoggingConfigurationState
name :: Maybe Text
id :: Maybe Text
destinationConfiguration :: Maybe DestinationConfiguration
createTime :: Maybe ISO8601
arn :: Maybe Text
$sel:httpStatus:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Int
$sel:updateTime:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe ISO8601
$sel:tags:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe (HashMap Text Text)
$sel:state:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse
-> Maybe CreateLoggingConfigurationState
$sel:name:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe Text
$sel:id:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe Text
$sel:destinationConfiguration:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse
-> Maybe DestinationConfiguration
$sel:createTime:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe ISO8601
$sel:arn:CreateLoggingConfigurationResponse' :: CreateLoggingConfigurationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DestinationConfiguration
destinationConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CreateLoggingConfigurationState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
updateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus