{-# 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.Support.Types.SupportService where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Support.Types.Category
data SupportService = SupportService'
{
SupportService -> Maybe [Category]
categories :: Prelude.Maybe [Category],
SupportService -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SupportService -> Maybe Text
code :: Prelude.Maybe Prelude.Text
}
deriving (SupportService -> SupportService -> Bool
(SupportService -> SupportService -> Bool)
-> (SupportService -> SupportService -> Bool) -> Eq SupportService
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SupportService -> SupportService -> Bool
$c/= :: SupportService -> SupportService -> Bool
== :: SupportService -> SupportService -> Bool
$c== :: SupportService -> SupportService -> Bool
Prelude.Eq, ReadPrec [SupportService]
ReadPrec SupportService
Int -> ReadS SupportService
ReadS [SupportService]
(Int -> ReadS SupportService)
-> ReadS [SupportService]
-> ReadPrec SupportService
-> ReadPrec [SupportService]
-> Read SupportService
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SupportService]
$creadListPrec :: ReadPrec [SupportService]
readPrec :: ReadPrec SupportService
$creadPrec :: ReadPrec SupportService
readList :: ReadS [SupportService]
$creadList :: ReadS [SupportService]
readsPrec :: Int -> ReadS SupportService
$creadsPrec :: Int -> ReadS SupportService
Prelude.Read, Int -> SupportService -> ShowS
[SupportService] -> ShowS
SupportService -> String
(Int -> SupportService -> ShowS)
-> (SupportService -> String)
-> ([SupportService] -> ShowS)
-> Show SupportService
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SupportService] -> ShowS
$cshowList :: [SupportService] -> ShowS
show :: SupportService -> String
$cshow :: SupportService -> String
showsPrec :: Int -> SupportService -> ShowS
$cshowsPrec :: Int -> SupportService -> ShowS
Prelude.Show, (forall x. SupportService -> Rep SupportService x)
-> (forall x. Rep SupportService x -> SupportService)
-> Generic SupportService
forall x. Rep SupportService x -> SupportService
forall x. SupportService -> Rep SupportService x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SupportService x -> SupportService
$cfrom :: forall x. SupportService -> Rep SupportService x
Prelude.Generic)
newSupportService ::
SupportService
newSupportService :: SupportService
newSupportService =
SupportService' :: Maybe [Category] -> Maybe Text -> Maybe Text -> SupportService
SupportService'
{ $sel:categories:SupportService' :: Maybe [Category]
categories = Maybe [Category]
forall a. Maybe a
Prelude.Nothing,
$sel:name:SupportService' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:code:SupportService' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
supportService_categories :: Lens.Lens' SupportService (Prelude.Maybe [Category])
supportService_categories :: (Maybe [Category] -> f (Maybe [Category]))
-> SupportService -> f SupportService
supportService_categories = (SupportService -> Maybe [Category])
-> (SupportService -> Maybe [Category] -> SupportService)
-> Lens
SupportService SupportService (Maybe [Category]) (Maybe [Category])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportService' {Maybe [Category]
categories :: Maybe [Category]
$sel:categories:SupportService' :: SupportService -> Maybe [Category]
categories} -> Maybe [Category]
categories) (\s :: SupportService
s@SupportService' {} Maybe [Category]
a -> SupportService
s {$sel:categories:SupportService' :: Maybe [Category]
categories = Maybe [Category]
a} :: SupportService) ((Maybe [Category] -> f (Maybe [Category]))
-> SupportService -> f SupportService)
-> ((Maybe [Category] -> f (Maybe [Category]))
-> Maybe [Category] -> f (Maybe [Category]))
-> (Maybe [Category] -> f (Maybe [Category]))
-> SupportService
-> f SupportService
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Category] [Category] [Category] [Category]
-> Iso
(Maybe [Category])
(Maybe [Category])
(Maybe [Category])
(Maybe [Category])
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 [Category] [Category] [Category] [Category]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
supportService_name :: Lens.Lens' SupportService (Prelude.Maybe Prelude.Text)
supportService_name :: (Maybe Text -> f (Maybe Text))
-> SupportService -> f SupportService
supportService_name = (SupportService -> Maybe Text)
-> (SupportService -> Maybe Text -> SupportService)
-> Lens SupportService SupportService (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportService' {Maybe Text
name :: Maybe Text
$sel:name:SupportService' :: SupportService -> Maybe Text
name} -> Maybe Text
name) (\s :: SupportService
s@SupportService' {} Maybe Text
a -> SupportService
s {$sel:name:SupportService' :: Maybe Text
name = Maybe Text
a} :: SupportService)
supportService_code :: Lens.Lens' SupportService (Prelude.Maybe Prelude.Text)
supportService_code :: (Maybe Text -> f (Maybe Text))
-> SupportService -> f SupportService
supportService_code = (SupportService -> Maybe Text)
-> (SupportService -> Maybe Text -> SupportService)
-> Lens SupportService SupportService (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportService' {Maybe Text
code :: Maybe Text
$sel:code:SupportService' :: SupportService -> Maybe Text
code} -> Maybe Text
code) (\s :: SupportService
s@SupportService' {} Maybe Text
a -> SupportService
s {$sel:code:SupportService' :: Maybe Text
code = Maybe Text
a} :: SupportService)
instance Core.FromJSON SupportService where
parseJSON :: Value -> Parser SupportService
parseJSON =
String
-> (Object -> Parser SupportService)
-> Value
-> Parser SupportService
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SupportService"
( \Object
x ->
Maybe [Category] -> Maybe Text -> Maybe Text -> SupportService
SupportService'
(Maybe [Category] -> Maybe Text -> Maybe Text -> SupportService)
-> Parser (Maybe [Category])
-> Parser (Maybe Text -> Maybe Text -> SupportService)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Category]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"categories" Parser (Maybe (Maybe [Category]))
-> Maybe [Category] -> Parser (Maybe [Category])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Category]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> SupportService)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SupportService)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser (Maybe Text -> SupportService)
-> Parser (Maybe Text) -> Parser SupportService
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"code")
)
instance Prelude.Hashable SupportService
instance Prelude.NFData SupportService