{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Pinpoint.Types.ChannelsResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types.ChannelResponse
import qualified Amazonka.Prelude as Prelude
data ChannelsResponse = ChannelsResponse'
{
ChannelsResponse -> HashMap Text ChannelResponse
channels :: Prelude.HashMap Prelude.Text ChannelResponse
}
deriving (ChannelsResponse -> ChannelsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelsResponse -> ChannelsResponse -> Bool
$c/= :: ChannelsResponse -> ChannelsResponse -> Bool
== :: ChannelsResponse -> ChannelsResponse -> Bool
$c== :: ChannelsResponse -> ChannelsResponse -> Bool
Prelude.Eq, ReadPrec [ChannelsResponse]
ReadPrec ChannelsResponse
Int -> ReadS ChannelsResponse
ReadS [ChannelsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelsResponse]
$creadListPrec :: ReadPrec [ChannelsResponse]
readPrec :: ReadPrec ChannelsResponse
$creadPrec :: ReadPrec ChannelsResponse
readList :: ReadS [ChannelsResponse]
$creadList :: ReadS [ChannelsResponse]
readsPrec :: Int -> ReadS ChannelsResponse
$creadsPrec :: Int -> ReadS ChannelsResponse
Prelude.Read, Int -> ChannelsResponse -> ShowS
[ChannelsResponse] -> ShowS
ChannelsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelsResponse] -> ShowS
$cshowList :: [ChannelsResponse] -> ShowS
show :: ChannelsResponse -> String
$cshow :: ChannelsResponse -> String
showsPrec :: Int -> ChannelsResponse -> ShowS
$cshowsPrec :: Int -> ChannelsResponse -> ShowS
Prelude.Show, forall x. Rep ChannelsResponse x -> ChannelsResponse
forall x. ChannelsResponse -> Rep ChannelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelsResponse x -> ChannelsResponse
$cfrom :: forall x. ChannelsResponse -> Rep ChannelsResponse x
Prelude.Generic)
newChannelsResponse ::
ChannelsResponse
newChannelsResponse :: ChannelsResponse
newChannelsResponse =
ChannelsResponse' {$sel:channels:ChannelsResponse' :: HashMap Text ChannelResponse
channels = forall a. Monoid a => a
Prelude.mempty}
channelsResponse_channels :: Lens.Lens' ChannelsResponse (Prelude.HashMap Prelude.Text ChannelResponse)
channelsResponse_channels :: Lens' ChannelsResponse (HashMap Text ChannelResponse)
channelsResponse_channels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelsResponse' {HashMap Text ChannelResponse
channels :: HashMap Text ChannelResponse
$sel:channels:ChannelsResponse' :: ChannelsResponse -> HashMap Text ChannelResponse
channels} -> HashMap Text ChannelResponse
channels) (\s :: ChannelsResponse
s@ChannelsResponse' {} HashMap Text ChannelResponse
a -> ChannelsResponse
s {$sel:channels:ChannelsResponse' :: HashMap Text ChannelResponse
channels = HashMap Text ChannelResponse
a} :: ChannelsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ChannelsResponse where
parseJSON :: Value -> Parser ChannelsResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ChannelsResponse"
( \Object
x ->
HashMap Text ChannelResponse -> ChannelsResponse
ChannelsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Channels" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ChannelsResponse where
hashWithSalt :: Int -> ChannelsResponse -> Int
hashWithSalt Int
_salt ChannelsResponse' {HashMap Text ChannelResponse
channels :: HashMap Text ChannelResponse
$sel:channels:ChannelsResponse' :: ChannelsResponse -> HashMap Text ChannelResponse
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text ChannelResponse
channels
instance Prelude.NFData ChannelsResponse where
rnf :: ChannelsResponse -> ()
rnf ChannelsResponse' {HashMap Text ChannelResponse
channels :: HashMap Text ChannelResponse
$sel:channels:ChannelsResponse' :: ChannelsResponse -> HashMap Text ChannelResponse
..} = forall a. NFData a => a -> ()
Prelude.rnf HashMap Text ChannelResponse
channels