module Stratosphere.AppMesh.Route.GrpcTimeoutProperty (
        module Exports, GrpcTimeoutProperty(..), mkGrpcTimeoutProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AppMesh.Route.DurationProperty as Exports
import Stratosphere.ResourceProperties
data GrpcTimeoutProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-route-grpctimeout.html>
    GrpcTimeoutProperty {GrpcTimeoutProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-route-grpctimeout.html#cfn-appmesh-route-grpctimeout-idle>
                         GrpcTimeoutProperty -> Maybe DurationProperty
idle :: (Prelude.Maybe DurationProperty),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-route-grpctimeout.html#cfn-appmesh-route-grpctimeout-perrequest>
                         GrpcTimeoutProperty -> Maybe DurationProperty
perRequest :: (Prelude.Maybe DurationProperty)}
  deriving stock (GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool
(GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool)
-> (GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool)
-> Eq GrpcTimeoutProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool
== :: GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool
$c/= :: GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool
/= :: GrpcTimeoutProperty -> GrpcTimeoutProperty -> Bool
Prelude.Eq, Int -> GrpcTimeoutProperty -> ShowS
[GrpcTimeoutProperty] -> ShowS
GrpcTimeoutProperty -> String
(Int -> GrpcTimeoutProperty -> ShowS)
-> (GrpcTimeoutProperty -> String)
-> ([GrpcTimeoutProperty] -> ShowS)
-> Show GrpcTimeoutProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GrpcTimeoutProperty -> ShowS
showsPrec :: Int -> GrpcTimeoutProperty -> ShowS
$cshow :: GrpcTimeoutProperty -> String
show :: GrpcTimeoutProperty -> String
$cshowList :: [GrpcTimeoutProperty] -> ShowS
showList :: [GrpcTimeoutProperty] -> ShowS
Prelude.Show)
mkGrpcTimeoutProperty :: GrpcTimeoutProperty
mkGrpcTimeoutProperty :: GrpcTimeoutProperty
mkGrpcTimeoutProperty
  = GrpcTimeoutProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), idle :: Maybe DurationProperty
idle = Maybe DurationProperty
forall a. Maybe a
Prelude.Nothing,
       perRequest :: Maybe DurationProperty
perRequest = Maybe DurationProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties GrpcTimeoutProperty where
  toResourceProperties :: GrpcTimeoutProperty -> ResourceProperties
toResourceProperties GrpcTimeoutProperty {Maybe DurationProperty
()
haddock_workaround_ :: GrpcTimeoutProperty -> ()
idle :: GrpcTimeoutProperty -> Maybe DurationProperty
perRequest :: GrpcTimeoutProperty -> Maybe DurationProperty
haddock_workaround_ :: ()
idle :: Maybe DurationProperty
perRequest :: Maybe DurationProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AppMesh::Route.GrpcTimeout",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> DurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Idle" (DurationProperty -> (Key, Value))
-> Maybe DurationProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DurationProperty
idle,
                            Key -> DurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"PerRequest" (DurationProperty -> (Key, Value))
-> Maybe DurationProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DurationProperty
perRequest])}
instance JSON.ToJSON GrpcTimeoutProperty where
  toJSON :: GrpcTimeoutProperty -> Value
toJSON GrpcTimeoutProperty {Maybe DurationProperty
()
haddock_workaround_ :: GrpcTimeoutProperty -> ()
idle :: GrpcTimeoutProperty -> Maybe DurationProperty
perRequest :: GrpcTimeoutProperty -> Maybe DurationProperty
haddock_workaround_ :: ()
idle :: Maybe DurationProperty
perRequest :: Maybe DurationProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> DurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Idle" (DurationProperty -> (Key, Value))
-> Maybe DurationProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DurationProperty
idle,
               Key -> DurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"PerRequest" (DurationProperty -> (Key, Value))
-> Maybe DurationProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DurationProperty
perRequest]))
instance Property "Idle" GrpcTimeoutProperty where
  type PropertyType "Idle" GrpcTimeoutProperty = DurationProperty
  set :: PropertyType "Idle" GrpcTimeoutProperty
-> GrpcTimeoutProperty -> GrpcTimeoutProperty
set PropertyType "Idle" GrpcTimeoutProperty
newValue GrpcTimeoutProperty {Maybe DurationProperty
()
haddock_workaround_ :: GrpcTimeoutProperty -> ()
idle :: GrpcTimeoutProperty -> Maybe DurationProperty
perRequest :: GrpcTimeoutProperty -> Maybe DurationProperty
haddock_workaround_ :: ()
idle :: Maybe DurationProperty
perRequest :: Maybe DurationProperty
..}
    = GrpcTimeoutProperty {idle :: Maybe DurationProperty
idle = DurationProperty -> Maybe DurationProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Idle" GrpcTimeoutProperty
DurationProperty
newValue, Maybe DurationProperty
()
haddock_workaround_ :: ()
perRequest :: Maybe DurationProperty
haddock_workaround_ :: ()
perRequest :: Maybe DurationProperty
..}
instance Property "PerRequest" GrpcTimeoutProperty where
  type PropertyType "PerRequest" GrpcTimeoutProperty = DurationProperty
  set :: PropertyType "PerRequest" GrpcTimeoutProperty
-> GrpcTimeoutProperty -> GrpcTimeoutProperty
set PropertyType "PerRequest" GrpcTimeoutProperty
newValue GrpcTimeoutProperty {Maybe DurationProperty
()
haddock_workaround_ :: GrpcTimeoutProperty -> ()
idle :: GrpcTimeoutProperty -> Maybe DurationProperty
perRequest :: GrpcTimeoutProperty -> Maybe DurationProperty
haddock_workaround_ :: ()
idle :: Maybe DurationProperty
perRequest :: Maybe DurationProperty
..}
    = GrpcTimeoutProperty {perRequest :: Maybe DurationProperty
perRequest = DurationProperty -> Maybe DurationProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "PerRequest" GrpcTimeoutProperty
DurationProperty
newValue, Maybe DurationProperty
()
haddock_workaround_ :: ()
idle :: Maybe DurationProperty
haddock_workaround_ :: ()
idle :: Maybe DurationProperty
..}