{-# 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.CloudWatch.GetMetricStream
-- 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 information about the metric stream that you specify.
module Amazonka.CloudWatch.GetMetricStream
  ( -- * Creating a Request
    GetMetricStream (..),
    newGetMetricStream,

    -- * Request Lenses
    getMetricStream_name,

    -- * Destructuring the Response
    GetMetricStreamResponse (..),
    newGetMetricStreamResponse,

    -- * Response Lenses
    getMetricStreamResponse_includeFilters,
    getMetricStreamResponse_state,
    getMetricStreamResponse_excludeFilters,
    getMetricStreamResponse_arn,
    getMetricStreamResponse_firehoseArn,
    getMetricStreamResponse_outputFormat,
    getMetricStreamResponse_lastUpdateDate,
    getMetricStreamResponse_name,
    getMetricStreamResponse_creationDate,
    getMetricStreamResponse_roleArn,
    getMetricStreamResponse_httpStatus,
  )
where

import Amazonka.CloudWatch.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:/ 'newGetMetricStream' smart constructor.
data GetMetricStream = GetMetricStream'
  { -- | The name of the metric stream to retrieve information about.
    GetMetricStream -> Text
name :: Prelude.Text
  }
  deriving (GetMetricStream -> GetMetricStream -> Bool
(GetMetricStream -> GetMetricStream -> Bool)
-> (GetMetricStream -> GetMetricStream -> Bool)
-> Eq GetMetricStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMetricStream -> GetMetricStream -> Bool
$c/= :: GetMetricStream -> GetMetricStream -> Bool
== :: GetMetricStream -> GetMetricStream -> Bool
$c== :: GetMetricStream -> GetMetricStream -> Bool
Prelude.Eq, ReadPrec [GetMetricStream]
ReadPrec GetMetricStream
Int -> ReadS GetMetricStream
ReadS [GetMetricStream]
(Int -> ReadS GetMetricStream)
-> ReadS [GetMetricStream]
-> ReadPrec GetMetricStream
-> ReadPrec [GetMetricStream]
-> Read GetMetricStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMetricStream]
$creadListPrec :: ReadPrec [GetMetricStream]
readPrec :: ReadPrec GetMetricStream
$creadPrec :: ReadPrec GetMetricStream
readList :: ReadS [GetMetricStream]
$creadList :: ReadS [GetMetricStream]
readsPrec :: Int -> ReadS GetMetricStream
$creadsPrec :: Int -> ReadS GetMetricStream
Prelude.Read, Int -> GetMetricStream -> ShowS
[GetMetricStream] -> ShowS
GetMetricStream -> String
(Int -> GetMetricStream -> ShowS)
-> (GetMetricStream -> String)
-> ([GetMetricStream] -> ShowS)
-> Show GetMetricStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMetricStream] -> ShowS
$cshowList :: [GetMetricStream] -> ShowS
show :: GetMetricStream -> String
$cshow :: GetMetricStream -> String
showsPrec :: Int -> GetMetricStream -> ShowS
$cshowsPrec :: Int -> GetMetricStream -> ShowS
Prelude.Show, (forall x. GetMetricStream -> Rep GetMetricStream x)
-> (forall x. Rep GetMetricStream x -> GetMetricStream)
-> Generic GetMetricStream
forall x. Rep GetMetricStream x -> GetMetricStream
forall x. GetMetricStream -> Rep GetMetricStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMetricStream x -> GetMetricStream
$cfrom :: forall x. GetMetricStream -> Rep GetMetricStream x
Prelude.Generic)

-- |
-- Create a value of 'GetMetricStream' 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', 'getMetricStream_name' - The name of the metric stream to retrieve information about.
newGetMetricStream ::
  -- | 'name'
  Prelude.Text ->
  GetMetricStream
newGetMetricStream :: Text -> GetMetricStream
newGetMetricStream Text
pName_ =
  GetMetricStream' :: Text -> GetMetricStream
GetMetricStream' {$sel:name:GetMetricStream' :: Text
name = Text
pName_}

-- | The name of the metric stream to retrieve information about.
getMetricStream_name :: Lens.Lens' GetMetricStream Prelude.Text
getMetricStream_name :: (Text -> f Text) -> GetMetricStream -> f GetMetricStream
getMetricStream_name = (GetMetricStream -> Text)
-> (GetMetricStream -> Text -> GetMetricStream)
-> Lens GetMetricStream GetMetricStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStream' {Text
name :: Text
$sel:name:GetMetricStream' :: GetMetricStream -> Text
name} -> Text
name) (\s :: GetMetricStream
s@GetMetricStream' {} Text
a -> GetMetricStream
s {$sel:name:GetMetricStream' :: Text
name = Text
a} :: GetMetricStream)

instance Core.AWSRequest GetMetricStream where
  type
    AWSResponse GetMetricStream =
      GetMetricStreamResponse
  request :: GetMetricStream -> Request GetMetricStream
request = Service -> GetMetricStream -> Request GetMetricStream
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMetricStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMetricStream)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse GetMetricStream))
-> Logger
-> Service
-> Proxy GetMetricStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMetricStream)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"GetMetricStreamResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [MetricStreamFilter]
-> Maybe Text
-> Maybe [MetricStreamFilter]
-> Maybe Text
-> Maybe Text
-> Maybe MetricStreamOutputFormat
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Int
-> GetMetricStreamResponse
GetMetricStreamResponse'
            (Maybe [MetricStreamFilter]
 -> Maybe Text
 -> Maybe [MetricStreamFilter]
 -> Maybe Text
 -> Maybe Text
 -> Maybe MetricStreamOutputFormat
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Int
 -> GetMetricStreamResponse)
-> Either String (Maybe [MetricStreamFilter])
-> Either
     String
     (Maybe Text
      -> Maybe [MetricStreamFilter]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MetricStreamOutputFormat
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Int
      -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IncludeFilters" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [MetricStreamFilter]))
-> Either String (Maybe [MetricStreamFilter])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [MetricStreamFilter])
-> [Node] -> Either String (Maybe [MetricStreamFilter])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [MetricStreamFilter]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe Text
   -> Maybe [MetricStreamFilter]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MetricStreamOutputFormat
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Int
   -> GetMetricStreamResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [MetricStreamFilter]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MetricStreamOutputFormat
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Int
      -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"State")
            Either
  String
  (Maybe [MetricStreamFilter]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MetricStreamOutputFormat
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Int
   -> GetMetricStreamResponse)
-> Either String (Maybe [MetricStreamFilter])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe MetricStreamOutputFormat
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Int
      -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ExcludeFilters" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [MetricStreamFilter]))
-> Either String (Maybe [MetricStreamFilter])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [MetricStreamFilter])
-> [Node] -> Either String (Maybe [MetricStreamFilter])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [MetricStreamFilter]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe MetricStreamOutputFormat
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Int
   -> GetMetricStreamResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe MetricStreamOutputFormat
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Int
      -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe MetricStreamOutputFormat
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Int
   -> GetMetricStreamResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe MetricStreamOutputFormat
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Int
      -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FirehoseArn")
            Either
  String
  (Maybe MetricStreamOutputFormat
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Int
   -> GetMetricStreamResponse)
-> Either String (Maybe MetricStreamOutputFormat)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Int
      -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe MetricStreamOutputFormat)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OutputFormat")
            Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Int
   -> GetMetricStreamResponse)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601 -> Maybe Text -> Int -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastUpdateDate")
            Either
  String
  (Maybe Text
   -> Maybe ISO8601 -> Maybe Text -> Int -> GetMetricStreamResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601 -> Maybe Text -> Int -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Name")
            Either
  String
  (Maybe ISO8601 -> Maybe Text -> Int -> GetMetricStreamResponse)
-> Either String (Maybe ISO8601)
-> Either String (Maybe Text -> Int -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CreationDate")
            Either String (Maybe Text -> Int -> GetMetricStreamResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetMetricStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RoleArn")
            Either String (Int -> GetMetricStreamResponse)
-> Either String Int -> Either String GetMetricStreamResponse
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 GetMetricStream

instance Prelude.NFData GetMetricStream

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

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

instance Core.ToQuery GetMetricStream where
  toQuery :: GetMetricStream -> QueryString
toQuery GetMetricStream' {Text
name :: Text
$sel:name:GetMetricStream' :: GetMetricStream -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"GetMetricStream" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
        ByteString
"Name" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
name
      ]

-- | /See:/ 'newGetMetricStreamResponse' smart constructor.
data GetMetricStreamResponse = GetMetricStreamResponse'
  { -- | If this array of metric namespaces is present, then these namespaces are
    -- the only metric namespaces that are streamed by this metric stream.
    GetMetricStreamResponse -> Maybe [MetricStreamFilter]
includeFilters :: Prelude.Maybe [MetricStreamFilter],
    -- | The state of the metric stream. The possible values are @running@ and
    -- @stopped@.
    GetMetricStreamResponse -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | If this array of metric namespaces is present, then these namespaces are
    -- the only metric namespaces that are not streamed by this metric stream.
    -- In this case, all other metric namespaces in the account are streamed by
    -- this metric stream.
    GetMetricStreamResponse -> Maybe [MetricStreamFilter]
excludeFilters :: Prelude.Maybe [MetricStreamFilter],
    -- | The ARN of the metric stream.
    GetMetricStreamResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the Amazon Kinesis Firehose delivery stream that is used by
    -- this metric stream.
    GetMetricStreamResponse -> Maybe Text
firehoseArn :: Prelude.Maybe Prelude.Text,
    GetMetricStreamResponse -> Maybe MetricStreamOutputFormat
outputFormat :: Prelude.Maybe MetricStreamOutputFormat,
    -- | The date of the most recent update to the metric stream\'s
    -- configuration.
    GetMetricStreamResponse -> Maybe ISO8601
lastUpdateDate :: Prelude.Maybe Core.ISO8601,
    -- | The name of the metric stream.
    GetMetricStreamResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date that the metric stream was created.
    GetMetricStreamResponse -> Maybe ISO8601
creationDate :: Prelude.Maybe Core.ISO8601,
    -- | The ARN of the IAM role that is used by this metric stream.
    GetMetricStreamResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetMetricStreamResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMetricStreamResponse -> GetMetricStreamResponse -> Bool
(GetMetricStreamResponse -> GetMetricStreamResponse -> Bool)
-> (GetMetricStreamResponse -> GetMetricStreamResponse -> Bool)
-> Eq GetMetricStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMetricStreamResponse -> GetMetricStreamResponse -> Bool
$c/= :: GetMetricStreamResponse -> GetMetricStreamResponse -> Bool
== :: GetMetricStreamResponse -> GetMetricStreamResponse -> Bool
$c== :: GetMetricStreamResponse -> GetMetricStreamResponse -> Bool
Prelude.Eq, ReadPrec [GetMetricStreamResponse]
ReadPrec GetMetricStreamResponse
Int -> ReadS GetMetricStreamResponse
ReadS [GetMetricStreamResponse]
(Int -> ReadS GetMetricStreamResponse)
-> ReadS [GetMetricStreamResponse]
-> ReadPrec GetMetricStreamResponse
-> ReadPrec [GetMetricStreamResponse]
-> Read GetMetricStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMetricStreamResponse]
$creadListPrec :: ReadPrec [GetMetricStreamResponse]
readPrec :: ReadPrec GetMetricStreamResponse
$creadPrec :: ReadPrec GetMetricStreamResponse
readList :: ReadS [GetMetricStreamResponse]
$creadList :: ReadS [GetMetricStreamResponse]
readsPrec :: Int -> ReadS GetMetricStreamResponse
$creadsPrec :: Int -> ReadS GetMetricStreamResponse
Prelude.Read, Int -> GetMetricStreamResponse -> ShowS
[GetMetricStreamResponse] -> ShowS
GetMetricStreamResponse -> String
(Int -> GetMetricStreamResponse -> ShowS)
-> (GetMetricStreamResponse -> String)
-> ([GetMetricStreamResponse] -> ShowS)
-> Show GetMetricStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMetricStreamResponse] -> ShowS
$cshowList :: [GetMetricStreamResponse] -> ShowS
show :: GetMetricStreamResponse -> String
$cshow :: GetMetricStreamResponse -> String
showsPrec :: Int -> GetMetricStreamResponse -> ShowS
$cshowsPrec :: Int -> GetMetricStreamResponse -> ShowS
Prelude.Show, (forall x.
 GetMetricStreamResponse -> Rep GetMetricStreamResponse x)
-> (forall x.
    Rep GetMetricStreamResponse x -> GetMetricStreamResponse)
-> Generic GetMetricStreamResponse
forall x. Rep GetMetricStreamResponse x -> GetMetricStreamResponse
forall x. GetMetricStreamResponse -> Rep GetMetricStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMetricStreamResponse x -> GetMetricStreamResponse
$cfrom :: forall x. GetMetricStreamResponse -> Rep GetMetricStreamResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMetricStreamResponse' 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:
--
-- 'includeFilters', 'getMetricStreamResponse_includeFilters' - If this array of metric namespaces is present, then these namespaces are
-- the only metric namespaces that are streamed by this metric stream.
--
-- 'state', 'getMetricStreamResponse_state' - The state of the metric stream. The possible values are @running@ and
-- @stopped@.
--
-- 'excludeFilters', 'getMetricStreamResponse_excludeFilters' - If this array of metric namespaces is present, then these namespaces are
-- the only metric namespaces that are not streamed by this metric stream.
-- In this case, all other metric namespaces in the account are streamed by
-- this metric stream.
--
-- 'arn', 'getMetricStreamResponse_arn' - The ARN of the metric stream.
--
-- 'firehoseArn', 'getMetricStreamResponse_firehoseArn' - The ARN of the Amazon Kinesis Firehose delivery stream that is used by
-- this metric stream.
--
-- 'outputFormat', 'getMetricStreamResponse_outputFormat' -
--
-- 'lastUpdateDate', 'getMetricStreamResponse_lastUpdateDate' - The date of the most recent update to the metric stream\'s
-- configuration.
--
-- 'name', 'getMetricStreamResponse_name' - The name of the metric stream.
--
-- 'creationDate', 'getMetricStreamResponse_creationDate' - The date that the metric stream was created.
--
-- 'roleArn', 'getMetricStreamResponse_roleArn' - The ARN of the IAM role that is used by this metric stream.
--
-- 'httpStatus', 'getMetricStreamResponse_httpStatus' - The response's http status code.
newGetMetricStreamResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMetricStreamResponse
newGetMetricStreamResponse :: Int -> GetMetricStreamResponse
newGetMetricStreamResponse Int
pHttpStatus_ =
  GetMetricStreamResponse' :: Maybe [MetricStreamFilter]
-> Maybe Text
-> Maybe [MetricStreamFilter]
-> Maybe Text
-> Maybe Text
-> Maybe MetricStreamOutputFormat
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Int
-> GetMetricStreamResponse
GetMetricStreamResponse'
    { $sel:includeFilters:GetMetricStreamResponse' :: Maybe [MetricStreamFilter]
includeFilters =
        Maybe [MetricStreamFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:state:GetMetricStreamResponse' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:excludeFilters:GetMetricStreamResponse' :: Maybe [MetricStreamFilter]
excludeFilters = Maybe [MetricStreamFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetMetricStreamResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firehoseArn:GetMetricStreamResponse' :: Maybe Text
firehoseArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputFormat:GetMetricStreamResponse' :: Maybe MetricStreamOutputFormat
outputFormat = Maybe MetricStreamOutputFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateDate:GetMetricStreamResponse' :: Maybe ISO8601
lastUpdateDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetMetricStreamResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:GetMetricStreamResponse' :: Maybe ISO8601
creationDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:GetMetricStreamResponse' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMetricStreamResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If this array of metric namespaces is present, then these namespaces are
-- the only metric namespaces that are streamed by this metric stream.
getMetricStreamResponse_includeFilters :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe [MetricStreamFilter])
getMetricStreamResponse_includeFilters :: (Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_includeFilters = (GetMetricStreamResponse -> Maybe [MetricStreamFilter])
-> (GetMetricStreamResponse
    -> Maybe [MetricStreamFilter] -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe [MetricStreamFilter]
includeFilters :: Maybe [MetricStreamFilter]
$sel:includeFilters:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe [MetricStreamFilter]
includeFilters} -> Maybe [MetricStreamFilter]
includeFilters) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe [MetricStreamFilter]
a -> GetMetricStreamResponse
s {$sel:includeFilters:GetMetricStreamResponse' :: Maybe [MetricStreamFilter]
includeFilters = Maybe [MetricStreamFilter]
a} :: GetMetricStreamResponse) ((Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
 -> GetMetricStreamResponse -> f GetMetricStreamResponse)
-> ((Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
    -> Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
-> (Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
-> GetMetricStreamResponse
-> f GetMetricStreamResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
-> Iso
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
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
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The state of the metric stream. The possible values are @running@ and
-- @stopped@.
getMetricStreamResponse_state :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.Text)
getMetricStreamResponse_state :: (Maybe Text -> f (Maybe Text))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_state = (GetMetricStreamResponse -> Maybe Text)
-> (GetMetricStreamResponse
    -> Maybe Text -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe Text
state :: Maybe Text
$sel:state:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe Text
state} -> Maybe Text
state) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe Text
a -> GetMetricStreamResponse
s {$sel:state:GetMetricStreamResponse' :: Maybe Text
state = Maybe Text
a} :: GetMetricStreamResponse)

-- | If this array of metric namespaces is present, then these namespaces are
-- the only metric namespaces that are not streamed by this metric stream.
-- In this case, all other metric namespaces in the account are streamed by
-- this metric stream.
getMetricStreamResponse_excludeFilters :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe [MetricStreamFilter])
getMetricStreamResponse_excludeFilters :: (Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_excludeFilters = (GetMetricStreamResponse -> Maybe [MetricStreamFilter])
-> (GetMetricStreamResponse
    -> Maybe [MetricStreamFilter] -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe [MetricStreamFilter]
excludeFilters :: Maybe [MetricStreamFilter]
$sel:excludeFilters:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe [MetricStreamFilter]
excludeFilters} -> Maybe [MetricStreamFilter]
excludeFilters) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe [MetricStreamFilter]
a -> GetMetricStreamResponse
s {$sel:excludeFilters:GetMetricStreamResponse' :: Maybe [MetricStreamFilter]
excludeFilters = Maybe [MetricStreamFilter]
a} :: GetMetricStreamResponse) ((Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
 -> GetMetricStreamResponse -> f GetMetricStreamResponse)
-> ((Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
    -> Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
-> (Maybe [MetricStreamFilter] -> f (Maybe [MetricStreamFilter]))
-> GetMetricStreamResponse
-> f GetMetricStreamResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
-> Iso
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
     (Maybe [MetricStreamFilter])
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
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
  [MetricStreamFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the metric stream.
getMetricStreamResponse_arn :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.Text)
getMetricStreamResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_arn = (GetMetricStreamResponse -> Maybe Text)
-> (GetMetricStreamResponse
    -> Maybe Text -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe Text
a -> GetMetricStreamResponse
s {$sel:arn:GetMetricStreamResponse' :: Maybe Text
arn = Maybe Text
a} :: GetMetricStreamResponse)

-- | The ARN of the Amazon Kinesis Firehose delivery stream that is used by
-- this metric stream.
getMetricStreamResponse_firehoseArn :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.Text)
getMetricStreamResponse_firehoseArn :: (Maybe Text -> f (Maybe Text))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_firehoseArn = (GetMetricStreamResponse -> Maybe Text)
-> (GetMetricStreamResponse
    -> Maybe Text -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe Text
firehoseArn :: Maybe Text
$sel:firehoseArn:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe Text
firehoseArn} -> Maybe Text
firehoseArn) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe Text
a -> GetMetricStreamResponse
s {$sel:firehoseArn:GetMetricStreamResponse' :: Maybe Text
firehoseArn = Maybe Text
a} :: GetMetricStreamResponse)

-- |
getMetricStreamResponse_outputFormat :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe MetricStreamOutputFormat)
getMetricStreamResponse_outputFormat :: (Maybe MetricStreamOutputFormat
 -> f (Maybe MetricStreamOutputFormat))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_outputFormat = (GetMetricStreamResponse -> Maybe MetricStreamOutputFormat)
-> (GetMetricStreamResponse
    -> Maybe MetricStreamOutputFormat -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe MetricStreamOutputFormat)
     (Maybe MetricStreamOutputFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe MetricStreamOutputFormat
outputFormat :: Maybe MetricStreamOutputFormat
$sel:outputFormat:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe MetricStreamOutputFormat
outputFormat} -> Maybe MetricStreamOutputFormat
outputFormat) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe MetricStreamOutputFormat
a -> GetMetricStreamResponse
s {$sel:outputFormat:GetMetricStreamResponse' :: Maybe MetricStreamOutputFormat
outputFormat = Maybe MetricStreamOutputFormat
a} :: GetMetricStreamResponse)

-- | The date of the most recent update to the metric stream\'s
-- configuration.
getMetricStreamResponse_lastUpdateDate :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.UTCTime)
getMetricStreamResponse_lastUpdateDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_lastUpdateDate = (GetMetricStreamResponse -> Maybe ISO8601)
-> (GetMetricStreamResponse
    -> Maybe ISO8601 -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe ISO8601
lastUpdateDate :: Maybe ISO8601
$sel:lastUpdateDate:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe ISO8601
lastUpdateDate} -> Maybe ISO8601
lastUpdateDate) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe ISO8601
a -> GetMetricStreamResponse
s {$sel:lastUpdateDate:GetMetricStreamResponse' :: Maybe ISO8601
lastUpdateDate = Maybe ISO8601
a} :: GetMetricStreamResponse) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> GetMetricStreamResponse -> f GetMetricStreamResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMetricStreamResponse
-> f GetMetricStreamResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the metric stream.
getMetricStreamResponse_name :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.Text)
getMetricStreamResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_name = (GetMetricStreamResponse -> Maybe Text)
-> (GetMetricStreamResponse
    -> Maybe Text -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe Text
a -> GetMetricStreamResponse
s {$sel:name:GetMetricStreamResponse' :: Maybe Text
name = Maybe Text
a} :: GetMetricStreamResponse)

-- | The date that the metric stream was created.
getMetricStreamResponse_creationDate :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.UTCTime)
getMetricStreamResponse_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_creationDate = (GetMetricStreamResponse -> Maybe ISO8601)
-> (GetMetricStreamResponse
    -> Maybe ISO8601 -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe ISO8601
creationDate :: Maybe ISO8601
$sel:creationDate:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe ISO8601
creationDate} -> Maybe ISO8601
creationDate) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe ISO8601
a -> GetMetricStreamResponse
s {$sel:creationDate:GetMetricStreamResponse' :: Maybe ISO8601
creationDate = Maybe ISO8601
a} :: GetMetricStreamResponse) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> GetMetricStreamResponse -> f GetMetricStreamResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMetricStreamResponse
-> f GetMetricStreamResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the IAM role that is used by this metric stream.
getMetricStreamResponse_roleArn :: Lens.Lens' GetMetricStreamResponse (Prelude.Maybe Prelude.Text)
getMetricStreamResponse_roleArn :: (Maybe Text -> f (Maybe Text))
-> GetMetricStreamResponse -> f GetMetricStreamResponse
getMetricStreamResponse_roleArn = (GetMetricStreamResponse -> Maybe Text)
-> (GetMetricStreamResponse
    -> Maybe Text -> GetMetricStreamResponse)
-> Lens
     GetMetricStreamResponse
     GetMetricStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStreamResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:GetMetricStreamResponse' :: GetMetricStreamResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: GetMetricStreamResponse
s@GetMetricStreamResponse' {} Maybe Text
a -> GetMetricStreamResponse
s {$sel:roleArn:GetMetricStreamResponse' :: Maybe Text
roleArn = Maybe Text
a} :: GetMetricStreamResponse)

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

instance Prelude.NFData GetMetricStreamResponse