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